【Oracle】Check size of datafiles and tempfile tablespaces used in CDB and PDB

 

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- WX:DBAJOE399 --<br>set line 200 pages 999
column name for a10
column tablespace_name for a15
column "MAXSIZE (GB)" format 9,999,990.00
column "ALLOC (GB)" format 9,999,990.00
column "USED (GB)" format 9,999,990.00
select a.con_id,c.name,b.tablespace_name,a.bytes_alloc/power(2,30) "MAXSIZE (GB)",nvl(a.physical_bytes,0)/power(2,30) "ALLOC (GB)" ,nvl(b.tot_used,0)/power(2,30) "USED (GB)"
from
(select con_id,tablespace_name, sum(bytes) physical_bytes,sum(decode(autoextensible,'NO',bytes,'YES',maxbytes)) bytes_alloc
from cdb_data_files group by con_id,tablespace_name ) a,
(select con_id,tablespace_name, sum(bytes) tot_used from cdb_segments group by con_id,tablespace_name ) b,
(select name,con_id from v$containers) c
where a.con_id= b.con_id and a.con_id = c.con_id and a.tablespace_name = b.tablespace_name (+)
order by 1,3;<br><br>-- outputCON_ID NAME     TABLESPACE_NAME MAXSIZE (GB) ALLOC (GB) USED (GB)
------ -------- --------------- ------------ ---------- ---------
     1 CDB$ROOT SYSAUX             32,767.98     510.00    479.00
     1 CDB$ROOT SYSTEM             32,767.98     840.00    829.88
     1 CDB$ROOT UNDOTBS1           32,767.98      60.00      9.06
     3 XEPDB1   SYSAUX             32,767.98     410.00    383.31
     3 XEPDB1   SYSTEM             32,767.98     260.00    255.94
     3 XEPDB1   UNDOTBS1           32,767.98     100.00      0.00
     4 PDB2     SYSAUX             32,767.98     410.00    383.44
     4 PDB2     SYSTEM             32,767.98      260.00   255.94
     4 PDB2     UNDOTBS1           32,767.98      100.00     0.00<br><br>

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- WX:DBAJOE399 --set line 200 pages 999
column name for a10
column tablespace_name for a26
column "MAXSIZE (GB)" format 9,999,990.00
column "ALLOC (GB)" format 9,999,990.00
select a.con_id,c.name,a.tablespace_name,a.bytes_alloc/power(2,30) "MAXSIZE (GB)",nvl(a.physical_bytes,0)/power(2,30) "ALLOC (GB)"
from
(select con_id,tablespace_name, sum(bytes) physical_bytes,sum(decode(autoextensible,'NO',bytes,'YES',maxbytes)) bytes_alloc
from cdb_temp_files group by con_id,tablespace_name ) a,
(select name,con_id from v$containers) c
where a.con_id = c.con_id
order by 1,3;<br><br>--outputCON_ID NAME     TABLESPACE_NAME MAXSIZE (GB) ALLOC (GB)
------ -------- --------------- ------------ ----------
     1 CDB$ROOT TEMP               32,767.98     131.00
     3 XEPDB1   TEMP               32,767.98     129.00
     4 PDB2     TEMP               32,767.98     129.00<br><br>

  

 

posted @   DBAGPT  阅读(12)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· .NET Core 中如何实现缓存的预热?
· 三行代码完成国际化适配,妙~啊~
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
点击右上角即可分享
微信分享提示