2007年3月15日 星期四

DB2 V8, manual re-create SYSTOOLS tablespce

1.create 4k tabslapce and user temporary tabslapce for systools usage
db2 "create tablespace TOOLSTBS managed by system USING ('d:\worktmp\TBS\umc\toolstbs')"
db2 "create user temporary tablespace usertmp managed by system USING ('d:\worktmp\TBS\umc\usertmp')"

2.drop currently systools table/view
db2 "CALL SYSPROC.SYSINSTALLOBJECTS ('DB2AC','D','', '')"
db2 "CALL SYSPROC.SYSINSTALLOBJECTS('POLICY','D','', '')"
db2 "CALL SYSPROC.SYSINSTALLOBJECTS('AM','D','', '')"
db2 "CALL SYSPROC.SYSINSTALLOBJECTS('STMG_DBSIZE_INFO','D','', '')"

3.create new systools on new tablespace
db2 "CALL SYSPROC.SYSINSTALLOBJECTS ('DB2AC','C','TOOLSTBS', CAST(NULL AS VARCHAR(128)))"
db2 "CALL SYSPROC.SYSINSTALLOBJECTS('POLICY','C','TOOLSTBS', CAST(NULL AS VARCHAR(128)))"
db2 "CALL SYSPROC.SYSINSTALLOBJECTS('AM','C','TOOLSTBS', CAST(NULL AS VARCHAR(128))) "
db2 "CALL SYSPROC.SYSINSTALLOBJECTS('STMG_DBSIZE_INFO','C','TOOLSTBS', CAST(NULL AS VARCHAR(128))) "

4.check all systools state
db2 "select substr(tabname,1,10),substr(tabschema,1,20),substr(TBSPACE,1,20),type from syscat.tables where tabschema='SYSTOOLS'"

5.drop SYSTOOLSPACE,SYSTOOLTMPSPACE
db2 drop tablespace SYSTOOLSPACE
db2 drop tablespace SYSTOOLTMPSPACE

沒有留言: