- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Tablespace / filesystem monitoring script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2006 02:52 AM
тАО05-16-2006 02:52 AM
I would like to write a premptive script, that monitors the freespace within all tablespaces of an oracle database and also the filesystems in which the datafiles reside, alerting us when both reach predefined levels. This is so we can find and allocate space on the arrays in advance. Does anyone have any experience of writing such a script? and could offer some advice on where to start?
Do you think it could it be written in plain shell and sql or would I have to delve into perl?
Thanks for any advice or sample scripts you can offer
Phil
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2006 03:20 AM
тАО05-16-2006 03:20 AM
Re: Tablespace / filesystem monitoring script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2006 03:27 AM
тАО05-16-2006 03:27 AM
Re: Tablespace / filesystem monitoring script
lots of scripts available via search engine of your choice.
I would set the database to autoextend, so you just have to worry about disk storage level. That also gets you around the potential problem of hardcoded Oracle usernames/passwords.
As the simplest solution I would use cron and bdf.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2006 10:24 AM
тАО05-16-2006 10:24 AM
Re: Tablespace / filesystem monitoring script
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2006 08:48 PM
тАО05-16-2006 08:48 PM
Re: Tablespace / filesystem monitoring script
Oh well, I'll let you know what I come up with.
Thanks again
Phil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2006 09:37 PM
тАО05-16-2006 09:37 PM
Re: Tablespace / filesystem monitoring script
This is a very cool sql script for your
tablespaces I have been using over the years.
I build a unix script around it , but it
all boils down to knowing your % free .
To bypass password in script you can use
a ops$account from unix or windows.
Keep cooking :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2006 09:40 PM
тАО05-16-2006 09:40 PM
Re: Tablespace / filesystem monitoring script
select df.tablespace_name tspace,
round(sum(fs.bytes)/(df.bytes) * 100) "%_free",
round(sum(fs.bytes)/(1024*1024)) free_ts_size,
df.bytes/(1024*1024) tot_ts_size
from dba_free_space fs, (select tablespace_name, sum(bytes) bytes from dba_data_files
group by tablespace_name ) df
where fs.tablespace_name = df.tablespace_name
group by df.tablespace_name, df.bytes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2006 10:10 PM
тАО05-16-2006 10:10 PM
Solutionnot wanting to disappoint you I have concatinated a number of sources into:
#!/usr/bin/sh
export ORACLE_HOME=
export ORACLE_SID=
file=/tmp/${$}_`date +%Y%m%d`
sqlplus -s system/manager << .eof > $file
set pages 0
select df.tablespace_name tspace,
round(sum(fs.bytes)/(df.bytes) * 100) "%_free",
round(sum(fs.bytes)/(1024*1024)) free_ts_size,
df.bytes/(1024*1024) tot_ts_size
from dba_free_space fs, (select tablespace_name, sum(bytes) bytes from dba_data_files
group by tablespace_name ) df
where fs.tablespace_name = df.tablespace_name
group by df.tablespace_name, df.bytes
having round(sum(fs.bytes)/(df.bytes) * 100) > 89;
exit;
.eof
if [ -s $file ]
then
mailx -s"database level" emailid < $file
fi
rm $file
bdf|awk '{print $5," ",$6}'|sed 's/%/ /g'|awk '$1>89{print $1," ",$2}'|sed '1d' > $file
if [ -s $file ]
then
mailx -s"bdf level" emailid < $file
fi
rm $file