Tablespace alert [message #332269] |
Tue, 08 July 2008 01:22 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
balaji1482
Messages: 312 Registered: July 2007 Location: INDIA
|
Senior Member |
![YES](/forum/theme/orafaq/images/yahoo.png)
|
|
hi Experts,
i have a script for tablespace alert showing the complete details of tablespace like total available space,used space,free space in percentage (%).
i want this tablespace script to be set in crontab for hourly basis (every 1 hr) everyday,every month etc and also i want this tablespace alert to be sent to my mail if the free space of tablespace becomes less than 15%.
At present i have made a tablespace script showing complete details of tablespace in percentage and saved it in text file called free.txt .
how to proceed it further? Kindly suggest me.
[Updated on: Tue, 08 July 2008 01:23] Report message to a moderator
|
|
|
|
|
Re: Tablespace alert [message #332303 is a reply to message #332300] |
Tue, 08 July 2008 02:40 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68658 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
And I want you to work a little bit instead of waiting for others to feed you and make your job, please.
man grep
man cat
man sed
man awk
man mail
All what you need is in my previous post, I will write the full code for you (it depends on what you finally want).
Regards
Michel
[Updated on: Tue, 08 July 2008 02:53] Report message to a moderator
|
|
|
|
Re: Tablespace alert [message #333206 is a reply to message #332269] |
Thu, 10 July 2008 17:26 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
gungalagunga
Messages: 3 Registered: July 2008
|
Junior Member |
|
|
I would create some sort of PL/SQL procedure that would execute the script you defined. For any tablespace that exceeded the defined threshold, a mail message would be generated. This will avoid creating multiple files/messages if there isn't a problem. Of course you could also generate a file (see utl_file) or insert the offending tablespace stats into a table that you created.
Then, for the cron job (assuming oracle (or anyone with the oracle env) had cron privileges), create your cron job as:
/path/to/sqlplus username < pw @run_script.sql
(your pw file would have the user's password with rw permissions only for the user).
The run_script.sql file would look like:
exec my_procedure;
exit;
That's it.
|
|
|
|