I've written a sql to run a few heartbeat checks on our oracle database. Within the sql I've added a spool command. I'd like the filename to include the today's date so that it does not overwrite other outputs from the previous days. A batch file will run the sql. Here is the sample:
sql 1:
------------------------------------------
alter session set nls_date_format='whatyouwant';
set head off
spool aaa.sql
select 'spool u:\oracle\analyzescripts'||sysdate||'.lis' from dual;
select '@sql2' from dual;
select 'spool off' from dual;
spool off
set head on
@aaa.sql
----------------------------------------------------------
sql2 being the script you want to launch
Bookmarks