oracle 导出table,oracle中的多表导出(Multiple table export in oracle)

oracle中的多表导出(Multiple table export in oracle)

是否可以使用QUERY参数在oracle中导出多个表,每个表的WHERE子句是否不同?

Is it possible to export multiple tables in oracle using QUERY parameter the WHERE clauses are different for each table?

原文:https://stackoverflow.com/questions/5428872

更新时间:2020-01-09 19:14

最满意答案

如果您使用的是旧导出( exp ),那么不需要,您需要为每个表单独导出。 这些限制显示在文档中 。

如果您正在使用数据泵( expdp ),那么您可以指定多个QUERY子句并指定每个子句也适用,再次如文档中所述。

If you're using the old export (exp) then no, you'd need to do a separate export for each table. The restrictions are shown in the documentation.

If you're using data pump (expdp) then yes, you can specify multiple QUERY clauses and specify which table each applies too, again as described in the documentation.

2011-03-25

相关问答

而不是导入/导出使用Datapump 检查Oracle GoldenGate 检查Oracle Streams Instead of import/export use Datapump check Oracle GoldenGate check Oracle Streams

您应该问自己:“为什么我要将数据保存在数据库之外 - 数据最安全的地方?备份,还原和恢复到位的地方。 如果要将数据从数据库A移动到数据库B,请确保两个数据库都可以访问公共文件区域,在该文件区域中,他们可以通过其目录对象访问datadump文件并使用数据泵。 如果你仍然想把数据导出到客户端,你可以使用好的旧工具exp和imp 。 You should ask yourself: "Why do I want to keep data outside the database - the most s

...

用exp可以使用参数ROWS=N 10g文档在这里 。 尽管如此, 数据泵仍是首选; 等效参数是CONTENT=METADATA_ONLY 。 It is possible with exp, using parameter ROWS=N. 10g documentation is here. Data pump is preferred these days though; the equivalent parameter is CONTENT=METADATA_ONLY.

在代码编辑器中,您应该能够像这样做一些事情。 这些假设您已经将oralib定义为与oracle的连接(在libname语句或DIS的等效语句中)。 * Get last ID in oracle into a macro variable;

proc sql;

select max(id) into :maxID from oralib.oratable; *make these the real oracle libname and oracle table name;

quit;

*us

...

如果您使用的是旧导出( exp ),那么不需要,您需要为每个表单独导出。 这些限制显示在文档中 。 如果您正在使用数据泵( expdp ),那么您可以指定多个QUERY子句并指定每个子句也适用,再次如文档中所述。 If you're using the old export (exp) then no, you'd need to do a separate export for each table. The restrictions are shown in the documentation

...

创建由seq_no索引的文件句柄的关联数组 type ta_file is table of utl_file.file_type index by number(5);

va_file ta_file;

迭代行并将其csv行放入文件中(您必须通过连接替换'{csv string from x}' ) for r in (

select * from (

select seq_no, '{csv string from a}' s, 'a' t from a

union al

...

对某人来说 我已经通过这种方式恢复了:使用jdbc,并使用Maven运行我的类..不是很好,但效率很高。 For somebody. I've resovled by this way : use jdbc, and run my class with Maven.. Not very nice, but efficient.

从文档 : 格式 :为要卸载的数据选择所需的输出格式。 根据所选格式,可能会显示其他选项。 例如,对于xls(Microsoft Excel文件),您可以为数据和SELECT语句指定工作表名称。 对于CLOB数据,仅当格式为加载程序(SQL * Loader)或pdf(PDF)时才支持导出。 某些导出类型仅导出字符串的子集,后跟省略号(...)。 它没有明确地引用BLOB,但是如果CLOB只能作为loader或pdf导出,那么BLOB也会有这种限制。 如果要在另一个模式或数据库中重新创建此数据,S

...

调用dbms_metadata.get_ddl是一种选择。 例如 SET LONG 10000

SELECT dbms_metadata.get_ddl('TABLE', 'MY-TABLE-NAME')

FROM dual;

或者,许多GUI工具(包括TOAD和企业管理器)都有DDL生成器。 Calling dbms_metadata.get_ddl is one option. e.g. SET LONG 10000

SELECT dbms_metadata.get_ddl('TAB

...

没有Oracle版本所以我假设10或11。 要安排您的流程,您只需创建一份工作并安排工作。 作业必须运行您的脚本(可以是函数或存储过程)。 这里的文档: http : //docs.oracle.com/cd/B28359_01/server.111/b28310/scheduse.htm#i1033533 要写入文件,可以在SQL中使用spool命令。 在这里您可以找到文档: http : //docs.oracle.com/cd/B19306_01/server.102/b14357/ch12

...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值