Oracle:使用来自完整数据库 expdp 的 impdp
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7557538/
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
Oracle: using impdp from a full DB expdp
提问by domiSchenk
I've got a full Dump of an Database (all schema, system etc...) Now I want to import just one schema of this file, is this even possible?
我有一个完整的数据库转储(所有模式、系统等...)现在我只想导入这个文件的一个模式,这可能吗?
As far I got this command:
到目前为止,我得到了这个命令:
impdp sysadm/sysadm@sysadm schemas=sysadm directory=dp_dir dumpfile=export.dmp logfile=export.log
Would this work? The problem is, in this dump file there are schemas that are already used and I can't overwrite them (I can but it would be pain for me to recover them)
这行得通吗?问题是,在这个转储文件中,有一些模式已经被使用,我不能覆盖它们(我可以,但恢复它们对我来说会很痛苦)
thanks for help
感谢帮助
回答by DCookie
It should work as you have shown. You might also want to take a look at the TABLE_EXISTS_ACTION parameter to provide additional warm-fuzziness. With that you can skip tables that exist already.
它应该像你展示的那样工作。您可能还想查看 TABLE_EXISTS_ACTION 参数以提供额外的温暖模糊性。有了它,您可以跳过已经存在的表。
That said, of course you will have a backup of your database before you start? Or if it's a real pain to recover, perhaps you could create another test database to try this out on?
也就是说,在开始之前,您当然会备份数据库吗?或者,如果恢复真的很痛苦,也许您可以创建另一个测试数据库来尝试一下?
回答by Mr.T
"impdp system/*****@nsd1 directory=DATA_PUMP_DIR parfile=exclude_schemas_parfile.par REMAP_SCHEMA=old_schema:new_schema remap_tablespace=Schema1_TS_TABLES:Schema2_TS_TABLES dumpfile=schema1.dmp LOGFILE=schema1_import.log"
.par file enteries look like this:
exclude=SCHEMA:"='CTXSYS'"
exclude=SCHEMA:"='ORDDATA'"
exclude=SCHEMA:"='OWBSYS_AUDIT'"
.
.
get list of all schemas from schema1 (using system user).
Thanks