日期:2014-05-16  浏览次数:20316 次

db2常用的性能监控和管理命令

??????????????????????????????????????????????????????????? 常用的性能监控和管理命令

??下面是一些常用的性能监控和管理命令的列表

??性能

get monitor switches 返回会话监控开关的状态
update monitor switches using <monitor> <on|off> 为 <monitor> 设置会话监控开关的状态

reset monitor all

复位性能监控程序值
get snapshot for dbm 返回实例级别的性能信息
get snapshot for all on <dbname> 为数据库 <dbname> 在数据库级别返回所有性能信息
get snapshot for dynamic sql on <dbname> 返回动态 SQL 高速缓存的内容
runstats on table <tbschema>.<tbname> 收集表 <tbname> 的统计信息。表名必须是用 <dbschema> 全限定的
reorgchk on table all 确定是否需要对表进行重组。这对于对所有表自动执行 runstats 很有用
reorg table <tablename> 通过重构行来消除“碎片”数据并压缩信息,对表进行重组

??管理

export 将数据库数据抽取到一个平面文件中
import 通过使用 IMPORT 实用程序,将数据导入到数据库
load query table <tbname>[to local-message-file][nosummary | summaryonly] [showdelta] 返回 LOAD 实用程序的进度
backup database <dbname> [to <path>] 执行数据库备份
restore database <dbname> [from <path>]
执行数据库恢复
get health snapshot for dbm 返回实例的正常快照信息(仅适用于 V8)
get health snapshot for all on <dbname>
返回数据库 <dbname> 的所有正常快照(仅适用于 V8)


??管理服务器

get admin cfg 返回管理服务器的配置设置
update admin cfg using <p> <v> 将管理服务器配置参数 <p> 更新为值 <v>

?