--查看所有表空间大小
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;
--下面这条语句查看所有segment的大小。
select segment_name,sum(bytes)/1024/1024 from user_extents group by segment_name;
--并行无日志建索引
create index lifedata.ix_prem_info_region_code on lifedata.prem_info (region_code) parallel 8 nologging;
--创建完索引之后开始写日志
alter index lifedata.ix_prem_info_region_code logging;
--查看当前用户每个表占用空间的大小:
Select Segment_Name,Sum(bytes)/1024/1024 From User_Extents Group By Segment_Name;
--查看每个表空间占用空间的大小:
Select Tablespace_Name,Sum(bytes)/1024/1024 From Dba_Segments Group By Tablespace_Name;