[转]一些有用的语句

转自网络,但是地址忘记了.抱歉.

1.查看数据文件的大小,以M为单位
select tablespace_name,(bytes/1024/1024) M from dba_data_files;

2.查看system表空间中非相关user存储table/index情况:
 select *  from dba_segments where owner not in ('MGMT_VIEW ','SYS','SYSTEM','OUTLN')
  and tablespace_name = 'SYSTEM'

select   username,default_tablespace,temporary_tablespace   from   dba_users
where   (default_tablespace='SYSTEM'   or   temporary_tablespace='SYSTEM')   and   username   not   in   ('SYSTEM','SYS');

select * from dba_tables where tablespace_NAME ='SYSTEM' AND OWNER NOT IN ('SYS','SYSTEM');

select * from dba_indexes where tablespace_NAME ='SYSTEM' AND OWNER NOT IN ('SYS','SYSTEM');

3.tablespaces 和   dba_free_space
select * from  dba_tablespaces;

select * from  dba_free_space

 

请使用浏览器的分享功能分享到微信等