oracle - sqlplus print running statement -
is there way sqlplus can print statement executed. mean have .sql files run in bash script. need know when read log file statement sqlplus ran.
example: have test.sql file:
set timing on create table foo (a varchar2(10)); create table bar (b varchar2(10)); exit
when check log this:
table created. elapsed: 00:00:00.02 table created. elapsed: 00:00:00.01
which not informative. there way can output this:
table foo created. elapsed: 00:00:00.02 table bar created. elapsed: 00:00:00.01
or this:
create table foo (a varchar2(10)); table created. elapsed: 00:00:00.02 create table bar (b varchar2(10)); table created. elapsed: 00:00:00.01
i know can use prompt before each statement have big sql scripts , tedious write prompt before each statement.
edit:
for allan's solution work (i.e. using "set echo on"), should avoid following:
1) don't use -s option sqlplus because suppress display of echoing of commands.
2) don't "cat" script sqlplus this:
cat test.sql | sqlplus scott/tiger@orcl
the command you're looking set echo on
, repeat each statement issued.
Comments
Post a Comment