表空间的查询
select tablespace_name,sum(bytes)/1024/1024 from dba_data_files
select f.BYTES/1024/1024, f.* from dba_data_files f
select a.tablespace_name, total, free, total - free used
from (select tablespace_name, sum(bytes) / 1024 / 1024 total
from dba_data_files
group by tablespace_name) a,
(select tablespace_name, sum(bytes) / 1024 / 1024 free
from dba_free_space
group by tablespace_name) b
where a.tablespace_name = b.tablespace_name;
--表空间是否自动扩展
select tablespace_name,file_name,autoextensible from dba_data_files where tablespace_name = 'YUANYT'
表空间不够解决方法:
1、 alter database datafile '全路径的数据文件名称' autoextend on;
2、alter database datafile 'E:ORCLYUANYT.DBF' autoextend on next 50m maxsize UNLIMITED; --无限扩大
3、
alter database datafile 'E:ORCLYUANYT.DBF' resize 34G --文件已经是最大了,再加毫无意义
4、 alter tablespace YUANYT add datafile 'E:ORCLYUANYT20150630.DBF' size 1G;--增加表空间文件