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

来源:互联网 发布:推荐充电宝 知乎 编辑:程序博客网 时间:2024/05/22 17:43
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
原创粉丝点击