当前位置:首页 > 数据库 > SQL其他

db2 reorg runstats rebind具体操作

#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   

本文系统来源:http://www.cnblogs.com/xiaojianblogs/p/7309230.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!