6

I am trying to migrate my database (11.2.0.4) A to another machine by using rman backup. At present, in the source machine, the redo log file, temp file is stored under the directory foo (/foo). In the target machine, I would like to store these files under the directory bar (/bar). In the past practice, what I did is to create foo for these files and move these files to bar manually after the recovery is complete. RMAN is such a powerful tool that I think there must be some an easy way to satisfy my requirement. So far, by searching the google, I got a useful rman command for temp file:

set newname for tempfile <fileno> to '<path>'

It seems that there is no similar command for redo file. Before using this command to perform a recovery, I have several questions to ask:

  1. When we take an full backup, the backup did not go with temp tablespace and redo files, but in the past migration I experienced, I found that when I open (alter database open resetlogs)the database after recovery is complete, redo log files and temp files exist. Will rman create this automatically for database? I can`t find the reliable oracle documents for this topic.
  2. To change the path for redo is so boring, I would the finish this task in the rman scripts, is there any command available to rename the redo log file in the rman scripts?
1
  • Temp tablespace and online redo logs files will be created on the basis of information available in control file. For each online redo log that is to be created at a different location than it had on the source host, use ALTER DATABASE RENAME FILE commands to specify the path name on the destination host. More...
    – atokpas
    Jan 4, 2017 at 15:14

1 Answer 1

1

You can either use a pfile and set the following in the pfile, or you can use an spfile and do a startup nomount to set the following variables. You can have as many directories as you want the pattern will still be: '','','','','',''...

alter system set db_file_name_convert='/foo/','/bar/' scope=spfile;
alter system set log_file_name_convert='/foo/','/bar/' scope=spfile;

You can also specify the redo on the clone/restore command.

DUPLICATE DATABASE TO mytest BACKUP LOCATION '/mybackup/mytest' 
LOGFILE 
       GROUP 1 ('/mybackup/mytest/redo01a.log',  '/mybackup/mytest/redo01b.log') SIZE 256M REUSE,
       GROUP 2 ('/mybackup/mytest/redo02a.log',  '/mybackup/mytest/redo02b.log') SIZE 256M REUSE,
       GROUP 3 ('/mybackup/mytest/redo03a.log',  '/mybackup/mytest/redo03b.log') SIZE 256M REUSE  
NOFILENAMECHECK;
5
  • db_file_name_convert and log_file_name_convert is for data guard mainly,I did not try these parameters before,what about you ?Does it work when doing rman recovery? Jan 4, 2017 at 14:57
  • I have used the parameters for restore and clone and it works. I also added the part about redo after I initially posted my reply.
    – Gandolf989
    Jan 4, 2017 at 14:58
  • what about the first question? Jan 4, 2017 at 15:05
  • for this post oratin.blogspot.com/2011/02/…, when using RESTORE command to restore a database into new host even if we use the “DB_FILE_NAME_CONVERT” & “LOG_FILE_NAME_CONVERT” parameters to change the file names it will not take effect as we do the restore step by step Jan 4, 2017 at 15:09
  • The convert parameters don't affect the control files. Those are set in the pfile/spfile. So that is not relevant for my answer. Yes, you should set the control file to point to where you want in the pfile/spfile.
    – Gandolf989
    Jan 4, 2017 at 15:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.