How to Shrink table after deleting bulk records to reclaim space in Tablespace.
Step 1
Enable row movement using below comand as Scott user
SQL> show user
Scott
SQL> Alter table test enable row movement;
SQL> Alter table test shrink space;
Step 2
We have to gather the stats to reflect the auctual space released.
SQL> exec dbms_stats.gather_table_stats ownname=>'SCOTT',tabname=>'TEST',estimate_percent=>100);
Now you can check the status of data files. Space has been releaseed.
Step 1
Enable row movement using below comand as Scott user
SQL> show user
Scott
SQL> Alter table test enable row movement;
SQL> Alter table test shrink space;
Step 2
We have to gather the stats to reflect the auctual space released.
SQL> exec dbms_stats.gather_table_stats ownname=>'SCOTT',tabname=>'TEST',estimate_percent=>100);
Now you can check the status of data files. Space has been releaseed.
No comments:
Post a Comment