Thursday 23 May 2013

HOW TO SHRINK A TABLE IN ORACLE

--------------- How to create table to another table reference

create table test121 as select * from fnd_user;


select count(1) from test121;

select * from test121;
------------------Insert data to anoter table reference:


insert into test121  select * from fnd_user;

------------------Check the table size

select segment_name,bytes/1024/1024 as mb from user_segments where segment_name='TEST121';


delete from test121;


alter table test121 enable row movement;


 alter table test121 shrink space;


select segment_name,bytes/1024/1024 as mb from user_segments


------ take table backup

create table test_bak as select * from test1

No comments:

Post a Comment