DB2数据库性能下降后做runstats及rebind包
在表(大表)的记录的条数有 30%的变化以后,就应该做一次 runstats
从方便管理的角度,直接从 syscat.tables中建script。 
 db2 “select 'runstats on table db2inst1.'  || tabname || ' and indexes all'  from
syscat.tables where tabschema='DB2INST1' and type='T'”    >stats.sql 
将 stats.sql中的多余的信息删除后,运行该脚本。
db2  -tvf  stats.sql
请注意在做 runstats时,将其他应用全部断开。
为了提高速度,可以调整一下 database 的参数,将 applheapsz,
sortheadp,stmtheap先扩大10 倍,但注意做完 rebind 后将参数恢复回来。 
注意:在作完 runstats 后,相关的 sp  如果不做 rebind,性能不会有任何变
化,不会使用新的统计数据来计算。 
db2 “select 'rebind package '||pkgname from syscat.packages where
pkgschema='DB2INST1’ “ >rebind.sql 
将 stats.sql中的多余的信息删除后,运行该脚本。
db2  -tvf  rebind.sql 
		本文标签:					
		
		
		
		 
			网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
		
				
			
	 
	            