
Preparing the database manager for database backup
To back up the data in the database to IBM Storage Protect, you must enable the database manager and configure the IBM Storage Protect application programming interface (API).
About this task
It is not necessary to set the API password during a manual configuration of the server. If you set the API password during the manual configuration process, attempts to back up the database might fail.
If you use the configuration wizard to create an IBM Storage Protect server instance, you do not have to complete these steps. If you are configuring an instance manually, complete the following steps before you issue either the BACKUP DB or the RESTORE DB commands.
- Set the IBM
Storage Protect API
environment-variable configuration for the database instance:
- Log in by using the tsminst1 user ID.
- When user tsminst1 is logged in, ensure that the IBM®
Db2® environment is properly initialized. The Db2 environment is initialized by running the
/home/tsminst1/sqllib/db2profile script, which normally runs automatically from
the profile of the user ID. Ensure the
.profilefile exists in the instance users home directory, for example, /home/tsminst1/.profile. If.profiledoes not run thedb2profilescript, add the following lines:if [ -f /home/tsminst1/sqllib/db2profile ]; then . /home/tsminst1/sqllib/db2profile fi - In the instance_directory/sqllib/userprofile file, add the following lines:
where:DSMI_CONFIG=server_instance_directory/tsmdbmgr.opt DSMI_DIR=server_bin_directory/dbbkapi DSMI_LOG=server_instance_directory export DSMI_CONFIG DSMI_DIR DSMI_LOG- instance_directory is the home directory of the server instance user.
- server_instance_directory is the server instance directory.
- server_bin_directory is the server bin directory. The default location is /opt/tivoli/tsm/server/bin.
In the instance_directory/sqllib/usercshrc file, add the following lines:setenv DSMI_CONFIG=server_instance_directory/tsmdbmgr.opt setenv DSMI_DIR=server_bin_directory/dbbkapi setenv DSMI_LOG=server_instance_directory
- Log off and log in again as tsminst1, or issue this
command:
. ~/.profileTip: Ensure that you enter a space after the initial dot (.) character. - Create a file that is named tsmdbmgr.opt in the
server_instance directory, which is in the /tsminst1
directory in this example, and add the following
line:
SERVERNAME TSMDBMGR_TSMINST1Remember: The value forSERVERNAMEmust be consistent in thetsmdbmgr.optanddsm.sysfiles. - As a root user, add the following lines to the IBM
Storage Protect API
dsm.sysconfiguration file. By default, thedsm.sysconfiguration file is in the following default location:- server_bin_directory/dbbkapi/dsm.sys
servername TSMDBMGR_TSMINST1 commmethod tcpip tcpserveraddr localhost tcpport 1500 errorlogname /tsminst1/tsmdbmgr.log nodename $$_TSMDBMGR_$$Where- servername matches the
servernamevalue in thetsmdbmgr.optfile. - commethod specifies the client API that is used to contact the server for
database backup. This value can be
tcpiporsharedmem. For more information about shared memory, see step 5. - tcpserveraddr specifies the server address that the client API uses to
contact the server for database backup. To ensure that the database can be backed up, this value
must be
localhost.Important: If your server is using a CA-signed certificate, you must specify the server's external IP address for the tcpserveraddr option. - tcpport specifies the port number that the client API uses to contact the server for database backup. Ensure that you enter the same tcpport value that is specified in the dsmserv.opt server options file.
- errorlogname specifies the error log where the client API logs errors that are encountered during a database backup. This log is typically in the server instance directory. However, this log can be placed in any location where the instance user ID has write-permission.
- nodename specifies the node name that the client API uses to connect to the
server during a database backup. To ensure that the database can be backed up, this value must be
$$_TSMDBMGR_$$.
Attention: Do not add the PASSWORDACCESS
generate option to the dsm.sys configuration file. This option can
cause the database backup to fail.
Server database backup configuration on Windows systems
About this task
If you use the configuration wizard to create an IBM Storage Protect server instance, you do not have to complete these steps. If you are configuring an instance manually, complete the following steps before you issue either the BACKUP DB or the RESTORE DB commands.
- Determine the location of your Db2 instance directory by issuing the following command, where
tsminst1 is the name of the database
instance:
db2set -i tsminst1 db2instprofBy default, the client options file that you create in Step 2 is named dsm.opt and is located in a subdirectory that has the same name as the database instance. The subdirectory is located in the Db2 instance directory path that is returned when this command is issued.
For example, if your database instance name is tsminst1 and your Db2 instance directory is c:\programdata\ibm\db2\db2tsm1, the client options file is stored at the following location with the default name dsm.opt:c:\programdata\ibm\db2\db2tsm1\tsminst1\dsm.optTip: Optionally, configure theDSMI_CONFIGenvironment variable to specify an alternative name and location for the client options file. - Create an API client options file that is called dsm.opt in the
c:\programdata\ibm\db2\db2tsm1\tsminst1 directory with the following
contents:
************************************************* nodename $$_TSMDBMGR_$$ commmethod tcpip tcpserveraddr localhost tcpport 1500Where
nodenamespecifies the node name that the client API uses to connect to the server during a database backup. To ensure that the database can be backed up, this value must be$$_TSMDBMGR_$$.commmethodspecifies the communication method that the client API uses to contact the server.tcpserveraddrspecifies the server address that the client API uses to contact the server for database backup. To back up the database, the value must belocalhost.Important: If your server is using a CA-signed certificate, you must specify the server's external IP address for thetcpserveraddroption.tcpportspecifies the port number that the client API uses to contact the server for database backup. Enter the sametcpportvalue that is specified in thedsmserv.optserver options file.
Note:The steps use tsminst1 for the database instance name and c:\programdata\ibm\db2\db2tsm1 for the Db2 instance directory. Replace these values with your actual values.