1、2018.07.11扩展过一次:由16G扩展为20G
ALTER DATABASE DATAFILE '/oracle/SRP/sapdata2/sr3_1/sr3.data1' AUTOEXTEND ON NEXT 50M MAXSIZE 21474836480;
ALTER DATABASE DATAFILE '/oracle/SRP/sapdata2/sr3_2/sr3.data2' AUTOEXTEND ON NEXT 50M MAXSIZE 21474836480;
ALTER DATABASE DATAFILE '/oracle/SRP/sapdata2/sr3_3/sr3.data3' AUTOEXTEND ON NEXT 50M MAXSIZE 21474836480;
2、2019.08.30 扩展过一次:由20G扩展为30G,下一次需要进行数据文件的扩容了,一个数据文件最大32G
ALTER DATABASE DATAFILE '/oracle/SRP/sapdata2/sr3_1/sr3.data1' AUTOEXTEND ON NEXT 50M MAXSIZE 32212254720;
ALTER DATABASE DATAFILE '/oracle/SRP/sapdata2/sr3_2/sr3.data2' AUTOEXTEND ON NEXT 50M MAXSIZE 32212254720;
ALTER DATABASE DATAFILE '/oracle/SRP/sapdata2/sr3_3/sr3.data3' AUTOEXTEND ON NEXT 50M MAXSIZE 32212254720;
SELECT UPPER(F.TABLESPACE_NAME) "表空间名",
D.TOT_GROOTTE_MB "表空间大小(M)",
D.TOT_GROOTTE_MB - F.TOTAL_BYTES "已使用空间(M)",
TO_CHAR(ROUND((D.TOT_GROOTTE_MB - F.TOTAL_BYTES) / D.TOT_GROOTTE_MB * 100,2),'990.99') "使用比",
F.TOTAL_BYTES "空闲空间(M)",
F.MAX_BYTES "最大块(M)"
FROM (SELECT TABLESPACE_NAME,
ROUND(SUM(BYTES) / (1024 * 1024), 2) TOTAL_BYTES,
ROUND(MAX(BYTES) / (1024 * 1024), 2) MAX_BYTES
FROM SYS.DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME) F,
(SELECT DD.TABLESPACE_NAME,
ROUND(SUM(DD.BYTES) / (1024 * 1024), 2) TOT_GROOTTE_MB
FROM SYS.DBA_DATA_FILES DD
GROUP BY DD.TABLESPACE_NAME) D
WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME
ORDER BY 4 DESC;
SELECT T.TABLESPACE_NAME,D.FILE_NAME,
D.AUTOEXTENSIBLE,D.BYTES,D.MAXBYTES,D.STATUS
FROM DBA_TABLESPACES T,DBA_DATA_FILES D
WHERE T.TABLESPACE_NAME =D.TABLESPACE_NAME
ORDER BY TABLESPACE_NAME,FILE_NAME;
select
b.file_name 物理文件名,
b.tablespace_name 表空间,
b.bytes/1024/1024 大小M,
(b.bytes-sum(nvl(a.bytes,0)))/1024/1024 已使用M,
substr((b.bytes-sum(nvl(a.bytes,0)))/(b.bytes)*100,1,5) 利用率
from dba_free_space a,dba_data_files b
where a.file_id=b.file_id
group by b.tablespace_name,b.file_name,b.bytes
order by b.tablespace_name;
扩展文件
ALTER DATABASE DATAFILE '/oracle/SRP/sapdata2/sr3_1/sr3.data1' AUTOEXTEND ON NEXT 50M MAXSIZE 16106127360;
ALTER DATABASE DATAFILE '/oracle/SRP/sapdata2/sr3_2/sr3.data2' AUTOEXTEND ON NEXT 50M MAXSIZE 16106127360;
ALTER DATABASE DATAFILE '/oracle/SRP/sapdata2/sr3_3/sr3.data3' AUTOEXTEND ON NEXT 50M MAXSIZE 16106127360;
ALTER DATABASE DATAFILE '/oracle/SRP/sapdata2/sr3_1/sr3.data1' AUTOEXTEND ON NEXT 50M MAXSIZE 32212254720;
ALTER DATABASE DATAFILE '/oracle/SRP/sapdata2/sr3_2/sr3.data2' AUTOEXTEND ON NEXT 50M MAXSIZE 32212254720;
ALTER DATABASE DATAFILE '/oracle/SRP/sapdata2/sr3_3/sr3.data3' AUTOEXTEND ON NEXT 50M MAXSIZE 32212254720;
--扩容SRD,手动指定当前库容大小,
(1)扩容数据文件大小ALTER DATABASE DATAFILE '/oracle/SRP/sapdata2/sr3_3/sr3.data3' resize 12288M
(2)自动扩展,并指定最大ALTER DATABASE DATAFILE '/oracle/SRP/sapdata2/sr3_3/sr3.data3' AUTOEXTEND ON NEXT 1024M MAXSIZE 15360M;
扩展后
文章评论