top of page

Renaming Data Files with RMAN scripts

I spent some time today arguing with RMAN.

I know, how could that be?

Well without explaining all my delights, here is how you get RMAN to run a script to firstly copy your existing data files to new names, switch across to them, recover and then delete the old files.

For this post, an explanation of each step is missing, but the command set works, aand if you are like me, the example is all we need to make it all work.

I hope is helps strip out some wasted time.

Cheers.

Martin Power

Ace Associate.

run { copy datafile 1 to +DATA/PROD/DATAFILE/SYSTEM_PCS_1.dbf tag move1; copy datafile 3 to +DATA/PROD/DATAFILE/SYSAUX_PCS_3.dbf tag move2; copy datafile 7 to +DATA/PROD/DATAFILE/USERS_PCS_7.dbf tag move3; copy datafile 4 to +DATA/PROD/DATAFILE/UNDOTBS1_PCS_4.dbf tag move4; shutdown immediate; startup mount; switch datafile 1 to datafilecopy tag move1; switch datafile 3 to datafilecopy tag move2; switch datafile 7 to datafilecopy tag move3; switch datafile 4 to datafilecopy tag move4; recover datafile 1; recover datafile 3; recover datafile 7; recover datafile 4; alter database open; delete noprompt copy of datafile 1; delete noprompt copy of datafile 3; delete noprompt copy of datafile 7; delete noprompt copy of datafile 4; }


Featured Posts
Recent Posts
Archive
Search By Tags
No tags yet.
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page