标签:
一、查看
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) "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;
TABLESPACE_NAME | sum MB | used MB | free MB | used% |
SEC_D | 32767 | 32760 | 7 | 99.97 |
二、增加
查看使用率,没满则:
①查看是否自动扩容
select tablespace_name,file_name,autoextensible from dba_data_files where tablespace_name = ‘SEC_D‘
TABLESPACE_NAME | FILE_NAME | AUT |
SEC_D | C:\orcl\sec_d01.dbf | NO |
②没有,则修改为自动
alter database datafile ‘C:\orcl\sec_d01.dbf‘ autoextend on
满了,则:
①增加一个
ALTER TABLESPACE SEC_D ADD DATAFILE ‘C:\orcl\sec_d02.dbf‘ SIZE 32767M;//最大32G
标签:
原文地址:http://www.cnblogs.com/margin-gu/p/5053395.html