Solved

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

Posted on 2014-11-17
25
1,879 Views
Last Modified: 2014-11-17
Hello experts,

I am having a serious problem.

My tsm database and logs are  on the same disk

e.png

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.
0
Comment
Question by:cismoney
  • 13
  • 12
25 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 40446802
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!
0
 

Author Comment

by:cismoney
ID: 40446943
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.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40446972
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,
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40446983
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").
0
 

Author Comment

by:cismoney
ID: 40447034
what will be the impact if I manually delete old archive logs?

db2diag.0.log
0
 

Author Comment

by:cismoney
ID: 40447046
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?
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40447056
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.
0
 

Author Comment

by:cismoney
ID: 40447065
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
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40447073
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:

http://www-01.ibm.com/support/knowledgecenter/SSGSG7_6.4.0/com.ibm.itsm.srv.install.doc/t_srv_install_luw.html?lang=en
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40447098
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)!
0
 

Author Comment

by:cismoney
ID: 40447274
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
tsmdbmgr.txt
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40447323
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):

DSMI_CONFIG=d:\tsmserver1\tsmdbmgr.opt
DSMI_LOG=d:\tsmserver1


"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!
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

Author Comment

by:cismoney
ID: 40447352
Cool I just found the file . I think the file settings are ok
tsmdbmgr.env.txt
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40447360
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.
0
 

Author Comment

by:cismoney
ID: 40447399
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
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 500 total points
ID: 40447452
Good!

Now we must make the env file known to DB2:

Run

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!
0
 

Author Comment

by:cismoney
ID: 40447495
great, it succeeds

db2
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 500 total points
ID: 40447557
Perfect!

Next steps:

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

db2cmd

then:

set db2instance=NSIABKP
db2stop
db2start


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

0
 

Author Comment

by:cismoney
ID: 40447618
Hello,

I just ran all the commands

output
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40447644
Merveilleux!

Now retry the full database backup.

Bonne chance!
0
 

Author Comment

by:cismoney
ID: 40447651
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?
tsm.png
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40447660
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!
0
 

Author Comment

by:cismoney
ID: 40447732
Hello,

You are a genius!

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


tsm
thanx a lot, without you I would be in trouble right now.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40447753
Félicitations!

A bientôt

wmp
0
 

Author Closing Comment

by:cismoney
ID: 40447770
very good support from woolmilkporc, he saved my "life" lol
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

By default, Carbonite Server Backup manages your encryption key for you using Advanced Encryption Standard (AES) 128-bit encryption. If you choose to manage your private encryption key, your backups will be encrypted using AES 256-bit encryption.
This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
In this Micro Tutorial viewers will learn how to restore single file or folder from Bare Metal backup image of their system. Tutorial shows how to restore files and folders from system backup. Often it is not needed to restore entire system when onl…
This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now