IBM TSM (tivoli) : Need to clear db2 archives log

Hello experts,

I am having a serious problem.

My tsm database and logs are  on the same disk


More than 95% of this disk space is filled with archives logs.

How can I delete the old archives logs ? what is the best practice, please help.
Williams225System AdministatorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Run a full database backup immediately. You will run into big trouble when the disk space gets 100% filled!

On the administrative command line (dsmadmc) run

BACKUP DB TYPE=FULL DEVC=<your tape deviceclass>

Replace "<your tape deviceclass> " with the name of the device class of your tape library and take care to have a scratch tape available in that library.

A full database backup will also clear the archive logs and is the only recommended way to do this.
If the logs are not fully pruned after the backup has completed run a second backup the same way as described above.

In the future, schedule a full db backup on a regular basis!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Williams225System AdministatorAuthor Commented:
hello thanx for your reply.

II don't understand , I get the error bellow

The command used is : BACKUP DB TYPE=FULL DEVC=LTO4 >> backupdb_17_11_2014.log

ANR4626I Database backup will use 1 streams for processing with the number originally requested 1.
ANR2984E Database backup terminated due to environment or setup issue related to DSMI_CONFIG - DB2 sqlcode -2033 sqlerrmc 40
ANR1361I Output volume BUL002L4 closed.
ANR0515I Process 4550 closed volume BUL002L4.
ANR0985I Process 4550 for Database Backup running in the BACKGROUND completed with completion state FAILURE at 10:58:21.
ANR1893E Process 4550 for Database Backup completed with a completion state of FAILURE.
So you never ran a DB backup before? That's spunky!

Anyway, please find the file named "db2diag.log". It contains more information about the error.

I don't know where this file is located under Windows, under Unix it's in the "sqllib/db2dump" subdirectory of the top level instance directory,
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

And please check that  the DSMI_CONFIG system variable is set correctly in the DB2 userprofile ("<instance_dir>/sqllib/userprofile".

The variable must contain path and name of a valid user options file ( normally "tsmdbmgr.opt").
Williams225System AdministatorAuthor Commented:
what will be the impact if I manually delete old archive logs?

Williams225System AdministatorAuthor Commented:
bro, please help me.

How do I check  if the DSMI_CONFIG system variable is set correctly in the DB2 userprofile ("<instance_dir>/sqllib/userprofile".

Do you know the path? do you have an example or a step by step guide?
The archive logs should never be diretly manipulated!  TSM and DB2 will manage them!

You can anyway delete archive logs (and only archive logs, not the active log!!) manually, but then you'll loose the option to succesfully restore the DB from a backup. Well, you don't have any backup, so ...

Why wouldn't you try going the TSM way? I, personally (let alone IBM) will never recommend direct logfile manupulation. IBM will cease giving support should any problems arise due to your interventions.
Williams225System AdministatorAuthor Commented:
ok, you are right. But I don't understand the why db backup with tsm is not working , I only have 9gb of free space right now.

Disk Space
I still haven't found out to check the DSMI_CONFIG system variable
I don't know the path on Windows. You should be able to find the file by a simple file search. (Windows does have a file search??)

DSMI_CONFIG in the userprofile should point to a file tsmdbmgr.opt. This file, in turn, has to contain a servername. Again, in turn, this servername must point to an entry in the API system options file. On UNIX, it's /usr/tivoli/tsm/client/api/bin64/dsm.sys.
This file should look as follows:

servername <servername from tsmdbmgr.opt>
commmethod tcpip
tcpserveraddr localhost
tcpport 1500
passwordaccess generate
passworddir /<install_dir>/config
errorlogname /<install_dir>/logs/tsmdbmgr.log
nodename $$_TSMDBMGR_$$

"servername" in dsm.sys must correspond to "servername" in tsmdbmgr.opt.

Here is the installation guide:
Best STOP THE SERVER before the disk in question becomes 100% full!!

I fear you will not be able to recover from an archiver stuck situation without assistance from IBM!

Well, basically I know how to do it, but it's rather hard for a person being not familiar with DB2 (and for me, being not familiar with your particular environment)!
Williams225System AdministatorAuthor Commented:
Wooolmikpork, you are the man!!! please continue to help me.

I am still trying to figure out , out to check that DSMI_CONFIG in the userprofile  point to a file tsmdbmgr.opt.

But I don't find solution online , I really don't know how to check DSMI_CONFIG.

N.B : I just noticed that all my database backup start failing after the upgrade of tsm server to  version 7.0 back to september. My oldest archive logs are from september.

Please find a copy of my tsmdbmgr
The content of your tsmdbmgr.opt file is OK.

If you don't find the "userprofile" file maybe you have a file called "tsmdbmgr.env" directly below the instance directory (by default it's "D:\tsmserver1")?

This file should contain the following (I use the default names):


"d:\tsmserver1\tsmdbmgr.opt" is the file whose content you posted.

Please tell me if you found the "tsmdbmgr.env" file. Once you found it please note down its full path information.

There are several more steps to be performed, but we cannot continue unless we've made sure that this file exists and holds the correct information!
Williams225System AdministatorAuthor Commented:
Cool I just found the file . I think the file settings are ok
I need two important things:

1) Is "E:\NSIABKP\tsmdbmgr.opt" the tsmdbmgr file whose content you posted?

2) What is the full path to tsmdbmgr.env?

We can continue as soon as the above questions are answered.
Williams225System AdministatorAuthor Commented:
1) yes it is E:\NSIABKP\tsmdbmgr.opt file whose content was posted at at 06:36:25

2) the full path for tsmdbmgr.env is E:\NSIABKP\tsmdbmgr.env

Now we must make the env file known to DB2:


C:\Program Files\Tivoli\TSM\db2\bin\db2cmd

If TSM is installed in a different location run db2cmd from the "db2/bin" subdirectory of that location.

Then issue

db2set -i NSIABKP DB2_VENDOR_INI=E:\NSIABKP\tsmdbmgr.env

If this fails retry with the other instance name:

db2set -i TSMDB1 DB2_VENDOR_INI=E:\NSIABKP\tsmdbmgr.env

If one of the above succeeds we're almost there!
Williams225System AdministatorAuthor Commented:
great, it succeeds


Next steps:

Still in "C:\Program Files\Tivoli\TSM\db2\BIN" run



set db2instance=NSIABKP

Now run on one single line:

"c:\program files\tivoli\tsm\server\dsmsutil.exe" UPDATEPW /NODE:$$_TSMDBMGR_$$ /PASSWORD:TSMDBMGR /VALIDATE:NO /OPTFILE:"E:\NSIABKP\tsmdbmgr.opt"

Open in new window

Williams225System AdministatorAuthor Commented:

I just ran all the commands


Now retry the full database backup.

Bonne chance!
Williams225System AdministatorAuthor Commented:
since I did this change ,  ia m not able to login to the tsm server! what can i do? is there something else to update?
Your TSM server is down! Let's hope that it didn't crash due to the archive directory being full!

Try to restart the server!
Williams225System AdministatorAuthor Commented:

You are a genius!

After a reboot of the server, I ran the database backup command, and now all the archives logs are free.

thanx a lot, without you I would be in trouble right now.

A bientôt

Williams225System AdministatorAuthor Commented:
very good support from woolmilkporc, he saved my "life" lol
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2012

From novice to tech pro — start learning today.