简体   繁体   English

如何从脚本文件到Oracle假脱机文件生成结果

[英]How to Generate Result from Script Files to Oracle Spool File

I have a script file containing a mix of DDL and DML which rebuilds a database I use for testing against. 我有一个包含DDL和DML混合的脚本文件,该文件重建了用于测试的数据库。 The script file is generating some errors which I need to track down so I attempted to output the results of the script to a spool file using SQLPlus, see below: 该脚本文件正在生成一些错误,需要跟踪,因此我尝试使用SQLPlus将脚本的结果输出到假脱机文件中,请参见下文:

spool "c:\DBDeploy\ALERTSTLOCAL_Version4x_Rebuild.spl";
@"c:\DBDeploy\ALERTSTLOCAL_Version4x_Rebuild.sql";
spool off;

Unfortunately although the spool file gets generated none of the results from the script file (apart from the 'spool off' statement ), get written to the spool file. 不幸的是,尽管假脱机文件没有从脚本文件中生成任何结果(除了'spool off'语句),还是要写入假脱机文件中。 Can anyone suggest what is happening here. 任何人都可以建议这里发生了什么。 I am sure I have used this technique in bygone years, its most perplexing :-/ 我敢肯定,我已经在过去的几年中使用过这种技术,它最令人困惑:-/

Kind Regards Paul J. 亲切的问候Paul J.

you need some tweaking 你需要一些调整

SET SERVEROUTPUT ON FORMAT WRAPPED
SET VERIFY OFF
SET FEEDBACK OFF
SET TERMOUT OFF

DBMS_OUTPUT.ENABLE(1000000);

spool "c:\DBDeploy\ALERTSTLOCAL_Version4x_Rebuild.spl";
@"c:\DBDeploy\ALERTSTLOCAL_Version4x_Rebuild.sql";
spool off;

SET TERMOUT ON
SET FEEDBACK ON
SET VERIFY ON

Tested Screenshot: 经过测试的截图:

在此处输入图片说明

On Windows 在Windows上

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM