User Tools

Site Tools


tsm:tsm_operation_db

DB and logs management

Spectrum Protect sizing

Active log

Start with 128GB and keep 20% extra space in the filesystem in cas of trouble Up to 512GB in version 8.1.8

Archive log

Start with minumum 3x the size of active log

Database Management

Increase the size of the database

TSM v6 database is self expanding, as long as there is enough space into filesystems or drives (Windows). Then to extend the DB, expand the LUNs, or add new disks or filesystems, and add it to the dbspace:

TSM:SERVER1> extend dbspace /tsmdb005,/tsmdb006

Reduce the size of the database

If a significant amount of data has been deleted from the database, consider reducing the database size.

  • Create a file containing a list of directories that represent the new directories. For example, dbdirs.txt.
  • Run a full database backup. For example:
TSM:SERVER1> backup db devclass=tapeclass type=full
  • Halt the server.
  • Remove the database instance.
TSM:SERVER1> dsmserv removedb TSMDB1
  • Restore the database specifying the file containing the directories to be used. For example:
TSM:SERVER1> dsmserv restore db todate=today on=dbdirs.txt
  • Restart the server.

Restore DB

Restore from library

For tape libraries, you need to add one line per K7, with element number on the VTL

/* LIBRARYINVENTORY SCSI TS3100 885BCML5 4097 101*/
/* Device Configuration */
SET SERVERNAME TSM_OPECGDY
DEFINE LIBRARY TS3100 LIBTYPE=SCSI SERIAL="00L2U78V8326_LL0" SHARED=NO AUTOLABEL=NO RESETDRIVE=YES
DEFINE DRIVE TS3100 DRIVE1 ELEMENT=256 ONLINE=Yes WWN="2001000E1114975E" SERIAL="1068045826"
DEFINE DRIVE TS3100 DRIVE2 ELEMENT=257 ONLINE=Yes WWN="2004000E1114975E" SERIAL="1068069878"
/* LIBRARYINVENTORY SCSI TS3100 885BCML5 4097 101*/
/* LIBRARYINVENTORY SCSI TS3100 886BCML5 4104 101*/
/* LIBRARYINVENTORY SCSI TS3100 887BCML5 4100 101*/
/* LIBRARYINVENTORY SCSI TS3100 888BCML5 4096 101*/
/* LIBRARYINVENTORY SCSI TS3100 889BCML5 4103 101*/
/* LIBRARYINVENTORY SCSI TS3100 895BCML5 4107 101*/
/* LIBRARYINVENTORY SCSI TS3100 896BCML5 4111 101*/
/* LIBRARYINVENTORY SCSI TS3100 897BCML5 4115 101*/
/* LIBRARYINVENTORY SCSI TS3100 898BCML5 4106 101*/
/* LIBRARYINVENTORY SCSI TS3100 899BCML5 4112 101*/
/* LIBRARYINVENTORY SCSI TS3100 915BCML5 4116 101*/
/* LIBRARYINVENTORY SCSI TS3100 916BCML5 4102 101*/
/* LIBRARYINVENTORY SCSI TS3100 917BCML5 4098 101*/
/* LIBRARYINVENTORY SCSI TS3100 918BCML5 4101 101*/
/* LIBRARYINVENTORY SCSI TS3100 919BCML5 4105 101*/
/* LIBRARYINVENTORY SCSI TS3100 935BCML5 4113 101*/
/* LIBRARYINVENTORY SCSI TS3100 936BCML5 4114 101*/
/* LIBRARYINVENTORY SCSI TS3100 937BCML5 4099 101*/
/* LIBRARYINVENTORY SCSI TS3100 938BCML5 4108 101*/
/* LIBRARYINVENTORY SCSI TS3100 939BCML5 4110 101*/
/* LIBRARYINVENTORY SCSI TS3100 940BCML5 4109 101*/
/* LIBRARYINVENTORY SCSI TS3100 941BCML5 4117 101*/
DEFINE PATH TSM_OPECGDY TS3100 SRCTYPE=SERVER DESTTYPE=LIBRARY DEVICE=lb2.1.0.5 ONLINE=YES
DEFINE PATH TSM_OPECGDY DRIVE1 SRCTYPE=SERVER DESTTYPE=DRIVE LIBRARY=TS3100 DEVICE=mt2.0.0.5 ONLINE=YES
DEFINE PATH TSM_OPECGDY DRIVE2 SRCTYPE=SERVER DESTTYPE=DRIVE LIBRARY=TS3100 DEVICE=mt3.0.0.5 ONLINE=YES
DEFINE DEVCLASS ULTRIUM5 DEVT=LTO FORMAT=ULTRIUM5C MOUNTL=DRIVES MOUNTWAIT=15 MOUNTRETENTION=15 PREFIX=ADSM LIBRARY=TS3100 WORM=NO DRIVEENCRYPTION=ALLOW LBPROTECT=NO
SERVERBACKUPNODEID 1

Moving the database

You can move only the database to new directories. To move the database from one location on the server to another location, follow this procedure:

  • Back up the database. For example:
TSM:SERVER1> backup db type=full devclass=files
  • Halt the server.
  • Create directories for the database. The directories must be accessible to the user ID of the database manager. For example:
mkdir /tsmdb005
mkdir /tsmdb006
mkdir /tsmdb007
mkdir /tsmdb008
  • Create a file that lists the locations of the database directories. This file will be used if the database must be restored. Enter each location on a separate line. For example, here are the contents of the dbdirs.txt file:
/tsmdb005
/tsmdb006
/tsmdb007
/tsmdb008
  • Remove the database instance.
TSM:SERVER1> dsmserv removedb TSMDB1
  • Issue the DSMSERV RESTORE DB utility to move the database to the new directories. For example:
TSM:SERVER1> dsmserv restore db todate=today on=dbdir.file
  • Start the server.

Suppress the TSM database

  • Soft way to remove the TSM database:

As « tsminst1 » user, stop the TSM server:

# dsmserv  removedb
  • Hard way, remove the DB2 instance:

Stop DB2 as tsminst1 user:

# db2stop

List the DB2 instance and remove it:

[tsminst1@tsmsrv]/tsm/config# db2ilist
tsminst1
[tsminst1@tsmsrv]/tsm/config# db2idrop tsminst1

Then remove the directories DB, log, archlog, configuration files.

Active logs management

Increase the size of active log

If the log is running out of space, the current transaction is rolled back, and the server issues an error message and halts. You cannot restart the server until the active log size is increased.

To increase the size of the active log while the server is halted, complete the following steps:

  • Issue the DSMSERV DISPLAY LOG offline utility to display the size of the active log.
  • Ensure that the location for the active log has enough space for the increased log size. If a log mirror exists, its location must also have enough space for the increased log size.
  • In the dsmserv.opt file, update the ACTIVELOGSIZE server option to the new maximum size of the active log, in megabytes. For example, to change the active log to its maximum size of 128 GB, enter the following server option:

activelogsize 131072

  • If you will use a new active log directory, update the directory name specified in the ACTIVELOGDIR server option. The new directory must be empty and must be accessible to the user ID of the database manager.
  • Restart the server.

Log files of 512 MB are automatically defined until the size specified in the ACTIVELOGSIZE server option is reached. If a log mirror exists, log files are also defined automatically.

Moving active logs

You can move only the active log from one directory to another.

  • Create a new active log directory. For example:
mkdir /activelog2
  • Update the dsmserv.opt option file for the new active log directory. For example:
activelogdir /activelog2
  • Halt and restart the server. The active logs are automatically moved by the database manager from the old directory to the new directory.
  • Optional: Remove the old directory.

Delete the mirrorlog

http://www-01.ibm.com/support/docview.wss?uid=swg21567061

  • Just remove the parameter MIRRORLOGDIRECTORY /mirrorlogs from dsmserv.opt
  • Restart TSM server (maybe twice on some TSM versions
  • check if the update is done
tsm: LU21TSM01>q log f=d
          Active Log Directory: /tsmserver/tsminst1/tsmactilog
               Total Space(MB): 8,192
                Used Space(MB): 55
                Free Space(MB): 8,137
         Archive Log Directory: /tsmserver/tsminst1/tsmarchlog
Total Size of File System (MB): 32,768.00
Space Used on File System (MB): 334.79
                Free Space(MB): 32,433.21
          Mirror Log Directory: 
Total Size of File System (MB): 
Space Used on File System (MB): 
                Free Space(MB): 
Archive Failover Log Directory: /tsmserver/tsminst1/tsmarcflog
Total Size of File System (MB): 15,360.00
Space Used on File System (MB): 7,826.44
                Free Space(MB): 7,533.56
As tsminst1
db2 connect to tsmdb1
db2 get db cfg |grep LOG
tsminst1@TSM01:/home/tsminst1>db2 get db cfg | grep -i tsminst 
 Path to log files                                       = /tsmserver/tsminst1/tsmactilog/NODE0000/LOGSTREAM0000/
 Mirror log path                         (MIRRORLOGPATH) = /tsmserver/tsminst1/tsmmirrlog/NODE0000/LOGSTREAM0000/
 First log archive method                 (LOGARCHMETH1) = DISK:/tsmserver/tsminst1/tsmarchlog/
 Failover log archive path                (FAILARCHPATH) = /tsmserver/tsminst1/tsmarcflog/

If the paramaters aren't updated, you can stop TSM, start DB2 manually, update the paramater and stop DB2 before starting TSM again.

db2 update db cfg for tsmdb1 using MIRRORLOGPATH ''

ArchiveLog management

Moving only the ArchiveLog

It’s not possible to reduce or increase the size of the archive log, it’s done automatically, depending on space available on the filesystem or drive. You can move only the archive log from one directory to another.

  • Create an new archive log directory. For example:
mkdir /archivelog2
  • Update the dsmserv.opt option file for the new archive log directory. For example:
archivelogdir /archivelog2
  • Halt and restart the server.
  • Move the archive logs from the old directory to the new directory. Preserve any subdirectory structure. Use and verify a recursive copy directory command. For example:
cp -r /archivelog/*   /archivelog2
  • Optional: Remove the old directory.

Instance Management

Recatalog the database to the instance

System Database Directory

The system database directory resides in the SQLDBDIR subdirectory in the instance directory. This directory is used to catalog both local and remote databases. The directory contains the database name, alias, type, and node where the database resides. If the database is local, a pointer to the local database directory is located in the system database directory. If the database is remote, there is a pointer to the node directory.

As instance user

$ db2 catalog db TSMDB1 on <path_instance>

Move the instance to another location

make a copy of all files located in the instance user home directory

  1. dsmserv*
  2. cert*
  3. tsminst1 (or instance name in the instance home directory)
  4. volhist*
  5. devconf*
  6. tsmdbmgr*

After renaming the instance file, complete the following steps. Important: Complete steps 1-6 for each one of your Tivoli Storage Manager server instances.

1. Issue the following command: installation_directory\db2\bin\db2idrop InstanceName

2. Start the installation wizard again and step through it to upgrade the Tivoli Storage Manager server.

3. After the upgrade, recreate each of the instances using the following command: installation_directorydb2\bin\db2icrt InstanceName –u InstanceUser, password

4. Recreate the variables in the instance file using the db2set -i command. Issue this command for each variable in your instance file. Ensure that the variable is in quotation marks: installation_directory\db2\bin\db2set –i InstanceName “Variable”

For example, to recreate the first variable in the example instance file, issue the following command: db2set -i server1 “DB2_SKIPINSERTED=ON”

5. Stop and start the database instance:

a. Open a DB2 command window. One method of doing this is by going to the C:\Program Files\Tivoli\TSM\db2\bin directory, or if you installed Tivoli Storage Manager in a different location, go to the db2\bin subdirectory in your main installation directory. Then, issue this command: db2cmd

b. Set the database instance: set db2instance=InstanceName

c. Start DB2: db2start

d. Catalog and upgrade each database name. The DatabasePath is the drive, for example, D:, if the DB2 database catalog exists on the D drive. “db2 catalog db DatabaseNameon DatabasePath“ “db2 upgrade db DatabaseName”

e. Stop DB2: db2stop

6. Start and run the Tivoli Storage Manager server.

tsm/tsm_operation_db.txt · Last modified: 2021/06/15 17:39 by manu