Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: TABLESPACE ALERT
Hi Seema,
I've a weekly job that informs me "List Of Tablespaces With Next Extent > Largest Free Extent". This list helps me to identify the list of tablespaces that need to be extended due to lack of space (This script will take into considerations the autoextend indicator). If this is what you were looking for, below is the sql statement. I am using Oracle 8.1.6.
Hope it helps.
Regds,
New Bee
REM
REM NAME : fail_ext_segment.sql REM FUNCTION : To identify segments that will fail to acquire REM their next extent. REM HISTORY : REM DATE WHO WHAT REM ---- --- ---- REM 07-Nov-2001 CHORLING CREATIONREM connect / as sysdba
SET PAGESIZE 60
SET LINESIZE 132
SET FEEDBACK OFF
SET VERIFY OFF
SET ECHO OFF
SET HEADING OFF
SELECT 'Database : '||NAME||' Time : '|| TO_CHAR(SYSDATE, 'DD-MON-YY HH24:MI:SS')FROM V$DATABASE; SELECT 'Report : List Of Segments With Next Extent > Largest Free Extent'
COLUMN NEXT_EXTENT_BYTES FORMAT 999,999,999 COLUMN AUTO_EXTEND_TABLESPACE FORMAT A7 COLUMN NEXT_EXTENT_BYTES HEADING "Next|Extent|Bytes"COLUMN MAX_FREE_BYTES HEADING "Largest|Free|Extent" COLUMN TABLESPACE_NAME HEADING "Tablespace|Name" COLUMN AUTO_EXTEND_TABLESPACE HEADING "Auto|Extend"
BREAK ON OWNER SKIP 1
SELECT
T.OWNER,T.SEGMENT_NAME,T.SEGMENT_TYPE,F.TABLESPACE_NAME,T.NEXT_EXTENT_BYTES,
T.Extents_alloc,F.MAX_FREE_BYTES,DF.AUTO Auto_Extend_Tablespace
FROM (SELECT
OWNER,SEGMENT_NAME,SEGMENT_TYPE,TABLESPACE_NAME,MAX(NEXT_EXTENT)
NEXT_EXTENT_BYTES,
SUM(EXTENTS) Extents_alloc FROM DBA_SEGMENTS GROUP BY OWNER,SEGMENT_NAME,SEGMENT_TYPE,TABLESPACE_NAME) T,GROUP BY TABLESPACE_NAME) DF
(SELECT TABLESPACE_NAME,MAX(BYTES) MAX_FREE_BYTES FROM DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME) F,
(SELECT TABLESPACE_NAME,MAX(AUTOEXTENSIBLE) AUTO FROM DBA_DATA_FILES
AND F.MAX_FREE_BYTES <= T.NEXT_EXTENT_BYTES AND DF.TABLESPACE_NAME=T.TABLESPACE_NAME AND DF.AUTO='NO'
FROM DBA_DATA_FILES WHERE AUTOEXTENSIBLE='YES') F,
(SELECT
SUM(EXTENTS) Extents_alloc FROM DBA_SEGMENTS GROUP BY
-----Original Message----- From: Seema Singh [mailto:oracledbam_at_hotmail.com] Sent: Wednesday, January 09, 2002 8:00 AM To: Multiple recipients of list ORACLE-L Subject: TABLESPACE ALERT Hi I want to set alert information whenever a tablespaces reach close to full or some particular space is free. If some one have any scripts please send me. Thanks -Seema _________________________________________________________________ Send and receive Hotmail on your mobile device:http://mobile.msn.com
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Seema Singh INET: oracledbam_at_hotmail.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (likesubscribing).
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: CHAN Chor Ling Catherine (CSC) INET: clchan_at_nie.edu.sg Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Tue Jan 08 2002 - 19:37:54 CST