使用expdp和impdp远程导入导出库
2017-11-06 15:44
281 查看
使用expdb ,impdp 导入导出库,首先在本地必须建立db_link才可导入导出,exp,imp 这两个命令无需建立db_link即可导入导出。
一.远程导出库的步骤:
1.在本地库的配置文件中加如下配置:
tnames.ora增加[html] view
plain copy
orcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 远程主机IP)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = 远程服务名)
)
)
2.创建dblink
[html] viewplain copy
SQL> create public database link oradb(db_link名)connect to
userneme(远程登录用户名) identified by password(远程数据库用户密码) using 'oradb';
Database link created.
SQL> select * from test.db@oradb;
ID NAME
---------- --------------------
1 zhangsan
2 lisi
3.创建导出临时目录:
[html] viewplain copy
SQL> create or replace directory dumpdir as '/oradata/dump';
Directory created.
4.授权用户,一般用system用户。
[html] viewplain copy
SQL> grant read,write on directory dumpdir to hr;
Grant succeeded.
SQL> conn
zhangsan/zhangsan
Connected.
SQL> select * from test.db@oradb;
ID NAME
---------- --------------------
1 zhangsan
2 lisi
1 wangwu
SQL> quit
5.在cmd中写expdp 导出语句:
[html] view
plain copy
[oracle@ORA11G-DG1 ~]$ expdp 本地登录库的用户名密码(system/orcl) network_link=oradb directory=dumpdir dumpfile=test.dmp logfile=test.log schemas=test
(1):问题1:
Export: Release 11.2.0.4.0 - Production on Wed Dec 10 07:50:25 2014
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-31631: privileges are required
ORA-39109: Unprivileged users may not operate upon other users' schemas
问题解决办法
SQL*Plus: Release 11.2.0.4.0 Production on Wed Dec 10 07:52:01 2014
Copyright (c) 1982, 2013, Oracle. 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
SQL> grant exp_full_database to
zhangsan;
Grant succeeded.
SQL> quit
(2):问题2:
ORA-31631: privileges are required
ORA-39149: cannot link privileged user to non-privileged user
解决办法
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> grant exp_full_database to test;
授权成功。
以上是导出步骤。
二.远程导入库:
1.步骤请参照导出库。
2.直接写导入语句:
[html] viewplain copy
Impdp utest/utest@orcl directory=DMPDIR schemas=e01 network_link=sourcedatabase remap_schema=e01:e0311 job_name=impjob
相关文章推荐
- 使用expdp和impdp远程导入导出库
- oracle10g--使用expdp导出数据和impdp导入数据
- How to use expdp/empdp in Oracle Database (使用expdp/impdp导入导出oracle数据 )
- 【oracle】使用EXPDP和IMPDP数据泵进行导出导入的方法
- 【EXPDP】expdp/impdp数据泵远程导入导出
- linux 下使用exp/imp 或者expdp/impdp导出导入oracle数据表数据
- ORACLE使用EXPDP和IMPDP数据泵进行导出导入的方法
- oracle使用expdp、impdp和exp、imp导入导出表及表结构
- Oracle使用expdp/impdp导出导入数据
- ORACLE使用EXPDP和IMPDP数据泵进行导出导入的方法
- 关于Linux下使用expdp和impdp命令对Oracle数据库进行导入和导出操作
- ORACLE使用EXPDP和IMPDP数据泵进行导出导入的方法
- expdp和impdp导入导出工具的使用
- 使用数据泵导入(impdp)和导出(expdp)
- ORACLE使用EXPDP和IMPDP数据泵进行导出导入的方法
- ORACLE使用EXPDP和IMPDP数据泵进行导出导入的方法
- 关于Linux下使用expdp和impdp命令对Oracle数据库进行导入和导出操作
- 数据泵EXPDP导出工具和IMPDP导入工具的使用
- ORACLE使用EXPDP和IMPDP数据泵进行导出导入的方法
- ORACLE使用EXPDP和IMPDP数据泵进行导出导入的方法