如何用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>

 

 

 

请使用浏览器的分享功能分享到微信等