当前位置:Gxlcms > 数据库问题 > db2 reorg runstats rebind具体操作

db2 reorg runstats rebind具体操作

时间:2021-07-01 10:21:17 帮助过:34人阅读

#reorg table
db2 -x "select ‘reorg table ‘||rtrim(tabschema)||‘.‘||tabname||‘;‘ from syscat.tables where TYPE=‘T‘" > reorg.sql

#reorg index
db2 -x "select ‘reorg indexes all for table ‘||rtrim(tabschema)||‘.‘||tabname||‘;‘ from syscat.tables where TYPE=‘T‘" > reorg_index.sql

#runstats table
db2 -x "select ‘runstats on table ‘||rtrim(tabschema)||‘.‘||tabname|| ‘ and indexes all;‘ from syscat.tables where tabschema=‘NRWAUSR‘ and TYPE=‘T‘" > runstats.sql

# rebind
db2 -x "select ‘rebind package ‘||rtrim(pkgschema)||‘.‘||pkgname||‘;‘ from syscat.packages where pkgschema not in (‘NULLID‘ ) and PKGSCHEMA=‘NRWAUSR‘" > rebind.sql

 

db2 -tvf reorg.sql -z reorg_error.log
db2 -tvf reorg_index.sql -z reorg_index.log
db2 -tvf runstats.sql -z runstats_error.log
db2 -tvf rebind.sql -z rebind_error.log

db2 reorg runstats rebind具体操作

标签:ror   sql   rtrim(   schema   pac   tables   err   sel   cat   

人气教程排行