Martin Klier


How to move a datafile as Oracle Managed File (OMF) before and after

Sometimes, you just have to move your data files away from where they sit. But when you love Oracle Managed Files as I do, you may want to have it being an OMF afterwards as well as before. Doing it the way you would have done it with ASM, fails.

(RMAN> copy datafile 10 to ‘/my/path’;)


(English: File already exists)

Stating the file name explicitly breaks the OMF spirit:

(RMAN> copy datafile 10 to ‘/my/path/O1_MF_USERS_76TDX9GH_.DBF;)


(File already has the name of Oracle managed Files)

So what’s the problem? Using deprecated syntax! Just use “backup as copy”, it gives you the TO DESTINATION keyword:

(RMAN> backup to copy datafile 10 to destination ‘/my/path’;)



Now you can switch the datafile to copy “as usual”:

(RMAN> switch datafile 10 to copy;)


(Datafile switched)

Lesson learned: Don’t become stuck on old syntax just because you know it by heart.

Stay careful
Martin Klier

PS: Windows isn’t my preferred platform by far. But as you can see from the screen shots, the solution works even there. 🙂

Oracle 12c: Change hostname for Grid Infrastructure / Oracle restart
Martin Klier now on twitter

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.