Need to Backup previous days Archive Logs

Need to Backup previous days Archive Logs

 

  

Platform: Windows, DB2 v9.1

I would like to be able to backup the previous day's archive Logs off to
another disk for safekeeping.

What are the best ways to do this?
(1) Windows Shell Script
(2) DB2 Task ................. I'd prefer to use this method so it
can be portable to another platform ...
(3) Any other way to accomplish this?

So far, I've created some SQL to pick-up the previous day's Archive Logs;
pipe the output to a file; but am unable to pick-off only the lines I
need from the output file and execute them...
The lines below show all the extraneous lines in the output file ... how
can I pull out only the "xcopy" lines and then get them to execute?

Any suggestions to achieve this is appreciated.


------------------------------ Commands Entered
------------------------------
connect to dev user db2dfnc using ********;
select
'xcopy /v /y ' || rtrim(substr(a.value,6,30)) || b.firstlog || '
E:\SQLLOGDIR_Backup'
from sysibmadm.DBCFG a,
sysibmadm.db_history b
where a.name = 'logarchmeth1'
and b.operation = 'X'
and b.end_time between current_timestamp - 1 days and
current_timestamp;
connect reset;
------------------------------------------------------------------------------

connect to dev user db2dfnc using

Database Connection Information

Database server = DB2/NT 9.1.0
SQL authorization ID = DB2DFNC
Local database alias = DEV


select 'xcopy /v /y ' || rtrim(substr(a.value,6,30)) || b.firstlog || '
E:\SQLLOGDIR_Backup' from sysibmadm.DBCFG a, sysibmadm.db_history b where
a.name = 'logarchmeth1' and b.operation = 'X' and b.end_time between
current_timestamp - 1 days and current_timestamp

1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
xcopy /v /y f:\sqllogdir\S0000183.LOG E:\SQLLOGDIR_Backup

xcopy /v /y f:\sqllogdir\S0000184.LOG E:\SQLLOGDIR_Backup

xcopy /v /y f:\sqllogdir\S0000185.LOG E:\SQLLOGDIR_Backup


3 record(s) selected.


connect reset
DB20000I The SQL command completed successfully.




Bob Khosla

DB2 & UDB email list listserv db2-l LazyDBA home page