Solved

ASM Disk Group script

Posted on 2014-03-07
3
927 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 77

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
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 video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

821 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