TSLM データベースのインプレース・マイグレーションの手順

以下の手順は、TSLM データベースを DB2® V9.7 から DB2 V10.5 にマイグレーションするために必要な手順を説明しています。

手順

  1. マウントされているすべてのボリュームをアンマウントします。

    すべてのマウント・タスクが完了してから、現行の TSLM サーバーを停止します。

  2. TSLM サーバーを停止します。

    以下のコマンドを使用して、現行の TSLM サーバーで稼働しているライブラリー・マネージャーおよびメディア・マネージャーを停止します。

    
         [ermm@eidai ~]$ ermmLmStop
         [ermm@eidai ~]$ ermmStop
  3. TSLM データベースを DB2 V9.7 としてバックアップします。

    現行の TSLM サーバー上の TSLM データベースをバックアップします。

    1. バックアップ・イメージ用のディレクトリーを準備します。次の例では、 ディレクトリーのオーナー/グループは db2inst1/db2grp1 です。
      
      [root@oldtslm opt]# ls -l
      total 12
      drwxr-xr-x. 2 db2inst1 db2grp1 4096 May 27 13:32 bkup
    2. 以下の例のように、オフライン・バックアップを開始します。
      
      [root@eidai opt]# su - db2inst1
      [db2inst1@eidai ~]$ db2 deactivate db ermm
      [db2inst1@eidai ~]$ db2 backup database ermm to /opt/bkup
      Backup successful. The timestamp for this backup image is : 20170327192419
      
  4. DB2 V10.5 および TSLM をインストールします。
    次の例では、構成ファイルとして「tslm_db2wse2.rsp」が使用されます。「tslm_db2wse2.rsp」と 「tslm_db2wse.rsp」の間の違いは例に示されています。必要に応じて、 インスタンス名およびディレクトリーを変更できます。
    注:
    1. tslm_db2wse2.rsp」および「tslm_db2wse.rsp」は tslm/doc ディレクトリーにあります。
    2. tslm_db2wse2.rsp」と「tslm_db2wse.rsp」の両方とも、 DB2 V10.5 用です。
         
         [root@eidai doc]# diff tslm_db2wse2.rsp tslm_db2wse.rsp
         270c270
         < DB2_INST.NAME             = db2inst2        ** char(8)  no spaces, no upper case letters
         > DB2_INST.NAME             = db2inst1        ** char(8)  no spaces, no upper case letters
         275,276c275,276
         < DB2_INST.GROUP_NAME       = db2grp2        ** char(30) no spaces
         > DB2_INST.GROUP_NAME       = db2grp1        ** char(30) no spaces
         281c281
         < DB2_INST.HOME_DIRECTORY   = /home/db2inst2
         > DB2_INST.HOME_DIRECTORY   = /home/db2inst1
         299,300c299,300
         < DB2_INST.SVCENAME        = db2cdb2inst2
         > DB2_INST.SVCENAME        = db2cdb2inst1
         302c302
         < DB2_INST.PORT_NUMBER     = 50006
         > DB2_INST.PORT_NUMBER     = 50003
         407c407
         < DB2_INST.FENCED_USERNAME  = db2fenc2        ** char(8)  no spaces, no upper case letters
         > DB2_INST.FENCED_USERNAME  = db2fenc1        ** char(8)  no spaces, no upper case letters
         412c412
         < DB2_INST.FENCED_GROUP_NAME = db2fsdm2       ** char(30)  no spaces
         > DB2_INST.FENCED_GROUP_NAME = db2fsdm1       ** char(30)  no spaces
         418c418
         < DB2_INST.FENCED_HOME_DIRECTORY = /home/db2fenc2
         > DB2_INST.FENCED_HOME_DIRECTORY = /home/db2fenc1
    
         [root@eidai server_r]# ./db2setup -r tslm_db2wse2.rsp -i db2_install.log
         ...
         The execution completed successfully.
         
         For more information see the DB2 installation log at "/tmp/db2setup.log".
         [root@eidai server_r]#
    
  5. TSLM データベースのリストア・スクリプトを生成します。
    1. データベースのリストア時のエラー発生に備えて、DB2 のエラー・ログ・レベルをレベル 4 にアップグレードします。
      
      [root@eidai db2inst1]# su - db2inst2
      
      [db2inst2@eidai ~]$ db2 get dbm cfg | grep LEVEL 
      Diagnostic error capture level              (DIAGLEVEL) = 3 
      Notify Level                              (NOTIFYLEVEL) = 3 
      
      [db2inst2@eidai ~]$ db2 update dbm cfg using diaglevel 4
      DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed successfully.
      
      [db2inst2@eidai ~]$ db2 update dbm cfg using notifylevel 4
      DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed successfully.
      
      [db2inst2@eidai ~]$ db2 get dbm cfg | grep LEVEL
      Diagnostic error capture level              (DIAGLEVEL) = 4
      Notify Level                              (NOTIFYLEVEL) = 4
      
    2. 3 で作成されたバックアップ・イメージのオーナーを db2inst2/db2grp2 に変更します。
      
      [root@eidai opt]# chown -R db2inst2.db2grp2 bkup
      [root@eidai opt]# ls -l bkup/
      total 141432
      -rw-------. 1 db2inst2 db2grp2 144822272 Mar 27 19:24 
      ERMM.0.db2inst1.NODE0000.CATN0000.20170327192419.001
      
    3. DB2 の restore コマンドを実行して、TSLM データベースのリストア・スクリプトを生成します。以下の例では、tslmdb10.sh という名前のリストア・スクリプトを生成します。
      
      [root@eidai ~]# su - db2inst2
      [db2inst2@eidai ~]$ db2 restore db ermm from /opt/bkup taken at 20170327234831 
           redirect generate script tslmdb10.sh
      DB20000I  The RESTORE DATABASE command completed successfully.
      
      [db2inst2@eidai ~]$ ls -l
      total 20
      drwxrwxr-x.  2 db2inst2 db2grp2 4096 Mar 27 23:07 db2inst2
      drwxrwsr-t. 24 db2inst2 db2grp2 4096 Mar 27 23:07 sqllib
      -rw-r--r--.  1 db2inst2 db2grp2 8370 Mar 27 23:07 tslmdb10.sh
      
    4. 新規インスタンス名のスクリプトを変更します。
      
      [db2inst2@eidai ~]$ cp tslmdb10.sh tslmdb10a.sh
      
      Edit tslmdb10a.sh to change the instance name from 'db2inst1' to 'db2inst2' as below. 
      
      [db2inst2@eidai ~]$ diff tslmdb10a.sh tslmdb10.sh
      15c15  ** Remove the double dash "--"  ("--" means commented out)
      < ON '/home/db2inst2'
      > -- ON '/home/db2inst1'
      18c18
      < -- NEWLOGPATH '/home/db2inst2/db2inst2/NODE0000/SQL00001/SQLOGDIR/'
      ---
      > -- NEWLOGPATH '/home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/'
      39c39
      < -- ON '/home/db2inst2'
      ---
      > -- ON '/home/db2inst1'
      99c99
      <   PATH   '/home/db2inst2/ermmtmpspace'
      >   PATH   '/home/db2inst1/ermmtmpspace'
      114c114
      <   PATH   '/home/db2inst2/ermminsttmpspace'
      >   PATH   '/home/db2inst1/ermminsttmpspace'
           
      [db2inst2@eidai ~]$ ls -l
      total 36
      drwxrwxr-x.  2 db2inst2 db2grp2 4096 Mar 27 23:18 db2inst2
      drwxrwsr-t. 24 db2inst2 db2grp2 4096 Mar 27 23:07 sqllib
      -rw-r--r--.  1 db2inst2 db2grp2 8370 Mar 27 23:26 tslmdb10a.sh
      -rw-r--r--.  1 db2inst2 db2grp2 8370 Mar 27 23:18 tslmdb10.sh
      
  6. リストア・スクリプトを実行して、TSLM データベースをリストアします。
    
         [root@eidai ~]# su - db2inst2
         [db2inst2@eidai ~]$ db2 -tvf tslmdb10a.sh
         UPDATE COMMAND OPTIONS USING S ON Z ON ERMM_NODE0000.out V ON
         DB20000I  The UPDATE COMMAND OPTIONS command completed successfully.
         
         SET CLIENT ATTACH_MEMBER  0
         DB20000I  The SET CLIENT command completed successfully.
         
         SET CLIENT CONNECT_MEMBER 0
         DB20000I  The SET CLIENT command completed successfully.
         
         RESTORE DATABASE ERMM FROM '/opt/bkup' TAKEN AT 20170328011226 ON '/home/db2inst2' 
    INTO ERMM REDIRECT WITHOUT ROLLING FORWARD
         SQL1277W  A redirected restore operation is being performed. During a table
         space restore, only table spaces being restored can have their paths
         reconfigured. During a database restore, storage group storage paths and DMS
         table space containers can be reconfigured.
         DB20000I  The RESTORE DATABASE command completed successfully.
         
         SET TABLESPACE CONTAINERS FOR 3 USING ( PATH   '/home/db2inst2/ermmtmpspace' )
         DB20000I  The SET TABLESPACE CONTAINERS command completed successfully.
         
         SET TABLESPACE CONTAINERS FOR 4 USING ( PATH   '/home/db2inst2/ermminsttmpspace' )
         DB20000I  The SET TABLESPACE CONTAINERS command completed successfully.
         
         RESTORE DATABASE ERMM CONTINUE
         SQL2555I  The database was restored and then successfully upgraded to the
         current DB2 release where you issued the RESTORE DATABASE command.
         
         Check the existence of TSLM database:
         
         [db2inst2@eidai ~]$ db2 connect to ermm
         
            Database Connection Information
         
          Database server        = DB2/LINUXX8664 10.5.3
          SQL authorization ID   = DB2INST2
          Local database alias   = ERMM
         
         Set back the original diag level (level 3):
         
         [db2inst2@eidai ~]$ db2 update dbm cfg using diaglevel 3
         DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed
         successfully.
         [db2inst2@eidai ~]$ db2 update dbm cfg using notifylevel 3
         DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed
         successfully.
         [db2inst2@eidai ~]$ db2 get dbm cfg | grep LEVEL
          Diagnostic error capture level              (DIAGLEVEL) = 3
          Notify Level                              (NOTIFYLEVEL) = 3
    
  7. TSLM の現行バージョンをアンインストールします。
    注: 次の RHEL の例を参照してください。この場合は依然として 1.1.1.X です。
    
         [root@eidai scripts]# cd /<TSLM extract path>/tslm/scripts
    
         [root@eidai scripts]# ./uninstall_xlinux.sh
         IBM Tape System Library Manager
         Licensed Materials - Property of IBM
         (C) Copyright IBM Corp. 2004, 2017 All Rights Reserved
         
         RHEL(x86_64) 6.8 detected
         compatible mode:uninstall_xlinux.sh
         ###############################################################################
         Start of TSLM installation process on Tue Mar 28 02:22:27 JST 2017
         ###############################################################################
         
         Uninstall Tape System Library Manager and drop database ermm.
         Usage: uninstall_xlinux.sh [-p] [-d] [-b] [-h]
         Options:
           -p    Uninstall TSLM packages only.
           -d    Drop database ermm only.
           -b    Uninstall TSLM packages and drop database ermm.
           -h    Display this help and exit.
      
         Caution! DO NOT SPECIFY '-d' or '-b' (Drop database) options.
         [root@eidai scripts]# ./uninstall_xlinux.sh -p
         IBM Tape System Library Manager
         Licensed Materials - Property of IBM
         (C) Copyright IBM Corp. 2004, 2017 All Rights Reserved
         
         RHEL(x86_64) 6.8 detected
         compatible mode:uninstall_xlinux.sh
         ###############################################################################
         Start of TSLM installation process on Tue Mar 28 02:48:02 JST 2017
         ###############################################################################
         
         ###############################################################################
         Checking prerequisite
         ###############################################################################
         Checking OS Version...
         RHEL(x86_64) 6.8
         Accepted
         
         ###############################################################################
         TSLM Uninstallation Menu
         ###############################################################################
         TSLM System
         TSLM Media Manager
         TSLM Library Manager
         TSLM Library Balancer
         TSLM External Library Manager
         TSLM Host Drive Manager
         TSLM CLI
         TSLM 3494 Emulator
         TSLM Password Creation Tool (pwgen)
         Would do you like to continue? (y/n)
         y
         ###############################################################################
         TSLM Uninstallation Menu
         ###############################################################################
         Uninstalling TSLM Library Balancer Package
         package tslm-libbal is not installed
         Uninstalling TSLM External Library Manager Package
         tslm-elm-1.2.0-0.x86_64
         Attempting to remove tslm-elm
         Removal of tslm-elm was successful.
         
         Uninstalling TSLM Host Drive Manager Package
         tslm-hdm-1.2.0-0.x86_64
         Attempting to remove tslm-hdm
         Removal of tslm-hdm was successful.
         
         Uninstalling TSLM CLI Package
         tslm-cli-1.2.0-0.x86_64
         Attempting to remove tslm-cli
         Removal of tslm-cli was successful.
         
         Uninstalling TSLM 3494 Emulator Package
         tslm-3494-1.2.0-0.x86_64
         Attempting to remove tslm-3494
         Removal of tslm-3494 was successful.
         
         Uninstalling TSLM Password Creation Tool (pwgen) Package
         tslm-pwgen-1.2.0-0.x86_64
         Attempting to remove tslm-pwgen
         Removal of tslm-pwgen was successful.
         
         Uninstalling TSLM Library Manager Package
         tslm-lm-1.2.0-0.x86_64
         Attempting to remove tslm-lm
         Removal of tslm-lm was successful.
         
         Uninstalling TSLM Media Manager Package
         tslm-mm-1.2.0-0.x86_64
         Attempting to remove tslm-mm
         Removal of tslm-mm was successful.
         
         Uninstalling TSLM System Package
         tslm-system-1.2.0-0.x86_64
         Attempting to remove tslm-system
         Removal of tslm-system was successful.
         
         [root@eidai scripts]#
    
  8. 「ermm」ユーザーを削除します。
    1. DB2 インスタンスを停止します。
      
      [root@eidai ~]$ su - db2inst1        
      ##Specify the user, in this case "db2inst1", from the older instance.
      [db2inst1@eidai ~]$ db2 terminate
      DB20000I  The TERMINATE command completed successfully.
      [db2inst1@eidai ~]$ db2stop
      SQL1064N  DB2STOP processing was successful.
    2. 「ermm」ユーザー (root ユーザーとして) を削除します。
      [root@eidai scripts]# userdel -r ermm
    3. 「ermm」ユーザーによって作成されたログおよび PID ファイルを削除します。削除操作は root ユーザーで実行する必要があります。
      
      [root@eidai ~]$ rm -f /opt/IBM/ermm/log/*
      [root@eidai ~]$ rm -rf /opt/IBM/ermm/run
      
  9. TSLM の新しいバージョンをインストールします。
    
         [root@eidai scripts]# ./install_xlinux.sh
         IBM Tape System Library Manager
         Licensed Materials - Property of IBM
         (C) Copyright IBM Corp. 2004, 2017 All Rights Reserved
         
         RHEL(x86_64) 6.8 detected
         compatible mode:install_xlinux.sh
         ###############################################################################
         Start of TSLM installation process on Tue Mar 28 02:50:12 JST 2017
         ###############################################################################
         
         Install Tape System Library Manager and create database ermm.
         Usage: install_xlinux.sh [-c] [-s] [-b] [-e] [-h]
         Options:
           -c    Install client packages of TSLM.
           -s    Install server packages of TSLM.
           -b    Install both, client and server packages of TSLM.
           -e    Install  package. Must be specified with -c/-s/-b.
           -h    Display this help and exit.
           
         [root@eidai scripts]# ./install_xlinux.sh -b
         IBM Tape System Library Manager
         Licensed Materials - Property of IBM
         (C) Copyright IBM Corp. 2004, 2017 All Rights Reserved
         
         RHEL(x86_64) 6.8 detected
         compatible mode:install_xlinux.sh
         ###############################################################################
         Start of TSLM installation process on Tue Mar 28 02:50:41 JST 2017
         ###############################################################################
         
         ###############################################################################
         Checking prerequisite
         ###############################################################################
         Checking OS Version...
         RHEL(x86_64) 6.8
         Accepted
         
         Checking Perl...
         Perl version 5.10.1 detected on this system.
         Accepted
         
         Checking lin_tape driver...
         driver version 3.0.18 detected on this system.
         Accepted
         
         
         Checking packages for Media Manager...
         audit-libs-2.4.5-6.el6.i686
         libstdc++-4.4.7-17.el6.i686
         cracklib-2.8.16-4.el6.i686
         libselinux-2.0.94-7.el6.i686
         pam-1.1.1-22.el6.i686
         ksh-20120801-33.el6.x86_64
         db4-4.7.25-22.el6.i686
         
         Checking packages for Library Manager...
         sg3_utils-1.28-12.el6.x86_64
         sg3_utils-libs-1.28-12.el6.x86_64
         
         Checking packages for Host Drive Manager...
         sg3_utils-1.28-12.el6.x86_64
         sg3_utils-libs-1.28-12.el6.x86_64
         perl-Locale-Maketext-Simple-0.18-141.el6_7.1.x86_64
         
         Checking packages for CLI...
         perl-Locale-Maketext-Simple-0.18-141.el6_7.1.x86_64
         Checking DB2 Instance...  
         Please enter DB2 instance user name [db2inst1]:db2inst2
         DB2 instance user name is "db2inst2". OK? ('yes' or 'no') y
         Please enter DB2 instance group name [db2grp1]:db2grp2
         DB2 instance group name is "db2grp2". OK? ('yes' or 'no') y
         Please enter DB2 instance directory [/home/db2inst2]:
         DB2 instance directory is "/home/db2inst2". OK? ('yes' or 'no') y
         Accepted
         
         DB2 10.5 is detected
         Accepted
         
         Creating /etc/tslm.cfg...
         Reading /etc/tslm.cfg...
         ###############################################################################
         TSLM Installation Menu
         ###############################################################################
         TSLM System
         TSLM Media Manager
         TSLM Library Manager
         TSLM External Library Manager
         TSLM Host Drive Manager
         TSLM CLI
         TSLM Password Creation Tool (pwgen)
         Would do you like to continue? (y/n)
         y
         ###############################################################################
         Checking previous installations...
         ###############################################################################
         ###############################################################################
         Start installing TSLM packages..
         ###############################################################################
         Installing TSLM System Package
         Attempting to install tslm-system-1.2.0-1.x86_64.rpm
         Installation of system was successful.
         
         Installing TSLM Media Manager Package
         Attempting to install tslm-mm-1.2.0-1.x86_64.rpm
         Installation of mm was successful.
         
         Installing TSLM Library Manager Package
         Attempting to install tslm-lm-1.2.0-1.x86_64.rpm
         Installation of lm was successful.
         
         Installing TSLM External Library Manager Package
         Attempting to install tslm-elm-1.2.0-1.x86_64.rpm
         Installation of elm was successful.
         
         Installing TSLM Host Drive Manager Package
         Attempting to install tslm-hdm-1.2.0-1.x86_64.rpm
         Installation of hdm was successful.
         
         Installing TSLM CLI Package
         Attempting to install tslm-cli-1.2.0-1.x86_64.rpm
         Installation of cli was successful.
         
         Installing TSLM Password Creation Tool (pwgen) Package
         Attempting to install tslm-pwgen-1.2.0-1.x86_64.rpm
         Installation of pwgen was successful.
         
         Creating database ermm...
         IBM Tape System Library Manager
         Licensed Materials - Property of IBM
         (C) Copyright IBM Corp. 2004, 2017 All Rights Reserved
         
         Prepare log archive for db2 instance at /home/db2inst2/sqllib/adm
         IBM Tape System Library Manager
         Licensed Materials - Property of IBM
         (C) Copyright IBM Corp. 2004, 2017 All Rights Reserved
         
         Starting database instance ...
         Creating database ermm. This may take a while ...
         SQL1005N  The database alias "ermm" already exists in either the local
         database directory or system database directory.
         Cannot create database ermm.
         Would you like to recreate database ermm? (y/n)
         n
         Done!
         
         Preparing config file...
         Config file of "mm.xml" already exists in /opt/IBM/ermm/conf/.
         Would you like to use the current config file? (y/n)
         y
         Done!
         
         Preparing config file...
         Config file of "genhdm.cfg" already exists in /opt/IBM/ermm/conf/.
         Would you like to use the current config file? (y/n)
         y
         Done!
         
         Preparing config file...
         Config file of "elm.cfg" already exists in /opt/IBM/ermm/client/tsm/.
         Would you like to use the current config file? (y/n)
         y
         Done!
    
  10. TSLM サーバーを開始します。
    
         [root@eidai ~]# su - ermm
         [ermm@eidai ~]$ ermmStart
         IBM Tape System Library Manager
         Licensed Materials - Property of IBM
         (C) Copyright IBM Corp. 2004, 2013 All Rights Reserved
         
         Spawning IBM Tape System Library Manager daemon
         Using log file: /opt/IBM/ermm/log/ermmstart.log. Please check this file in case of problems.
         
         [ermm@eidai ~]$ ermmLmStart
         IBM Tape System Library Manager
         Licensed Materials - Property of IBM
         (C) Copyright IBM Corp. 2004, 2013 All Rights Reserved
         
         no core dump file to process
         2017/03/28 - 22:05:36 : starting.
         Starting background daemon.
         no core dump file to process
         2017/03/28 - 22:05:36 : starting.
         Starting background daemon.
    
  11. ホスト・ドライブ・マネージャー (HDM) を再始動します。
    
         [root@eidai ~]# /opt/IBM/ermm/bin/ermmHDMRestart
         IBM Tape System Library Manager
         Licensed Materials - Property of IBM
         (C) Copyright IBM Corp. 2004, 2013 All Rights Reserved
         
         Stopping ermmGenHDM...
         Stopped.
         ermmGenHDM will restart automatically.
    
  12. TSLM クライアントを新しい TSLM サーバーに接続します。
    
         [ermm@eidai ~]$ ermmtool
         IBM Tape System Library Manager
         Licensed Materials - Property of IBM
         (C) Copyright IBM Corp. 2004, 2013 All Rights Reserved
             host: localhost
             port: 6740
           client: ERMMSystem
         instance: ERMMAdmin
         ermmtool> lslib
         Name   Online Disabled LM       StateSoft StateHard
         ===================================================
         3592-3 false  false    lm3592-3 ready     unknown
         LTO    false  false    lmLTO    ready     unknown
         ermmtool>
    
    詳しくは、『DB2 メンテナンス』を参照してください。