现在的位置: 首页 > 综合 > 正文

oracle导出某个表的表结构

2013年08月09日 ⁄ 综合 ⁄ 共 543字 ⁄ 字号 评论关闭
和大家分享下
用这个脚本,可以导出表结构到./TAB248_20091217.sql 文件中
set colsep ''
set trimspool on
set long 90000
set linesize 120
set pagesize 2000
set newpage 1
set heading off
set term off
spool ./TAB248_20091217.sql
select  '--' || a.table_name ||'(' || a.comments ||')'||chr(3)||chr(9)||
       dbms_metadata.get_ddl(a.table_type,
                            a.table_name,
                             NULL,
                             'COMPATIBLE',
                             'ORACLE',
                             'DDL') ||';' as createsql
  from user_tab_comments  a
  where  a.table_name not like 'BIN%';
 
spool off

抱歉!评论已关闭.