Here is the SQL script from page 886. It tells you the tablespaces that have less than 10% free space. It is a great troubleshooting script. Try running it once per day and emailing the results to yourself. I think you will find this is good way to keep an eye on your tablespace, especially when you don't have a lot of time free. It runs on Oracle database 8, 8i, 9i and 10g.
SELECT
TSP.TABLESPACE_NAME T_NAME,
TSP.TOTAL_SPACE TOT_SPACE,
FREE.TOTAL_FREE,
ROUND(FREE.TOTAL_FREE /TSP.TOTAL_SPACE*100) PCT_FREE,
ROUND((TSP.TOTAL_SPACE - FREE.TOTAL_FREE),2) TOT_USED,
ROUND((TSP.TOTAL_SPACE - FREE.TOTAL_FREE)/TSP.TOTAL_SPACE*100) PCT_USED,
NEXTEXT.MAX_NEXT_EXTENT
FROM
(SELECT
TABLESPACE_NAME,
SUM(BYTES)/1024/1024 TOTAL_SPACE
FROM
DBA_DATA_FILES
GROUP BY TABLESPACE_NAME) TSP,
(SELECT
TABLESPACE_NAME,
ROUND(SUM(BYTES)/1024/1024,2) TOTAL_FREE,
ROUND(MAX(BYTES)/1024/1024,2) MAX_FREE
FROM
DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME) FREE,
(SELECT
TABLESPACE_NAME,
ROUND(MAX(NEXT_EXTENT)/1024/1024,2) MAX_NEXT_EXTENT
FROM DBA_SEGMENTS
GROUP BY TABLESPACE_NAME) NEXTEXT
WHERE
TSP.TABLESPACE_NAME = FREE.TABLESPACE_NAME (+)
AND TSP.TABLESPACE_NAME = NEXTEXT.TABLESPACE_NAME (+)
AND ((ROUND(FREE.TOTAL_FREE/TSP.TOTAL_SPACE*100)) <> FREE.MAX_FREE);
Fortune 500 and the Art of Execution
-
The Fortune 500 Companies 2018 rankings came out last week, and browsing
the list, the following random thoughts struck me about the list and the
technolo...
6 years ago
No comments:
Post a Comment