ITPub博客

首页 > 数据库 > 数据库开发技术 > 导入导出中支持表名模式匹配

导入导出中支持表名模式匹配

原创 数据库开发技术 作者:yaanzy 时间:2006-04-26 10:26:27 0 删除 编辑

这个特性是从9i开始支持的,格式如下:TABLES=(MYSCHEMA.ORDER%, MYSCHEMA.EMP%)
可以将以模式MYSCHEMA下以ORDER、EMP开头的表导出或者导入,下面是个简单的验证过程

[@more@]

[oracle@localhost oracle]$ sqlplus test/test

SQL*Plus: Release 9.2.0.4.0 - Production on 星期三 4月 26 09:38:26 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

SQL> select table_name from user_tables;

TABLE_NAME
------------------------------
CLUSTER
SESSION
ZY_1
ZY_2
ZY_3

SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
[oracle@localhost oracle]$ exp test/test file=tmp.dmp tables=(zy%)

Export: Release 9.2.0.4.0 - Production on 星期三 4月 26 09:38:57 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table ZY_1 2 rows exported
. . exporting table ZY_2 3 rows exported
. . exporting table ZY_3 4 rows exported
Export terminated successfully without warnings.
[oracle@localhost oracle]$
[oracle@localhost oracle]$ exp test/test file=tmp.dmp tables=(%)

Export: Release 9.2.0.4.0 - Production on 星期三 4月 26 09:39:29 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table CLUSTER 0 rows exported
. . exporting table SESSION 0 rows exported
. . exporting table ZY_1 2 rows exported
. . exporting table ZY_2 3 rows exported
. . exporting table ZY_3 4 rows exported
Export terminated successfully without warnings.
[oracle@localhost oracle]$ sqlplus test/test

SQL*Plus: Release 9.2.0.4.0 - Production on 星期三 4月 26 09:43:10 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

SQL> drop table zy1;
drop table zy1
*
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> drop table zy_1;

Table dropped.

SQL> drop table zy_2;

Table dropped.

SQL> drop table zy_3;

Table dropped.

SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

[oracle@localhost oracle]$ imp test/test file=tmp.dmp tables=(zy%)

Import: Release 9.2.0.4.0 - Production on 星期三 4月 26 09:44:00 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

Export file created by EXPORT:V09.02.00 via conventional path
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing ZHANGYI's objects into ZHANGYI
. . importing table "ZY_1" 2 rows imported
. . importing table "ZY_2" 3 rows imported
. . importing table "ZY_3" 4 rows imported
Import terminated successfully without warnings.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/3898/viewspace-830435/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    108
  • 访问量
    766811