1、强行停止DB2某个db应用连接(from Sharon)
方法一:
db2 connect to DBNAMEdb2 force application all for DBNAME
方法二:
db2 "force application for(hand id)"
PS: 多啰嗦一句,其实最好的方式应该是断开网络连接,然后使用类似ILO的工具连接到server进行离线备份,因为有些应用在我们强行断开连接后,马上又会自动连接过来。ILO这种工具是很多主机都自带的东西,完全free,只是需要多连接一根网线而已。
2、查看表空间:
list tablespaces
list tablespace containers for 1
3、检查db2的常用命令:
pe -ef | grep db2
db2ilist
db2 get db cfg for dbname
db2 get db cfg for dbname | grep LOGARCHMETH1
db2 list db directory
db2 list applications
db2 connect to dbname
db2 disconnect current
db2 list tablespaces
db2 list tablespace containers for 0
4、查看数据库备份情况:
db2 list utilities show detail
5、查询数据库列表:(from Billy)
db2 list db directory | grep -E 'Database alias|Directory entry type' | cut -d= -f2 | awk '
BEGIN { i=-1 }
i == -1 { printf "%s:", $1 }
i == 1 { print $1 }
// { i=i*-1; }
' | grep -i Indirect | cut -d: -f1
6、查询db2的创建时间:
select min(create_time) from syscat.tables
db2 list tables
for
schema
SYSIBM
__
___________________________________________________________________________________
版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!
Author: laven54 (lurou)
Email: laven54@163.com
Blog: http://blog.csdn.net/laven54