(3)rman采用了自动备份控制文件
*****************************************数据库处于归档模式****************************************
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 4
Next log sequence to archive 6
Current log sequence 6
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 4
Next log sequence to archive 6
Current log sequence 6
*****************************************rman自动备份控制文件****************************************
RMAN> show all;
RMAN configuration parameters for database with db_unique_name ORA11 are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
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 COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/oracle/oracle11/product/11.2/dbs/snapcf_ora11.f'; # default
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
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 COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/oracle/oracle11/product/11.2/dbs/snapcf_ora11.f'; # default
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;---------------->开启自动备份控制文件模式
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
RMAN> show all;
RMAN configuration parameters for database with db_unique_name ORA11 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 COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/oracle/oracle11/product/11.2/dbs/snapcf_ora11.f'; # default
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 COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/oracle/oracle11/product/11.2/dbs/snapcf_ora11.f'; # default
RMAN>
user interrupt received
user interrupt received
*****************************************模拟控制文件损坏****************************************
SQL> ! rm /u01/oracle/oracle11/oradata/ora11/control01.ctl
SQL> ! rm /u01/oracle/oracle11/flash_recovery_area/ora11/control02.ctl
*****************************************报错了,这也是我们实验想看到的****************************************
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 497995776 bytes
Fixed Size 1337464 bytes
Variable Size 360712072 bytes
Database Buffers 130023424 bytes
Redo Buffers 5922816 bytes
ORA-00205: error in identifying control file, check alert log for more info
Fixed Size 1337464 bytes
Variable Size 360712072 bytes
Database Buffers 130023424 bytes
Redo Buffers 5922816 bytes
ORA-00205: error in identifying control file, check alert log for more info
*****************************************从备份restore控制文件****************************************
[oracle@ora11 ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jan 26 16:03:09 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
RMAN> startup nomount;
Oracle instance started
Total System Global Area 497995776 bytes
Fixed Size 1337464 bytes
Variable Size 360712072 bytes
Database Buffers 130023424 bytes
Redo Buffers 5922816 bytes
Variable Size 360712072 bytes
Database Buffers 130023424 bytes
Redo Buffers 5922816 bytes
RMAN> restore controlfile from autobackup;
Starting restore at 26-JAN-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK
recovery area destination: /u01/oracle/oracle11/flash_recovery_area
database name (or database unique name) used for search: ORA11
channel ORA_DISK_1: AUTOBACKUP /u01/oracle/oracle11/flash_recovery_area/ORA11/autobackup/2012_01_26/o1_mf_s_773596686_7l3hm2or_.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 /u01/oracle/oracle11/flash_recovery_area/ORA11/autobackup/2012_01_26/o1_mf_s_773596686_7l3hm2or_.bkp
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=/u01/oracle/oracle11/oradata/ora11/control01.ctl
output file name=/u01/oracle/oracle11/flash_recovery_area/ora11/control02.ctl
Finished restore at 26-JAN-12
database name (or database unique name) used for search: ORA11
channel ORA_DISK_1: AUTOBACKUP /u01/oracle/oracle11/flash_recovery_area/ORA11/autobackup/2012_01_26/o1_mf_s_773596686_7l3hm2or_.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 /u01/oracle/oracle11/flash_recovery_area/ORA11/autobackup/2012_01_26/o1_mf_s_773596686_7l3hm2or_.bkp
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=/u01/oracle/oracle11/oradata/ora11/control01.ctl
output file name=/u01/oracle/oracle11/flash_recovery_area/ora11/control02.ctl
Finished restore at 26-JAN-12
*****************************************尝试打开数据库****************************************
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
released channel: ORA_DISK_1
RMAN> alter database open;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 01/26/2012 16:04:25
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 01/26/2012 16:04:25
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
RMAN> alter database open NORESETLOGS;-------------------报错,需要recover数据库
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "resetlogs, ;"
RMAN-01008: the bad identifier was: NORESETLOGS
RMAN-01007: at line 1 column 21 file: standard input
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "resetlogs, ;"
RMAN-01008: the bad identifier was: NORESETLOGS
RMAN-01007: at line 1 column 21 file: standard input
RMAN> recover database;---------------->recover数据库
Starting recover at 26-JAN-12
Starting implicit crosscheck backup at 26-JAN-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 26-JAN-12
Starting implicit crosscheck backup at 26-JAN-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 26-JAN-12
Starting implicit crosscheck copy at 26-JAN-12
using channel ORA_DISK_1
Finished implicit crosscheck copy at 26-JAN-12
using channel ORA_DISK_1
Finished implicit crosscheck copy at 26-JAN-12
searching for all files in the recovery area
cataloging files...
cataloging done
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/oracle/oracle11/flash_recovery_area/ORA11/autobackup/2012_01_26/o1_mf_s_773596686_7l3hm2or_.bkp
=======================
File Name: /u01/oracle/oracle11/flash_recovery_area/ORA11/autobackup/2012_01_26/o1_mf_s_773596686_7l3hm2or_.bkp
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 6 is already on disk as file /u01/oracle/oracle11/oradata/ora11/redo03.log
archived log file name=/u01/oracle/oracle11/oradata/ora11/redo03.log thread=1 sequence=6
media recovery complete, elapsed time: 00:00:04
Finished recover at 26-JAN-12
archived log file name=/u01/oracle/oracle11/oradata/ora11/redo03.log thread=1 sequence=6
media recovery complete, elapsed time: 00:00:04
Finished recover at 26-JAN-12
RMAN> alter database open;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 01/26/2012 16:05:36
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 01/26/2012 16:05:36
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
RMAN> alter database open RESETLOGS; ------------------------>ok.恢复完毕
database opened
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28278387/viewspace-746676/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/28278387/viewspace-746676/