Tech Blog

oracle low tablespace alert email using util_o_14_1

Description

Here is a shell script to check for free memory in Ex Libris oracle tablespaces.
The script runs from a cron job to automate the Ex Libris menu option util_o_14_1 for Primo, Aleph, Metalib, Digitool and ARC.

A “low tablespace” email is sent to an “alerts” email address when free tablespace is below 2000Megabytes.
The application user and server name appear in the subject. The email body lists the lablespaces with low free space, and the free space in Megabytes.
An “ok tablespace” email is sent to a “monitor” email address when free tablespace is not below 2000Megabytes to verify that the script has been run.
The application user and server name appear in the subject. The email body lists the lablespaces with low free space, and the free space in Megabytes.
Once a month on the 23rd day the “ok tablespace” email is sent to the “alerts” email address to verify that the script has been run.
An “error tablespace” email is sent to the “alerts” email address if an ORA- message is produced by the execution of util_o_14_1.

We have found this useful for users who are familiar with the Ex Libris util menu for monitoring and manageing oracle tablespaces.
We have implemented a simple policy of 2000Megabytes minimum free memory for each Ex Libris tablespace.

With this policy it is unlikely that any tablespaces should have zero free space without warning.
There is no check for tablespaces with zero free space. Oracle administrative/system tablespaces are not checked.
We have the script running in RedHat EL 5.4 64 bit physical servers and under VMWare.

This script is also an example of how to automate the util menu in Ex Libris applications to run from a cron job.

 

  • Author: Laszlo Gercsov
  • Institution: University of New South Wales
  • Year: 2011
  • License: BSD style
  • Short description: Use, modification and distribution of the code are permitted provided the copyright notice, list of conditions and disclaimer appear in all related material.
  • Skill required for using this code: Basic

 

State

Stable

Programming language

shell (tcsh)

Screen captures

 

Release notes

The default path for the script is /exlibris/cleanup. The cron jobs log output/errors to that directory. The cron job(s) should be adjusted if another path is required for the script.
The script produces files in /tmp starting with _util_o_14_1_x_ – the file name includes the application user and a timestamp. The files should be cleaned up periodically.

Installation instructions

Copy the script to the directory /exlibris/cleanup and edit the email addresses “alert@myu.edu” and “monitor@myu.edu“.
Check the application usernames and paths in the script to ensure that they match your installation.
Create cron jobs as required eg.
11 00 * * * su – metalib -c “csh -f /exlibris/cleanup/util_o_14_1_x” > /exlibris/cleanup/util_o_14_1_x_m_log 2>&1
15 00 * * * su – dtl -c “csh -f /exlibris/cleanup/util_o_14_1_x” > /exlibris/cleanup/util_o_14_1_x_d_log 2>&1
17 00 * * * su – crn -c “csh -f /exlibris/cleanup/util_o_14_1_x” > /exlibris/cleanup/util_o_14_1_x_c_log 2>&1

Known issues

No check for zero free tablespace.
No check for administrative tablespaces.

Page attachments

util_o_14_1_x.2

util_o_14_1_x.txt

error_tablespace_arc.JPG

ok_metalib.JPG

low_tablespace_primo.JPG

 

 

Leave a Reply