如何在不同服务器上的两个不同数据库之间复制或导入 Oracle 模式?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8451219/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I copy or import Oracle schemas between two different databases on different servers?
提问by Kamilski81
What is the best way to copy schema from one user/instance/server:
从一个用户/实例/服务器复制架构的最佳方法是什么:
jdbc:oracle:thin:@deeb02:1535:DH, user pov
to another user/instance/server
到另一个用户/实例/服务器
jdbc:oracle:thin:@123.456.789.123:1523:orcl, user vrs_development
?
?
回答by Aaron
Similarly, if you're using Oracle 10g+, you should be able to make this work with Data Pump:
类似地,如果您使用的是 Oracle 10g+,您应该能够使用 Data Pump 使其工作:
expdp user1/pass1@db1 directory=dp_out schemas=user1 dumpfile=user1.dmp logfile=user1.log
And to import:
并导入:
impdp user2/pass2@db2 directory=dp_out remap_schema=user1:user2 dumpfile=user1.dmp logfile=user2.log
回答by Raihan
Use oracle exp
utility to take a dump of the schema from the first database
使用 oracleexp
实用程序从第一个数据库中获取模式的转储
exp user1/pass1@db1 owner=user1 file=user1.dmp log=user1.log
Then use imp
utility to populate the other schema in the other datbase
然后使用imp
实用程序填充其他数据库中的其他架构
imp user2/pass2@db2 fromuser=user1 touser=user2 file=user1.dmp log=user2.log
回答by ildar
you can directly copy schema via network (without moving files from one server to another) using datapump parameter NETWORK LINK as described here:
您可以使用数据泵参数 NETWORK LINK 通过网络直接复制架构(无需将文件从一台服务器移动到另一台服务器),如下所述:
http://vishwanath-dbahelp.blogspot.com/2011/09/network-link-in-datapump.html
http://vishwanath-dbahelp.blogspot.com/2011/09/network-link-in-datapump.html
for example:
例如:
impdp -userid user/pass@destination_server LOGFILE=log.txt NETWORK_LINK=dblink_from_dest_to_source SCHEMAS=schema1 directory=DATA_PUMP_DIR
check that directory DATA_PUMP_DIR exists in
检查目录 DATA_PUMP_DIR 存在于
select *
from dba_directories
and points to correct place in destination_server file system.
并指向 destination_server 文件系统中的正确位置。