Musas - rbogusze/oracleinfrastructure GitHub Wiki

I find it beneficial to have an offsite location of AWR / Statspack reports together with SQL reports that allows me easily to see what was happening on the database yesterday, week ago, month ago, etc.

Please note that using AWR reports requires a valid extra licence for Diagnostic Pack. Actually very similar report can be collected using a free old-style Statspack.

This project simply collects the AWR reports once a day together with SQL report and stores them on logwatch host.

Installation

$ cd
$ svn checkout https://github.com/rbogusze/oracleinfrastructure/trunk/oi_musas_awr
??? not sure any more about that??? $ svn propset svn:keywords "Header" awr_reports.sh
or
$ svn checkout https://github.com/rbogusze/oracleinfrastructure/trunk/oi_musas_statspack

Usual LDAP attributes

orainfDbMusasMonitoring: TRUE
orainfDbMusasMonitoringMode: awr | statspack
orainfDbMusasStart: 08:00
orainfDbMusasEnd: 16:00
orainfDbRrdoraIndexHash: xxccxx
orainfDbRrdoraUser: perfstat

Rights for the orainfDbRrdoraUser

SQL> grant execute on sys.DBMS_WORKLOAD_REPOSITORY to perfstat;

Some packages and directory setup

# yum install httpd
# chkconfig httpd on
# /etc/init.d/httpd start
# yum install php53 php53-gd lynx

# mkdir /var/www/html/awr_reports
# chown orainf:orainf /var/www/html/awr_reports
or
# mkdir /var/www/html/statspack_reports
# chown orainf:orainf /var/www/html/statspack_reports


Basically the whole point is to issue a commands like:

$ ${HOME}/oi_musas_awr/awr_reports.sh TEST perfstat `date -I` 14:00 15:00

But as we have good old LDAP and configure there what we run on which database this is automated by a cron script:

#
# MUSAS_AWR - Generate AWR reports
#
16 16 * * * . ${HOME}/.bash_profile; cd ${HOME}/oi_musas_awr; ./prepare_exec_cmd.sh > exec_cmd.sh; sh exec_cmd.sh


#
# MUSAS_STATSPACK - Generate Statspack reports
#
09 21 * * * . ${HOME}/.bash_profile; cd ${HOME}/oi_musas_statspack; ./prepare_exec_cmd.sh > exec_cmd.sh; sh exec_cmd.sh; touch /tmp/ala_ma_kota2

We should now see the reports lifter for every monitored database under:

http://logwatch/awr_reports/

http://logwatch/statspack_reports/

⚠️ **GitHub.com Fallback** ⚠️