ORACLE下SCHEMA表结构导出

方法一:

exp userid=scott/tiger owner=scott imp userid=scott/tiger full=y indexfile=scott.sql

 

方法二:

set pagesize 0

set long 90000

set feedback off

set echo off

spool get_allddl.sql

connect USERNAME/PASSWORD@SID;

SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name)

FROM USER_TABLES u;

SELECT DBMS_METADATA.GET_DDL('INDEX',u.index_name)

FROM USER_INDEXES u;

spool off;

你可能感兴趣的:(数据库)