RMAN Migration Library in ORACLE10G Non-archiving Mode

Environmental information:

Source Library Target Library
operating system WIN7 WIN SVR 2012 R2
IP x.x.x.216 x.x.x.112
Database Version - 64bi - 64bi
Storage Single instance Single instance
ORACLE_HOME D:\oracle\product\10.2.0\db_1 D:\oracle\product\10.2.0\db_1

RMAN Recovery Idea Steps:

  • Initialize the database and install the same environment;
  • Restore parameter file;
  • Restore control files;
  • Start the database to MOUNT state and use the control file for data recovery;
  • restore database;
  • alter database open ressetlogs;
  • Verification results

    Specific recovery steps:

  1. Log in to the RMAN console on the source library and switch log groups, trigger checkpoints, close the database, and restart the database to mount mode.
rman target /
sql'alter system switch logfile';
sql'alter system checkpoint';
shutdown immediate;
startup mount;

  1. Start another command window, log in to sqlplus, query the DBID, and record the value before closing the command window.
sqlplus / as sysdba
select dbid from v$database;

  1. Make a full backup of the source library and record the backup path.
    allocate channel d1 type disk;  
    allocate channel d2 type disk;
    backup as compressed backupset database;
    release channel d1;
    release channel d2;
    report obsolete;  
    crosscheck backup; 
    delete noprompt expired backup; 
   delete noprompt obsolete; 

  1. Make a backup of the parameter files, control files and record the backup path to the source library.
backup spfile;
backup current controlfile;

  1. Install the same version of the ORACLE database on the target system and set the DB_HOME and DB_SID settings as in the source library.
  2. After installation, copy the full library backup file, parameter file backup, control file backup to the same system path in the target library
  3. Create a new blank file in the target library, D:\oracle\product\10.2.0\db_1\database, named FAKESPFILEORCL.ORA, and copy the following into the file
  1. If there is no shutdown in the target library, shutdown first and nomount the database with the newly created parameter file
startup pfile='D:\oracle\product\10.2.0\db_1\database\FAKESPFILEORCL.ORA' nomount;

  1. Under RMAN, execute the command SET DBID=1526707455 (source library DBID);
set dbid=1526707455;

  1. Parameter file recovery in target library
restore spfile from 'D:\oracle\product\10.2.0\flash_recovery_area\ORCL\BACKUPSET\2019_01_30\O1_MF_NNSNF_TAG20190130T171134_G52TL81Y_.BKP';

  1. Close the database and start nomount with the restored parameter file
shutdown immediate;
startup nomount;

  1. Control file recovery in target library
restore controlfile from 'D:\oracle\product\10.2.0\flash_recovery_area\ORCL\BACKUPSET\2019_01_30\O1_MF_NCNNF_TAG20190130T171148_G52TLNS2_.BKP';

  1. Close the database and start with mount
shutdown immediate;
startup mount;
  1. (Optional) Modify the data file path recorded in the control file (this is necessary if there is a database file on the source system and no F disk on the target system) and initiate recovery
    (Or use a windows virtual drive letter)
    Make sure there is a path folder for the data files in the target system!
report schema;

    set newname for datafile 8 to 'D:\ORACLEDATA1\INFO_LOB';
    restore database;             
    switch datafile all;          

  • Database recovery is now complete
  1. Restore the database directly if you don't need to modify the path; you can
    Make sure there is a path folder for the data files in the target system!
  2. Clear the redo log to open the database
alter database open resetlogs;
  1. Verify the database (verify that the data in the source database is in the target database)
  2. End


  1. Other reference addresses:
  2. win system migration linux is similar to the above steps, but the specific path of the control file needs to be modified after restoring the parameter file
  3. Monitor progress of execution
select sid,SERIAL# ,CONTEXT,SOFAR,TOTALWORK,round(SOFAR/TOTALWORK*100,2) "_%" from v$session_longops where OPNAME like 'RMAN%' and SOFAR<>TOTALWORK and TOTALWORK<>0;

Tags: Oracle Database rman SQL

Posted on Sat, 04 Jan 2020 15:12:49 -0500 by davidz