catalog数据库:
catalog indirect: db2 catalog database on /db2sys[dir_name]
catalog remote: db2 catalog database as at node
catalog indirect: db2 catalog database on /db2sys[dir_name]
catalog remote: db2 catalog database as at node
事例:
db2
catalog tcpip node NODESUN remote 192.168.1.1 server 50000 ostype aix
catalog tcpip node NODESUN remote 192.168.1.1 server 50000 ostype aix
db2
catalog db SUNDB as SUN at node NODESUN
catalog db SUNDB as SUN at node NODESUN
uncatalog数据库:
db2 uncatalog database
db2 uncatalog database
查看本地数据库最好的办法:
db2 list db directory on /db2sys[dir_name]
db2 list db directory on /db2sys[dir_name]
更改DB2归档路径:
db2 update db cfg for cmsdb using LOGARCHMETH1 disk:/home/db2inst1/archlog
db2 update db cfg for cmsdb using LOGARCHMETH1 disk:/home/db2inst1/archlog
查询DB2下schema:
db2 "select * from sysibm.sysschemata"
db2 "select * from sysibm.sysschemata"
db2表空间扩展(加入容器):
db2 "alter tablespace USERSPACE1 add (file '/db2data/db2inst1/cmsdb/db2data/userspacefs01/c00000006.LRG' 114688)"
db2 "alter tablespace USERSPACE1 add (file '/db2data/db2inst1/cmsdb/db2data/userspacefs01/c00000006.LRG' 114688)"
db2做迁移恢复的时候,若从32位到64位实例的时候。
须要做下面处理:
1、须要先将源端实例使用db2iupdt命令将实例升级到64位
root>./db2iupdt -w 64 db2inst1
2、对源端数据库做冷备
3、将源端数据库实例更改为32位
root>./db2iupdt -w 32 db2inst1
4、传输备份到目标端
5、在目标端上做恢复并升级数据库
db2 migrade db sundb
数据库做迁移后,出现大量的I/O等待,经过分析是db2数据库的buffer pool设置过小导致。以下提供查询和更改buffer pool的事例:
db2 connect to sundb
db2 "select bpname,npages from sysibm.sysbufferpools"
db2 "alter bufferpool IBMDEFAULTBP immediate size 10000"
能够參考:http://liqian-84.blog.163.com/blog/static/8813102010101562837232/
设置联邦数据库查询(类似oracle dblink):
db2 update dbm cfg using federated yes
db2stop
db2start