Home » Infrastructure » Unix » Tablespace alert (solaris, Oracle 10g)
Tablespace alert [message #332269] Tue, 08 July 2008 01:22 Go to next message
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 #332277 is a reply to message #332269] Tue, 08 July 2008 01:32 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
How is this an Oracle question?
How is this a performances question?

There are many questions like this.
Hint: use "grep | mail"

Regards
Michel

[Updated on: Tue, 08 July 2008 01:32]

Report message to a moderator

Re: Tablespace alert [message #332300 is a reply to message #332277] Tue, 08 July 2008 02:22 Go to previous messageGo to next message
balaji1482
Messages: 312
Registered: July 2007
Location: INDIA
Senior Member

i want the answer please.
Re: Tablespace alert [message #332303 is a reply to message #332300] Tue, 08 July 2008 02:40 Go to previous messageGo to next message
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 #332495 is a reply to message #332300] Tue, 08 July 2008 13:02 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Just another hint.
Search the forum.
This is been answered many times with all kinds of scripting. Smile
Re: Tablespace alert [message #333206 is a reply to message #332269] Thu, 10 July 2008 17:26 Go to previous messageGo to next message
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.

Re: Tablespace alert [message #337179 is a reply to message #333206] Wed, 30 July 2008 02:02 Go to previous message
balaji1482
Messages: 312
Registered: July 2007
Location: INDIA
Senior Member

Thanks for your information .
Previous Topic: oracle 10g installation on unix
Next Topic: problem connecting to oracle 10g after NCR node reboot
Goto Forum:
  


Current Time: Mon Dec 02 18:49:00 CST 2024