oracle – 防止SPOOL的输出被包装

前端之家收集整理的这篇文章主要介绍了oracle – 防止SPOOL的输出被包装前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试使用sqlPLUS中的SPOOL命令为数据库中的对象生成所有DDL

SET trimspool ON
SET wrap off
SET heading off
SET linesize 300
SET echo off
SET pages 999
SET long 90000
Col object_type format a10000
Col object_name format a10000
Col owner format a10000

spool export.out

SELECT DBMS_MetaDATA.GET_DDL(object_type,object_name,owner)
FROM all_OBJECTS 
WHERE OWNER = 'DMALM' 
and object_type not like '%PARTITION'
and object_type not like '%BODY'
and object_type not like '%LOB';

spool off
quit

但我得到的输出文件是在col#80切割.
如何防止输出文件被包装?

解决方法

使用word_wrapped怎么样?

SET trimspool ON
SET heading off
SET linesize 300
SET echo off
SET pages 999
SET long 90000
set termout off
column txt format a121 word_wrapped
Col object_type format a10000
Col object_name format a10000
Col owner format a10000
spool export.out

SELECT DBMS_MetaDATA.GET_DDL(object_type,owner)txt
FROM all_OBJECTS 
WHERE OWNER = 'DMALM' 
and object_type not like '%PARTITION'
and object_type not like '%BODY'
and object_type not like '%LOB';

spool off
quit

猜你在找的Oracle相关文章