Размер и свободное место табличных пространств
SELECT a.tablespace_name, "Free, MB", "Total, MB" FROM
(SELECT tablespace_name, ROUND(SUM(bytes)/1024/1024) AS "Total, MB" FROM dba_data_files GROUP BY tablespace_name
UNION
SELECT tablespace_name, ROUND(SUM(bytes)/1024/1024) AS "Total, MB" FROM dba_temp_files GROUP BY tablespace_name) a,
(SELECT tablespace_name, ROUND(SUM(bytes)/1024/1024) AS "Free, MB" FROM dba_free_space GROUP BY tablespace_name) b
WHERE a.tablespace_name = b.tablespace_name (+)
ORDER BY a.tablespace_name;
TABLESPACE_NAME |
|
Free, MB |
|
Total, MB |
SYSAUX |
|
56 |
|
820 |
SYSTEM |
|
1 |
|
750 |
TEMP |
|
|
|
54 |
UNDOTBS1 |
|
39 |
|
75 |
USERS |
|
4 |
|
5 |
Размер и свободное место временных табличных пространств
SELECT a.tablespace_name, total_bytes/1024/1024 AS "Total, MB", used_mbytes AS "Used, MB", (total_bytes/1024/1024 - used_mbytes) AS "Free, MB" FROM (SELECT tablespace_name, SUM(bytes_used + bytes_free) AS total_bytes FROM v$temp_space_header GROUP BY tablespace_name) a, (SELECT tablespace_name, used_blocks*8/1024 AS used_mbytes FROM v$sort_segment) b WHERE a.tablespace_name=b.tablespace_name;
TABLESPACE_NAME |
|
Free, MB |
|
Used, MB |
Total, MB |
TEMP |
|
2100 |
|
900 |
3000 |