Script for V$flash_recovery_area_usage


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script for V$flash_recovery_area_usage
# 1  
Old 06-08-2011
Script for V$flash_recovery_area_usage

Hello,

on a daily / hourly basis I need need to check the size for the Flash Recovery Area (v$flash_recovery_area_usage)

I was not in work yesterday and when I arrived today I checked the alert log only to find that the usage was 100%. This means the overnight backups will not run.

I was wondering if someone could provide a script that gives a warning at 80%

The SQL that I use to determine the ASM Flash Recovery Usage is -->

Code:
SQL> COL % FORMAT 99.0
SQL> SELECT name, free_mb, total_mb, free_mb/total_mb*100 "%" FROM v$asm_diskgroup;

NAME                              FREE_MB   TOTAL_MB          %
------------------------------ ---------- ---------- ----------
DATA                                36054      40960 88.0224609
REDOLOG                             40859      40960  99.753418
BACKUP                              17885      20480 87.3291016
OCRVOTE                             10145      10240 99.0722656

At the moment the usage is fine, but I'd like a shell script that I can schedule via cron, on an hourly basis and send an email, warning me that any of the ASM disks usage has gone above 80%

Thanks in advance

Last edited by pludi; 06-08-2011 at 10:40 AM..
# 2  
Old 06-08-2011
You could consider adding this new functionality to the script related to the monitoring of the ORA- alerts: the Oracle database instance processes log a warning in the alert log when the usage of the fast recovery area (a.k.a. flash recovery area) reaches a certain threshold.
# 3  
Old 06-08-2011
Hi,

Yes that is true. However the alert script runs once a day at 4am and I'd like to run this particular script on an hourly basis. Otherwise the first sign I am aware of the space issue is in the morning, after the backups have been scheduled to run.

Thanks again
# 4  
Old 06-08-2011
OK,
so you could create and schedule a new script (copy the original one, change the message parameter and the mail subject handling).
# 5  
Old 06-08-2011
OK,

tested and worked so thanks

I did that - but if there are any other errors within the hour will it also mail these?

For example I could have ORA-600 or other meaningless errors that I do not need to know about.

Regards
# 6  
Old 06-08-2011
Quote:
Originally Posted by jnrpeardba
OK,

tested and worked so thanks

I did that - but if there are any other errors within the hour will it also mail these?
If you remove the message like '%ORA-%' part, you won't receive a notification for an ORA- alerts.

Quote:
For example I could have ORA-600 or other meaningless errors that I do not need to know about.
? The ORA-00600 alerts could be more than important ..., they could be critical.
# 7  
Old 06-08-2011
Hi,

thanks and that is true what you say, and I was just using the ORA-600 as an example. But I wanted to be able to act on the Flash back area, if the disk was say 80% full.

Thanks

---------- Post updated at 04:11 PM ---------- Previous update was at 03:54 PM ----------

Hi,

does this make it easier?

When it generates an alert for Disk usage, I get an email like this

Code:
ADR Home = /u01/app/oracle/diag/rdbms/dctmprod/DCTMPROD1:
*************************************************************************
2011-06-07 08:36:24.865000 +01:00
Errors in file /u01/app/oracle/diag/rdbms/dctmprod/DCTMPROD1/trace/DCTMPROD1_m000_31563.trc:
ORA-19815: WARNING: db_recovery_file_dest_size of 10737418240 bytes is 97.17% used, and has 304087040 remaining bytes available.
2011-06-07 10:21:17.155000 +01:00
Errors in file /u01/app/oracle/diag/rdbms/dctmprod/DCTMPROD1/trace/DCTMPROD1_ora_17971.trc:
ORA-19815: WARNING: db_recovery_file_dest_size of 10737418240 bytes is 100.00% used, and has 0 remaining bytes available.

So in my script can I do something which only searches for ORA-19815 errors
On that line it displays the percentage - so if it is above 80% (threshold) then it can send an email.

Thanks again

Last edited by radoulov; 06-08-2011 at 12:34 PM.. Reason: Code tags.
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies

2. Shell Programming and Scripting

Shell script works fine as a standalone script but not as part of a bigger script

Hello all, I am facing a weird issue while executing a code below - #!/bin/bash cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset sh UKBA_publish.sh UKBA 28082015 3 if then echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies

3. UNIX for Dummies Questions & Answers

Calling a script from master script to get value from called script

I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below. #masterscript.sh ./callingscript.sh echo $fileExist #callingscript.sh echo "The script is called"... (2 Replies)
Discussion started by: Raj Roy
2 Replies

4. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies

5. Shell Programming and Scripting

create a shell script that calls another script and and an awk script

Hi guys I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file. #!/bin/sh echo " $2 $3 $4 $5 $6 $7 isql -w400 -U$2 -S$5 -P$3 << xxx use $4 go print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies
Login or Register to Ask a Question