首页 > 数据库 > Oracle > oracle查看索引、表空间
1.检察表空间运用景象:
select
sum(bytes)/(1024*1024) as free_space,tablespace_name
group by tablespace_name;
SELECT
A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME AND A.TABLESPACE_NAME=C.TABLESPACE_NAME;
2、检察数据库库对象
select owner,
object_type, status, count(*) count# from all_objects group by
owner, object_type, status;
3、检察数据库的版本
Select
version FROM Product_component_version
4、检察数据库建坐日期战归档体例
Select
Created, Log_Mode, Log_Mode From V$Database;
5、查询数据库中索引占用表空间的大小
select
a.segment_name,a.tablespace_name,b.table_name,a.bytes/1024/1024
mbytes,a.blocks
from
user_segments a, user_indexes b
where
a.segment_name = b.index_name
and a.segment_type = "INDEX" --索引
and a.tablespace_name="APPINDEX" --表空间
and b.table_name like "%PREP%" --索引地点表
order by
table_name,a.bytes/1024/1024 desc
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23575788/viewspace-1115981/ ,如需转载,请注明出处,否则将追究法律责任。