Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1001
  • Last Modified:

ASM Disk Group script

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
k3vsmith
Asked:
k3vsmith
2 Solutions
 
slightwv (䄆 Netminder) Commented:
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
 
k3vsmithAuthor Commented:
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
 
dbmullenCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now