Home » RDBMS Server » Backup & Recovery » scripting setnew name for datafile 1 to
scripting setnew name for datafile 1 to [message #290592] Sun, 30 December 2007 04:54 Go to next message
hrishy
Messages: 25
Registered: August 2005
Junior Member
Hi

Does anybody have a script that dynamically generates the RMAN script

setnew name for datafile 1 to


from sqlplus and spools it to file which i can later edit.

I require this for duplication of my database where the file systems don't match between source and target database and also the sizes of the file systems are vastly different

regards
Hrishy
Re: scripting setnew name for datafile 1 to [message #290605 is a reply to message #290592] Sun, 30 December 2007 09:11 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
spool myfile
set feedback off
set heading off
set linesize 500
set trimspool on
select 'setnew name for datafile 1 to' from dual;
spool off


Regards
Michel
Re: scripting setnew name for datafile 1 to [message #290612 is a reply to message #290592] Sun, 30 December 2007 11:24 Go to previous messageGo to next message
hrishy
Messages: 25
Registered: August 2005
Junior Member
Hi Michel

Than you very much i appreciate the effort answering my question on a sunday.

I was looking for a script that is generic and can work on a any database when i do a duplication.

Wish you a very happy new year Very Happy

regards
Hrishy

Re: scripting setnew name for datafile 1 to [message #290613 is a reply to message #290592] Sun, 30 December 2007 11:29 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
>looking for a script that is generic
So select from dba_datafiles instead of dual.
Re: scripting setnew name for datafile 1 to [message #290617 is a reply to message #290613] Sun, 30 December 2007 15:25 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
anacedent wrote on Sun, 30 December 2007 12:29

So select from dba_datafiles instead of dual.

Slight correction DBA_DATA_FILES.
Previous Topic: Using RMAN to create a Standby Database
Next Topic: RMAN, how to schedule a backup of the huge table?
Goto Forum:
  


Current Time: Sat Dec 10 22:27:05 CST 2016

Total time taken to generate the page: 0.07490 seconds