- 最后登录
- 2019-7-8
- 在线时间
- 133 小时
- 威望
- 131
- 金钱
- 1368
- 注册时间
- 2011-10-14
- 阅读权限
- 50
- 帖子
- 126
- 精华
- 1
- 积分
- 131
- UID
- 31
|
4#
发表于 2012-3-18 18:06:37
SQL> select DBMS_METADATA.GET_DDL(SCHEMA=>'CLM',OBJECT_TYPE=>'TABLE',NAME=>'T1_NEW') from dual;
DBMS_METADATA.GET_DDL(SCHEMA=>'CLM',OBJECT_TYPE=>'TABLE',NAME=>'T1_NEW')
--------------------------------------------------------------------------------
CREATE TABLE "CLM"."T1_NEW"
( "ID" VARCHAR2(60) NOT NULL ENABLE,
"A" VARCHAR2(60),
"B" VARCHAR2(60),
"CREATE_TIME" TIMESTAMP (6),
"D" NUMBER(2,0),
"E" VARCHAR2(400),
"OUTER_ID" VARCHAR2(100)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
DBMS_METADATA.GET_DDL(SCHEMA=>'CLM',OBJECT_TYPE=>'TABLE',NAME=>'T1_NEW')
--------------------------------------------------------------------------------
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS"
PARTITION BY RANGE ("ID")
(PARTITION "P_T1_NEW" VALUES LESS THAN ('201204')
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DE
FAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" NOCOMPRESS ,
PARTITION "P_T2_NEW" VALUES LESS THAN ('201205')
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
DBMS_METADATA.GET_DDL(SCHEMA=>'CLM',OBJECT_TYPE=>'TABLE',NAME=>'T1_NEW')
--------------------------------------------------------------------------------
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DE
FAULT CELL_FLASH_CACHE DEFAULT)
SQL> select DBMS_METADATA.GET_DDL(SCHEMA=>'CLM',OBJECT_TYPE=>'TABLE',NAME=>'T1') from dual;
DBMS_METADATA.GET_DDL(SCHEMA=>'CLM',OBJECT_TYPE=>'TABLE',NAME=>'T1')
--------------------------------------------------------------------------------
CREATE TABLE "CLM"."T1"
( "ID" VARCHAR2(60) NOT NULL ENABLE,
"A" VARCHAR2(60),
"B" VARCHAR2(60),
"CREATE_TIME" TIMESTAMP (6),
"D" NUMBER(2,0),
"E" VARCHAR2(400),
"OUTER_ID" VARCHAR2(100),
CONSTRAINT "PK_T1" PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
DBMS_METADATA.GET_DDL(SCHEMA=>'CLM',OBJECT_TYPE=>'TABLE',NAME=>'T1')
--------------------------------------------------------------------------------
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DE
FAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DE
FAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS"
DBMS_METADATA.GET_DDL(SCHEMA=>'CLM',OBJECT_TYPE=>'TABLE',NAME=>'T1')
--------------------------------------------------------------------------------
SQL>
新表旧表的创建语句
EXEC DBMS_REDEFINITION.START_REDEF_TABLE(USER, 'T1', 'T1_NEW');---执行这个没有问题
没有报错 |
|