Database Reference
In-Depth Information
EMPLOYEES_HIST_IX 16
SQL> ALTER TABLE HR.EMPLOYEES_HIST SHRINK SPACE;
Table altered.
SQL> SELECT SEGMENT_NAME, BLOCKS FROM DBA_SEGMENTS
WHERE OWNER = 'HR' and SEGMENT_NAME LIKE 'EMPL%';
SEGMENT_NAME BLOCKS
------------------------- ----------
EMPLOYEES 8
EMPLOYEES_HIST 16
EMPLOYEES_HIST_IX 16
SQL> ALTER TABLE HR.EMPLOYEES_HIST SHRINK SPACE CASCADE;
Table altered.
SQL> SELECT SEGMENT_NAME, BLOCKS FROM DBA_SEGMENTS
WHERE OWNER = 'HR' and SEGMENT_NAME LIKE 'EMPL%';
SEGMENT_NAME BLOCKS
------------------------- ----------
EMPLOYEES 8
EMPLOYEES_HIST 16
EMPLOYEES_HIST_IX 8
SQL> SELECT COUNT(1) from hr.employees_hist;
COUNT(1)
----------
910
SQL>
Using Enterprise Manager Segment Space Advisor to Perform an
Online Segment Shrink Operation
After repopulating and deleting from the test table HR.EMPLOYEES_HIST , you want to use
EM to shrink the segment.
1. From the Enterprise Manager database home page, select the Performance menu 
Advisors Home  Segment Advisor.
2. From the Segment Advisor: Scope page, shown in Figure 10.12, choose Schema Objects
and then click Next.
Search WWH ::




Custom Search