TSM Server Rebalance and Reduce DB2 Table Space: Difference between revisions

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


== Further Reading ==
== Further Reading ==

Latest revision as of 14:11, 12 January 2016

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