In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
What are the three different situations in which RAC controls file recovery? aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
RAC controls file recovery (three different situations)
Test environment:
System: LINUX-64
Database: 10.2.0.1
Two-node RAC (RACDB1,RACDB2), ASM for storage
In the case of backup, if the control file is lost, how can we restore it?
One: use the backup control file to restore, and finally need to use resetlogs to open.
(1) backup control files
RMAN > backup current controlfile
(2) switch logs and modify data
RACDB1 > alter system switch logfile
System altered.
RACDB1 > create table test2 as select * from dba_users
Table created.
RACDB1 > alter system switch logfile
System altered.
RACDB1 > SELECT thread#,group#,sequence#,status FROM V$log
THREAD# GROUP# SEQUENCE# STATUS
--
1 1 5 ACTIVE
1 2 6 CURRENT
2 3 3 CURRENT
2 4 2 INACTIVE
1 5 4 INACTIVE
(3) close the database and delete the control file
RACDB1 > shutdown abort
RACDB2 > shutdown abort
ASMCMD > pwd
+ rac_disk/racdb/controlfile
ASMCMD > ls
Current.256.794232615
ASMCMD > rm *
(4) start the database and have no control files, so you can only go to nomount.
RACDB1 > startup
ORACLE instance started.
Total System Global Area 184549376 bytes
Fixed Size 2019448 bytes
Variable Size 142610312 bytes
Database Buffers 37748736 bytes
Redo Buffers 2170880 bytes
ORA-00205: error in identifying control file, check alert log for more info
(5) restore control files
RMAN > restore controlfile from'+ RAC_DISK/racdb/backupset/2012_09_28/ncnnf0_tag20120928t003933_0.272.795141579'
RACDB1 > alter database mount
Database altered.
RACDB1 > SELECT thread#,group#,sequence#,status FROM V$log
THREAD# GROUP# SEQUENCE# STATUS
--
1 1 2 CURRENT
1 2 0 UNUSED
1 5 1 INACTIVE
2 4 0 UNUSED
2 3 1 CURRENT
(6) restore the database
First use auto to restore to the current online log, oracle will prompt that the archive cannot be found, and you need to enter the online log manually. As follows:
RACDB1 > recover database using backup controlfile
ORA-00279: change 1185078 generated at 09/28/2012 00:40:37 needed for thread 1
ORA-00289: suggestion: + RAC_DISK/racdb/flashback/1_6_795092359.dbf
ORA-00280: change 1185078 for thread 1 is in sequence # 6
Specify log: {= suggested | filename | AUTO | CANCEL}
+ rac_disk/racdb/onlinelog/group_2.258.794232619-enter the current online log of RACDB1
ORA-00279: change 1185078 generated at 09/28/2012 00:40:10 needed for thread 2
ORA-00289: suggestion: + RAC_DISK/racdb/flashback/2_2_795092359.dbf
ORA-00280: change 1185078 for thread 2 is in sequence # 2
Specify log: {= suggested | filename | AUTO | CANCEL}
+ rac_disk/racdb/onlinelog/group_4.266.794234285-this is not RACDB2's current online log, but you can actually enter an archive.
ORA-00279: change 1185082 generated at 09/28/2012 00:40:38 needed for thread 2
ORA-00289: suggestion: + RAC_DISK/racdb/flashback/2_3_795092359.dbf
ORA-00280: change 1185082 for thread 2 is in sequence # 3
ORA-00278: log file'+ rac_disk/racdb/onlinelog/group_4.266.794234285' no longer
Needed for this recovery
Specify log: {= suggested | filename | AUTO | CANCEL}
+ rac_disk/racdb/onlinelog/group_3.265.794234279-- this is RACDB2's current online log
Log applied.
Media recovery complete.
Summary: in RAC environment, the online log of each node must be used when you want to use current online log.
(7) Open the database in resetlogs mode.
RACDB1 > alter database open resetlogs
Database altered.
RACDB2 > startup
ORACLE instance started.
Total System Global Area 184549376 bytes
Fixed Size 2019448 bytes
Variable Size 138416008 bytes
Database Buffers 41943040 bytes
Redo Buffers 2170880 bytes
Database mounted.
Database opened.
RACDB1 > select count (*) from test2
COUNT (*)
-
eleven
Second, using noresetlogs method to reconstruct the control file.
(1) backup control files
RMAN > backup current controlfile
(2) switch between log and operation data
RACDB1 > alter system switch logfile
System altered.
RACDB1 > create table test3 as select * from dba_data_files
Table created.
RACDB1 > alter system switch logfile
System altered.
(3) close the database and delete the control file
RACDB1 > shutdown abort
RACDB2 > shutdown abort
ASMCMD > pwd
+ rac_disk/racdb/controlfile
ASMCMD > ls
Current.256.795142367
ASMCMD > rm *
RACDB1 > startup
ORACLE instance started.
Total System Global Area 184549376 bytes
Fixed Size 2019448 bytes
Variable Size 146804616 bytes
Database Buffers 33554432 bytes
Redo Buffers 2170880 bytes
ORA-00205: error in identifying control file, check alert log for more info
(4) restore control files
RMAN > restore controlfile from'+ RAC_DISK/racdb/backupset/2012_09_28/ncnnf0_tag20120928t015109_0.285.795145873'
RACDB1 > alter database mount
Database altered.
RACDB1 > alter database backup controlfile to trace;-back up the control file to the trace file
Database altered.
(5) reconstruct the control file.
RACDB1 > shutdown immediate
Delete the control file.
RACDB1 > startup nomount
(6) reconstruct the control file by noresetlogs
Since it is a RAC environment, the following parameters need to be modified first:
If you do not modify the parameters, the error is as follows:
ORA-01503: CREATE CONTROLFILE failed
ORA-12720: operation requires database is in EXCLUSIVE mode
RACDB1 > alter system set cluster_database=FALSE scope=spfile sid='*'
System altered.
RACDB1 > shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
RACDB1 > startup nomount
ORACLE instance started.
Total System Global Area 184549376 bytes
Fixed Size 2019448 bytes
Variable Size 146804616 bytes
Database Buffers 33554432 bytes
Redo Buffers 2170880 bytes
CREATE CONTROLFILE REUSE DATABASE "RACDB" NORESETLOGS ARCHIVELOG
MAXLOGFILES 192
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 32
MAXLOGHISTORY 292
LOGFILE
GROUP 1 (
'+ RAC_DISK/racdb/onlinelog/group_1.257.795091225'
'+ RAC_DISK/racdb/onlinelog/group_1.295.795091229'
) SIZE 50m
GROUP 2'+ RAC_DISK/racdb/onlinelog/group_2.258.794232619' SIZE 50m
GROUP 3'+ RAC_DISK/racdb/onlinelog/group_3.265.794234279' SIZE 50m
GROUP 4'+ RAC_DISK/racdb/onlinelog/group_4.266.794234285' SIZE 50m
GROUP 5 (
'+ RAC_DISK/racdb/onlinelog/group_5.269.795092365'
'+ RAC_DISK/racdb/onlinelog/group_5.296.795092369'
) SIZE 100m
-- STANDBY LOGFILE
DATAFILE
'+ RAC_DISK/racdb/datafile/system.259.794232627'
'+ RAC_DISK/racdb/datafile/undotbs1.260.794232647'
'+ RAC_DISK/racdb/datafile/sysaux.261.794232657'
'+ RAC_DISK/racdb/datafile/undotbs2.263.794232675'
'+ RAC_DISK/racdb/datafile/users.264.794232683'
CHARACTER SET ZHS16GBK
twenty-seven
CREATE CONTROLFILE REUSE DATABASE "RACDB" NORESETLOGS ARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01276: Cannot add file + RAC_DISK/racdb/controlfile/current.256.795146237.
File has an Oracle Managed Files file name. -- because you use OMF, you need to comment out controlfile in the parameter file first.
RACDB1 > show parameter control_files
NAME TYPE VALUE
-
Control_files string + RAC_DISK/racdb/controlfile/cu
Rrent.256.795146237
RACDB1 > alter system set control_files=false scope=spfile sid='*'
System altered.
RACDB1 > alter system reset control_files scope=spfile sid='*'
System altered.
RACDB1 > shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
RACDB1 > startup nomount
ORACLE instance started.
Total System Global Area 184549376 bytes
Fixed Size 2019448 bytes
Variable Size 146804616 bytes
Database Buffers 33554432 bytes
Redo Buffers 2170880 bytes
RACDB1 > show parameter control_files
NAME TYPE VALUE
-
Control_files string / u01/app/oracle/product/10.2.0
/ db_1/dbs/cntrlRACDB1.dbf
CREATE CONTROLFILE REUSE DATABASE "RACDB" NORESETLOGS ARCHIVELOG
MAXLOGFILES 192
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 32
MAXLOGHISTORY 292
LOGFILE
GROUP 1 (
'+ RAC_DISK/racdb/onlinelog/group_1.257.795091225'
'+ RAC_DISK/racdb/onlinelog/group_1.295.795091229'
) SIZE 50m
GROUP 2'+ RAC_DISK/racdb/onlinelog/group_2.258.794232619' SIZE 50m
GROUP 3'+ RAC_DISK/racdb/onlinelog/group_3.265.794234279' SIZE 50m
GROUP 4'+ RAC_DISK/racdb/onlinelog/group_4.266.794234285' SIZE 50m
GROUP 5 (
'+ RAC_DISK/racdb/onlinelog/group_5.269.795092365'
'+ RAC_DISK/racdb/onlinelog/group_5.296.795092369'
) SIZE 100m
-- STANDBY LOGFILE
DATAFILE
'+ RAC_DISK/racdb/datafile/system.259.794232627'
'+ RAC_DISK/racdb/datafile/undotbs1.260.794232647'
'+ RAC_DISK/racdb/datafile/sysaux.261.794232657'
'+ RAC_DISK/racdb/datafile/undotbs2.263.794232675'
'+ RAC_DISK/racdb/datafile/users.264.794232683'
CHARACTER SET ZHS16GBK
27
Control file created.
RACDB1 > RACDB1 > show parameter control_files
NAME TYPE VALUE
-
Control_files string + RAC_DISK/racdb/controlfile/cu
Rrent.256.795147383, + RAC_DISK
/ racdb/controlfile/current.279
. 795147383
RACDB1 > alter system set cluster_database=true scope=spfile sid='*';-Don't forget
System altered.
(7) restore the database
RACDB1 > recover database
ORA-00279: change 1185480 generated at 09/28/2012 01:45:00 needed for thread 1
ORA-00289: suggestion: + RAC_DISK/racdb/flashback/1_1_795145477.dbf
ORA-00280: change 1185480 for thread 1 is in sequence # 1
Specify log: {= suggested | filename | AUTO | CANCEL}
Auto
Log applied.
Media recovery complete.
(8) Open the database
RACDB1 > alter database open
Database altered.
Third, use the resetlogs method to reconstruct the control file. The recovery process in this method is similar to the control file that uses a backup. There is no narrative here. Finally, you also need to use resetlogs to open it.
It is worth noting that the difference between the two reconstruction methods of create controlfile resetlogs/noresetlogs is that when noresetlogs rebuilds the control file, the datafile checkpoint in the control file comes from the current log header in online logs. When the control file is reconstructed with resetlogs, the datafile checkpoint in the control file comes from each data file header.
The answers to the questions about what are the three different situations of RAC control file recovery are shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.