Home  >  Article  >  Database  >  分区表

分区表

WBOY
WBOYOriginal
2016-06-07 16:06:311163browse

--删除分区 truncate table partition declare day number; begin day := 20110901; loop execute immediate 'alter table lbidw.TB_DW_MGR_01_DAY truncate partition DATA_' || day; day := day 1; exit when day 20110915; end loop; end; --分区大小 SEL

--删除分区 truncate table partition
declare day number;
begin
day := 20110901;
loop
execute immediate 'alter table lbidw.TB_DW_MGR_01_DAY truncate partition DATA_' || day;
day := day + 1;
exit when day > 20110915;
end loop;
end;

--分区大小
SELECT owner,
DECODE (partition_name,
NULL, segment_name,
segment_name || ':' || partition_name
) NAME,
segment_type, tablespace_name, BYTES/1024/1024 , initial_extent, next_extent,
pct_increase, extents, max_extents
FROM dba_segments t
WHERE 1 = 1 AND extents > 1
and t.segment_name like 'TB_MK%'
ORDER BY 9 DESC,
3
;

--统计分区数
select count(*),owner from dba_tables group by owner;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn