How to migrate DB2 to Version 9
The main steps for the migration v8 to DB2 v9. It is really an usefull and complete guide. I really encourage anyone that will perform or be involved in a DB2 Migration to v9 to read this document. Please note that the instance name I was using is instvlsi and the database name is VLSI. Also, this is a EEE (partitioned) database, that's why some commands have db2_all before them. So you would need to adapt the commands according to your environment.
1)
Pre-Migration Tasks
Ensure
that you backup any configuration that could get lost during the
migration and that are not included in a database backup.
--
db2support /home/instvlsi/migration/db2support -d vlsi -cl 0
-- db2
LIST PACKAGES FOR ALL SHOW DETAIL >
/home/instvlsi/migration/vlsi_pckg.txt
--
db2_all "db2 GET DBM CFG" >
/home/instvlsi/migration/dbm_instvlsi.cfg
--
db2_all "db2 GET DB CFG FOR VLSI" >
/home/instvlsi/migration/db_vlsi.cfg
--
db2look -d vlsi -e -o /home/instvlsi/migration/db2look.out -l -x -f
--
db2_all "db2set -all" >
/home/instvlsi/migration/db2set.out
--
db2_all "set |grep DB2" >
/home/instvlsi/migration/set.out
--
db2 "select * from syscat.bufferpools" >
/home/instvlsi/migration/bufferpools.out
--
db2_all "db2 UPDATE DBM CFG USING diaglevel 4"
--
Extract the DDL and drop any views that may face problems during the
migration (usually the ones that reference the catalog tables)
2)
Take offline backup
3)
Migrate DB2 Server
--
Install DB2 9.1 on the server
4)
Migrate DB2 instance
--
db2licd -end
--
db2_all "db2 force application all"
--
db2stop
--
ipclean -a
--
Logon as root
--
/opt/IBM/db2/V9.1/bin/db2ckmig vlsi -l db2ckmig.log
Need to see the message below:
db2ckmig was successful. Database(s) can be
migrated.
--
/opt/IBM/db2/V9.1/instance/db2imigr -u vlsifenc instvlsi
--
db2start
--
db2level
5)
Migrate DB2 DAS
Create
a new DB2 Administration Server (DAS) on each database partition
server.
If
you need to keep your existing DAS settings, you can migrate the DAS
on each participating
database
partition server instead of creating a new DAS.
--
/opt/IBM/db2/V9.1/das/bin/db2admin stop
--
Login as root
--
/opt/IBM/db2/V9.1/instance/dasmigr
--
/opt/IBM/db2/V9.1/das/bin/db2admin start
--
/opt/IBM/db2/V9.1/das/bin/db2daslevel
--
db2 get admin cfg
6)
Migrate DB2 database
--
nohup db2 MIGRATE DATABASE vlsi >
/home/instvlsi/migration/migratedb.out &
--
db2 connect to vlsi
7)
Post-migration tasks
Compare
the old configuration you saved in step 1 with the current
configuration and decide if you need to change any of them.
--
db2_all "db2 activate database vlsi"
--
db2_all "db2 UPDATE DBM CONFIGURATION USING diaglevel 3"
-- db2
LIST PACKAGES FOR ALL SHOW DETAIL >
/home/instvlsi/migration/vlsi_pckg_new.txt
--
diff /home/instvlsi/migration/vlsi_pckg_new.txt
/home/instvlsi/migration/vlsi_pckg.txt
--
db2_all "db2 GET DBM CFG" >
/home/instvlsi/migration/dbm_instvlsi_new.cfg
--
diff /home/instvlsi/migration/dbm_instvlsi_new.cfg
/home/instvlsi/migration/dbm_instvlsi.cfg
--
db2_all "db2 GET DB CFG FOR VLSI" >
/home/instvlsi/migration/db_vlsi_new.cfg
--
diff /home/instvlsi/migration/db_vlsi_new.cfg
/home/instvlsi/migration/db_vlsi.cfg
--
db2_all "db2set -all" >
/home/instvlsi/migration/db2set_new.out
--
diff /home/instvlsi/migration/db2set_new.out
/home/instvlsi/migration/db2set.out
--
db2_all "set |grep DB2" >
/home/instvlsi/migration/set_new.out
--
diff /home/instvlsi/migration/set_new.out
/home/instvlsi/migration/set.out
--
Verify table spaces information and utilization
--
Take a new database backup copy.
--
Revoke EXECUTE privilege on PUBLIC for migrated routines ? If you ran
the db2undgp command after
you migrated to DB2 UDB Version 8, you do not
have to run this command again after your database
is migrated to DB2 Version 9:
db2undgp -d sample -o revoke.db2
--
db2rbind vlsi -l /home/instvlsi/migration/rbind.out all -u instvlsi
--
Recreate views dropped in step 1 using the saved DDL.
8)
Changes in DB2 registry variables, configuration parameters, and
database physical design characteristics:
There
are several new functionalities in v9, so you will probably need to
look at each of them and decide together with
the
application team which of them should be applied to your database, as
self tunning memory, compressed tables and so on.
9)
User test
---------------------------------------------------------------------------------------------------------------
Backout
- Reversing DB2 server migration
Drop
DB2 v9 database
Drop
DB2 v9 instance
Create
DB2 v8 instance
Restore
the dbm cfg parameter values
Re-create
database running RESTORE DATABASE command