简单演示一下使用EXP的QUERY选项导出表中部分数据(具有where限制条件的导出)。1.创建实验表T,并初始化4条记录sec@secooler> create table t (x int ,y varchar2(20));Table created.sec@secooler> insert into t values (1,'sec1');1 row created.sec@secooler> insert into t values (2,'sec2');1 row created.sec@secooler>sec@secooler> insert into t values (3,'sec3');1 row created.sec@secooler> insert into t values (4,'sec4');1 row created.sec@secooler> commit;Commit complete.sec@secooler> select * from t;X Y---------- ------------------------------------------------------------1 sec12 sec23 sec34 sec42.按照“x<3”条件导出T表中的部分数据secooler@secDB /exp$ exp sec/sec file=sec.dmp log=sec.log tables=t query=\"where x\<3\"Export: Release 11.2.0.1.0 - Production on Sun Mar 7 20:19:43 2010Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, Oracle Label Security, OLAP, Data Mining,Oracle Database Vault and Real Application Testing optionExport done in AL32UTF8 character set and AL16UTF16 NCHAR character setserver uses ZHS16GBK character set (possible charset conversion)About to export specified tables via Conventional Path .... . exporting table T 2 rows exportedExport terminated successfully without warnings.OK,导出成功,满足“x<3”条件的T表数据有两条。3.小结EXP工具的每一个选项都有其重要的应用场合。当仅需要备份表中部分数据时,您也不妨使用一下QUERY选项,注意这个选项要与TABLES选项一同使用,同时注意在命令行中特殊字符的转义方法。Good luck.secooler10.03.07-- The End --
oracle exp 部分数据,【EXP】使用EXP的QUERY选项导出表中部分数据
最新推荐文章于 2024-04-19 15:23:28 发布