Een makkelijke manier om de object ddl boven water te krijgen.
Het volgende script zorgt dat je een nette object ddl op je scherm krijgt;
REM DBAsupport.nl REM ddl informatie van objecten REM object_ddl
set pages 0 set long 9000 set verify off set echo off
accept object_type prompt 'Geef object_type : ' accept object_name prompt 'Geef object_name : ' accept object_owner prompt 'Geef object_owner: '
select dbms_metadata.get_ddl('&object_type','&object_name','&object_owner') from dual;
Voorbeeld: SQL> @object_ddl Geef object_type : TABLE Geef object_name : PLAN_TABLE Geef object_owner: SYSTEM
CREATE TABLE "SYSTEM"."PLAN_TABLE" ( "STATEMENT_ID" VARCHAR2(30 CHAR), "TIMESTAMP" DATE, "REMARKS" VARCHAR2(80 CHAR), "OPERATION" VARCHAR2(30 CHAR), "OPTIONS" VARCHAR2(255 CHAR), "OBJECT_NODE" VARCHAR2(128 CHAR), "OBJECT_OWNER" VARCHAR2(30 CHAR), "OBJECT_NAME" VARCHAR2(30 CHAR), "OBJECT_INSTANCE" NUMBER(*,0), "OBJECT_TYPE" VARCHAR2(30 CHAR), "OPTIMIZER" VARCHAR2(255 CHAR), "SEARCH_COLUMNS" NUMBER, "ID" NUMBER(*,0), "PARENT_ID" NUMBER(*,0), "POSITION" NUMBER(*,0), "COST" NUMBER(*,0), "CARDINALITY" NUMBER(*,0), "BYTES" NUMBER(*,0), "OTHER_TAG" VARCHAR2(255 CHAR), "PARTITION_START" VARCHAR2(255 CHAR), "PARTITION_STOP" VARCHAR2(255 CHAR), "PARTITION_ID" NUMBER(*,0), "OTHER" LONG, "DISTRIBUTION" VARCHAR2(30 CHAR), "CPU_COST" NUMBER(*,0), "IO_COST" NUMBER(*,0), "TEMP_SPACE" NUMBER(*,0), "ACCESS_PREDICATES" VARCHAR2(4000 CHAR), "FILTER_PREDICATES" VARCHAR2(4000 CHAR) ) 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) TABLESPACE "SYSTEM"
1 rij is geselecteerd.
|