procedure call from SQL*Plus in Korn Shell script [message #199889] |
Thu, 26 October 2006 10:43 |
djehres
Messages: 3 Registered: June 2005 Location: Garland, TX
|
Junior Member |
|
|
I am trying to excute a procedure from sqlplus, truncate_audit_table. I doesn't execute. If I do it manually
it executes. I have tried multiple ways, as below. This is inside a Korn Shell scripts that creates the procedure
and counts the aud$ table. All that works, but does not truncate the aud$ table. It does not do it, no error, just
passes it by. Does anybody know why?
${ORACLE_HOME}/bin/sqlplus -s / << EOF | tee -a ${LOG}
set feedback on
@/backup/oracle/orcl/audit/truncate_audit_table.sql
select count(*) from sys.aud$;
exec truncate_audit_table;
exit
EOF
${ORACLE_HOME}/bin/sqlplus -s / << EOF | tee -a ${LOG}
set feedback on
@/backup/oracle/orcl/audit/truncate_audit_table.sql
select count(*) from sys.aud$;
begin
truncate_audit_table;
end;
exit
EOF
This is the procedure that is being called:
create procedure truncate_audit_table
as
begin
execute immediate 'truncate table sys.aud$';
end;
/
|
|
|
|
|