If you look at the db cfg for your db you will parameters that allow you to
do this.
LOGARCHMETH1 and LOGARCHMETH2. Determine where you want to archive your
logs, disk on server, disk on file server, tsm, vendor prod.
With the two methods enabled, you can archive to two different places and
let db2 control it. Your db2diag.log will contain info about successful or
failed archive for every log handled. This works for both V8 and V9.
This way you'll be able to let DB2 take of it and also be able to port this
to any other system running DB2.
I do understand you are presently archiving your logs (either with your own
exit or using DB2UEXT2) but using DB2 ARCHMETH makes your life simple and
also allows you to hace to targets to archive to.
Hope this helps, Pierre.
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
----- Original Message -----
From: "Bob Khosla" <db2udbdba-ezmlmshield-x92306821.[Email address protected]
To: "LazyDBA Discussion" <[Email address protected]
Sent: Friday, November 24, 2006 3:01 PM
Subject: 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
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
DB2 & UDB email list listserv db2-l LazyDBA home page