srqway / dba_scripts_02

Based on repo dba_scripts. Started at Feb.12 2015 in Nexen.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I plan to put about 20 scripts in this repository. Most of these scripts I'm using in production environment.
Most of the scripts are in Perl, some scripts are in Python and Shell.
All scripts write log files in directory ./log, and send e-mail to DBA in case of emergency.
We use Oracle DataGuard as disaster recovery. Almost all scrips check database role because supposed to run on
Primary database.

THIS IS WORK IN PROGRESS.

Directory structure
-------------------
WORKING_DIR - directory where all monitoring and statistics scripts are located (.sh, .pl, .py)
WORKING_DIR/log - all log files go into this directory
WORKING_DIR/config - Perl and Python configuration files live there.
WORKING_DIR/pictures - all charts generated by statistics scripts.

1. Oracle Alert Log Monitor Scripts
1.1. alert_monitor.pl
    This script connects to running Oracle instance and select alerts from table x$dbgalertext (for Oracle 11g and later).
    This table should be recycled in reqular bases because it can grow very fast and select statement will run for
    long time. Usualy it can be problem on Test/QA environments. Also this require database up and running.
    If your database crashs you will never receive alert, so there should be special script to monitor database.
1.2. alert_monitor_rb.pl
    This scrip read alert log file backward (from last line untill line with timestam stored in config file). In this
    case script execution time does not depend upon log file size. Also you will receive all alert, even if database is
    down, becase connection to the database is not requered.

2. Oracle Tablespace Monitor Script
3. Linux Disk Space Monitor Script
4. Perl library (my_library.pl) of common functions.
    4.1. sub CheckDBRole was added to eliminate query to database from each and every script to check current role
        (Primary or Standby). Some scripts should be run on Primary database only.
    4.2. All environment variables come from .bash_profile_cron
    

About

Based on repo dba_scripts. Started at Feb.12 2015 in Nexen.


Languages

Language:Perl 63.9%Language:Shell 22.3%Language:Python 13.7%