Posts

Showing posts with the label Monitoring Scripts

[Script] Tablespace Usage Alert

Hi, This is another variation of the previous scripts presented in this blog site. The building blocks of this script is the same as the Disk Space and ASM Diskgroup Space Monitoring scripts. This will alert you via email if a certain tablespace  reaches the set threshold. Let's share and make others love Oracle, too. For tablespace monitoring alert scripts. We have the following: Tablespace Monitoring Script You will notice that there is a pattern in the scripts creation presented in this blog.  Part 1: Report Generation : Here it is the tablespace report Part 2: Report output string process : Scripts are created to process further report into columns. Conditional statement was created to test the values in the report. Part 3: Check if the file generates alert : Email is sent if entities met the threshold. # # # # # #----- Start of Script -----###### #!/bin/bash  # Report tablespace usage  sqlplus "/ as sysdba" << EOF SET LINES 700...

[Script] ASM Diskgroup Space Usage Alert

Hi Again, Another important task that a DBA should do is to monitor the ASM diskgroup usage. We do not just add space to tablespaces, create more tablespaces or resize datafiles to increase storage without checking if there is space to our ASM diskgroup. Also, when we perform RMAN backups stored in ASM or Datapump Exports stored in ASM, we have to monitor and get alerts if we are running out of space. This is a simple monitoring script. I hope this could help you. Let's share and make others love Oracle, too. ASM Diskgroup  Space Monitoring ######--- Start of Script -----###### #!/bin/bash  # Report ASM Diskgroup space usage  #NOTES:  # 1. There is really a slash on the v$asm_diskgroup so Unix interpreter will treat dollar sign as a literal $ # 2. Set your tablespace threshold by changing the value of the AND clause  " >= 80" sqlplus "/ as sysdba" << EOF SET LINES 700 SET FEEDBACK OFF SET TRIMSPOOL ON SET ECHO OFF SPOOL /tmp/ASMs...

[Script] Simple Disk Space Monitoring Alert

Hello Everyone, Recently, I was tasked to create some simple monitoring scripts using Unix. Well, I must admit that I am not a Unix-expert but being a resourceful Oracle DBA, I was able to create simple monitoring scripts by combining different articles and sources online. I hope you find some of them useful. Let's share and make others love Oracle, too. Disk Space Monitoring Script ######---Start of Script---t##### #!/bin/bash  # Report disk space usage threshold="80"  i=2  diskresult=`df -h |grep -v "Filesystem" | awk '{ print $5 }' | sed 's/%//g'`  for percent in $diskresult; do  if ((percent > threshold))  then partition=`df -h | head -$i | tail -1| awk '{print $6}'`  echo "Warning: $partition is ${percent}% used."  fi  let i=$i+1  done ######---End of Script---##### Note: This Disk Space monitoring script will capture all your mount points that are more than 80% utilized.  What if I would ...