Skip to main content

How to use set newname option in rman restore



I was trying to restore  rman full backup and it was failed due to one of the required directory  is not available in  place .

I have total 693 data files and the last data file 693 is trying to restore in /u031 mount point which is not available in my destination server.

Using SET NEWNAME  we can change the data file location before restore.

REACTIVE

Case 1::  If you want to restore only single data file after completion of restore and failed for only  one data file.

RUN {

    set until sequence = 88903;
   
   Send 'NB_ORA_CLIENT=xxxxxx.ffdc.sbc.com';
   
   SET NEWNAME FOR DATAFILE  '/u031/oradata/qprd/xxxxxx.dbf' to '/u030/oradata/qprd/xxxxxx.dbf';
    RESTORE DATAFILE 693;
    SWITCH DATAFILE 693;          ( it will update the control file )
    RECOVER DATAFILE 693;
}

PROACTIVE

Case 2 : we can use below script, it is the best way to do restore.  If you want to move some data files into different location in destination server and restore complete database .

   RUN {
     set until sequence = 88903;
     Send 'NB_ORA_CLIENT=xxxxxx.ffdc.sbc.com';

    SET NEWNAME FOR DATAFILE  '/u031/oradata/qprd/xxxxxx.dbf' to '/u030/oradata/qprd/xxxxxx.dbf';
    RESTORE DATABASE;
    SWITCH DATAFILE 693;          ( it will update the control file )
    RECOVER DATABASE;
}

Comments

Popular posts from this blog

ORA-65139: Mismatch between XML metadata file and data file

Error: CDB$ROOT@EBTUPRDC> CREATE PLUGGABLE DATABASE EBTUSPRDPDB1 using '/home/oracle/EBTUSPRDC.xml' nocopy tempfile reuse; CREATE PLUGGABLE DATABASE EBTUSPRDPDB1 using '/home/oracle/EBTUSPRDC.xml' nocopy tempfile reuse * ERROR at line 1: ORA-65139: Mismatch between XML metadata file and data file /u05/odb/ORADATA_1/EBTUSPRDC/datafile/system.1531.807800993 for value of fcpsb (2230502002 in the plug XML file, 2230505492 in the data file) Fix: Don't open Non-CDB database until we complete pdb creation other wise we will get above error. Shutdown immediate; startup mount; alter database open read only; create xml file. shutdown immediate; Connect to CDB and Create Pluggable database .

Useful OEM Queries to get Target details from OEM Repository

List Targets with TNS Listener ports configured : SELECT mgmt$target.host_name , mgmt$target.target_name , mgmt$target.target_type , mgmt$target_properties.property_name , mgmt$target_properties.property_value FROM mgmt$target , mgmt$target_properties WHERE ( mgmt$target.target_name = mgmt$target_properties.target_name ) AND ( mgmt$target.target_type = mgmt$target_properties.target_type ) and ( mgmt$target.target_type = 'oracle_listener' ) and ( mgmt$target_properties.property_name = 'Port' ); Devora02       LISTENER_ora02                       oracle_listener Port 1529 Devora01       LISTENER_ora01                       oracle_listener Port 1529 Devora04       LISTENE...

TFA-00002 : Oracle Trace File Analyzer (TFA) is not running

TFA Failed to start listening for commands on one of the Rac Node : As a root user /etc/init.d/init.tfa  start Starting TFA.. start: Job is already running: oracle-tfa Waiting up to 100 seconds for TFA to be started.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Successfully started TFA Process.. . . . . . TFA-00002 : Oracle Trace File Analyzer (TFA) is not running TFA Failed to start listening for commands Solution : run synctfanodes.sh  if you have root password . if no root password copy below files to TFA Failed node and try to restart TFA .. Please check whether these 4 files exist on all nodes are similar. TFA_HOME/server.jks TFA_HOME/client.jks TFA_HOME/internal/ssl.properties   TFA_HOME/internal/ portmapping.txt If not similar just copy these files to TFA Failing node and try TFA Restart ..It Worked for me .   [root@host01]# ./tfactl  -v "debug" start Starting TFA...