RMAN> RESTORE SPFILE FROM '/u01/app/oracle/flash_recovery_area/DPROD/autobackup/2006_09_13/o1_mf_s_601036454_2jjj8px2_.bkp';
restore spfile from autobackup db_recovery_file_dest='/u01/app/oracle/flash_recovery_area' db_name='dprod';With the database started using the restored spfile, all the dba needs to do is to use the command
[oracle@xyx oracle]$ . oraenv
ORACLE_SID = [oracle] ? dprod
[oracle@xyx oracle]$ rman target /
Recovery Manager: Release 10.2.0.2.0 - Production on Wed Sep 13 10:33:35 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: DPROD (DBID=589180410)
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/10.2.0/db_1/dbs/snapcf_dprod.f'; # default
RMAN> backup database;
Starting backup at 13-SEP-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u02/oradata/dprod/system01.dbf
input datafile fno=00003 name=/u02/oradata/dprod/sysaux01.dbf
input datafile fno=00002 name=/u02/oradata/dprod/undotbs01.dbf
input datafile fno=00004 name=/u02/oradata/dprod/users01.dbf
channel ORA_DISK_1: starting piece 1 at 13-SEP-06
channel ORA_DISK_1: finished piece 1 at 13-SEP-06
piece handle=/u01/app/oracle/flash_recovery_area/DPROD/backupset/2006_09_13/o1_mf_nnndf_TAG20060913T103349_2jjj7y1g_.bkp tag=TAG20060913T103349 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 13-SEP-06
Starting Control File and SPFILE Autobackup at 13-SEP-06
piece handle=/u01/app/oracle/flash_recovery_area/DPROD/autobackup/2006_09_13/o1_mf_s_601036454_2jjj8px2_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-SEP-06
RMAN> shutdown immediate;
database closed
database dismounted
Oracle instance shut down
RMAN> exit
Recovery Manager complete.
[oracle@xyx oracle]$ # get rid of all database files, control files, online redo files:
[oracle@xyx oracle]$ mv /u02/oradata/dprod /u02/oradata/dprod_old
[oracle@xyx oracle]$ # recreate the directory, IMPORTANT STEP:
[oracle@xyx oracle]$ mkdir /u02/oradata/dprod
[oracle@xyx oracle]$ # get rid of the spfile:
[oracle@xyx oracle]$ rm $ORACLE_HOME/dbs/*dprod*.ora
[oracle@xyx oracle]$ rman target /
Recovery Manager: Release 10.2.0.2.0 - Production on Wed Sep 13 10:35:45 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/10.2.0/db_1/dbs/initdprod.ora'
starting Oracle instance without parameter file for retrival of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 1259672 bytes
Variable Size 58722152 bytes
Database Buffers 92274688 bytes
Redo Buffers 7127040 bytes
RMAN> RESTORE SPFILE FROM '/u01/app/oracle/flash_recovery_area/DPROD/autobackup/2006_09_13/o1_mf_s_601036454_2jjj8px2_.bkp';
Starting restore at 13-SEP-06
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK
channel ORA_DISK_1: autobackup found: /u01/app/oracle/flash_recovery_area/DPROD/autobackup/2006_09_13/o1_mf_s_601036454_2jjj8px2_.bkp
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 13-SEP-06
RMAN> shutdown immediate;
Oracle instance shut down
RMAN> startup nomount;
connected to target database (not started)
Oracle instance started
Total System Global Area 1879048192 bytes
Fixed Size 1261476 bytes
Variable Size 436207708 bytes
Database Buffers 1426063360 bytes
Redo Buffers 15515648 bytes
RMAN> RESTORE CONTROLFILE FROM AUTOBACKUP;
Starting restore at 13-SEP-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
recovery area destination: /u01/app/oracle/flash_recovery_area
database name (or database unique name) used for search: DPROD
channel ORA_DISK_1: autobackup found in the recovery area
channel ORA_DISK_1: autobackup found: /u01/app/oracle/flash_recovery_area/DPROD/autobackup/2006_09_13/o1_mf_s_601036454_2jjj8px2_.bkp
channel ORA_DISK_1: control file restore from autobackup complete
output filename=/u02/oradata/dprod/control01.ctl
output filename=/u02/oradata/dprod/control02.ctl
output filename=/u02/oradata/dprod/control03.ctl
Finished restore at 13-SEP-06
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> restore database;
Starting restore at 13-SEP-06
Starting implicit crosscheck backup at 13-SEP-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 9 objects
Finished implicit crosscheck backup at 13-SEP-06
Starting implicit crosscheck copy at 13-SEP-06
using channel ORA_DISK_1
Finished implicit crosscheck copy at 13-SEP-06
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/app/oracle/flash_recovery_area/DPROD/autobackup/2006_09_13/o1_mf_s_601036454_2jjj8px2_.bkp
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u02/oradata/dprod/system01.dbf
restoring datafile 00002 to /u02/oradata/dprod/undotbs01.dbf
restoring datafile 00003 to /u02/oradata/dprod/sysaux01.dbf
restoring datafile 00004 to /u02/oradata/dprod/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/DPROD/backupset/2006_09_13/o1_mf_nnndf_TAG20060913T103349_2jjj7y1g_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/app/oracle/flash_recovery_area/DPROD/backupset/2006_09_13/o1_mf_nnndf_TAG20060913T103349_2jjj7y1g_.bkp tag=TAG20060913T103349
channel ORA_DISK_1: restore complete, elapsed time: 00:00:26
Finished restore at 13-SEP-06
RMAN> recover database;
Starting recover at 13-SEP-06
using channel ORA_DISK_1
starting media recovery
unable to find archive log
archive log thread=1 sequence=1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/13/2006 10:38:23
RMAN-06054: media recovery requesting unknown log: thread 1 seq 1 lowscn 2286366
RMAN> alter database open resetlogs;
database opened
RMAN>
[oracle@xyx oracle]$ rman target /
Recovery Manager: Release 10.2.0.2.0 - Production on Wed Sep 13 10:14:15 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: DPROD (DBID=589180410)
RMAN> backup database;
Starting backup at 13-SEP-06
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=159 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u02/oradata/dprod/system01.dbf
input datafile fno=00003 name=/u02/oradata/dprod/sysaux01.dbf
input datafile fno=00002 name=/u02/oradata/dprod/undotbs01.dbf
input datafile fno=00004 name=/u02/oradata/dprod/users01.dbf
channel ORA_DISK_1: starting piece 1 at 13-SEP-06
channel ORA_DISK_1: finished piece 1 at 13-SEP-06
piece handle=/u01/app/oracle/flash_recovery_area/DPROD/backupset/2006_09_13/o1_mf_nnndf_TAG20060913T101422_2jjh3gps_.bkp tag=TAG20060913T101422 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 13-SEP-06
Starting Control File and SPFILE Autobackup at 13-SEP-06
piece handle=/u01/app/oracle/flash_recovery_area/DPROD/autobackup/2006_09_13/o1_mf_s_601035288_2jjh48bj_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-SEP-06
RMAN> shutdown immediate;
database closed
database dismounted
Oracle instance shut down
RMAN> exit
Recovery Manager complete.
[oracle@xyx oracle]$ # clean up previous dbprod_old directory:
[oracle@xyx oracle]$ rm -fr /u02/oradata/dprod_old
[oracle@xyx oracle]$ # get rid of all database files, control files, online redo files:
[oracle@xyx oracle]$ mv /u02/oradata/dprod /u02/oradata/dprod_old
[oracle@xyx oracle]$ # recreate the directory, IMPORTANT STEP:
[oracle@xyx oracle]$ mkdir /u02/oradata/dprod
[oracle@xyx oracle]$ # get rid of the spfile:
[oracle@xyx oracle]$ rm $ORACLE_HOME/dbs/*dprod*.ora
[oracle@xyx oracle]$ rman target /
Recovery Manager: Release 10.2.0.2.0 - Production on Wed Sep 13 10:16:47 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/10.2.0/db_1/dbs/initdprod.ora'
starting Oracle instance without parameter file for retrival of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 1259672 bytes
Variable Size 58722152 bytes
Database Buffers 92274688 bytes
Redo Buffers 7127040 bytes
RMAN> restore spfile from autobackup db_recovery_file_dest='/u01/app/oracle/flash_recovery_area' db_name='dprod';
Starting restore at 13-SEP-06
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK
recovery area destination: /u01/app/oracle/flash_recovery_area
database name (or database unique name) used for search: DPROD
channel ORA_DISK_1: autobackup found in the recovery area
channel ORA_DISK_1: autobackup found: /u01/app/oracle/flash_recovery_area/DPROD/autobackup/2006_09_13/o1_mf_s_601035288_2jjh48bj_.bkp
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 13-SEP-06
RMAN> shutdown immediate;
Oracle instance shut down
RMAN> startup nomount;
connected to target database (not started)
Oracle instance started
Total System Global Area 1879048192 bytes
Fixed Size 1261476 bytes
Variable Size 436207708 bytes
Database Buffers 1426063360 bytes
Redo Buffers 15515648 bytes
RMAN> restore controlfile from autobackup;
Starting restore at 13-SEP-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
recovery area destination: /u01/app/oracle/flash_recovery_area
database name (or database unique name) used for search: DPROD
channel ORA_DISK_1: autobackup found in the recovery area
channel ORA_DISK_1: autobackup found: /u01/app/oracle/flash_recovery_area/DPROD/autobackup/2006_09_13/o1_mf_s_601035288_2jjh48bj_.bkp
channel ORA_DISK_1: control file restore from autobackup complete
output filename=/u02/oradata/dprod/control01.ctl
output filename=/u02/oradata/dprod/control02.ctl
output filename=/u02/oradata/dprod/control03.ctl
Finished restore at 13-SEP-06
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> restore database;
Starting restore at 13-SEP-06
Starting implicit crosscheck backup at 13-SEP-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 8 objects
Finished implicit crosscheck backup at 13-SEP-06
Starting implicit crosscheck copy at 13-SEP-06
using channel ORA_DISK_1
Finished implicit crosscheck copy at 13-SEP-06
searching for all files in the recovery area
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/app/oracle/flash_recovery_area/DPROD/autobackup/2006_09_13/o1_mf_s_601035288_2jjh48bj_.bkp
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u02/oradata/dprod/system01.dbf
restoring datafile 00002 to /u02/oradata/dprod/undotbs01.dbf
restoring datafile 00003 to /u02/oradata/dprod/sysaux01.dbf
restoring datafile 00004 to /u02/oradata/dprod/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/DPROD/backupset/2006_09_13/o1_mf_nnndf_TAG20060913T101422_2jjh3gps_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/app/oracle/flash_recovery_area/DPROD/backupset/2006_09_13/o1_mf_nnndf_TAG20060913T101422_2jjh3gps_.bkp tag=TAG20060913T101422
channel ORA_DISK_1: restore complete, elapsed time: 00:00:26
Finished restore at 13-SEP-06
RMAN> recover database;
Starting recover at 13-SEP-06
using channel ORA_DISK_1
starting media recovery
unable to find archive log
archive log thread=1 sequence=1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/13/2006 10:19:10
RMAN-06054: media recovery requesting unknown log: thread 1 seq 1 lowscn 2284413
RMAN> alter database open resetlogs;
database opened
RMAN>
Oracle documentation states, "Because the repository is not available when you restore the control file, run the SET DBID command to identify the target database." [oracle@eve oracle]$ ORAENV_ASK=NO [oracle@eve oracle]$ export ORACLE_SID=dprod [oracle@eve oracle]$ . oraenv [oracle@xyx oracle]$ RMAN_LOG=rman_`date +%y-%m-%d`.log [oracle@xyx oracle]$ rman target / log=/u01/app/oracle/flash_recovery_area/DPROD/logs/$RMAN_LOG @/home/oracle/rman_backup_script.rman
| Taken from the Oracle® Database Backup and Recovery Advanced User's Guide 10g Release 1 (10.1) Part Number B10734-01 |
Performing Recovery with a Backup Control File and No Recovery CatalogThis section assumes that you have RMAN backups of the control file, but do not use a recovery catalog. Assuming that you enabled the control file autobackup feature for the target database, you can restore an autobackup of the control file. Because the autobackup uses a default format, RMAN can restore it even though it does not have a repository available that lists the available backups. You can restore the autobackup to the default or a new location. RMAN replicates the control file to all Because you are not connected to a recovery catalog, the control file must have a record of all needed backups. If any backups are not listed in the control file, then RMAN cannot restore them. You can add backup pieces and image copies to the control file repository with the Because the repository is not available when you restore the control file, run the
To recover the database with an autobackup of the control file without a recovery catalog:
|