http://blog.csdn.net/starnight_cbj/article/details/6792364-表空间更多内容
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
SELECT a.tablespace_name "表空间名",
total "表空间大小",
free "表空间剩余大小",
(total - free) "表空间使用大小",
total / (1024 * 1024 * 1024) "表空间大小(G)",
free / (1024 * 1024 * 1024) "表空间剩余大小(G)",
(total - free) / (1024 * 1024 * 1024) "表空间使用大小(G)",
round((total - free) / total, 4) * 100 "使用率 %"
FROM (SELECT tablespace_name, SUM(bytes) free
FROM dba_free_space
GROUP BY tablespace_name) a,
(SELECT tablespace_name, SUM(bytes) total
FROM dba_data_files
GROUP BY tablespace_name) b
查看SYSTEM这个表空间是否自动增长。。
SELECT file_id, file_name, tablespace_name, autoextensible, increment_by
FROM dba_data_files
WHERE tablespace_name = 'SYSTEM'
order by file_id desc;
扩展表空间
新增加文件
alter tablespace SYSTEM
add datafile '/usr/kingdee/oradata/smsdb/users03.dbf'
size 500M
autoextend on;
扩展已经有的文件
alter database datafile '/usr/kingdee/oradata/smsdb/users03.dbf' resize 100000M
设置表空间自动增长
alter database datafile '/u01/oradata/FOSSDB/datafile/o2_mf_bse_data_blh6ov4m_.dbf' autoextend on;
本文转自aaa超超aaa 51CTO博客,原文链接:http://blog.51cto.com/10983441/1732127