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:
- 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.
- 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
-
- Backup servers configuration
-
db2support /tmp -d database-name -cl 0 ( Note: errors and warning could occur on operating system checks )
-
db2 connect to <db> db2 LIST PACKAGES FOR ALL SHOW DETAIL > /tmp/databasename_pckg.txt
-
db2audit describe > /tmp/audit_instance-name.cfg ( only if you enabled audit )
-
cp -R $INSTHOME/sqllib/function $INSTHOME/routine_backup
-
db2 GET DBM CFG > /tmp/dbm_instname.cfg
-
db2 CONNECT TO database_alias db2 GET DB CFG FOR database_alias SHOW DETAIL > /tmp/db_database_alias.cfg
-
db2look -d sample -e -o /tmp/sample_tbs.db2 -l -x
( optional )set |grep DB2 > /tmp/env_instname.txt
-
- Increasing table space and log file size before upgrade
-
db2 CONNECT TO databasename
-
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.
-
number_of_pages = ( used_pages - free_pages ) / number_of_containers_in_SYSCATSPACE
db2 "ALTER TABLESPACE SYSCATSPACE EXTEND (ALL number_of_pages)"
-
db2 GET DB CFG FOR databasename |grep '(LOG[FPS]'| tee logsize.txt
-
db2 UPDATE DB CFG FOR sample using LOGSECOND (current_value of LOGPRIMARY + current_value of LOGSECOND) * 2
- 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
-
- Changing raw devices to block devices ( Linux ) REQUIRED !!!!
-
raw -a ( as root, to determine the RAW devices )
If non, then jump to the next step 6.
- Perform an offline backup on all database
- Shut down databases.
db2 CONNECT TO databasename db2 QUIESCE DATABASE DEFER FORCE CONNECTIONS db2 DEACTIVATE DATABASE databasename
- Follow procedure: https://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.qb.upgrade.doc/doc/t0022273.html
-
db2 activate database databasename
-
db2 CONNECT TO sample db2 UNQUIESCE DATABASE
-
- Gathering pre-upgrade diagnostics
-
db2fodc -preupgrade -db databasename
Note: can take a while -
db2support -preupgrade -d databasename
-
- run the db2setup for upgrading DB2 10.1 to 10.5
Choose Install New for installing a new copy of DB2 10.5 - upgrade the instances from the new 10.5 location
-
-
db2 force application all
-
db2 terminate
-
db2stop
$DB2DIR/instance/db2iupgrade [ -u fencedID ] InstName
db2start
-
-
-
db2level (to check the correct and current level)
- Upgrade all databases
-
db2 list database directory
-
db2 UPGRADE DATABASE
databasename
-
Views: 347