This article provides the steps involved in moving or migrating spectrum protect server database, activelog and archivelog to new directory location on windows operating system. IBM Spectrum Protect formerly known as TSM (Tivoli Storage Manager) is an enterprise class Data Protection software.
About this task
To move database and recovery logs to new directory location, complete the following steps:
Prerequisite Steps
Make sure prerequisite steps are performed before actual steps are performed
Step 1:
Make sure all client backups sessions have completed. In case any of any running backups please wait for the backups to complete or cancel backup sessions forcefully before proceeding.
Command to query backup session number
query session
Command to cancel backup session
cancel session <session number>
Step 2:
Make sure all server process have completed. In case any of any running process please wait for the process to complete or cancel process forcefully before proceeding.
Command to query server process number
query process
Command to cancel backup session
cancel process <process number>
Step 3:
Collect information about present TSM Database paths and Logs and save outputs for future reference.
Command to capture present database paths and space usage details
query dbspace
Command to capture present activelog and archivelog paths.
query log f=d
Step 4:
Gather information about each Db2 instance. Note the default database path, actual database path, database name, database alias, and any Db2 variables that are configured for the instance. Keep the record for future reference. This information is required to
Log on to the computer where the server is installed. Ensure that you are logged on with the instance user ID.
Obtain a list of Db2 instances. Issue the following system command
db2ilist
Open the Db2 command window by issuing the following system command
db2cmd
To change the instance, issue the following system command where instance specifies the Db2 instance. This command is executed on DB2 Command Line Processor open with db2cmd executed in last step.
set DB2INSTANCE=instance
Run below commands on DB2 Command Line Processor to collect database instance variables and values. Keep the record for future reference.
db2 get dbm cfg | findstr DFTDBPATH
db2 get dbm cfg
db2 list database directory
db2set -all
db2 get db cfg for tsmdb1
Actual Steps
Below mentioned steps will move database and recovery logs to new location on same server.
Step 1:
Initiate database backup with below command. Modify device class command as per site config.
backup db devclass=ltoclass type=full
Step 2:
After successful database backup save a copy of important files to alternate location outside server.
Back up the device configuration information by issuing the following administrative command
backup devconfig filenames=file_name
Back up the volume history information by issuing the following administrative command
backup volhistory filenames=file_name
Save a copy of the server options file, which is typically named dsmserv.opt. The file is in the server instance directory.
Step 3:
Stop the spectrum protect server by issuing the following administrative command
halt
Verify that the server is shut down and no processes are running. Open the Windows Task Manager application and review the list of active processes.
Step 4:
Login as instance user and make new directories for database, activelog and archivelog.
Additionally create a file “c:\tsmcfg\dbdirs.txt” with all Database directories mentioned.
Step 5:
Remove the server database TSMDB1 by issuing the following administrative command
dsmserv removedb TSMDB1
Step 6:
Restore database to new directories created in step 4 using below command
dsmserv restore db todate=today on=C:\tsmcfg\dbdirs.txt
Step 7:
After database restore completed successfully verify new database directory paths.
Start spectrum protect server service and verify by issuing the following administrative command
query dbspace
After verifying stop the spectrum protect server by issuing the following administrative command
halt
Step 8:
Once spectrum protect server service is stopped we can proceed with moving activelog and archivelog to new directories created in step 4.
Edit dsmserv.opt with new values as below:
ACTIVELOGDIRECTORY <new activelog directory path>
ARCHIVELOGDIRECTORY <new archivelog directory path>
ACTIVELOGSIZE <new activelog size>
Start spectrum protect server service and verify new activelog and archivelog directory paths by issuing the following administrative command
query log f=d
Once spectrum protect server service is started copy archive Logs from old path to new path using below command:
xcopy /s <old archivelog directory path>\* <new archivelog directory path>
Step 9:
Initiate database backup with below command. Modify device class command as per site config.
backup db devclass=ltoclass type=full
Verify database backup is completing successfully and this concludes the activity.