Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reducing a Datafile size

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I think this might be a peculiar question.
If i reduce the size of a datafile which is already attached to a tablespace,
what happens exactly?
Example:
I have tablespace TS01, with file ts01.dbf size
2 gb. After some time, i found out that i dont need this much big file, i would like reduce it to
1 gb. Ofcourse there are db objects in the tablespace. When i reduce the file size, how is it going to affect the existing objects.

Thanks in advance.
Srini Adepu


 
It shouldn't affect them at all.
If Oracle can find free space to deallocate, it will.
If Oracle can't find free space to deallocate (due to the existence of objects), you'll receive an error message (which is probably what will happen if your tablespace is fragmented). If this happens, you might try using progressively smaller shrinkages until you finally get the command run successfully. Or better yet, rebuild all of your objects in another tablespace, shrink your 2G tablespace to 1G, and then rebuild all of your objects back in the original tablespace.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top