TSM Server Rebalance and Reduce DB2 Table Space

From UNIX Systems Administration
Jump to: navigation, search

Rebalance and Reduce DB2 Tablespace

  1. Add new LUN to the TSM server
    # cfgmgr -v
    # extendvg tsmdbvg <hdisk#>
    # mklv -y'<lv_name>' -t'jfs2' -u'1' <tsm_db_vg_name> 298 <hdisk#>
    # crfs -v jfs2 -d'<lv_name>' -m'<mount_point> -a logname='INLINE' -a logsize='512'
  2. Enter into TSM, and disable client sessions.
    DISAble SESSions CLIent
  3. Note current administrative schedules.
    Query SCHedule Type=Administrative
  4. Update the start times of all administrative schedules, so their start time is after the procedure completes.
    UPDate SCHedule <schedule_name> Type=Administrative STARTTime=19:00:00
  5. Make note of all running processes and connected sessions.
    Query Session
    Query PRocess
  6. Make note of all current sequential storage pool reclamation thresholds
    Query STGpool <pool_name> F=D
  7. Prevent any space reclamations from running on sequential access storage pools.
    UPDate STGpool <pool_name> REClaim=100
    UPDate STGPool BACKUPTAPE REClaim=100
  8. Cancel all running processes and sessions.
    CANcel Session <session #>
    CANcel Process <process #>
  9. Expand the TSM Database.
    EXTend DBSpace </absolute/path/to/new/directory>
  10. Take a full Database backup. Wait for this process to complete before continuing.
    Backup DB DEVclass=<device_class_name> Type=Full Wait=No
  11. Record the volume used for the full database backup.
    Query VOLHistory Type=DBBackup
  12. Connect to db2 as the tsminst1 user.
    db2 connect to tsmdb1
    db2 set schema tsmdb1
  13. Run these commands in sequence, waiting for each rebalance to complete before starting the next rebalance.
    db2 alter tablespace SYSCATSPACE rebalance
    db2 alter tablespace USERSPACE1 rebalance
    db2 alter tablespace IDXSPACE1 rebalance
    db2 alter tablespace LARGESPACE1 rebalance
    db2 alter tablespace LARGEIDXSPACE1 rebalance
    db2 alter tablespace REPLTBLSPACE1 rebalance
    db2 alter tablespace REPLIDXSPACE1 rebalance
    db2 alter tablespace SYSTOOLSPACE rebalance
  14. To monitor the process TSM v6.
    db2 "select * from SYSIBMADM.TBSP_UTILIZATION " | grep -i progress
  15. When the rebalance is complete, reduce the space on the tables, wait for each reduce to complete before starting the next reduce.
    db2 alter tablespace SYSCATSPACE reduce
    db2 alter tablespace USERSPACE1 reduce
    db2 alter tablespace IDXSPACE1 reduce
    db2 alter tablespace LARGESPACE1 reduce
    db2 alter tablespace LARGEIDXSPACE1 reduce
    db2 alter tablespace REPLTBLSPACE1 reduce
    db2 alter tablespace REPLIDXSPACE1 reduce
    db2 alter tablespace SYSTOOLSPACE reduce
  16. When the rebalance and reduce are complete, update the start times of all modified administrative schedules to their original times.
    UPDate SCHedule <schedule_name> Type=Administrative STARTTime=<HH:MM:SS>

Further Reading

  1. Steps to rebalance Database tablespaces