What does the RMAN error message RMAN-05001 mean?
RMAN-05001 auxiliary filename string conflicts with a file used by the target database
Cause: RMAN is attempting to use the specified file name as a restore destination in the auxiliary database, but this name is already in use by the target database.
Action: Use the SET AUXNAME command to specify a name for the datafile that does not conflict with a file name in use by the target database
For our discussion we assume that a database is going to be duplicated using the following structure:
| Master database settings |
| instance: | master |
| data files: |
- /u01/MASTER/MASTER_system01.dbf
- /u02/MASTER/MASTER_undo_T1_01.dbf
- /u03/MASTER/MASTER_tools_01.dbf
- /u04/MASTER/MASTER_users_01.dbf
- /u05/MASTER/MASTER_data_01.dbf
|
| Online redo logs: |
- /u01/MASTER/MASTER_redog1m1.dbf
- /u02/MASTER/MASTER_redog1m2.dbf
- /u03/MASTER/MASTER_redog2m1.dbf
- /u04/MASTER/MASTER_redog2m2.dbf
|
The Oracle recovery manager rman can be used to duplicate a database on the same or on another host; the database can also be a standby database.
This operation has serious risks, because you can overwrite the original database. Errors happen: you think you have already connected to the replica server but you are still on the master; or you are using a backup manager with the wrong configuration file etc.
rman therefore, (and luckily for the DBA) , as default does not allows to use the same name as the original one for any database file and for each any redo log.
The consequence is that the simple command:
rman nocatalog target "sys/syspwd@master" auxiliary "/"
run
{
allocate channel ch1 type disk;
allocate auxiliary channel ch2 type disk;
duplicate target database;
}
will fail will the error message RMAN-05001.
How to avoid the error message RMAN-05001
- Self confident DBA
If you are sure of what you are doing and have double checked that you are on the correct replica host you can force rman to skip the filename check using the clause NOFILENAMECHECK. This way, on the replica server you can create data files and online redo logs having the same names as on the master.
rman nocatalog target "sys/syspwd@master" auxiliary "/"
run
{
allocate channel ch1 type disk;
allocate auxiliary channel ch2 type disk;
duplicate target database NOFILENAMECHECK;
}
- Cautious DBA
If you are very cautious about restores and not willing to run any risk of overwriting the actual database, you can explicitly order rman to use different names for the restored datafiles by means of the command set newname for datafile
rman nocatalog target "sys/syspwd@master" auxiliary "/"
run
{
allocate channel ch1 type disk;
allocate auxiliary channel ch2 type disk;
set newname for datafile 1 to '/u01/REPLICA/REPLICA_system01.dbf';
set newname for datafile 2 to '/u02/REPLICA/REPLICA_undo_T1_01.dbf';
set newname for datafile 3 to '/u03/REPLICA/REPLICA_tools_01.dbf';
set newname for datafile 4 to '/u04/REPLICA/REPLICA_users_01.dbf';
set newname for datafile 5 to '/u05/REPLICA/REPLICA_data_01.dbf';
duplicate target database FOR STANDBY DORECOVER;
}
Nevertheless, this command will fail again with the RMAN-05001, but this time because of the online redo logs; the error message will be something like RMAN-05001: auxiliary filename /u01/MASTER/MASTER_redog1m1.dbf conflicts with a file used by the target database.
The reason is that you must specify a new name for the online redo logs too; since there is no command "set newname for redo" nor for "set newname for online redo", we need the correct solution.
- Use the parameter LOG_FILE_NAME_CONVERT
The solution is using the parameter LOG_FILE_NAME_CONVERT in the init.ora of the REPLICA database. This will work as a rename or "set newname" for the online redo logs. In our case the parameter should be defined:
LOG_FILE_NAME_CONVERT = ('/u01/MASTER/MASTER','/u01/REPLICA/REPLICA'),
('/u02/MASTER/MASTER','/u02/REPLICA/REPLICA'),
('/u03/MASTER/MASTER','/u03/REPLICA/REPLICA'),
('/u04/MASTER/MASTER','/u04/REPLICA/REPLICA')
Analoguously, The init.ora parameter DB_FILE_NAME_CONVERT can replace the rman command "set newname for datafile"
Conclusions for the error RMAN-05001
- It is due to the fact that rman as default does not create files having the same names as in the master database.
- Can be avoided using the restore clause NOFILENAMECHECK, the command set newname for datafile and the init.ora parameters LOG_FILE_NAME_CONVERT and DB_FILE_NAME_CONVERT.
|
|