Tablespace alert [message #332269] |
Tue, 08 July 2008 01:22 |
balaji1482
Messages: 312 Registered: July 2007 Location: INDIA
|
Senior Member |
|
|
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 |
|
Michel Cadot
Messages: 68718 Registered: March 2007 Location: Saint-Maur, France, https...
|
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 |
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.
|
|
|
|