Common DB2 commands (2)

Source: Internet
Author: User
Tags db2 connect db2 connect to

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.