REORG INDEXES/TABLE COMMANDS
db2 -x "select 'reorg table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,50),';'from syscat.tables where type = 'T' " > 08_08_2017reorg.txt
db2 -tvf 08_08_2017reorg.txt -z 08_08_2017reorg.txt.out --> reord Process
db2 -x "select 'runstats on table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,50),' and indexes all;'from syscat.tables where type = 'T' " > 08_08_2017_runstats.txt
db2 -tvf 08_08_2017_runstats.txt -z 08_08_2017_runstats.txt.out --> runstat process
db2 ALTER TABLESPACE USERSPACE1 LOWER HIGH WATER MARK
db2 list tablespaces --> To checking table space It should be 0x00000. If it is 0x80000 state we need to wait till that state change to 0x0000
db2 ALTER TABLESPACE USERSPACE1 REDUCE MAX -->
db2rbind <dbname> -l logfile_bind all -->To build the required packages in DB2 software level
db2 -x "select 'reorgchk update statistics on table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,50),';' from syscat.tables where type = 'T' " > 08_08_2017_reorgchk.txt
db2pd -d <dbname>-reorg --> To check the status of reorg
db2top -d <dbname>-->check the DB2 Process
db2 ALTER TABLESPACE SYSCATSPACE LOWER HIGH WATER MARK
db2 ALTER TABLESPACE USERSPACE1 REDUCE MAX
db2 -x "select 'reorg table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,50),';'from syscat.tables where type = 'T' " > 08_08_2017reorg.txt
db2 -tvf 08_08_2017reorg.txt -z 08_08_2017reorg.txt.out --> reord Process
db2 -x "select 'runstats on table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,50),' and indexes all;'from syscat.tables where type = 'T' " > 08_08_2017_runstats.txt
db2 -tvf 08_08_2017_runstats.txt -z 08_08_2017_runstats.txt.out --> runstat process
db2 ALTER TABLESPACE USERSPACE1 LOWER HIGH WATER MARK
db2 list tablespaces --> To checking table space It should be 0x00000. If it is 0x80000 state we need to wait till that state change to 0x0000
db2 ALTER TABLESPACE USERSPACE1 REDUCE MAX -->
db2rbind <dbname> -l logfile_bind all -->To build the required packages in DB2 software level
db2 -x "select 'reorgchk update statistics on table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,50),';' from syscat.tables where type = 'T' " > 08_08_2017_reorgchk.txt
db2pd -d <dbname>-reorg --> To check the status of reorg
db2top -d <dbname>-->check the DB2 Process
db2 ALTER TABLESPACE SYSCATSPACE LOWER HIGH WATER MARK
db2 ALTER TABLESPACE USERSPACE1 REDUCE MAX
No comments:
Post a Comment