반응형

*DDL 추출하기

1) USING DBMS PACKAG

C:\> sqlplus /nolog

SQL> conn sys/manager as sysdba

SQL> desc all_db_links

SQL> select * from all_db_links;

SQL>

set long 2000000000



SQL> SELECT dbms_metadata.get_ddl('TABLE','EMP','SCOTT') FROM dual;
SQL> SELECT dbms_metadata.get_ddl('TABLESPACE','TBS_SCOTT') FROM dual;

SQL> SELECT dbms_metadata.get_ddl('DB_LINK','LINK_SCOTT','PUBLIC') FROM dual;
SQL> SELECT dbms_metadata.get_ddl('DB_LINK','LINK_SCOTT','PUBLIC') DDL_QUERY FROM dual;

2) USING export (rows=no 포함 시에 DDL만 export함)

가) 전체 export
C:\> exp system/manager file=full_dp.dmp log=full_dp.log feedback=10000 buffer=102400000 rows=no

나) scott_d_p만 export
C:\> exp scott_d_p/scott_d_p file=dp_ddl.dmp log=dp_ddl.log owner=scott_d_p feedback=10000 buffer=102400000 rows=no


http://www.koug.net/xe/3569

http://www.oracleclub.com/lecture/1560

http://www.koug.net/xe/3569

http://lazyjin.tistory.com/16

http://surachartopun.com/2008/02/using-dbmsmetadatagetddl.html

반응형