Home » RDBMS Server » Backup & Recovery » set newname vs db_file_name_convert
set newname vs db_file_name_convert [message #529699] Wed, 02 November 2011 10:11 Go to next message
BeefStu
Messages: 192
Registered: October 2011
Senior Member
Can somebody explain the difference between set newname and
db_file_name_convert.

I have used db_file_name_convert for my active clones since
my directory structures don't match.

1) When would one use set newname?
2) Does set newname take precedence over db_file_name_convert or vice a versa?

Lastly can somebody provide an simple of example of how to
pass in a script to RMAN that uses set newname.

Thanks in advance to all who answer
Re: set newname vs db_file_name_convert [message #529704 is a reply to message #529699] Wed, 02 November 2011 10:39 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10621
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
The exact restrictions depends on versions on Oracle version.
In 10g, there was a specific bug that would blow up.

http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmdupad.htm#CIHIJAEH
Quote:

If the source data files use OMF, then you cannot rename them using DB_FILE_NAME_CONVERT

If the auto change was no good (with OMF files), you might see this warning (With ASM in this case).
RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.

You can easily generate a list of "set newname for datafile" and call it in RMAN. Something like this
-- in a separate sql session.
-- +DATA would be source and all occurrences are replaced with +DWTEST.
-- spool output.
-- optionally you can do the same for logfiles
-- optionally echo what ever you want.
--
spool yourSoolFile.lst;
SELECT 'set newname for datafile '||file#||' to '''||replace(name,'+DATA','+DWTEST') ||''';' from  V\$DATAFILE; 
spool off.


##in RMAN
rman connect ..connectOptions-.
run {
allocate channels ..;
@yourSpoolFile.lst
duplicate target database to yourAux from active database nofilenamecheck
..other options
}


Re: set newname vs db_file_name_convert [message #529707 is a reply to message #529704] Wed, 02 November 2011 10:48 Go to previous messageGo to next message
BeefStu
Messages: 192
Registered: October 2011
Senior Member
Thanks for the response... I not using ASM or OMF, just regular
datafiles.

Still really dont get the difference between set newname and
db_filename_convert. Can you be a bit more specific.
Re: set newname vs db_file_name_convert [message #529708 is a reply to message #529707] Wed, 02 November 2011 10:49 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10621
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Quote:
If the source data files use OMF, then you cannot rename them using DB_FILE_NAME_CONVERT

The difference is in the restriction.
Re: set newname vs db_file_name_convert [message #529709 is a reply to message #529708] Wed, 02 November 2011 10:52 Go to previous messageGo to next message
BeefStu
Messages: 192
Registered: October 2011
Senior Member
so let me rephrase, what will happen if I use both? does one take precedent over the other? As mentioned
not using OMF or ASM
Re: set newname vs db_file_name_convert [message #529710 is a reply to message #529709] Wed, 02 November 2011 10:55 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10621
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
set newname should supercede over db_file_name_convert


Edit:
Seems I ignored you second question and not explicit on first.

>> 1) When would one use set newname?
Difference is in restriction. With OMF, db_file_name_convert will not work.
And "Set newname" is more flexible (for scripting) with multiple directories.

>>2) Does set newname take precedence over db_file_name_convert or vice a versa?
set newname should supercede over db_file_name_convert, as this is called from rman within "run" command.

[Updated on: Wed, 02 November 2011 10:59]

Report message to a moderator

Re: set newname vs db_file_name_convert [message #529711 is a reply to message #529710] Wed, 02 November 2011 10:57 Go to previous message
BeefStu
Messages: 192
Registered: October 2011
Senior Member
Thanks for the response and appreciate the help.. I will test it out.
Previous Topic: rman target xxx/xxx@tnsname
Next Topic: what to do after deleting a database without deleting its rman backups
Goto Forum:
  


Current Time: Tue Sep 02 06:38:23 CDT 2014

Total time taken to generate the page: 0.08604 seconds