question

OracleApprender avatar image
OracleApprender asked

How do we resize a data file?

How to change the size of a existing datafile to a new size. I really appreciate if you can provide a syntax for this. And also I want to know that what will happen if we give less size to the existing file size in this resize?

queryoracletable
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Andrew Mobbs avatar image
Andrew Mobbs answered
ALTER DATABASE DATAFILE '<filename>' RESIZE <size>;
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Its working perfectly.
0 Likes 0 ·
OracleApprender avatar image
OracleApprender answered

Andrew Mobbs answer for this question is correct and its working for me.

10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Leigh Riffel avatar image
Leigh Riffel answered

You can find the syntax in the documentation (11.2 syntax). As for shrinking the size, here is what the documentation linked to says:

It is not always possible to decrease the size of a file to a specific value. It could be that the file contains data beyond the specified decreased size, in which case the database will return an error.

10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.