shrink必须开启行迁移功能. alter table table_name enable row movement ; 在oracle中可以使用alter table table_name shrink space收缩表,使用shrink有两个前提条件: 1.表必须启用row movement 2.表段所在表空间的段空间管理(segment space management)必须为auto -shrink不能在segment space management manaual的表空间的段上执行
一.开启表的行迁移 alter table table_name enable row movement; select 'alter table '||s.owner||'.'||s.table_name||' enable row movement;' from dba_tables s where s.OWNER in ('ISMP'); 二.开始shrink表与索引 alter table table_name shrink space cascade; select 'alter t
CPU: select * from (select v.sql_id, v.child_number, v.sql_text, v.elapsed_time, v.cpu_time, v.disk_reads, rank() over(order by v.cpu_time desc) elapsed_rank from v$sql v) a where elapsed_rank 5 --100 0000微秒=1S AND S.PARSING_SCHEMA_NAME = USER AND TO
一.查询表大小,块多少语句 Select SEGMENT_Name,BYTES,BLOCKS,Extents From dba_segments Where segment_name In('BAI_NEW_SESSION_HISTORY2') order by segment_name; (2)查表空间 Select Tablespace_Name, Sum(bytes)/1024/1024 From Dba_Segments group By Tablespace_Name (3)可以用输入