I've got a .sql script running from a UNIX ksh shell script. Part of the .sql includes a SPOOL command to a log file. I'd like to include the date/time in the log file so it is a little more useful.
Here's my code:
Please advise on how I can add the date/time to the log file being generated.
Also, I keep getting this error when I run the .sql from the UNIX shell script...does this mean the SQL login I'm using to run this doesn't have access to run that command?:
ALTER SYSTEM FLUSH SHARED_POOL
*
ERROR at line 1:
ORA-01031: insufficient privileges
Here's my code:
Code:
DEFINE LOG_DIR=&1
SPOOL &&LOG_DIR/file.log
ALTER SYSTEM FLUSH SHARED_POOL
@@Date
/
TRUNCATE TABLE tblname
/
SPOOL OFF
EXIT
Please advise on how I can add the date/time to the log file being generated.
Also, I keep getting this error when I run the .sql from the UNIX shell script...does this mean the SQL login I'm using to run this doesn't have access to run that command?:
ALTER SYSTEM FLUSH SHARED_POOL
*
ERROR at line 1:
ORA-01031: insufficient privileges