SHELL SCRIPT

Shell script for monitoring blocking sessions

Below is the shell script, to be configured in crontab, which will send mail incase of blocking session observed in the database . In the mail body it will contain the blocking sessions details also. 1. Prepare the blocker.sql file.[ for blocking sessions more than 10 seconds)

2. Shell script.(/home/oracle/monitor/blocker.sh ) You need to […]

Shell script to monitor asm diskgroup usage

REQUIREMENT: Write a shell script, which will trigger a mail alert, if the utilization of the asm diskgroup reached 90 percent. SOLUTION: 1. Below is the shell script. Make sure to update ORACLE_HOME, ORACLE_SID inside the shell script. cat /export/home/oracle/asm_dg.sh

2. Give proper permission:

3. Configure in crontab:

Shell script to report failed login attempt in oracle

Requirement: Configure a shell script in crontab, that will send alert to DB support Team, in the case of any invalid login attempts in the database.   1. First, enable audit for create session

2. Final shell script Below script for any invalid login attempts in last 15 minutes. cat /export/home/oracle/invalid_log.sh

3. provide […]

shell script for file system alert

Below is script for sending notification ,when a mount point or filesystem crosses a threshold value. For solaris

Put in crontab:

For monitoring zpool usage in solaris:

Put in crontab as below:

Alert log rotation script in oracle

Day by day, alert log size will grow in Oracle database. So for housekeeping, we need to move the existing alert log to a backup location and compress there. Upon moving the alert log, the database will create a fresh alert log automatically. Below is the shell script. WE need to define the ORACLE_HOME in […]

Tablespace monitoring shell script

Below script can be configured in crontab to send a notification to the support DBAs in case tablespace usage crosses a threshold. 1. First, make the below .sql file, which will be used inside the shell script. In this script we have defined the threshold as 90%. You can change it as per your requirement. […]

Shell script for monitoring Alert log

Requirement: Configure a shell script to monitor alert log for all the databases on a server once in every 15 min.And in the case of any ORA- error mail to the DBA TEAM. Below script is prepared using the ADRCI utility of oracle 11g. It will monitor alert log for all the databases having same […]

RMAN backup using shell script

REQUIREMENT: Configure shell script to take rman Full backup . SCRIPT: ( rman_full_bkp.sh)

Give 755 permission

Configure script in crontab:

For taking incremental backup,Just update the backup command with the below one. backup as compressed backupset incremental level 1 check logical database plus archivelog;

Kill snipped sessions in oracle db

REQUIREMENT: Configure a shell script, to kill the snipped sessions in the database regularly.   SHELL SCRIPT:

Give 755 permission.

Configure in crontab:

expdp backup using shell script

Requirement: Configure a shell script, to take export backup of table daily at 3 PM  and send the log to stake holders. Script: ( EXP_TAB_cmprss.sh)

give 755 permission

Now configure the script in crontab as below( pass the ORACLE_SID )

  NOTES: Please let us know if you are getting aany errors:

Skip to toolbar