Using the following procedure at IBM: https://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.qb.upgrade.doc/doc/c0011933.html

Globally: you install a new copy of DB2 10.5 and perform a instance upgrade.

Procedure:

  1. Check if the databases are ready to be upgraded. Use this command from the 10.5 installer:  ./db2ckupgrade <db>l -u <user> -p <password> -l /tmp/output.log
    All responses should be:

    db2ckupgrade was successful.  Database(s) can be upgraded.
  2. Backup all databases manually
    • db2 LIST DATABASE DIRECTORY    ( list of databases )  
    • db2 LIST APPLICATIONS     ( list of database connections )
    • db2 FORCE APPLICATION ALL    ( disconnect all connections )
    • db2 BACKUP DATABASE database_alias USER username USING password TO backup-dir
    • Controle van de backup:
      cd backup-dir   
         db2ckbkp SAMPLE.0.arada.NODE0000.CATN0000.20091014114322.001
  3. Backup servers configuration
    1. db2support /tmp -d database-name -cl 0    ( Note: errors and warning could occur on operating system checks )
    2. db2 connect to <db>
      db2 LIST PACKAGES FOR ALL SHOW DETAIL > /tmp/databasename_pckg.txt
    3. db2audit describe > /tmp/audit_instance-name.cfg ( only if you enabled audit )
    4. cp -R $INSTHOME/sqllib/function $INSTHOME/routine_backup
    5. db2 GET DBM CFG > /tmp/dbm_instname.cfg
    6. db2 CONNECT TO database_alias
      db2 GET DB CFG FOR database_alias SHOW DETAIL > /tmp/db_database_alias.cfg
    7. db2look -d sample -e -o /tmp/sample_tbs.db2 -l -x ( optional )
      set |grep DB2 > /tmp/env_instname.txt
  4. Increasing table space and log file size before upgrade
    1. db2 CONNECT TO databasename
    2. db2 "SELECT SUBSTR(TBSP_NAME,1,15) NAME, TBSP_TYPE TYPE,
           TBSP_AUTO_RESIZE_ENABLED AUTO_RESIZE, TBSP_NUM_CONTAINERS CONTAINERS, 
           TBSP_TOTAL_PAGES TOTAL_PGS, TBSP_USED_PAGES USED_PGS, TBSP_FREE_PAGES FREE_PGS,
           TBSP_MAX_SIZE MAX_SZ, TBSP_PAGE_SIZE PG_SZ
           FROM SYSIBMADM.TBSP_UTILIZATION
           WHERE TBSP_CONTENT_TYPE IN ('ANY','SYSTEMP')"
      
      
      NAME            TYPE AUTO_RESIZE CONTAINERS TOTAL_PGS USED_PGS FREE_PGS MAX_SZ PG_SZ
      --------------- ---- ----------- ---------- --------- -------- -------- ------ -----
      SYSCATSPACE     DMS             1         1      8192     7576       612     -1  8192
      TEMPSPACE1      SMS             -         1        10       10         0      -  8192
      
        2 record(s) selected.
      
      This for determine table space disk usage.
      
      
    3. number_of_pages = ( used_pages - free_pages ) /
                             number_of_containers_in_SYSCATSPACE
      
      db2 "ALTER TABLESPACE SYSCATSPACE EXTEND (ALL number_of_pages)"
    4. db2 GET DB CFG FOR databasename |grep '(LOG[FPS]'| tee logsize.txt
    5. db2 UPDATE DB CFG FOR sample using LOGSECOND (current_value of LOGPRIMARY + current_value of LOGSECOND) * 2
    6. Optional…set archving and infinite logging.
      db2 UPDATE DB CFG FOR sample using LOGARCHMETH1 DISK:archive-dir 
      db2 UPDATE DB CFG FOR sample using LOGSECOND -1
  5. Changing raw devices to block devices ( Linux )   REQUIRED !!!!
    1. raw -a      ( as root, to determine the RAW devices )

      If non, then jump to the next step 6.

    2. Perform an offline backup on all database
    3. Shut down databases.
      db2 CONNECT TO databasename
      db2 QUIESCE DATABASE DEFER FORCE CONNECTIONS
      db2 DEACTIVATE DATABASE databasename
    4. Follow procedure: https://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.qb.upgrade.doc/doc/t0022273.html
    5. db2 activate database databasename
    6. db2 CONNECT TO sample
         db2 UNQUIESCE DATABASE 
  6. Gathering pre-upgrade diagnostics
    1. db2fodc -preupgrade -db databasename    Note: can take a while
    2. db2support -preupgrade -d databasename
  7. run the db2setup for upgrading DB2 10.1 to 10.5
    Choose Install New for installing a new copy of DB2 10.5
  8. upgrade the instances from the new 10.5 location
      1. db2 force application all
      2. db2 terminate
      3. db2stop
      4. $DB2DIR/instance/db2iupgrade [ -u fencedID ] InstName
      5. db2start
  9. db2level     (to check the correct and current level)
  10. Upgrade all databases
    1. db2 list database directory
    2. db2 UPGRADE DATABASE databasename

Visits: 350

By angioni

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.