Solved

ASM Disk Group script

Posted on 2014-03-07
3
916 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
ID: 39913755
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
ID: 39919422
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
ID: 39933294
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
This video shows how to recover a database from a user managed backup
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

776 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