ORACLE11G restores the rman backup of dataguard to the detailed process of standalone oracle in the test environment
1. copy the full backup file 1.1 from the production database to view the parameter file information.
RMAN> list backup of spfile;
Find the latest backup information from the large list information
/Pddata2/oracle/backup/data/ctl_auto/c-3391761643-20150820-01
1.2 View Control File Information:
RMAN> list backup of controlfile;
Find the control file
/Pddata2/oracle/backup/data/ctl_auto/c-3391761643-20150820-01
1.3 view database information:
RMAN> list backup of database;
1.4 view archived log information:
RMAN> list backup of archivelog all;
BS Key Type LV Size Device TypeElapsed Time Completion Time
-------------------------------------------------------------
4110 Full 18.36 m disk 00:00:01 20-AUG-15
BP Key: 4110 Status: AVAILABLE Compressed: NO Tag: TAG20150820T032017
Piece Name:/pddata2/oracle/backup/data/ctl_auto/c-3391761643-20150820-01
Control File Included: Ckp SCN: 11412370967 Ckp time: 20-AUG-15
Copy the parameter file control file to the test environment/data/impdp/
Cd/pddata2/oracle/backup/data/ctl_auto/
Scp c-3391761643-20150820-01c-3391761643-20150820-01 192.168.180.60:/data/impdp/
2. Start to restore the parameter file control file:
SQL> select dbid from v $ database;
2.1 set DBID:
Note: a dummy instance is started by default even if there is no parameter file in rman to restore the parameter file.
Set dbid 3391761643
2.2 restore the spfile File
Startup to open state, first view the spfile file location:
SQL> show parameter spfile;
/Oracle/app/oracle/product/11.2.0/dbhome_1/dbs/spfilepowerdes. ora
After shutdown, start up to nomount.
Search for production environment
RMAN> show all;
......
Configure snapshot controlfile name to '/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_powerdes.f'; # default
Copy it to the test environment:
Scp/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_powerdes.f192.168.180.60:/data/impdp/
Start recovery
Restore spfile to '/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/spfilepowerdes. ora' from '/data/impdp/snapcf_powerdes.f ';
Startup nomount and restore
The recovery error is as follows:
RMAN> restore spfile to '/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/spfilepowerdes. ora' from '/data/impdp/c-3391761643-20150820-01 ';
RMAN> restore spfile to '/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/spfilepowerdes. ora' from '/data/impdp/c-3391761643-20150820-01 ';
Starting restore at 20-AUG-15
Using channel ORA_DISK_1
Channel ORA_DISK_1: restoring spfile fromAUTOBACKUP/data/impdp/c-3391761643-20150820-01
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error messagestack follows ======================
RMAN-00571: ========================================================== ==============================
RMAN-03002: failure of restore command at08/20/2015 18:25:14
ORA-32011: cannot restore SPFILE tolocation already being used by the instance
RMAN>
So pull a parameter file from the pd line and copy it to the test environment.
SQL> create pfile = '/oracle/pfile01.ora' from spfile;
File created.
SQL>
Then, create a spfile in the test database based on the copied parameter file.
Create spfile frompfile = '/data/pfile01.ora ';
SQL> create spfile frompfile = '/data/impdp/pfile01.ora ';
File created.
SQL>
Then start the test database to nomount.
SQL> startup nomount
ORA-00845: MEMORY_TARGET not supported onthis system
SQL>
When a memory error is reported, modify the/etc/fstab file to set the memory ID.
Vi/etc/fstab
Tmpfs/dev/shm tmpfs ults, size = 11G 0 0
Executed
Mount-t tmpfs shmfs-o size = 11g/dev/shm
SQL> startup mount;
ORA-01078: failure in processing systemparameters
LRM-00109: cocould not open parameter file '/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/initpowerdes. ora'
SQL>
Restore
2.3 restore control files in the test environment:
Restore controlfile to '/data/oracle/powerdes/control01.ctl' from '/data/impdp/c-3391761643-20150820-01 ';
RMAN> restore controlfile to '/data/oracle/powerdes/control01.ctl' from '/data/impdp/c-3391761643-20150820-01'
Restore controlfile to '/home/oradata/powerdes/control01.ctl' from '/data/impdp/c-3391761643-20150820-01 ';
2>;
After that, you must start mount to perform the restore and recover operations, but the startup fails.
RMAN> alter database mount
2>;
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error messagestack follows ======================
RMAN-00571: ========================================================== ==============================
RMAN-03002: failure of alter db command at08/21/2015 11:12:13
ORA-00205: error in identifying controlfile, check alert log for more info
RMAN>
The reason is that the control file is not recognized. Check the alert Log information,
[Root @ testoracle1/] # tail-f/oracle/app/oracle/diag/rdbms/pdunq/powerdes/trace/alert_powerdes.log
Checker run found 1 new persistent datafailures
Fri Aug 21 11:13:51 2015
Alter database mount
Fri Aug 21 11:13:51 2015
ORA-00210: cannot open the specifiedcontrol file
ORA-00202: control file: '/home/oradata/powerdes/control01.ctl'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file ordirectory
Additional information: 3
ORA-205 signalled during: alter databasemount...
From the alert Log, we can see that the control file has changed to the production environment path because spfile is copied from the production environment, the control file path recorded in the spfile in the production environment is different from that recorded in the test environment. Therefore, in order to quickly restore the production environment, you must re-specify the control file in the same path as the production environment and regenerate the control file in the new path.
Control File
RMAN> restore controlfile to '/home/oradata/powerdes/control01.ctl' from '/data/impdp/c-3391761643-20150820-01 ';
Starting restore at 21-AUG-15
Using channel ORA_DISK_1
Channel ORA_DISK_1: restoring controlfile
Channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 21-AUG-15
OK. Now that the control file restore is successful, change the database status to mount.
RMAN> alter database mount;
Database mounted
Released channel: ORA_DISK_1
RMAN>
Then you can start restore the entire database.
2.4 Register data file backup and archive backup in the new control file
Change the database status to mount.
Catalog start with '/data/impdp/2015-08-20 /';
RMAN> alter database mount
2>;
Using target database control file insteadof recovery catalog
Database mounted
RMAN> catalog start with '/data/impdp/2015-08-20 /';
Starting implicit crosscheckbackup at20-AUG-15
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID = 129 devicetype = DISK
Crosschecked 98 objects
Finished implicit crosscheck backup at20-AUG-15
Starting implicit crosscheckcopy at20-AUG-15
Using channel ORA_DISK_1
Finished implicit crosscheckcopy at20-AUG-15
Searching for all files in the recoveryarea
Cataloging files...
No files cataloged
Searching for all files that match thepattern/data/impdp/2015-08-20/
List of Files Unknown to the Database
============================================
File Name:/data/impdp/2015-08-20/arch_powerdes_20150820_441_bak
File Name:/data/impdp/2015-08-20/rman_backup.log
File Name:/data/impdp/2015-08-20/arch_POWERDES_20150820_4418.bak
File Name:/data/impdp/2015-08-20/full_POWERDES_20150820_4419.bak
Do you really want to catalog the abovefiles (enter YES or NO )? YES
Cataloging files...
Cataloging done
List of Cataloged Files
======================================
File Name:/data/impdp/2015-08-20/arch_powerdes_20150820_441_bak
File Name:/data/impdp/2015-08-20/arch_POWERDES_20150820_4418.bak
File Name:/data/impdp/2015-08-20/full_POWERDES_20150820_4419.bak
List of Files Which Where Not Cataloged
========================================================
File Name:/data/impdp/2015-08-20/rman_backup.log
RMAN-07517: Reason: The file header is already upted
RMAN>
2.5, start to restore the entire database
Because the entire spfile has been recovered and controlfile has been recovered, you can recover the restore database directly without parameters;
RMAN> restore database;
RMAN> restore database;
Starting restore at 20-AUG-15
Using channel ORA_DISK_1
Channel ORA_DISK_1: starting datafilebackup set restore
Channel ORA_DISK_1: specifying datafile (s) to restore from backup set
Channel ORA_DISK_1: restoring datafile00001 to/home/oradata/powerdes/system01.dbf
Channel ORA_DISK_1: restoring datafile00002 to/home/oradata/powerdes/sysaux01.dbf
Channel ORA_DISK_1: restoring datafile00003 to/home/oradata/powerdes/undotbs01.dbf
Channel ORA_DISK_1: restoring datafile00004 to/home/oradata/powerdes/users01.dbf
Channel ORA_DISK_1: restoring datafile00005 to/home/oradata/powerdes/power1_01.dbf
Channel ORA_DISK_1: restoring datafile00006 to/home/oradata/powerdes/plas01.dbf
Channel ORA_DISK_1: restoring datafile00007 to/home/oradata/powerdes/pl01.dbf
Channel ORA_DISK_1: restoring datafile1_8 to/home/oradata/powerdes/help01.dbf
Channel ORA_DISK_1: restoring datafile00009 to/home/oradata/powerdes/adobelc01.dbf
Channel ORA_DISK_1: restoring datafile00010 to/home/oradata/powerdes/sms01.dbf
Channel ORA_DISK_1: restoring datafile00011 to/home/oradata/powerdes/plcrm01.dbf
Channel ORA_DISK_1: restoring datafile00012 to/home/oradata/powerdes/power1_02.dbf
Channel ORA_DISK_1: reading from backuppiece/data/impdp/2015-08-20/full_POWERDES_20150820_4419.bak
Channel ORA_DISK_1: piecehandle =/data/impdp/2015-08-20/full_POWERDES_20150820_4419.baktag = TAG20150820T030008
Channel ORA_DISK_1: restored backup piece 1
Channel ORA_DISK_1: restore complete, elapsed time: 00:17:35
Finished restore at 20-AUG-15
RMAN>
2.6 then recover the database
RMAN> recover database;
Starting recover at 20-AUG-15
Using channel ORA_DISK_1
Starting media recovery
Channel ORA_DISK_1: starting archived logrestore to default destination
Channel ORA_DISK_1: restoring archived log
Archived log thread = 1 sequence = 36277
Channel ORA_DISK_1: reading from backuppiece/data/impdp/2015-08-20/arch_powerdes_20150820_441_bak
Channel ORA_DISK_1: piecehandle =/data/impdp/2015-08-20/arch_powerdes_20150820_441_baktag = TAG20150820T032015
Channel ORA_DISK_1: restored backup piece 1
Channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Archived log filename =/oracle/app/oracle/flash_recovery_area/POWERDES/archivelog/2015_08_20/o1_mf_1_36277_bxcjyzbg _. arcthread = 1 sequence = 36277
Channel default: deleting archivedlog (s)
Archived log file name =/oracle/app/oracle/flash_recovery_area/POWERDES/archivelog/2015_08_20/o1_mf_1_36277_bxcjyzbg _. arcRECID = 71395 STAMP = 888264671
Unable to find archived log
Archived log thread = 1 sequence = 36278
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error messagestack follows ======================
RMAN-00571: ========================================================== ==============================
RMAN-03002: failure of recover command at08/20/2015 20:11:13
RMAN-06054: media recovery requestingunknown archived log for thread 1 with sequence 36278 and starting SCN of11412370952
RMAN>
The error message in the background alet log is:
Fri Aug 21 11:47:07 2015
Alter database recover datafile list clear
Completed: alter database recover datafilelist clear
Alter database recover datafile list
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
Completed: alter database recover datafilelist
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
Alter database recover if needed
Start until cancel using backup controlfile
Media Recovery Start
Started logmerger process
Parallel Media Recovery started with 4 slaves
ORA-279 signalled during: alter databaserecover if needed
Start until cancel using backup controlfile
...
Alter database recover logfile '/oracle/app/oracle/flash_recovery_area/archivelog1_36277_821708334.dbf'
Media Recovery Log/oracle/app/oracle/flash_recovery_area/archivelog1_36277_821708334.dbf
ORA-279 signalled during: alter databaserecover logfile '/oracle/app/oracle/flash_recovery_area/archivelog1_36277_821708334.dbf '...
Alter database recover cancel
Media Recovery Canceled
Completed: alter database recover cancel
Fri Aug 21 11:47:09 2015
Checker run found 1 new persistent datafailures
It can be seen that the cause of this error is that the archive log records required for recovery cannot be found in the control file or recovery directory. There are two solutions:
1. If the related log exists and is available, add the log to the control file or recovery directory.
2. If the related logs have been deleted or are unavailable, follow the error message "scn" to restore the database to this scn, Which is 11412370952. That is to say, the database can only be recovered completely. You must use resetlogs to open the database.
Recover database until scn 11412370952;
RMAN> recover database until scn11412370952;
Starting recover at 20-AUG-15
Using channel ORA_DISK_1
Starting media recovery
Media recovery complete, elapsed time: 00: 00: 00
Finished recover at 20-AUG-15
RMAN>
Then open the database
RMAN> alter database openresetlogs;
Database opened
RMAN>
3. Some unexpected errors during debugging
Then, an error is reported.
RMAN> alter database open resetlogs;
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error messagestack follows ======================
RMAN-00571: ========================================================== ==============================
RMAN-03002: failure of alter db command at08/20/2015 20:31:07;
ORA-03113: end of-file on communicationchannel
Process ID: 30584
Session ID: 192 Serial number: 19
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error messagestack follows ======================
RMAN-00571: ========================================================== ==============================
ORA-03114: not connected to ORACLE
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error messagestack follows ======================
RMAN-00571: ========================================================== ==============================
RMAN-03002: failure of alter db command at08/20/2015 20:31:07
ORA-03113: end of-file on communicationchannel
Process ID: 30584
Session ID: 192 Serial number: 19
[Oracle @ testoracle1 dbs] $
Re-open
RMAN> alter database open resetlogs;
Using target database control file insteadof recovery catalog
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error messagestack follows ======================
RMAN-00571: ========================================================== ==============================
RMAN-03002: failure of alter db command at08/20/2015 20:35:44
RMAN-06403: cocould not obtain a fullyauthorized session
A ORA-01034: ORACLE not available
ORA-27101: shared memory realm does notexist
Linux-x86_64 Error: 2: No such file ordirectory
RMAN>
Start in sqlplus Mode
SQL> startup
ORACLE instance started.
Total System Global Area 5010685952 bytes
Fixed Size 2212936 bytes
Variable Size 2751466424 bytes
Database Buffers 2214592512 bytes
Redo Buffers 42414080 bytes
Database mounted.
ORA-03113: end of-file on communicationchannel
Process ID: 10504
Session ID: 191 Serial number: 3
SQL>
The reason for the failure is that, after the parameter file is restored to an invalid state, the restoration step of the parameter file is skipped, And the restore recover database is recovered after the control file is restored. Solution: Restore the parameter file and perform the following steps to complete the operation.