DB2 Server Mgmt
1. Server, instance & database
一个物理服务器包括:
*一个管理服务器
*一个或多个实例
每个实例
*是一个逻辑服务器
*可以拥有一个到多个数据库
2. Instance creation, drop and listing
db2icrt instance_name [ linux: db2icrt -ufenced_user_ID instance_name ]
db2idrop -f instance_name
db2ilist
db2 get instance
3. Configuration param
db2set -lr
db2set registry_variable= value [ eg: db2set DB2COMM=TCPIP ]
db2set -all
Instance level : attach to instance
db2 get dbm cfg
db2 update dbm cfg using parameter new_value immediate/deferred
Database level: connect to db_name
db2 get db cfg for db_name
db2 update db cfg for database_name using parameter new_value immediate/deferred
4. Applications
force application all
db2stop force / db2start
list applications
force application (8)
5. Ensure the SERVER is ready to accept remote connections
byfollowing these THREEsteps:
(1).update SVCENAME (service name) parameter in DBM CFG
Example:update dbm cfg using svcename db2cdb2inst1
(2).update services with the service name and port number
–UNIX: /etc/services
–Windows:c:\winnt\system32\drivers\etc\services
Example: db2cdb2inst1 50000/tcp
(3).Enable applicable communication protocol(s) in DB2 registry
Example:db2set DB2COMM=TCPIP
5. Retrieve directory
db2 list node directory
db2 list database directory
6. 连接远程数据库命令
uncatalog node MGT
uncatalog db PRJMGT
db2 catalog tcpip node MGT remote 10.4.5.212 server 50000
list node directory
attach to MGT user db2admin using password
db2 catalog db PRJMGT as PRJMGT at node MGT
list db directory
connect to PRJMGT user db2admin using password
list tables
利用图形界面要填写service name 此变量一般SVCENAME=db2c_DB2