102.You want to import schema objects of the HR user using Oracle Data Pump from the development dat

102.You want to import schema objects of the HR user using Oracle Data Pump from the development
database, DEVDB, to the production database, PRODDB. A database link devdb.us.oracle.com is
created between PRODDB and DEVDB.
You execute the following command on the PRODDB database server:
$ impdp system/manager directory = DB_DATA
dumpfile = schemas.dat
schemas = hr
flashback_time = "TO_TIMESTAMP('25-08-2007 14:35:00', 'DD-MM-YYYY HH24:MI:SS')"
The command fails displaying the following error:
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31640: unable to open dump file "/home/oracle/schema/schemas.dat" for read
ORA-27037: unable to obtain file status
What would you do to overcome the error?
A.Add the user, SYSTEM, to the schemas option.
B.Add the network_link = devdb.us.oracle.com option.
C.Change the dumpfile option to schema.dat@devdb.us.oracle.com.
D.Replace the schemas option with the network_link = devdb.us.oracle.com option.
E.Replace the dumpfile option with the network_link = devdb.us.oracle.com option.
答案:E
解析:这道题主要问的是远程导入,我们测试一下远程导入和导出
这里需要注意的是network_link和dumpfile不能同时出现,如果远程导入的话,并且数据文件不在被导入的服务器本地的话,那么
必须使用network_link,还有一种方法,那就是先导入本地,然后通过network_link导入目标数据库
impdp导入远程数据库
1.impdp system/oracle@test3 directory=data_pump_dir dumpfile=test.dmp logfile=log.log tables=test.dept;
这里directory指的是远程的目录,dumpfile指的是远程的文件
2.如果dmp文件在本地,那么只能通过使用network_link来进行操作
客户端A:wahaha3,存在test
服务端B:wahaha7,不存在test
在B上执行,impdp system/oracle directory=data_pump_dir  logfile=log.log network_link='dblink3' schemas=test remap_tablespace=test:users;
--这里需要注意,这个impdp是在目标端执行的,直接从远程客户机test导过来,说明还是在服务器上
在A上执行,impdp system/oracle@wahaha7 directory=data_pump_dir  logfile=log.log network_link='dblink3' schemas=test remap_tablespace=test:users;
总结:这里impdp 连接的哪个库,就给哪个库里面导入,network_link是连接到的数据库的link


expdp导出
在wahaha7上导出wahaha3的东西
1.wahaha7上创建public database link
SQL> CREATE PUBLIC DATABASE LINK  dblink3
  2  CONNECT TO system
  3  IDENTIFIED BY oracle
  4  using 'TEST3';
[oracle@wahaha7 ~]$ expdp system/oracle directory=data_pump_dir dumpfile=test.dmp logfile=log.log network_link='dblink3' schemas=test;  
directory==wahaha7的目录
dumpfile==wahaha7的文件
network_link==连接wahaha3的dblink
--这个时候出成功,并且本地数据库中并没有导入test账号,这里使用system/oracle估计是使用dblink
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值