ADSM-L

Re: DB2 backups

2006-11-30 15:23:57
Subject: Re: DB2 backups
From: Gustavo Olivera <gusolivera AT GMAIL DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Thu, 30 Nov 2006 16:04:14 -0300
yes, by the db2adutl utility... in order to delete logs I wrote this script
in a Windows environment:

------------------------------------
@echo off

db2adutl query full db %1 | find /C "%2 Time" > nul

rem SI ERRORLEVEL = 0, EXISTE EL RESPALDO %2
if %ERRORLEVEL% EQU 0 goto continuar

echo NO EXISTE EL RESPALDO %2 - NO SE REALIZARA BORRADO DE LOGS PARA LA BASE
%1
goto fin

:continuar
db2adutl query full db %1 | find "%2 Time" | cut -b 41-52 > oldestLog_%1.txt

echo EXISTE EL RESPALDO %2 - SE BORRARAN LOS LOGS HASTA EL LOG
type oldestLog_%1.txt
echo PARA LA BASE %1

echo db2adutl delete logs between S0000000.LOG and > borraLogs_%1.tmp
type oldestLog_%1.txt >> borraLogs_%1.tmp
echo  db %1 without prompting >> borraLogs_%1.tmp

type borralogs_%1.tmp | tr -d "\r\n" > borraLogs_%1.bat

del oldestLog_%1.txt
del borraLogs_%1.tmp

echo.
@echo on
call borraLogs_%1.bat
@echo.
@echo off
del borraLogs_%1.bat

:fin
------------------------------------

You should set the DBNAME and the number of first unused backup (31 if you
want mantain 30 backups)

In order to delete backups I wrote this script:

-------------------------------------
db2adutl delete full db %1 keep %2 without prompting
-------------------------------------

The first parameter is the DB name and the second is the nomber of backups
that TSM should preserve

Best regards,

Gustavo Olivera

2006/11/30, Britton, Nick <nbritton AT fnts DOT com>:

So it does not matter if you are using the ba client or the api client
you still must use a script to backup the database. That is what I
needed to know.  Does anyone have a sample script that they use to
delete old db copies and logs?

Thanks
Nick

-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] On Behalf Of
Gustavo Olivera
Sent: Thursday, November 30, 2006 12:12 PM
To: ADSM-L AT VM.MARIST DOT EDU
Subject: Re: [ADSM-L] DB2 backups

Hi,

You can use the following statement from a DB2 CLP, a Command Editor,
the
Task Center or any tool:

backup database DBNAME use tsm

In order to verify the backups you can use the db2adutl utility, and can
check the syntax by typing only db2adutl from a DB2 CLP, but the first
statement that you should enter is:

db2adutl query full db DBNAME

Best regards,

Gustavo Olivera


2006/11/30, Britton, Nick <nbritton AT fnts DOT com>:
>
> Can someone help with understanding how db2 works with the api client.
> I am new to TSM and I am trying to understand how I backup the DB with
> the API client.
>
> I understand that I install the API and Configure the API.  I register
> the node and associate it with a schedule.  But how to you backup the
> actual databases?
>
> ***** PRIVILEGED AND CONFIDENTIAL *****
> This communication, including attachments, is for the exclusive
> use of addressee and may contain proprietary, confidential
> and/or privileged information. If you are not the intended
> recipient, any use, copying, disclosure, dissemination or
> distribution is strictly prohibited. If you are not the intended
> recipient, please notify the sender immediately by return e-
> mail, delete this communication and destroy all copies.
>

***** PRIVILEGED AND CONFIDENTIAL *****
This communication, including attachments, is for the exclusive
use of addressee and may contain proprietary, confidential
and/or privileged information. If you are not the intended
recipient, any use, copying, disclosure, dissemination or
distribution is strictly prohibited. If you are not the intended
recipient, please notify the sender immediately by return e-
mail, delete this communication and destroy all copies.


<Prev in Thread] Current Thread [Next in Thread>