DB2 Version 10.1 for Linux, UNIX, and Windows

Recovering data using db2adutl

You can perform cross-node recovery using the db2adutl command, logarchopt1 and vendoropt database configuration parameters. This recovery is demonstrated in examples from a few different Tivoli® Storage Manager (TSM) environments.

For the following examples, computer 1 is called bar and is running the AIX® operating system. The user on this machine is roecken. The database on bar is called zample. Computer 2 is called dps. This computer is also running the AIX operating system, and the user is regress9.

Example 1: TSM server manages passwords automatically (PASSWORDACCESS option set to GENERATE)

This cross-node recovery example shows how to set up two computers so that you can recover data from one computer to another when log archives and backups are stored on a TSM server and where passwords are managed using the PASSWORDACCESS=GENERATE option.

Note: After updating the database configuration, you might have to take an offline backup of the database.
  1. To enable the database for log archiving for the bar computer to the TSM server, update the database configuration parameter logarchmeth1 for the zample database using the following command:
       bar:/home/roecken> db2 update db cfg for zample using LOGARCHMETH1 tsm
    The following information is returned:
       DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
  2. Disconnect all users and applications from the database using the following command:
       db2 force applications all
  3. Verify that there are no applications connected to the database using the following command:
       db2 list applications
    You should receive a message that says that no data was returned.
    Note: In a partitioned database environment, you must perform this step on all database partitions.
  4. Create a backup of the database on the TSM server using the following command:
       db2 backup db zample use tsm
    Information similar to the following is returned:
       Backup successful. The timestamp for this backup imagge is : 20090216151025
    Note: In a partitioned database environment, you must perform this step on all database partitions. The order in which you perform this step on the database partitions differs depending on whether you are performing an online backup or an offline backup. For more information, see Backing up data.
  5. Connect to the zample database using the following command:
       db2 connect to zample
  6. Generate new transaction logs for the database by creating a table and loading data into the TSM server using the following command:
       bar:/home/roecken> db2 load from mr of del modified by noheader replace 
          into employee copy yes use tsm
    where in this example, the table is called employee, and the data is being loaded from a delimited ASCII file called mr. The COPY YES option is specified to make a copy of the data that is loaded, and the USE TSM option specifies that the copy of the data is stored on the TSM server.
    Note: You can specify the COPY YES option only if the database is enabled for roll-forward recovery; that is, the logarchmeth1 database configuration parameter must be set to USEREXIT, LOGRETAIN, DISK, or TSM.
    To indicate its progress, the load utility returns a series of messages:
       SQL3109N  The utility is beginning to load data from file "/home/roecken/mr".
    
       SQL3500W  The utility is beginning the "LOAD" phase at time "02/16/2009 
       15:12:13.392633".
    
       SQL3519W  Begin Load Consistency Point. Input record count = "0".
    
       SQL3520W  Load Consistency Point was successful.
    
       SQL3110N  The utility has completed processing.  "1" rows were read from the 
       input file.
    
       SQL3519W  Begin Load Consistency Point. Input record count = "1".
    
       SQL3520W  Load Consistency Point was successful.
    
       SQL3515W  The utility has finished the "LOAD" phase at time "02/16/2009 
       15:12:13.445718".
    
    
       Number of rows read         = 1
       Number of rows skipped      = 0
       Number of rows loaded       = 1
       Number of rows rejected     = 0
       Number of rows deleted      = 0
       Number of rows committed    = 1
  7. After the data has been loaded into the table, confirm that there is one backup image, one load copy image, and one log file on the TSM server by running the following query on the zample database:
      bar:/home/roecken/sqllib/adsm> db2adutl query db zample
    The following information is returned:
       Retrieving FULL DATABASE BACKUP information.
           1 Time: 20090216151025  Oldest log: S0000000.LOG  Log stream: 0    
           Sessions: 1  
    
       Retrieving INCREMENTAL DATABASE BACKUP information.
         No INCREMENTAL DATABASE BACKUP images found for ZAMPLE
    
       Retrieving DELTA DATABASE BACKUP information.
         No DELTA DATABASE BACKUP images found for ZAMPLE
    
       Retrieving TABLESPACE BACKUP information.
         No TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving INCREMENTAL TABLESPACE BACKUP information.
         No INCREMENTAL TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving DELTA TABLESPACE BACKUP information.
         No DELTA TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving LOAD COPY information.
           1 Time: 20090216151213
    
       Retrieving LOG ARCHIVE information.
          Log file: S0000000.LOG, Chain Num: 0, Log stream: 0, 
          Taken at: 2009-02-16-15.10.38
  8. To enable cross-node recovery, you must give access to the objects associated with the bar computer to another computer and account. In this example, give access to the computer dps and the user regress9 using the following command:
       bar:/home/roecken/sqllib/adsm> db2adutl grant user regress9 
          on nodename dps for db zample
    The following information is returned:
       Successfully added permissions for regress9 to access ZAMPLE on node dps.
    Note: You can confirm the results of the db2adutl grant operation by issuing the following command to retrieve the current access list for the current node:
       bar:/home/roecken/sqllib/adsm> db2adutl queryaccess
    The following information is returned:
       Node                 Username             Database Name   Type
       --------------------------------------------------------------
       DPS                  regress9             ZAMPLE          A
       --------------------------------------------------------------
        Access Types:  B - backup images   L - logs   A - both
  9. In this example, computer 2, dps, is not yet set up for cross-node recovery of the zample database. Verify that there is no data associated with this user and computer on the TSM server using the following command:
       dps:/home/regress9/sqllib/adsm> db2adutl query db zample      
    The following information is returned:
         --- Database directory is empty ---
       Warning: There are no file spaces created by DB2 on the ADSM server
       Warning: No DB2 backup images found in ADSM for any alias.
  10. Query the TSM server for a list of objects for the zample database associated with user roecken and computer bar using the following command:
      dps:/home/regress9/sqllib/adsm> db2adutl query db zample nodename 
           bar owner roecken
    The following information is returned:
       --- Database directory is empty ---
    
       Query for database ZAMPLE
    
       Retrieving FULL DATABASE BACKUP information.
           1 Time: 20090216151025  Oldest log: S0000000.LOG  Log stream: 0    
           Sessions: 1  
    
       Retrieving INCREMENTAL DATABASE BACKUP information.
         No INCREMENTAL DATABASE BACKUP images found for ZAMPLE
    
       Retrieving DELTA DATABASE BACKUP information.
         No DELTA DATABASE BACKUP images found for ZAMPLE
    
       Retrieving TABLESPACE BACKUP information.
         No TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving INCREMENTAL TABLESPACE BACKUP information.
         No INCREMENTAL TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving DELTA TABLESPACE BACKUP information.
         No DELTA TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving LOAD COPY information.
           1 Time: 20090216151213
    
       Retrieving LOG ARCHIVE information.
          Log file: S0000000.LOG, Chain Num: 0, Log stream: 0, 
          Taken at: 2009-02-16-15.10.38
    This information matches the TSM information that was generated previously and confirms that you can restore this image onto the dps computer.
  11. Restore the zample database from the TSM server to the dps computer using the following command:
       dps:/home/regress9> db2 restore db zample use tsm options 
       "'-fromnode=bar -fromowner=roecken'" without prompting
    The following information is returned:
       DB20000I  The RESTORE DATABASE command completed successfully.
    Note: If the zample database already existed on dps, the OPTIONS parameter would be omitted, and the database configuration parameter vendoropt would be used. This configuration parameter overrides the OPTIONS parameter for a backup or restore operation.
  12. Perform a roll-forward operation to apply the transactions recorded in the zample database log file when a new table was created and new data loaded. In this example, the following attempt for the roll-forward operation will fail because the roll-forward utility cannot find the log files because the user and computer information is not specified:
       dps:/home/regress9> db2 rollforward db zample to end of logs and stop
    The command returns the following error:
       SQL4970N  Roll-forward recovery on database "ZAMPLE" cannot reach the 
       specified stop point (end-of-log or point-in-time) because of missing log 
       file(s) on node(s) "0".
    Force the roll-forward utility to look for log files associated with another computer using the proper logarchopt value. In this example, use the following command to set the logarchopt1 database configuration parameter and search for log files associated with user roecken and computer bar:
       dps:/home/regress9> db2 update db cfg for zample using logarchopt1 
       "'-fromnode=bar -fromowner=roecken'"
  13. Enable the roll-forward utility to use the backup and load copy images by setting the vendoropt database configuration parameter using the following command:
       dps:/home/regress9> db2 update db cfg for zample using VENDOROPT 
       "'-fromnode=bar -fromowner=roecken'"
  14. You can finish the cross-node data recovery by applying the transactions recorded in the zample database log file using the following command:
       dps:/home/regress9> db2 rollforward db zample to end of logs and stop
    The following information is returned:
                                        Rollforward Status
    
     Input database alias                   = zample
     Number of members have returned status = 1
    
    
     Member number  Rollforward  Next log to  Log files processed        Last committed transaction
                    status       be read                                 
     -------------  -----------  -----------  -------------------------  ------------------------------
             0      not pending               S0000000.LOG-S0000000.LOG  2009-05-06-15.28.11.000000 UTC
    
    
    DB20000I  The ROLLFORWARD command completed successfully.
    The database zample on computer dps under user regress9 has been recovered to the same point as the database on computerbar under user roecken.

Example 2: Passwords are user-managed (PASSWORDACCESS option set to PROMPT)

This cross-node recovery example shows how to set up two computers so that you can recover data from one computer to another when log archives and backups are stored on a TSM server and where passwords are managed by the users. In these environments, extra information is required, specifically the TSM nodename and password of the computer where the objects were created.

  1. Update the client dsm.sys file by adding the following line because computer bar is the name of the source computer
    NODENAME bar
    Note: On Windows operating systems, this file is called the dsm.opt file. When you update this file, you must reboot your system for the changes to take effect.
  2. Query the TSM server for the list of objects associated with user roecken and computer bar using the following command:
       dps:/home/regress9/sqllib/adsm> db2adutl query db zample nodename bar 
       owner roecken password *******
    The following information is returned:
       Query for database ZAMPLE
    
       Retrieving FULL DATABASE BACKUP information.
           1 Time: 20090216151025  Oldest log: S0000000.LOG  Log stream: 0    
           Sessions: 1  
    
       Retrieving INCREMENTAL DATABASE BACKUP information.
         No INCREMENTAL DATABASE BACKUP images found for ZAMPLE
    
       Retrieving DELTA DATABASE BACKUP information.
         No DELTA DATABASE BACKUP images found for ZAMPLE
    
       Retrieving TABLESPACE BACKUP information.
         No TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving INCREMENTAL TABLESPACE BACKUP information.
         No INCREMENTAL TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving DELTA TABLESPACE BACKUP information.
         No DELTA TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving LOAD COPY information.
           1 Time: 20090216151213
    
       Retrieving LOG ARCHIVE information.
          Log file: S0000000.LOG, Chain Num: 0, Log stream: 0, 
          Taken at: 2009-02-16-15.10.38
  3. If the zample database does not exist on computer dps, perform the following steps:
    1. Create an empty zample database using the following command:
         dps:/home/regress9> db2 create db zample
    2. Update the database configuration parameter tsm_nodename using the following command:
         dps:/home/regress9> db2 update db cfg for zample using tsm_nodename bar
    3. Update the database configuration parameter tsm_password using the following command:
         dps:/home/regress9> db2 update db cfg for zample using 
         tsm_password ********
  4. Attempt to restore the zample database using the following command:
       dps:/home/regress9> db2 restore db zample use tsm options 
       "'-fromnode=bar -fromowner=roecken'" without prompting
    The restore operation completes successfully, but a warning is issued:
       SQL2540W  Restore is successful, however a warning "2523" was 
       encountered during Database Restore while processing in No 
       Interrupt mode.
  5. Perform a roll-forward operation using the following command:
       dps:/home/regress9> db2 rollforward db zample to end of logs and stop  
    In this example, because the restore operation replaced the database configuration file, the roll-forward utility cannot find the correct log files and the following error message is returned:
       SQL1268N  Roll-forward recovery stopped due to error "-2112880618" 
       while retrieving log file "S0000000.LOG" for database "ZAMPLE" on node "0".
    Reset the following TSM database configuration values to the correct values:
    1. Set the tsm_nodename configuration parameter using the following command:
         dps:/home/regress9> db2 update db cfg for zample using tsm_nodename bar
    2. Set the tsm_password database configuration parameter using the following command:
         dps:/home/regress9> db2 update db cfg for zample using tsm_password *******
    3. Set the logarchopt1 database configuration parameter so that the roll-forward utility can find the correct log files using the following command:
         dps:/home/regress9> db2 update db cfg for zample using logarchopt1 
         "'-fromnode=bar -fromowner=roecken'"
    4. Set the vendoropt database configuration parameter so that the load recovery file can also be used during the roll-forward operation using the following command:
         dps:/home/regress9> db2 update db cfg for zample using VENDOROPT  
         "'-fromnode=bar -fromowner=roecken'"
  6. You can finish the cross-node recovery by performing the roll-forward operation using the following command:
       dps:/home/regress9> db2 rollforward db zample to end of logs and stop
    The following information is returned:
                                        Rollforward Status
    
     Input database alias                   = zample
     Number of members have returned status = 1
    
    
     Member number  Rollforward  Next log to  Log files processed        Last committed transaction
                    status       be read                                 
     -------------  -----------  -----------  -------------------------  ------------------------------
             0      not pending               S0000000.LOG-S0000000.LOG  2009-05-06-15.28.11.000000 UTC
    
    
    DB20000I  The ROLLFORWARD command completed successfully.
The database zample on computer dps under user regress9 has been recovered to the same point as the database on computerbar under user roecken

Example 3: TSM server is configured to use client proxy nodes

This cross-node recovery example shows how to set up two computers as proxy nodes so that you can recover data from one computer to another when log archives and backups are stored on a TSM server and where passwords are managed using the PASSWORDACCESS=GENERATE option.

Note: After updating the database configuration, you might have to take an offline backup of the database.

In this example, the computers bar and dps are registered under the proxy name of clusternode. The computers are already setup as proxy nodes.

  1. Register the computers bar and dps on the TSM server as proxy nodes using the following commands:
    REGISTER NODE clusternode mypassword
    GRANT PROXYNODE TARGET=clusternode AGENT=bar,dps 
  2. To enable the database for log archiving to the TSM server, update the database configuration parameter logarchmeth1 for the zample database using the following command:
       bar:/home/roecken> db2 update db cfg for zample using 
          LOGARCHMETH1 tsm logarchopt1 "'-asnodename=clusternode'"
    The following information is returned:
       DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
  3. Disconnect all users and applications from the database using the following command:
       db2 force applications all
  4. Verify that there are no applications connected to the database using the following command:
       db2 list applications
    You should receive a message that says that no data was returned.
    Note: In a partitioned database environment, you must perform this step on all database partitions.
  5. Create a backup of the database on the TSM server using the following command:
       db2 backup db zample use tsm options "'-asnodename=clusternode'"
    Information similar to the following is returned:
       Backup successful. The timestamp for this backup image is : 20090216151025
    Instead of specifying the -asnodename option on the BACKUP DATABASE command, you can update the vendoropt database configuration parameter instead.
    Note: In a partitioned database environment, you must perform this step on all database partitions. The order in which you perform this step on the database partitions differs depending on whether you are performing an online backup or an offline backup. For more information, see Backing up data.
  6. Connect to the zample database using the following command:
       db2 connect to zample
  7. Generate new transaction logs for the database by creating a table and loading data into the TSM server using the following command:
    bar:/home/roecken> db2 load from mr of del modified by noheader 
    	replace into employee copy yes use tsmwhere
    where in this example, the table is called employee, and the data is being loaded from a delimited ASCII file called mr. The COPY YES option is specified to make a copy of the data that is loaded, and the USE TSM option specifies that the copy of the data is stored on the TSM server.
    Note: You can specify the COPY YES option only if the database is enabled for roll-forward recovery; that is, the logarchmeth1 database configuration parameter must be set to USEREXIT, LOGRETAIN, DISK, or TSM.
    To indicate its progress, the load utility returns a series of messages:
       SQL3109N  The utility is beginning to load data from file "/home/roecken/mr".
    
       SQL3500W  The utility is beginning the "LOAD" phase at time "02/16/2009 
       15:12:13.392633".
    
       SQL3519W  Begin Load Consistency Point. Input record count = "0".
    
       SQL3520W  Load Consistency Point was successful.
    
       SQL3110N  The utility has completed processing.  "1" rows were read from the 
       input file.
    
       SQL3519W  Begin Load Consistency Point. Input record count = "1".
    
       SQL3520W  Load Consistency Point was successful.
    
       SQL3515W  The utility has finished the "LOAD" phase at time "02/16/2009 
       15:12:13.445718".
    
    
       Number of rows read         = 1
       Number of rows skipped      = 0
       Number of rows loaded       = 1
       Number of rows rejected     = 0
       Number of rows deleted      = 0
       Number of rows committed    = 1
  8. After the data has been loaded into the table, confirm that there is one backup image, one load copy image, and one log file on the TSM server by running the following query on the zample database:
       bar:/home/roecken/sqllib/adsm> db2adutl query db zample 
          options "-asnodename=clusternode"
    The following information is returned:
       Retrieving FULL DATABASE BACKUP information.
           1 Time: 20090216151025  Oldest log: S0000000.LOG  Log stream: 0    
           Sessions: 1  
    
       Retrieving INCREMENTAL DATABASE BACKUP information.
         No INCREMENTAL DATABASE BACKUP images found for ZAMPLE
    
       Retrieving DELTA DATABASE BACKUP information.
         No DELTA DATABASE BACKUP images found for ZAMPLE
    
       Retrieving TABLESPACE BACKUP information.
         No TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving INCREMENTAL TABLESPACE BACKUP information.
         No INCREMENTAL TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving DELTA TABLESPACE BACKUP information.
         No DELTA TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving LOAD COPY information.
           1 Time: 20090216151213
    
       Retrieving LOG ARCHIVE information.
          Log file: S0000000.LOG, Chain Num: 0, Log stream: 0, 
          Taken at: 2009-02-16-15.10.38
  9. In this example, computer 2, dps, is not yet set up for cross-node recovery of the zample database. Verify that there is no data associated with this user and computer using the following command:
       dps:/home/regress9/sqllib/adsm> db2adutl query db zample      
    The following information is returned:
         --- Database directory is empty ---
       Warning: There are no file spaces created by DB2 on the ADSM server
       Warning: No DB2 backup images found in ADSM for any alias.
  10. Query the TSM server for a list of objects for the zample database associated with the proxy node clusternode using the following command:
      dps:/home/regress9/sqllib/adsm> db2adutl query db zample 
         options="-asnodename=clusternode"    
    The following information is returned:
       --- Database directory is empty ---
    
       Query for database ZAMPLE
    
       Retrieving FULL DATABASE BACKUP information.
           1 Time: 20090216151025  Oldest log: S0000000.LOG  Log stream: 0    
           Sessions: 1  
    
       Retrieving INCREMENTAL DATABASE BACKUP information.
         No INCREMENTAL DATABASE BACKUP images found for ZAMPLE
    
       Retrieving DELTA DATABASE BACKUP information.
         No DELTA DATABASE BACKUP images found for ZAMPLE
    
       Retrieving TABLESPACE BACKUP information.
         No TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving INCREMENTAL TABLESPACE BACKUP information.
         No INCREMENTAL TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving DELTA TABLESPACE BACKUP information.
         No DELTA TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving LOAD COPY information.
           1 Time: 20090216151213
    
       Retrieving LOG ARCHIVE information.
          Log file: S0000000.LOG, Chain Num: 0, Log stream: 0, 
          Taken at: 2009-02-16-15.10.38
    This information matches the TSM information that was generated previously and confirms that you can restore this image onto the dps computer.
  11. Restore the zample database from the TSM server to the dps computer using the following command:
       dps:/home/regress9> db2 restore db zample use tsm options 
          "'-asnodename=clusternode'" without prompting
    The following information is returned:
       DB20000I  The RESTORE DATABASE command completed successfully.
    Note: If the zample database already existed on dps, the OPTIONS parameter would be omitted, and the database configuration parameter vendoropt would be used. This configuration parameter overrides the OPTIONS parameter for a backup or restore operation.
  12. Perform a roll-forward operation to apply the transactions recorded in the zample database log file when a new table was created and new data loaded. In this example, the following attempt for the roll-forward operation will fail because the roll-forward utility cannot find the log files because the user and computer information is not specified:
       dps:/home/regress9> db2 rollforward db zample to end of logs and stop
    The command returns the following error:
       SQL4970N  Roll-forward recovery on database "ZAMPLE" cannot reach the 
       specified stop point (end-of-log or point-in-time) because of missing log 
       file(s) on node(s) "0".
    Force the roll-forward utility to look for log files on another computer using the proper logarchopt value. In this example, use the following command to set the logarchopt1 database configuration parameter and search for log files associated with user roecken and computer bar:
       dps:/home/regress9> db2 update db cfg for zample using logarchopt1 
          "'-asnodename=clusternode'"
  13. Enable the roll-forward utility to use the backup and load copy images by setting the vendoropt database configuration parameter using the following command:
       dps:/home/regress9> db2 update db cfg for zample using VENDOROPT 
          "'-asnodename=clusternode'"
  14. You can finish the cross-node data recovery by applying the transactions recorded in the zample database log file using the following command:
       dps:/home/regress9> db2 rollforward db zample to end of logs and stop
    The following information is returned:
                                        Rollforward Status
    
     Input database alias                   = zample
     Number of members have returned status = 1
    
    
     Member number  Rollforward  Next log to  Log files processed        Last committed transaction
                    status       be read                                 
     -------------  -----------  -----------  -------------------------  ------------------------------
             0      not pending               S0000000.LOG-S0000000.LOG  2009-05-06-15.28.11.000000 UTC
    
    
    DB20000I  The ROLLFORWARD command completed successfully.
    The database zample on computer dps under user regress9 has been recovered to the same point as the database on computer bar under user roecken.

Example 4: TSM server is configured to use client proxy nodes in a DB2 pureScale environment

This example shows how to set up two members as proxy nodes so that you can recover data from one member to the other when log archives and backups are stored on a TSM server and where passwords are managed using the PASSWORDACCESS=GENERATE option.

Note: After updating the database configuration, you might have to take an offline backup of the database.

In this example, the members member1 and member2 are registered under the proxy name of clusternode. In DB2® pureScale® environments, you can perform backup or data recovery operations from any member. In this example, data will be recovered from member2

  1. Register the members member1 and member2 on the TSM server as proxy nodes using the following commands:
    REGISTER NODE clusternode mypassword
    GRANT PROXYNODE TARGET=clusternode AGENT=member1,member2 
  2. To enable the database for log archiving to the TSM server, update the database configuration parameter logarchmeth1 for the zample database using the following command:
       member1:/home/roecken> db2 update db cfg for zample using 
          LOGARCHMETH1 tsm logarchopt1 "'-asnodename=clusternode'"
    Note: In DB2 pureScale environments, you can set the global logarchmeth1 database configuration parameters once from any member.
    The following information is returned:
       DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
  3. Disconnect all users and applications from the database using the following command:
       db2 force applications all
  4. Verify that there are no applications connected to the database using the following command:
       db2 list applications global
    You should receive a message that says that no data was returned.
  5. Create a backup of the database on the TSM server using the following command:
       db2 backup db zample use tsm options '-asnodename=clusternode'
    Information similar to the following is returned:
       Backup successful. The timestamp for this backup image is : 20090216151025
    Instead of specifying the -asnodename option on the BACKUP DATABASE command, you can update the vendoropt database configuration parameter instead.
    Note: In DB2 pureScale environments, you can run this command from any member to back up all data for the database.
  6. Connect to the zample database using the following command:
       db2 connect to zample
  7. Generate new transaction logs for the database by creating a table and loading data into the TSM server using the following command:
    member1:/home/roecken> db2 load from mr of del modified by noheader replace
          into employee copy yes use tsmwhere
    where in this example, the table is called employee, and the data is being loaded from a delimited ASCII file called mr. The COPY YES option is specified to make a copy of the data that is loaded, and the USE TSM option specifies that the copy of the data is stored on the TSM server.
    Note: You can specify the COPY YES option only if the database is enabled for roll-forward recovery; that is, the logarchmeth1 database configuration parameter must be set to USEREXIT, LOGRETAIN, DISK, or TSM.
    To indicate its progress, the load utility returns a series of messages:
       SQL3109N  The utility is beginning to load data from file "/home/roecken/mr".
    
       SQL3500W  The utility is beginning the "LOAD" phase at time "02/16/2009 
       15:12:13.392633".
    
       SQL3519W  Begin Load Consistency Point. Input record count = "0".
    
       SQL3520W  Load Consistency Point was successful.
    
       SQL3110N  The utility has completed processing.  "1" rows were read from the 
       input file.
    
       SQL3519W  Begin Load Consistency Point. Input record count = "1".
    
       SQL3520W  Load Consistency Point was successful.
    
       SQL3515W  The utility has finished the "LOAD" phase at time "02/16/2009 
       15:12:13.445718".
    
    
       Number of rows read         = 1
       Number of rows skipped      = 0
       Number of rows loaded       = 1
       Number of rows rejected     = 0
       Number of rows deleted      = 0
       Number of rows committed    = 1
  8. After the data has been loaded into the table, confirm that there is one backup image, one load copy image, and one log file on the TSM server by running the following query on the zample database:
       member1:/home/roecken/sqllib/adsm> db2adutl query db zample 
          options "-asnodename=clusternode"
    The following information is returned:
       Retrieving FULL DATABASE BACKUP information.
           1 Time: 20090216151025  Oldest log: S0000000.LOG  Log stream: 0    
           Sessions: 1  
    
       Retrieving INCREMENTAL DATABASE BACKUP information.
         No INCREMENTAL DATABASE BACKUP images found for ZAMPLE
    
       Retrieving DELTA DATABASE BACKUP information.
         No DELTA DATABASE BACKUP images found for ZAMPLE
    
       Retrieving TABLESPACE BACKUP information.
         No TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving INCREMENTAL TABLESPACE BACKUP information.
         No INCREMENTAL TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving DELTA TABLESPACE BACKUP information.
         No DELTA TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving LOAD COPY information.
           1 Time: 20090216151213
    
    Retrieving LOG ARCHIVE information.
    
       Log file: S0000000.LOG, Chain Num: 1, Log stream: 1, Taken at: 2009-02-16-13.01.10
    
       Log file: S0000000.LOG, Chain Num: 1, Log stream: 0, Taken at: 2009-02-16-13.01.11
    
       Log file: S0000000.LOG, Chain Num: 1, Log stream: 2, Taken at: 2009-02-16-13.01.19
    
       Log file: S0000001.LOG, Chain Num: 1, Log stream: 0, Taken at: 2009-02-16-13.02.49
    
       Log file: S0000001.LOG, Chain Num: 1, Log stream: 1, Taken at: 2009-02-16-13.02.49
    
       Log file: S0000001.LOG, Chain Num: 1, Log stream: 2, Taken at: 2009-02-16-13.02.49
    
       Log file: S0000002.LOG, Chain Num: 1, Log stream: 1, Taken at: 2009-02-16-13.03.15
    
       Log file: S0000002.LOG, Chain Num: 1, Log stream: 2, Taken at: 2009-02-16-13.03.15
    
       Log file: S0000002.LOG, Chain Num: 1, Log stream: 0, Taken at: 2009-02-16-13.03.16
  9. Query the TSM server for a list of objects for the zample database associated with the proxy node clusternode using the following command:
      member2:/home/regress9/sqllib/adsm> db2adutl query db zample 
         options="-asnodename=clusternode"    
    The following information is returned:
       --- Database directory is empty ---
    
       Query for database ZAMPLE
    
       Retrieving FULL DATABASE BACKUP information.
           1 Time: 20090216151025  Oldest log: S0000000.LOG  Log stream: 0    
           Sessions: 1  
    
       Retrieving INCREMENTAL DATABASE BACKUP information.
         No INCREMENTAL DATABASE BACKUP images found for ZAMPLE
    
       Retrieving DELTA DATABASE BACKUP information.
         No DELTA DATABASE BACKUP images found for ZAMPLE
    
       Retrieving TABLESPACE BACKUP information.
         No TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving INCREMENTAL TABLESPACE BACKUP information.
         No INCREMENTAL TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving DELTA TABLESPACE BACKUP information.
         No DELTA TABLESPACE BACKUP images found for ZAMPLE
    
       Retrieving LOAD COPY information.
           1 Time: 20090216151213
    
    Retrieving LOG ARCHIVE information.
    
       Log file: S0000000.LOG, Chain Num: 1, Log stream: 1, Taken at: 2009-02-16-13.01.10
    
       Log file: S0000000.LOG, Chain Num: 1, Log stream: 0, Taken at: 2009-02-16-13.01.11
    
       Log file: S0000000.LOG, Chain Num: 1, Log stream: 2, Taken at: 2009-02-16-13.01.19
    
       Log file: S0000001.LOG, Chain Num: 1, Log stream: 0, Taken at: 2009-02-16-13.02.49
    
       Log file: S0000001.LOG, Chain Num: 1, Log stream: 1, Taken at: 2009-02-16-13.02.49
    
       Log file: S0000001.LOG, Chain Num: 1, Log stream: 2, Taken at: 2009-02-16-13.02.49
    
       Log file: S0000002.LOG, Chain Num: 1, Log stream: 1, Taken at: 2009-02-16-13.03.15
    
       Log file: S0000002.LOG, Chain Num: 1, Log stream: 2, Taken at: 2009-02-16-13.03.15
    
       Log file: S0000002.LOG, Chain Num: 1, Log stream: 0, Taken at: 2009-02-16-13.03.16
    This information matches the TSM information that was generated previously and confirms that you can restore this image onto the member2 member.
  10. Restore the zample database on the TSM server from the member2 member using the following command:
       member2:/home/regress9> db2 restore db zample use tsm options 
          '-asnodename=clusternode' without prompting
    The following information is returned:
       DB20000I  The RESTORE DATABASE command completed successfully.
    Note: If the zample database already existed on member2, the OPTIONS parameter would be omitted, and the database configuration parameter vendoropt would be used. This configuration parameter overrides the OPTIONS parameter for a backup or restore operation.
  11. Enable the roll-forward utility to use the backup and load copy images by setting the vendoropt database configuration parameter using the following command:
       member2:/home/regress9> db2 update db cfg for zample using VENDOROPT 
          "'-asnodename=clusternode'"
    Note: In DB2 pureScale environments, you can set the global vendoropt database configuration parameters once from any member.
  12. You can finish the cross-member data recovery by applying the transactions recorded in the zample database log file using the following command:
       member2:/home/regress9> db2 rollforward db zample to end of logs and stop
    The following information is returned:
                                        Rollforward Status
    
     Input database alias                   = zample
     Number of members have returned status = 3
    
    
     Member number  Rollforward  Next log to  Log files processed        Last committed transaction
                    status       be read                                 
     -------------  -----------  -----------  -------------------------  ------------------------------
                 0  not pending               S0000001.LOG-S0000012.LOG  2009-05-06-15.28.11.000000 UTC
                 1  not pending               S0000001.LOG-S0000012.LOG  2009-05-06-15.28.11.000000 UTC
                 2  not pending               S0000001.LOG-S0000012.LOG  2009-05-06-15.28.11.000000 UTC
    
    DB20000I  The ROLLFORWARD command completed successfully.
    The database zample on member member2 under user regress9 has been recovered to the same point as the database on member member1 under user roecken.