Purpose
This statement rewrites the data of a table.
Syntax
ALTER TABLE table_name SHRINK SPACE
Parameters
| Parameter | Description |
|---|---|
| table_name | the name of the table. |
Examples
Create the
employeetable and insert data into it.obclient> CREATE TABLE employee (id NUMBER, name VARCHAR2(50)); obclient> INSERT INTO employee VALUES (1, 'John'); obclient> INSERT INTO employee VALUES (2, 'Mary');Rewrite the data of the
employeetable.obclient> ALTER TABLE employee SHRINK SPACE;Verify the space-shrinking result.
obclient> SELECT segment_name, bytes/1024/1024 MB FROM user_segments WHERE segment_name = 'EMPLOYEE';
