Home » RDBMS Server » Server Administration » Power Shell script to send alert (Oracle 19)
Power Shell script to send alert [message #689188] Wed, 04 October 2023 12:21 Go to next message
m.abdulhaq
Messages: 254
Registered: April 2013
Location: Ajman
Senior Member
Wondering if there is a way to create powershell script to send email alerts when tablespace is getting full or reaches 90% of threshold.
Re: Power Shell script to send alert [message #689189 is a reply to message #689188] Wed, 04 October 2023 13:22 Go to previous messageGo to next message
John Watson
Messages: 8916
Registered: January 2010
Location: Global Village
Senior Member
All Oracle databases have a pre-configured alert on tablespace usage: a warning at 85%, a critical warning at 97%. You'll see this in dba_tablespace_thresholds. Your shell script needs to dequeue the alerts from sys.alert_que (or just query dba_outstanding_alerts) and take appropriate action.
Re: Power Shell script to send alert [message #689190 is a reply to message #689188] Wed, 04 October 2023 13:31 Go to previous message
Michel Cadot
Messages: 68597
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

The part "powershell script to send email alerts" is not an Oracle question.

It is easy to create a SQL script which outputs, for instance, tablespace_name + %used space for tablespaces that exceed your threshold (see DBA_DATA_FILES), to call it with SQL*Plus and in your shell script take this output and do what you want.

Note an issue with auto-extendible files: do you want the percentage out of the current size or the possible max size?

Previous Topic: LogMiner - select for update
Next Topic: ORA-00445: background process "J001" did not start after 30 seconds
Goto Forum:
  


Current Time: Thu Feb 29 00:18:55 CST 2024