SQL NOTE
SQL NOTE
tablespace_name,
ROUND((bytes_used / bytes_total) * 100, 2) AS "Utilization (%)",
ROUND(bytes_used / 1024 / 1024, 2) AS "Used (MB)",
ROUND(bytes_total / 1024 / 1024, 2) AS "Total (MB)"
FROM (
SELECT
tablespace_name,
SUM(bytes_used) AS bytes_used,
SUM(bytes_total) AS bytes_total
FROM (
SELECT
tablespace_name,
DECODE(autoextensible, 'YES', bytes_max, bytes) AS bytes_total,
bytes_used
FROM (
SELECT
tablespace_name,
bytes,
CASE WHEN autoextensible = 'YES' THEN maxbytes ELSE bytes END AS
bytes_max,
SUM(bytes_cached) AS bytes_used
FROM
v$tempseg_usage
GROUP BY
tablespace_name, bytes, maxbytes, autoextensible
)
)
GROUP BY
tablespace_name
);
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.