Description
-----------
This is a complete DB2 maintenance suite for most common housekeeping operations, and is portable to most Linux and Unix environments.
It is highly configurable to the needs of your site.
The intention is to automate mundane, repetitive, predictable tasks, freeing up DBA time for more productive purposes.
The target audience is skilled, competent DBAs operating on Linux and Unix platforms with at least basic competencies in shell scripting.

This is not 'DB2 For Dummies' - you need to know what you're doing.
The one major item not included here is a backup script - there is simply too much variation to code a 'one size fits all' script.

The suite uses DB2FUNCTIONS.tar.gz, a separately downloadable modular function library for DB2 DBAs, realised in ksh93.
The download package for this suite is DB2MAINTENANCE.tar.gz and installation instructions are in the separate readme file below.

Packing list :
----------------
A_MAINTENANCE_README		<== this document
A_MAINTENANCE_SETUP_README	<== read this next!
ArchiveLog.ksh					Test archive logging is functioning and archive regularly to reduce recovery tme on a restore.
Check_Integrity.ksh				Validate referential integrity on systems where RI is declared but not enforced.
Check_Invalid_Objects.ksh		Report invalidated objects.
DropInoperativeViews.ksh		sic
Exit.ksh						< only called on error >
generate_integrity_checks.sql	
Get_DB_Settings.ksh				Comprehesve configuration capture.
Lower_HWM.ksh					Reduce tablespace high water marks (DB2 9.7+)
lower_hwm.sql
Monitor_Paging.ksh			<== AIX only
NotifyLog.ksh					Optional extra to summarise instance notify messages in the past 24 hours.
PruneFiles.ksh					Clear down and archive DIAGPATH, work directories, sqllib/tmp etc.
PruneHistory.ksh				Prune the recovery history file
Rebind_Packages.ksh				sic
Refresh_MQTs.ksh				sic
REORGS							Intelligent table and index REORGs 
report_hwm.sql
select_mqts.sql
STATS							Intelligent statistics gathering
TEMPLATES

./REORGS:
A_SETUP_REORGS_README
progress.sql
reorgchk_drop.ddl
reorgchk_ix.ddl
reorgchk_tb.ddl
reorg_online.ksh
reorg.pick_index.sql
reorg.pick_table.sql
reorg.schema_list.dbname

./STATS:
A_SETUP_STATS_README
A_STATS_README
statschk.awkin
statschk_include_tbspaces
STATSCHK.ksh
statschk_search_tbspaces

./TEMPLATES:
ExportInoperativeViews.template
FindInoperativeViews.template
reorgchk_ix.ddl.template
reorgchk_tb.ddl.template
reorg.pick_index.sql.template
reorg.pick_table.sql.template
reorg.schema_list.dbname
.profile.template

Legal Stuff
-----------
All code here is copyleft from http://www.sustainablesoftware.net/downloads.htm
Please respect copyleft conditions.
In particular:

- You keep comment lines specifying the original author and purpose in place.
- You comment any amendments to the original in a clearly marked amendment history.
- You do not sell or charge for it.
- Usual disclaimers: we accept no responsibility, give no warranty, no guarantees express or implied, at your own risk blaa blaa etc.
Alex Levy, Sustainable Software Ltd., June 2012.

