Recover database; -odtwarza również dzienniki archivelog -jeśli tryb jest wyłączony warto nie uwzględniać go w skrypcie komenda alter database open resetlogs; dopiero można wykonać.
W przypadku gdy korzystamy dzienników trzeba pamiętać o włączonym trybie archivelog
ponieważ będą problemy z odtwarzaniem bazy np do punktu czasu (restore point)
Recovery Manager: Release 11.2.0.2.0 - Production on îr Gru 25 14:48:28 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: XE (DBID=2712378990)
RMAN> set echo on;
2> startup nomount pfile=C:\Users\admin\AppData\Local\Temp\rman_dummy.ora force;
3>
echo set on
Oracle instance started
Total System Global Area 284565504 bytes
Fixed Size 1383076 bytes
Variable Size 100664668 bytes
Database Buffers 176160768 bytes
Redo Buffers 6356992 bytes
Recovery Manager complete.
Recovery Manager: Release 11.2.0.2.0 - Production on îr Gru 25 14:49:04 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: XE (not mounted)
RMAN> set echo on;
2> shutdown immediate;
3> startup nomount pfile="C:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\
SPFILE2INIT.ORA";
4> restore (spfile from autobackup) (controlfile from autobackup);
5> startup mount force;
6> configure controlfile autobackup off;
7> restore database;
8>
echo set on
using target database control file instead of recovery catalog
Oracle instance shut down
connected to target database (not started)
Oracle instance started
Total System Global Area 376635392 bytes
Fixed Size 1383692 bytes
Variable Size 289407732 bytes
Database Buffers 79691776 bytes
Redo Buffers 6152192 bytes
Starting restore at 13/12/25
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK
recovery area destination: C:\oraclexe\app\oracle\fast_recovery_area
database name (or database unique name) used for search: XE
channel ORA_DISK_1: AUTOBACKUP C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\AUTO
BACKUP\2013_12_25\O1_MF_S_835109025_9COR8LSG_.BKP found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring spfile from AUTOBACKUP C:\ORACLEXE\APP\ORACLE\FAST
_RECOVERY_AREA\XE\AUTOBACKUP\2013_12_25\O1_MF_S_835109025_9COR8LSG_.BKP
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
failover to previous backup
recovery area destination: C:\oraclexe\app\oracle\fast_recovery_area
database name (or database unique name) used for search: XE
channel ORA_DISK_1: AUTOBACKUP C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\AUTO
BACKUP\2013_12_25\O1_MF_S_835109025_9COR8LSG_.BKP found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring control file from AUTOBACKUP C:\ORACLEXE\APP\ORACL
E\FAST_RECOVERY_AREA\XE\AUTOBACKUP\2013_12_25\O1_MF_S_835109025_9COR8LSG_.BKP
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\CONTROL.DBF
Finished restore at 13/12/25
Oracle instance started
database mounted
Total System Global Area 376635392 bytes
Fixed Size 1383692 bytes
Variable Size 293602036 bytes
Database Buffers 75497472 bytes
Redo Buffers 6152192 bytes
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters are successfully stored
Starting restore at 13/12/25
Starting implicit crosscheck backup at 13/12/25
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK
Crosschecked 4 objects
Finished implicit crosscheck backup at 13/12/25
Starting implicit crosscheck copy at 13/12/25
using channel ORA_DISK_1
Finished implicit crosscheck copy at 13/12/25
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ARCHIVELOG\2013_12_25\O1
_MF_1_1_9COR8T1T_.ARC
File Name: C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ARCHIVELOG\2013_12_25\O1
_MF_1_2_9COR9622_.ARC
File Name: C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\AUTOBACKUP\2013_12_25\O1
_MF_S_835106118_9COOLFW3_.BKP
File Name: C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\AUTOBACKUP\2013_12_25\O1
_MF_S_835109025_9COR8LSG_.BKP
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to C:\ORACLEXE\APP\ORACLE\ORADATA\X
E\SYSTEM.DBF
channel ORA_DISK_1: restoring datafile 00002 to C:\ORACLEXE\APP\ORACLE\ORADATA\X
E\UNDOTBS1.DBF
channel ORA_DISK_1: restoring datafile 00003 to C:\ORACLEXE\APP\ORACLE\ORADATA\X
E\SYSAUX.DBF
channel ORA_DISK_1: restoring datafile 00004 to C:\ORACLEXE\APP\ORACLE\ORADATA\X
E\USERS.DBF
channel ORA_DISK_1: reading from backup piece C:\ORACLEXE\APP\ORACLE\FAST_RECOVE
RY_AREA\XE\BACKUPSET\2013_12_25\O1_MF_NNNDF_TAG20131225T144217_9COR5V3Q_.BKP
channel ORA_DISK_1: piece handle=C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\BA
CKUPSET\2013_12_25\O1_MF_NNNDF_TAG20131225T144217_9COR5V3Q_.BKP tag=TAG20131225T
144217
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:05
Finished restore at 13/12/25
Recovery Manager complete.
Recovery Manager: Release 11.2.0.2.0 - Production on îr Gru 25 14:51:06 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: XE (DBID=271755747, not open)
RMAN> set echo on;
2> recover database;
3> alter database open resetlogs;
4>
echo set on
Starting recover at 13/12/25
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=9 device type=DISK
starting media recovery
archived log for thread 1 with sequence 1 is already on disk as file C:\ORACLEXE
\APP\ORACLE\FAST_RECOVERY_AREA\XE\ARCHIVELOG\2013_12_25\O1_MF_1_1_9COR8T1T_.ARC
archived log for thread 1 with sequence 2 is already on disk as file C:\ORACLEXE
\APP\ORACLE\FAST_RECOVERY_AREA\XE\ARCHIVELOG\2013_12_25\O1_MF_1_2_9COR9622_.ARC
archived log for thread 1 with sequence 3 is already on disk as file C:\ORACLEXE
\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\O1_MF_1_981B260Y_.LOG
archived log file name=C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ARCHIVELOG\2
013_12_25\O1_MF_1_1_9COR8T1T_.ARC thread=1 sequence=1
archived log file name=C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ARCHIVELOG\2
013_12_25\O1_MF_1_2_9COR9622_.ARC thread=1 sequence=2
archived log file name=C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\O1
_MF_1_981B260Y_.LOG thread=1 sequence=3
media recovery complete, elapsed time: 00:00:02
Finished recover at 13/12/25
database opened
Recovery Manager complete.
Restore of the database succeeded.
Log file is at C:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\OXE_RESTORE
.LOG.
W przypadku gdy korzystamy dzienników trzeba pamiętać o włączonym trybie archivelog
ponieważ będą problemy z odtwarzaniem bazy np do punktu czasu (restore point)
Recovery Manager: Release 11.2.0.2.0 - Production on îr Gru 25 14:48:28 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: XE (DBID=2712378990)
RMAN> set echo on;
2> startup nomount pfile=C:\Users\admin\AppData\Local\Temp\rman_dummy.ora force;
3>
echo set on
Oracle instance started
Total System Global Area 284565504 bytes
Fixed Size 1383076 bytes
Variable Size 100664668 bytes
Database Buffers 176160768 bytes
Redo Buffers 6356992 bytes
Recovery Manager complete.
Recovery Manager: Release 11.2.0.2.0 - Production on îr Gru 25 14:49:04 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: XE (not mounted)
RMAN> set echo on;
2> shutdown immediate;
3> startup nomount pfile="C:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\
SPFILE2INIT.ORA";
4> restore (spfile from autobackup) (controlfile from autobackup);
5> startup mount force;
6> configure controlfile autobackup off;
7> restore database;
8>
echo set on
using target database control file instead of recovery catalog
Oracle instance shut down
connected to target database (not started)
Oracle instance started
Total System Global Area 376635392 bytes
Fixed Size 1383692 bytes
Variable Size 289407732 bytes
Database Buffers 79691776 bytes
Redo Buffers 6152192 bytes
Starting restore at 13/12/25
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK
recovery area destination: C:\oraclexe\app\oracle\fast_recovery_area
database name (or database unique name) used for search: XE
channel ORA_DISK_1: AUTOBACKUP C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\AUTO
BACKUP\2013_12_25\O1_MF_S_835109025_9COR8LSG_.BKP found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring spfile from AUTOBACKUP C:\ORACLEXE\APP\ORACLE\FAST
_RECOVERY_AREA\XE\AUTOBACKUP\2013_12_25\O1_MF_S_835109025_9COR8LSG_.BKP
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
failover to previous backup
recovery area destination: C:\oraclexe\app\oracle\fast_recovery_area
database name (or database unique name) used for search: XE
channel ORA_DISK_1: AUTOBACKUP C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\AUTO
BACKUP\2013_12_25\O1_MF_S_835109025_9COR8LSG_.BKP found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring control file from AUTOBACKUP C:\ORACLEXE\APP\ORACL
E\FAST_RECOVERY_AREA\XE\AUTOBACKUP\2013_12_25\O1_MF_S_835109025_9COR8LSG_.BKP
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\CONTROL.DBF
Finished restore at 13/12/25
Oracle instance started
database mounted
Total System Global Area 376635392 bytes
Fixed Size 1383692 bytes
Variable Size 293602036 bytes
Database Buffers 75497472 bytes
Redo Buffers 6152192 bytes
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters are successfully stored
Starting restore at 13/12/25
Starting implicit crosscheck backup at 13/12/25
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK
Crosschecked 4 objects
Finished implicit crosscheck backup at 13/12/25
Starting implicit crosscheck copy at 13/12/25
using channel ORA_DISK_1
Finished implicit crosscheck copy at 13/12/25
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ARCHIVELOG\2013_12_25\O1
_MF_1_1_9COR8T1T_.ARC
File Name: C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ARCHIVELOG\2013_12_25\O1
_MF_1_2_9COR9622_.ARC
File Name: C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\AUTOBACKUP\2013_12_25\O1
_MF_S_835106118_9COOLFW3_.BKP
File Name: C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\AUTOBACKUP\2013_12_25\O1
_MF_S_835109025_9COR8LSG_.BKP
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to C:\ORACLEXE\APP\ORACLE\ORADATA\X
E\SYSTEM.DBF
channel ORA_DISK_1: restoring datafile 00002 to C:\ORACLEXE\APP\ORACLE\ORADATA\X
E\UNDOTBS1.DBF
channel ORA_DISK_1: restoring datafile 00003 to C:\ORACLEXE\APP\ORACLE\ORADATA\X
E\SYSAUX.DBF
channel ORA_DISK_1: restoring datafile 00004 to C:\ORACLEXE\APP\ORACLE\ORADATA\X
E\USERS.DBF
channel ORA_DISK_1: reading from backup piece C:\ORACLEXE\APP\ORACLE\FAST_RECOVE
RY_AREA\XE\BACKUPSET\2013_12_25\O1_MF_NNNDF_TAG20131225T144217_9COR5V3Q_.BKP
channel ORA_DISK_1: piece handle=C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\BA
CKUPSET\2013_12_25\O1_MF_NNNDF_TAG20131225T144217_9COR5V3Q_.BKP tag=TAG20131225T
144217
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:05
Finished restore at 13/12/25
Recovery Manager complete.
Recovery Manager: Release 11.2.0.2.0 - Production on îr Gru 25 14:51:06 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: XE (DBID=271755747, not open)
RMAN> set echo on;
2> recover database;
3> alter database open resetlogs;
4>
echo set on
Starting recover at 13/12/25
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=9 device type=DISK
starting media recovery
archived log for thread 1 with sequence 1 is already on disk as file C:\ORACLEXE
\APP\ORACLE\FAST_RECOVERY_AREA\XE\ARCHIVELOG\2013_12_25\O1_MF_1_1_9COR8T1T_.ARC
archived log for thread 1 with sequence 2 is already on disk as file C:\ORACLEXE
\APP\ORACLE\FAST_RECOVERY_AREA\XE\ARCHIVELOG\2013_12_25\O1_MF_1_2_9COR9622_.ARC
archived log for thread 1 with sequence 3 is already on disk as file C:\ORACLEXE
\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\O1_MF_1_981B260Y_.LOG
archived log file name=C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ARCHIVELOG\2
013_12_25\O1_MF_1_1_9COR8T1T_.ARC thread=1 sequence=1
archived log file name=C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ARCHIVELOG\2
013_12_25\O1_MF_1_2_9COR9622_.ARC thread=1 sequence=2
archived log file name=C:\ORACLEXE\APP\ORACLE\FAST_RECOVERY_AREA\XE\ONLINELOG\O1
_MF_1_981B260Y_.LOG thread=1 sequence=3
media recovery complete, elapsed time: 00:00:02
Finished recover at 13/12/25
database opened
Recovery Manager complete.
Restore of the database succeeded.
Log file is at C:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0\SERVER\DATABASE\OXE_RESTORE
.LOG.