DB2异库(异机)重定向恢复步骤
创建实例
# cd /opt/IBM/db2/v9.7/instance
# ./db2icrt -p 50004 -u db2inst4 db2inst4
建库
$ db2 create db payment on /home/db2inst4 using codeset GBK territory CN
检查备份文件
$ db2ckbkp -h PAYMENT.0.db2inst2.NODE0000.CATN0000.20130913013001.001
Backup Mode -- 1 #表示是在线备份文件
Includes Logs -- 1 #表示备份文件中包含恢复所需要的归档日志<喎?http://www.2cto.com/kf/ware/vc/" target="_blank" class="keylink">vcD4KPGgzPsn6s8nHqNLGvcWxvjwvaDM+CjxwPiQgZGIyICZxdW90O3Jlc3RvcmUgZGIgcGF5bWVudCBmcm9tIC4gdGFrZW4gYXQgIDIwMTMwOTEzMDEzMDAxIG9uIC9ob21lL2RiMmluc3Q0IGludG8gcGF5bWVudCBsb2d0YXJnZXQgL2hvbWUvZGIyaW5zdDQgcmVkaXJlY3QgZ2VuZXJhdGUgc2NyaXB0IHBheTIuY2xwJnF1b3Q7PC9wPgo8cD4gICAgICAgIC0tLS2hsWxvZ3RhcmdldCAvaG9tZS9kYjJpbnN0NCChsdfWts6jrLHtyr7WuLaoyfqzydDCv+Jyb2xsZm9yd2FyZMv50Oi1xMjV1r7Ct762PC9wPgo8cD4gPGltZyBzcmM9"http://www.2cto.com/uploadfile/Collfiles/20131224/2013122410080743.jpg" alt="\">
修改脚本
$ vi pay.clp ----编辑
根据实际情况修改下面内容(新数据库的存储路径):
下面参数中的数值和上面“生成迁移脚本”语句中的参数值意义对应
修改容器路径(表空间)
根据pay.clp中修改的实际情况,创建对应的表空间:
创建表空间
$ db2 "SELECT BPNAME,NPAGES,PAGESIZE FROM SYSCAT.BUFFERPOOLS" ----查看缓冲池
$ cat pool.sql ----写一个脚本,创建表空间
#!/bin/sh
db2 connect to payment
db2 create bufferpool PAYM_SYS_POOL_4K size 25000 pagesize 4k
db2 create bufferpool PAYM_SYS_POOL_8K size 25000 pagesize 8k
db2 create bufferpool PAYM_SYS_POOL_32K size 25000 pagesize 32k
db2 "create tablespace EPS_SPACE_8K PAGESIZE 8K MANAGED BY DATABASE USING (file "/home/db2inst4/db2inst4/tablespaces/EPS_SPACE_8K' 100M) AUTORESIZE YES BUFFERPOOL PAYM_SYS_POOL_8K"
db2 "create user temporary tablespace EPS_SPACE_32K PAGESIZE 32K MANAGED BY SYSTEM USING ('/home/db2inst4/db2inst4/tablespaces/EPS_SPACE_32K' ) BUFFERPOOL PAYM_SYS_POOL_32K "
db2 "create user temporary tablespace SYSTOOLSTMPSPACE PAGESIZE 4K MANAGED BY SYSTEM USING ('/home/db2inst4/db2inst4/tablespaces/SYSTOOLSTMPSPACE' ) BUFFERPOOL PAYM_SYS_POOL_4K "
db2 "create system temporary tablespace PAYMENT_TMP PAGESIZE 32K MANAGED BY DATABASE USING (file '/home/db2inst4/db2inst4/tablespaces/PAYMENT_TMP' 100M) BUFFERPOOL PAYM_SYS_POOL_32K "
相关新闻>>
- 发表评论
-
- 最新评论 更多>>