[转载]impdp transform=segment_attributes|st
(2014-02-11 10:56:38)
标签:
转载 |
分类: oracle-partition |
impdp 得到简洁的create 语法
impdp的一个参数 TRANSFORM
这个参数的语法是 transform=segment_attributes|storage|oid|pctspace:Y/N:object_type
--实验
--导出表结构
[oracle@afc2 ~]$ expdp test/test dumpfile=test.dmp
directory=dpump_dir
Export: Release 10.2.0.1.0 - Production on Friday, 21 January, 2011 11:06:36
Copyright (c) 2003, 2005, Oracle.
Connected to: Oracle Database 10g Enterprise Edition Release
10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Starting "TEST"."SYS_EXPORT_TABLE_01":
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 2 MB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type
TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type
TABLE_EXPORT/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
Processing object type
TABLE_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
Processing object type
TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported
"TEST"."T_INSTR"
Master table "TEST"."SYS_EXPORT_TABLE_01" successfully
loaded/unloaded
******************************************************************************
Dump file set for TEST.SYS_EXPORT_TABLE_01 is:
Job "TEST"."SYS_EXPORT_TABLE_01" successfully completed at
11:11:27
[oracle@afc2 ~]$ impdp test/test DIRECTORY=dpump_dir
DUMPFILE=test.dmp sqlfile=test.sql
TRANSFORM=segment_attributes:n
Import: Release 10.2.0.1.0 - Production on Friday, 21 January, 2011 11:13:01
Copyright (c) 2003, 2005, Oracle.
Connected to: Oracle Database 10g Enterprise Edition Release
10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Master table "TEST"."SYS_SQL_FILE_FULL_01" successfully
loaded/unloaded
Starting "TEST"."SYS_SQL_FILE_FULL_01":
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type
TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type
TABLE_EXPORT/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
Processing object type
TABLE_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
Processing object type
TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "TEST"."SYS_SQL_FILE_FULL_01" successfully completed at
11:13:13
--查看test.sql,表和索引后面的storage,pctfree,tablespace等信息都没有了
CREATE TABLE "TEST"."T_INSTR"
-- new object type path is: TABLE_EXPORT/TABLE/INDEX/INDEX
CREATE INDEX "TEST"."I_T_INSTR_B" ON "TEST"."T_INSTR" ("B")
[oracle@afc2 ~]$ impdp test/test DIRECTORY=dpump_dir
DUMPFILE=test.dmp sqlfile=test2.sql
TRANSFORM=segment_attributes:n:table
Import: Release 10.2.0.1.0 - Production on Friday, 21 January, 2011
11:16:14
Copyright (c) 2003, 2005, Oracle.
Connected to: Oracle Database 10g Enterprise Edition Release
10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Master table "TEST"."SYS_SQL_FILE_FULL_01" successfully
loaded/unloaded
Starting "TEST"."SYS_SQL_FILE_FULL_01":
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type
TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type
TABLE_EXPORT/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
Processing object type
TABLE_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
Processing object type
TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "TEST"."SYS_SQL_FILE_FULL_01" successfully completed at
11:16:23
--查看test2.sql,表的storage,pctfree,tablespace等信息都没有了,索引还有的
CREATE TABLE "TEST"."T_INSTR"
-- new object type path is: TABLE_EXPORT/TABLE/INDEX/INDEX
CREATE INDEX "TEST"."I_T_INSTR_B" ON "TEST"."T_INSTR" ("B")
[oracle@afc2 ~]$ impdp test/test DIRECTORY=dpump_dir
DUMPFILE=test.dmp sqlfile=test3.sql
TRANSFORM=storage:n
Import: Release 10.2.0.1.0 - Production on Friday, 21 January, 2011 11:23:56
Copyright (c) 2003, 2005, Oracle.
Connected to: Oracle Database 10g Enterprise Edition Release
10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Master table "TEST"."SYS_SQL_FILE_FULL_01" successfully
loaded/unloaded
Starting "TEST"."SYS_SQL_FILE_FULL_01":
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type
TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type
TABLE_EXPORT/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
Processing object type
TABLE_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
Processing object type
TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "TEST"."SYS_SQL_FILE_FULL_01" successfully completed at
11:24:06
--查看test2.sql,表和索引的storage信息没有了,pctfree 等信息还是有的
-- CONNECT TEST
-- new object type path is: TABLE_EXPORT/TABLE/TABLE
CREATE TABLE "TEST"."T_INSTR"
-- new object type path is: TABLE_EXPORT/TABLE/INDEX/INDEX
CREATE INDEX "TEST"."I_T_INSTR_B" ON "TEST"."T_INSTR" ("B")
--剩余2个参数大家可以实验一下