{"name":"Temp Tablespace Allocated (MB) \u2013 TEMP","description":"Tracks the total allocated size of a temp tablespace's files so you can alert when growth exceeds a size you choose (\"X\"). Once allocated, temp files do not automatically shrink, so expect the value to stay at its high-water mark until the temp file is resized or recreated. Create one instance of this metric per temporary tablespace (there can be more than one), substituting the tablespace name in the WHERE clause.","tsql":"-- Returns total allocated temp file size in MB (detects autoextend growth)\r\n-- Replace TEMP with your temporary tablespace name; one row is returned per container that has it\r\nSELECT f.con_id,\r\n       ROUND(SUM(f.bytes) \/ 1024 \/ 1024, 2) AS metric_value,\r\n       f.tablespace_name || ' ' || ROUND(SUM(f.bytes) \/ 1024 \/ 1024) || ' MB allocated of '\r\n           || ROUND(SUM(CASE WHEN f.autoextensible = 'YES' THEN f.maxbytes ELSE f.bytes END) \/ 1024 \/ 1024)\r\n           || ' MB max' AS alert_detail_text\r\n  FROM cdb_temp_files f\r\n WHERE f.tablespace_name = 'TEMP'\r\n GROUP BY f.con_id, f.tablespace_name","instances":true,"frequency":300,"frequency_comment":"seconds (collected every 5 minutes)","rateofchange":false,"metricenabled":true,"alertname":"Temp tablespace growth \u2013 TEMP","alertdescription":"The total allocated temp file size for this tablespace has exceeded X, where X is the size at which you want to be warned (for example, 1.5x the temp tablespace's normal steady-state size).","aboveorbelow":"above","thresholds_comment":"Note: These thresholds are intended as guideline values. If they seem too high or too low for your environment, replace them with values more suited to your server performance.","_thresholds_high":{"selected":true,"value":10240},"collections":2,"alertenabled":true,"databases":{"mode":1},"_thresholds_medium":{"selected":false},"_thresholds_low":{"selected":false},"targetentitytype":2}