怎么查看ORACLE数据库剩余空间?

发布于2022-01-13 04:26:55
4个回答
admin
网友回答2022-01-13
1. 查看所有表空间大小
SQL select tablespace_name,sum(bytes)/1024/1024 || 'M' from dba_data_files
group by tablespace_name;
2. 已经使用的表空间大小
SQL select tablespace_name,sum(bytes)/1024/1024 || 'M'
from dba_free_space
group by tablespace_name;
3. 所以使用空间可以这样计算
select a.tablespace_name,total,free,total-free used from
( select tablespace_name,sum(bytes)/1024/1024 || 'M'
total from dba_data_files
group by tablespace_name) a,
( select tablespace_name,sum(bytes)/1024/1024|| 'M' free from dba_free_space
group by tablespace_name) b
where a.tablespace_name=b.tablespace_name;

4. 下面这条语句查看所有segment的大小。
Select Segment_Name,Sum(bytes)/1024/1024 From User_Extents Group By Segment_Name
5. 还有在命令行情况下如何将结果放到一个文件里。
SQL spool out.txt
SQL select * from v$database;
SQL spool off
admin
网友回答2022-01-13
SQL select userenv('language') from dual; USERENV('LANGUAGE')----------------------------------------------------SIMPLIFIED CHINESE_CHINA.AL32UTF8
admin
网友回答2022-01-13
语句如下:
select serial#, sid from v$session;
alter system kill session 'serial#, sid ';

事先要确保有足够的权限。
admin
网友回答2022-01-13
select serial#, sid from v$session;
alter system kill ...;

回到
顶部