1. 查看所有表空间大小
select tablespace_name,sum(bytes)/1024/1024 from dba_data_files group by tablespace_name;
select tablespace_name,sum(bytes)/1024/1024 from dba_free_space group by tablespace_name;
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;
4. 下面这条语句查看所有segment的大小。
5. 还有在命令行情况下如何将结果放到一个文件里。
SQL> spool out.txt;
SQL> select * from v$database;
SQL> spool off;
6.扩展表空间
alter database datafile 'E:\oracle\tools\IC_DATA01.DBF' rasize 30720m;alter tablespace SBDATA add datafile 'E:\oracle\tools\IC_DATA04.DBF' size 15G;