1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| --查看所有表空间大小
select a.tablespace_name,a.bytes/1024/1024 "Sum MB",(a.bytes-b.bytes)/1024/1024 "used MB",b.bytes/1024/1024 "free MB",round(((a.bytes-b.bytes)/a.bytes)*100,2) "percent_used"
from
(select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a,
(select tablespace_name,sum(bytes) bytes,max(bytes) largest from dba_free_space group by tablespace_name) b
where a.tablespace_name=b.tablespace_name
order by ((a.bytes-b.bytes)/a.bytes) desc;
select file_id,file_name from dba_data_files where tablespace_name='SYSAUX';
SELECT tablespace_name, SUM(bytes)/1024/1024 AS total_space_mb, SUM(maxbytes)/1024/1024 AS max_space_mb FROM dba_data_files GROUP BY tablespace_name;
SELECT file_id, file_name, bytes/1024/1024 AS size_mb FROM dba_data_files WHERE tablespace_name = 'SYSAUX';
-- ALTER DATABASE DATAFILE '/opt/oracle/oradata/XE/XEPDB1/sysaux01.dbf' RESIZE 5000M;
ALTER TABLESPACE SYSAUX ADD DATAFILE '/u01/app/oracle/oradata/XE/XEPDB1/sysaux02.dbf' SIZE 32000M AUTOEXTEND ON NEXT 300M;
|