1. 首页 > ITPUX技术网 > 正文

如何用oracle exp逻辑导出某个表的某几列数据

如何用oracle exp逻辑导出某个表的某几列数据
通过查询exp help=y 的命令帮助信息,确实还没这项功能 10g好像也没有这功能
不过我们可以变通一下 达到我们的需要 通过create table tablename as select 方法
测试如下:
C:\Documents and Settings\Paul Yi>sqlplus paul/paul
SQL*Plus: Release 9.2.0.4.0 – Production on Mon May 26 10:14:51 2008
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> create table test as select * from user_objects;
Table created.
SQL> desc test;
Name Null? Type
—————————————– ——– —————————-
OBJECT_NAME VARCHAR2(128)
SUBOBJECT_NAME VARCHAR2(30)
OBJECT_ID NUMBER
DATA_OBJECT_ID NUMBER
OBJECT_TYPE VARCHAR2(18)
CREATED DATE
LAST_DDL_TIME DATE
TIMESTAMP VARCHAR2(19)
STATUS VARCHAR2(7)
TEMPORARY VARCHAR2(1)
GENERATED VARCHAR2(1)
SECONDARY VARCHAR2(1)
SQL> select count(*) from test;
COUNT(*)
———-
25
假设我们导出只需要object_id,object_name 两个字段的数据
SQL> create table test_column as select object_id,object_name from test;
Table created.
SQL>
C:\Documents and Settings\Paul Yi>exp paul/paul tables=(test_column) file=c:\tes
t.dmp log=c:\test.log buffer=10240000
Export: Release 9.2.0.4.0 – Production on Mon May 26 10:19:54 2008
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 TEST_COLUMN 25 rows exported
Export terminated successfully without warnings.
C:\Documents and Settings\Paul Yi>

本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html

联系我们

在线咨询:点击这里给我发消息

微信号:itpux-com

工作日:9:30-18:30,节假日休息