--查看表空间文件及大小 select tablespace_name "表空间名", file_name "文件名称", round(bytes / (1024 * 1024), 0) "表空间大小(m)" from dba_data_files order by tablespace_name, file_name;数据库
--查看表空间使用状况oracle
select a.tablespace_name "表空间名",app
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) freespa
from dba_free_space group by tablespace_name) a, (select tablespace_name, sum(bytes) total from dba_data_files group by tablespace_name) b
where a.tablespace_name = b.tablespace_name;code
--修改表空间为自增加 alter database datafile 'd:\oracle\product\10.2.0\oradata\edwtest\app03.dbf' autoextend on next 5m maxsize 100m;table
--增长表空间文件 alter tablespace users add datafile 'e:\oracle\product\10.2.0\oradata\orcl\users03.dbf' size 10240m;test
alter tablespace users add datafile 'e:\oracle\product\10.2.0\oradata\orcl\users03.dbf' size 10240m autoextend on next 64m maxsize 512m;file
--改变数据库文件大小 alter database datafile 'e:\oracle\product\10.2.0\oradata\orcl\users02.dbf' resize 10240m;select