any script where i can create a batch job to run via windows task scheduler
i am able to get a script when the tablespace is full but wanted that output to trigger an email to a specific address any suggestions please
below is the script which i have mentioned above
SET ECHO OFF; SET TERM OFF; SET TIMING OFF; SET HEAD OFF; SET FEED OFF; CREATE TABLE temp_ts(tablespace_name,total_bytes,free_bytes,max_chunk) AS SELECT tablespace_name, NVL(SUM(bytes), 1), 1, 1 FROM dba_data_files GROUP BY tablespace_name; UPDATE temp_ts a SET a.free_bytes = (SELECT NVL(SUM(b.bytes), 1) FROM dba_free_space b WHERE b.tablespace_name = a.tablespace_name); COMMIT; UPDATE temp_ts a SET a.max_chunk = (SELECT NVL(MAX(b.bytes), 1) FROM dba_free_space b WHERE b.tablespace_name = a.tablespace_name); COMMIT; REM ************************ REM Display tablespaces more than 95% full. SELECT tablespace_name || ' is ' || TO_CHAR(ROUND(100-(free_bytes*100/total_bytes), 2)) || '% full.' Tablename FROM temp_ts WHERE 95 < 100-(free_bytes*100/total_bytes) ORDER BY tablespace_name;
the output will be the tablespacename along with the percentage
now i want that output to trigger an email if it is crossing the more than 95%
any suggestions ??
Source: Windows Questions