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’;)

screenshot1

(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;)

screenshot2

(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’;)

screenshot3

(Success)

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

(RMAN> switch datafile 10 to copy;)

screenshot4

(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. :)




You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “How to move a datafile as Oracle Managed File (OMF) before and after”

  1. ojas Says:

    Thank you very…we faced the same issue and referred your provided doc as we were not able to move the datafile from file system to OMF ASM..

    backup to copy datafile 10 to destination…

    Thank you very much again.

Leave a Reply