zoukankan      html  css  js  c++  java
  • expdp数据库导出导入

    1、从现有环境导出一份数据库文件:

    [oracle@huydvm ~]$ expdp

    Username: fm

    Password: 1

    导出的文件默认放在:

    /home/oracle/app/admin/orcl/dpdump

    2、将上面导出的文件拷贝到另一台机器还原文件所在目录下面;

    3、使用sys as sysdba执行 install.sql 创建数据库用户等必要信息;

    4、impdp命令:impdp fm/1 dumpfile=expdat.dmp full=y;

     

    5、上面导出的文件在另外一个数据库中导入的时候报错如下:

    [oracle@localhost dpdump]$ impdp fm/1 dumpfile=expdat20170805.dmp full=y;

     

    Import: Release 11.2.0.4.0 - Production on Sat Aug 5 17:22:58 2017

     

    Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

     

    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

    With the Partitioning, OLAP, Data Mining and Real Application Testing options

    ORA-39006: internal error

    ORA-39213: Metadata processing is not available

    解决:

    SQL> conn / as sysdba;

    Connected.

    SQL> execute  sys.dbms_metadata_util.load_stylesheets;

    PL/SQL procedure successfully completed.

    [oracle@localhost dpdump]$ impdp fm/1 dumpfile=expdat20170805.dmp full=y transform=OID:N

    6、查看oracle默认导出目录

    SELECT directory_path FROM dba_directories WHERE directory_name = 'DATA_PUMP_DIR';

    7、设置oracle导出目录

    SQL> CREATE DIRECTORY dmpdir AS '/opt/oracle';

    Directory created.

    SQL> GRANT read, write ON DIRECTORY dmpdir TO scott;

    Grant succeeded.

    使用exp和imp进行特定用户数据库的导入和导出

    1、从A数据库中把fm用户下的所有内容导入fm.dmp文件;

    [fm@huydvm ~]$ exp fm/1@ois buffer=64000 file=./fm.dmp owner=fm

  • 相关阅读:
    Flask-1-03-HelloWorld
    Flask-1-02-安装环境
    Flask-1-01-初识Flask
    Ubuntu解决virtualbox 安装增强包的报错
    ubuntu安装软件has install-snap change in progress错误
    virtualbox
    Nginx 403 Forbidden错误的解决方法
    处理Redis报错:redis.exceptions.ResponseError: MISCONF Redis is configured to save RDB snap
    在Ubuntu18.04上安装MySQL
    Python3 错误、调试和测试
  • 原文地址:https://www.cnblogs.com/skiing886/p/7616306.html
Copyright © 2011-2022 走看看