Oracle 将带有数据、触发器、序列的自定义表导出到 dmp 文件中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4671204/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 22:26:12  来源:igfitidea点击:

Oracle exporting custom tables with data, triggers, sequences into dmp file

oracleexport

提问by bikt

topic says all, i need to export custom tables with data, triggers and sequences into dmp file.

主题说明了一切,我需要将包含数据、触发器和序列的自定义表导出到 dmp 文件中。

exp SYSTEM/password FULL=y FILE=dba.dmp LOG=dba.log CONSISTENT=y

This example helps to export all database, but i need to export custom objects. Maybe someone can tell me how to do that?

此示例有助于导出所有数据库,但我需要导出自定义对象。也许有人可以告诉我该怎么做?

Thanks.

谢谢。

采纳答案by Blair

You need to create a parameter file which specifies the tables that you want to include.

您需要创建一个参数文件来指定要包含的表。

Here is an example:

下面是一个例子:

DIRECTORY=DATA_PUMP_DIR
FILESIZE=2G
EXCLUDE=INDEX
EXCLUDE=CONSTRAINT
EXCLUDE=GRANT,ROLE_GRANT,DEFAULT_ROLE
EXCLUDE=VIEW,PACKAGE,PROCEDURE,FUNCTION
EXCLUDE=COMMENT,JOB,SYNONYM
EXCLUDE=TABLE:" NOT IN ('table1','table2','table3')"

Then run the expdb utility, specifying your parameter file path:

然后运行 ​​expdb 实用程序,指定您的参数文件路径:

${ORACLE_HOME}/bin/expdp user/pass@db SCHEMAS=schemaname DUMPFILE=$DMPFILE LOGFILE=$DMPLOG PARFILE=$DATA_PUMP_PAR

That will export table1, table2 and table3 with associated sequences, data and triggers.

这将导出 table1、table2 和 table3 以及关联的序列、数据和触发器。