oracle 如何使用 PL/SQL 进行 Exp 和 Imp
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/365656/
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 can I do Exp and Imp by using PL/SQL
提问by Dwayne King
How can I do Exp and Imp by using PL/SQL?
如何使用 PL/SQL 执行 Exp 和 Imp?
回答by Dwayne King
This could be done in a few ways.
这可以通过几种方式完成。
First, if you're using 10g or later, you can consider using data pump (expdp and impdp) as opposed to imp and exp. These are the newer and more capable versions of those tools.
首先,如果您使用 10g 或更高版本,您可以考虑使用数据泵(expdp 和 impdp)而不是 imp 和 exp。这些是这些工具的更新和功能更强大的版本。
As for how to call them from PL/SQL, you can do so by:
至于如何从 PL/SQL 中调用它们,可以通过以下方式进行:
- You can make an external procedure call to a DLL (or shared library if you're on UNIX)
- you could write a simple Java class (to run in the Oracle JVM) that would call out using Java
- you could use Advanced Queues or DBMS_PIPE to communicate with external applications
- You could use UTL_TCP to interact over the network (e.g. SOAP)
- In 10g, you could use the DBMS_SCHEDULER package to call OS commands
- 您可以对 DLL(或共享库,如果您在 UNIX 上)进行外部过程调用
- 您可以编写一个简单的 Java 类(在 Oracle JVM 中运行),使用 Java 进行调用
- 您可以使用 Advanced Queues 或 DBMS_PIPE 与外部应用程序通信
- 您可以使用 UTL_TCP 通过网络进行交互(例如 SOAP)
- 在 10g 中,您可以使用 DBMS_SCHEDULER 包来调用操作系统命令
The first and last options should be well documented in the Oracle online docs - the other two options would require a little more coordination and coding.
第一个和最后一个选项应该在 Oracle 在线文档中详细记录 - 其他两个选项需要更多的协调和编码。
回答by Dwayne King
If you are using impdp/expdp - Datapump (10g or later) - , you can simply use DBMS_DATAPUMP:
如果您使用的是 impdp/expdp - Datapump (10g or later) - ,您可以简单地使用 DBMS_DATAPUMP:
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_datpmp.htm
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_datpmp.htm
回答by FerranB
You can see an example about exactly you are requesting in the Examples of Using the Data Pump APIinside the Oracle Database Utilitiesbook.
您可以在Oracle Database Utilities一书中的使用数据泵 API的示例中看到一个关于您正在请求的示例。