When calling the BACKUP and RESTORE commands, you can specify that you want to use the ADSTAR Distributed Storage Manager (ADSM) product to manage the database or table space backup. You can use ADSM Version 2.x and later with DB2. The following topics provide additional information:
Before the database manager can use the ADSM option, the following set-up activities must be performed:
libApiDS.so -> libApiDS.so.1 libApiDS.so.1 -> /opt/IBMDSMap5/api/libApiDS.so.2
Note: | For the SunOS and Solaris environments, this should be set to /opt/IBMDSMap5. |
Note: | For the SunOS and Solaris environments, this should be set to /opt/IBMDSMap5/dsm.opt. |
For an ADSM client to be able to interface with an ADSM server, it must have a password for the server. The executable file dsmapipw is installed in the INSTHOME/sqllib/adsm directory of the instance owner. This executable allows you to establish and reset the ADSM password.
To execute the dsmapipw command, you must be logged in as the "root" user. When this command is executed, you will be prompted for the following information:
Note: | The user executing the BACKUP or RESTORE commands does not need to know this password. The only times you need to run this command are to establish a password for the initial connection and if the password has been reset on the ADSM server. |
Before the database manager can use the ADSM option, the following set-up activities must be performed:
For an ADSM client to be able to interface with an ADSM server, it must have a password for the server. The executable file dsmapipw is installed in the \sqllib\adsm directory of the instance owner. This executable allows you to establish and reset the ADSM password.
To execute the dsmapipw command, you must be logged in as the local administrator. When this command is executed, you will be prompted for the following information:
Note: | The user executing the BACKUP or RESTORE commands does not need to know this password. The only times you need to run this command are to establish a password for the initial connection and if the password has been reset on the ADSM server. |
To use specific features within ADSM, you may be required to give the fully-qualified path name of the object using the feature. (Remember that on Intel platforms the \ will be used instead of /.) The fully-qualified path name of:
where <database> is the database alias name, and NODEnnnn is the node number.
Note: | The names shown in upper case must be entered as shown. |
The recommended value for this parameter is 6 000 seconds.
The db2adutl utility allows you to query, extract, and delete backups, logs, and load copy images saved using ADSM. The utility is installed in the INSTHOME/sqllib/misc directory on UNIX platforms and in the \sqllib\misc directory on Intel platforms.
All of the options available through the db2adutl utility are shown:
Figure 35. Syntax for db2adutl
Where:
You can choose which database you wish to work with when you use each command through the use of the DATABASE parameter. For the EXTRACT and DELETE commands, you can request not to see the prompts to confirm your choices through use of the WITHOUT PROMPTING parameter.
The QUERY command of this utility allows you to list backups. logs, and load copy images. The backups can be full database, table spaces, or both. When using this command, the default is to list both types of backups, any load copy images, and any logs. You can select a range of logs to be listed instead of seeing all of the logs. You can also request to see the inactive backups.
The EXTRACT command of this utility allows you to copy from ADSM to your current directory backups, logs, or both at the ADSM server. The backups can be full database, table spaces, or both. When using this command, the default without qualifiers is to list the active backups and each log. You can then select which backups and/or logs to extract. You can also select a range of logs to be listed instead of seeing all of the logs. You can also request to see the inactive backups. A specific backup for extraction can be selected by using the TAKEN AT <timestamp> parameter.
The DELETE command of this utility allows you to delete logs or deactivate backups from ADSM. When using this command, the default without qualifiers is to list the active backups and each log. You can then select which backups and/or logs to delete/deactivate. You can qualify the command with KEEP n to keep the most recent n backups. You can also qualify the command with OLDER [THAN] <timestamp> or n DAYS. This will delete backups older than the given date (timestamp) or older than the days specified. You can also select a range of logs to be listed instead of seeing all of the logs. A specific backup for deletion can be selected by using the TAKEN AT <timestamp> parameter.
For DB2, we recommend that the ADSM default policy be used. With the changes to the backup naming conventions, each backup is now unique. In order to delete old backups, the policy must be set up so that no active copies are kept.
For examples of using this utility, see "Examples of Using db2adutl".
db2 backup database rawsampl use adsm Backup successful. The timestamp for this backup is : 19970929130942
db2adutl query Query for database RAWSAMPL Retrieving full database backup information. full database backup image: 1, Time: 19970929130942, Oldest log: S0000053.LOG, Sessions used: 1 full database backup image: 2, Time: 19970929142241, Oldest log: S0000054.LOG, Sessions used: 1 Retrieving tablespace backup information. tablespace backup image: 1, Time: 19970929094003, Oldest log: S0000051.LOG, Sessions used: 1 tablespace backup image: 2, Time: 19970929093043, Oldest log: S0000050.LOG, Sessions used: 1 tablespace backup image: 3, Time: 19970929105905, Oldest log: S0000052.LOG, Sessions used: 1 Retrieving log archive information. Log file: S0000050.LOG Log file: S0000051.LOG Log file: S0000052.LOG Log file: S0000053.LOG Log file: S0000054.LOG Log file: S0000055.LOG
db2adutl delete full taken at 19950929130942 db rawsampl Query for database RAWSAMPL Retrieving full database backup information. Please wait. full database backup image: RAWSAMPL.0.db26000.0.19970929130942.001 Do you want to deactivate this backup image (Y/N)? y Are you sure (Y/N)? y
db2adutl query Query for database RAWSAMPL Retrieving full database backup information. full database backup image: 2, Time: 19950929142241, Oldest log: S0000054.LOG, Sessions used: 1 Retrieving tablespace backup information. tablespace backup image: 1, Time: 19950929094003, Oldest log: S0000051.LOG, Sessions used: 1 tablespace backup image: 2, Time: 19950929093043, Oldest log: S0000050.LOG, Sessions used: 1 tablespace backup image: 3, Time: 19950929105905, Oldest log: S0000052.LOG, Sessions used: 1 Retrieving log archive information. Log file: S0000050.LOG Log file: S0000051.LOG Log file: S0000052.LOG Log file: S0000053.LOG Log file: S0000054.LOG Log file: S0000055.LOG