Solved

ASM Disk Group script

Posted on 2014-03-07
3
886 Views
Last Modified: 2014-03-21
I need assistance with a script I can run as a cronjob that will send me the space of my ASM Disk groups (Total, free and used). I have the coding on how to send to my email but Im looking for details of whats inside script as to how to connect to sqlplus / as sysdba and execute sql query.
Any of you have a script in place that sends you your disk group info periodically so you know how much space is used?

Thanks
0
Comment
Question by:k3vsmith
3 Comments
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 250 total points
Comment Utility
Why use CRON?  Once you get the query why not use UTL_SMTP and have the database email you?

I've not done a lot with ASM but take a look at:  V$ASM_DISKGROUP

FREE_MB       NUMBER       Unused capacity of the disk group (in megabytes)

http://docs.oracle.com/cd/E11882_01/server.112/e40402/dynviews_1027.htm#REFRN30171
0
 

Author Comment

by:k3vsmith
Comment Utility
Yes this gave the query I need but can you provide more info on UTL_SMTP? How are you using it? You recommend it over cron jobs?
0
 
LVL 10

Accepted Solution

by:
dbmullen earned 250 total points
Comment Utility
If you are into shell-scripting and "cron" you might want a "command-line" way of getting "disk" group information...

set your oracle environment variables to point to "asm", then
asmcmd lsdg

or remove the headings:
asmcmd lsdg -H  

I like the "view" of v$asm_diskgroup but that will need scheduled in a DBMS_JOB or DBMS_scheduler job or your scheduler of choice..  plus, if you have MANY databases on the same server, you just need to pick one.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now