Common DB2 commands (2)
Catalog Database:
Catalog indirect: db2 catalog database on/db2sys [dir_name]
Catalog remote: db2 catalog database as at node example: db2 catalog tcpip node NODESUN remote 192.168.1.1 server 50000 ostype aix db2 catalog db SUNDB as SUN at node NODESUN
Uncatalog database:
Db2 uncatalog database
The best way to view the local database:
Db2 list db directory on/db2sys [dir_name]
Change the DB2 archiving path:
Db2 update db cfg for cmsdb using LOGARCHMETH1 disk:/home/db2inst1/archlog
Query the schema in DB2:
Db2 "select * from sysibm. sysschemata"
Db2 tablespace extension (add container ):
Db2 "alter tablespace USERSPACE1 add (file '/db2data/db2inst1/cmsdb/db2data/userspacefs01/c00000006.lrg' 114688 )"
When db2 performs migration and recovery, if it is from 32-bit to 64-bit instances. You need to do the following:
1. Upgrade the source instance to 64-bit by running the db2iupdt command.
Root>./db2iupdt-w 64 db2inst1
2. Perform cold backup for the source database
3. Change the source database instance to 32-bit
Root>./db2iupdt-w 32 db2inst1
4. Transmit the backup data to the target end
5. Restore and upgrade the database on the target end
Db2 migrade db sundb
After the database is migrated, a large number of I/O waits occur. The analysis result is that the buffer pool setting of the db2 database is too small. The following example shows how to query and change the buffer pool:
Db2 connect to sundb
Db2 "select bpname, npages from sysibm. sysbufferpools"
Db2 "alter bufferpool IBMDEFAULTBP immediate size 10000"
See http://liqian-84.blog.163.com/blog/static/8813102010101562837232/
Configure a federated database query (similar to oracle dblink): db2 update dbm cfg using federated yesdb2stopdb2start