Friday, November 06, 2009

GET DDL from DBMS_METADATA.

if you want to get your table or index DDL , there is an easy way to get it on CLI.

--- command --
set long 10000

select dbms_metadata.get_ddl('INDEX','SYS_C0018108','TAT') from dual;


--- result ---
CREATE UNIQUE INDEX "TAT"."SYS_C0018108" ON "TAT"."TEST" ("TID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TAT_DATA"


-- TaTsHuYa --

No comments: