查看: 3784|回复: 8

[Tips] Migrating DB2 databases to DB2 UDB Version 9.1

[复制链接]
论坛徽章:
1
2010新春纪念徽章
日期:2010-01-04 08:33:08
跳转到指定楼层
1#
发表于 2008-10-10 11:26 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
===================================================================================
xcoolwinds@gmail.com      2007.08.25 实战过程  随后即将推出 Migrating DB2 databases to DB2 UDB Version 9.5

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.

mkdir /db2bckup/<TempDirecty>

cd /db2bckup/<TempDirecty>
db2support . -d <DBNAME> -cl 0

db2 LIST PACKAGES FOR ALL SHOW DETAIL > /db2bckup/<TempDirecty>/<DBNAME>_pckg.txt

db2 GET DBM CFG > /db2bckup/<TempDirecty>/dbm_<DBNAME>.cfg

db2 GET DB CFG FOR <DBNAME> > /db2bckup/<TempDirecty>/db_<DBNAME>.cfg

db2look -d <DBNAME> -e -o /db2bckup/<TempDirecty>/db2look.out -l -x -f

db2set -all > /db2bckup/<TempDirecty>/db2set.out

set |grep DB2 > /db2bckup/<TempDirecty>/set.out

db2 "select * from syscat.bufferpools" > /db2bckup/<TempDirecty>/bufferpools.out

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)

3) Take offline backup

db2 force application all

db2 list applications for db <DBNAME>| grep <DBNAME> | wc -l

db2 deactivate db <DBNAME>

db2 backup db <DBNAME> to /db2bckup/<TempDirecty>


4) Migrate DB2 Server

-- Install DB2 9.1 on the server


5) Migrate DB2 instance

-- db2licd -end

-- db2 force application all

-- db2stop

-- ipclean -a

-- Logon as root

-- /opt/IBM/db2/V9.1_FP2/bin/db2ckmig <DBNAME> -l db2ckmig.log

        Need to see the message below:
        db2ckmig was successful. Database(s) can be migrated.

-- /opt/IBM/db2/V9.1_FP2/instance/db2imigr -u db2inst1 password

-- db2start

-- db2level


6) 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_FP2_FP2/das/bin/db2admin stop

-- Login as root

-- /opt/IBM/db2/V9.1_FP2/instance/dasmigr

-- /opt/IBM/db2/V9.1_FP2/das/bin/db2admin start

-- /opt/IBM/db2/V9.1_FP2/das/bin/db2daslevel

-- db2 get admin cfg


7) Migrate DB2 database

-- nohup db2 MIGRATE DATABASE <DBNAME> > /db2bckup/<TempDirecty>/migratedb.out &

-- db2 connect to <DBNAME>

8) Post-migration tasks

db2 activate database <DBNAME>

db2 UPDATE DBM CONFIGURATION USING diaglevel 3

db2 LIST PACKAGES FOR ALL SHOW DETAIL > /db2bckup/<TempDirecty>/<DBNAME>_pckg_new.txt
diff /db2bckup/<TempDirecty>/<DBNAME>_pckg.txt  /db2bckup/<TempDirecty>/<DBNAME>_pckg_new.txt

-- 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 <DBNAME> -o revoke.db2

-- db2 connect to <DBNAME>
-- db2rbind <DBNAME> -l /db2bckup/<TempDirecty>/rbind.out all

Procedure:

To rebind packages in migrated databases:

1. Log on as the instance owner.
2. Rebind all invalid packages in each database by running the db2rbind command:
db2rbind database–name -l logfile all -u userid -p password
The all clause rebinds valid and invalid packages.
3. Test your applications
Verify that your DB2 server migration was successful. Test your applications
and tools to ensure the server is working as expected.

-- Recreate views dropped in step 1 using the saved DDL.


9) Changes in DB2 registry variables, configuration parameters, and database physical design characteristics:

These are the changes the DBM needs to make to enable all the automatic DB2 memory settings once the database has been migrated to v9:

Update DB cfg:
self_tuning_mem on
database_memory automatic
avg_appls automatic
locklist automatic
maxlocks automatic
num_iocleaners automatic
num_ioservers automatic
pckcachesz automatic
sheapthres_shr automatic
app_ctl_heap_sz 512
IE:
  db2 update db cfg for <DBNAME> using self_tuning_mem on database_memory automatic avg_appls automatic locklist automatic maxlocks automatic num_iocleaners automatic num_ioservers automatic pckcachesz automatic sheapthres_shr automatic app_ctl_heap_sz 512

Update DMB cfg
sheapthres 0
java_heap_sz 2048
IE:
  db2 update dbm cfg using sheapthres 0 java_heap_sz 2048

Enable automatic storage on the bufferpools:
db2 alter bufferpool ibmdefaultbp size automatic
db2 alter bufferpool bp_sys size automatic
db2 alter bufferpool bp_snap size automatic
db2 alter bufferpool bp_32k size automatic
论坛徽章:
42
ITPUB元老
日期:2005-09-09 13:45:35马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:14优秀写手
日期:2013-12-18 09:29:09ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:32版主3段
日期:2012-05-15 15:24:112012新春纪念徽章
日期:2012-02-13 15:13:362012新春纪念徽章
日期:2012-02-13 15:13:36
2#
发表于 2008-10-30 15:50 | 只看该作者
不错,设为 Tip

使用道具 举报

回复
论坛徽章:
0
3#
发表于 2008-10-30 17:10 | 只看该作者
migrate的大致时间 以及 migrate之后的参数变更是否可以补充下?

使用道具 举报

回复
论坛徽章:
1
2010新春纪念徽章
日期:2010-01-04 08:33:08
4#
 楼主| 发表于 2008-10-31 08:31 | 只看该作者
回复楼上兄弟,migrate 的大致时间常规是根据你的系统环境决定的,一般情况10-20分钟可以搞定. 另外你说的参数变更是指migrate 之前和之后的 DB/DBM CFG 的变更? 这个我当时做过比较,变化不是很大,可惜结果没有保留. 主要针对V9版本新特性需要调整的地方 就在 第 9) Changes in DB2 registry variables, configuration parameters, and database physical design characteristics.

使用道具 举报

回复
论坛徽章:
42
ITPUB元老
日期:2005-09-09 13:45:35马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:14优秀写手
日期:2013-12-18 09:29:09ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:32版主3段
日期:2012-05-15 15:24:112012新春纪念徽章
日期:2012-02-13 15:13:362012新春纪念徽章
日期:2012-02-13 15:13:36
5#
发表于 2008-10-31 09:52 | 只看该作者
呵,Migrating DB2 databases to DB2 UDB Version 9.5 的做好了没?

使用道具 举报

回复
论坛徽章:
42
ITPUB元老
日期:2005-09-09 13:45:35马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:14优秀写手
日期:2013-12-18 09:29:09ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:32版主3段
日期:2012-05-15 15:24:112012新春纪念徽章
日期:2012-02-13 15:13:362012新春纪念徽章
日期:2012-02-13 15:13:36
6#
发表于 2008-10-31 09:57 | 只看该作者
我记得在做 v8 的 migration 是需要 bind   db2ubind.lst 和 db2cli.lst 的

使用道具 举报

回复
论坛徽章:
71
马上加薪
日期:2014-02-19 11:55:14ITPUB十周年纪念徽章
日期:2011-11-01 16:19:412010广州亚运会纪念徽章:橄榄球
日期:2011-05-22 10:54:33管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:502011新春纪念徽章
日期:2011-01-25 15:41:012010年世界杯参赛球队:丹麦
日期:2010-04-06 10:23:36
7#
发表于 2008-10-31 13:44 | 只看该作者
最近做了几个db2 migrate到9.5的项目。不用bind   db2ubind.lst 和 db2cli.lst

使用道具 举报

回复
求职 : 数据库管理员
论坛徽章:
186
授权会员
日期:2008-07-27 22:25:202014年新春福章
日期:2014-02-18 16:42:02马上有房
日期:2014-02-18 16:42:02马上有车
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有对象
日期:2014-02-19 11:55:14马上加薪
日期:2014-02-19 11:55:14版主4段
日期:2015-02-26 02:21:03慢羊羊
日期:2015-03-04 14:51:35
8#
发表于 2008-10-31 17:10 | 只看该作者
不错,支持~

使用道具 举报

回复
论坛徽章:
1
2010新春纪念徽章
日期:2010-01-04 08:33:08
9#
 楼主| 发表于 2008-11-3 09:39 | 只看该作者
回 macrozeng 版主,Migrating DB2 databases to DB2 UDB Version 9.5 的还没有机会实施,不过在 IBM developerworks 论坛倒是看过一篇,为了方便查找我就新开个帖子啊^_^

Look here http://www.itpub.net/thread-1080391-1-1.html

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表