獲取物件的構建語句

楊奇龍發表於2010-07-08

構造表的語句

SQL> set pagesize 0
SQL> set long 999
SQL> select dbms_metadata.get_ddl('TABLE','A1') from dual;       
  CREATE TABLE "SYS"."A1"                                                                        
   ( "A" NUMBER(38,0),                                                                              
  PRIMARY KEY ("A")                                                                             
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255                                                          STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645                                   PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)                                            TABLESPACE "TEST"  ENABLE                                                                             ) 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 "TEST"               
                                                                                                                                                                                                                                              獲取表空間的構建語句                             

SQL> select dbms_metadata.get_ddl('TABLESPACE','SYSTEM') from dual;
   CREATE TABLESPACE "SYSTEM" DATAFILE                                                                  
  'F:\APP\YANG\ORADATA\ORACL\SYSTEM01.DBF' SIZE 314572800                                              
  AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M                                                           
  LOGGING ONLINE PERMANENT BLOCKSIZE 8192                                                                

 EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT MANUAL                   
  ALTER DATABASE DATAFILE   'F:\APP\YANG\ORADATA\ORACL\SYSTEM01.DBF' RESIZE 786432000   

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-667574/,如需轉載,請註明出處,否則將追究法律責任。

相關文章