Last active
December 25, 2015 05:19
-
-
Save davidhooey/6923363 to your computer and use it in GitHub Desktop.
Oracle Segment Shrink
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ROW MOVEMENT is required to move rows. | |
-- SHRINK SPACE COMPACT moves the rows without resetting the high water mark. | |
-- SHRINK SPACE moves the rows and resets the high water mark which temporarily locks the table. | |
-- May need to rebuild the indexes after a shrink. | |
alter table [tableName] enable row movement; | |
alter table [tableName] shrink space compact; | |
alter table [tableName] shrink space; | |
alter index [indexName] shrink space compact; | |
alter index [indexName] shrink space; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment