
1. 查看所有表
空间大小 SQL>select tablespace_name,sum(bytes)/1024/1024 from dba_data_files 2 group by tablespace_name2. 已经使用的表空间大小 SQL>select tablespace_name,sum(bytes)/1024/1024 from dba_free_space 2 group by tablespace_name3. 所以使用空间可以这样计算 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_name4. 下面这条语句查看所有segment的大小。 Select Segment_Name,Sum(bytes)/1024/1024 From User_Extents Group By Segment_Name 5. 还有在命令行情况下如何将结果放到一个文件里。 SQL>spool out.txt SQL>select * from v$databaseSQL>spool off
可用如下语句查看:
select round(BYTES/1024/1024,2)||'M' from user_segments where segment_name='表名'
注意:表名需要用英文大写。
如要查询数据库中emp表的大小,用如下语句:
select round(BYTES/1024/1024,2)||'M' from user_segments where segment_name='EMP'
查询结果:
查询结果代表EMP表所占空间大小为0.06M。
1.查看Oracle数据库中表空间信息的
工具方法: 使用oracle enterprise manager console工具,这是oracle的客户端工具,当安装oracle服务器或客户端时会自动安装此工具,在...
2.查看Oracle数据库中表空间信息的命令方法: 通过查询数据库系统中的数据字典表(data dictionary tables)获取表空间的相关信息,首先使用客户端工具连接到数据库,这些工具可以是SQL..
评论列表(0条)