In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Record the Oracle RAC cluster backup remote single instance recovery operation this time. Mainly record the key operations, do not paste the detailed operation flow because of confidentiality.
1. Environment:
Original library:
Operating system: Redhat 6.5
Database: Oracle 11.2.0.4 RAC (two nodes)
Tool: rman
IP address: 192.168.10.10 (Node 1)
Remote recovery library:
Operating system: Centos 6.5
Database: Oracle 11.2.0.4 (single instance)
Tool: rman
IP address: 192.168.10.123
II. Operation
1. The two nodes of the original library all stop the application service and stop listening to prevent further connection to carry out the operation. Then use the rman tool to back up the entire library on one node (192.168.10.10), and manually archive once before performing the backup, mainly backing up the database, archive files, and control files. As for the spfile parameter file, there is no need to back up, because the parameter file of the RAC environment still needs to be modified in many places on the single instance. You can use the command create pfile='/home/oracle/orclint.ora' from spfile to generate the pfile file in the original library.
two。 Copy the backed-up database, archive, control files and generated pfile files remotely to 192.168.10.123 (remote library) using scp, and put them in the / data/rmanbackup directory.
3.192.168.10.123 (remote repository) Oracle 11.2.0.4 software has been installed and no library has been built. Setting environment variables, especially ORACLE_SID, is consistent with 192.168.10.10 (original database) cluster environment, which is convenient for recovery operation.
4. According to the contents of the pfile file passed over, I will make a general list of the modified parameter files:
* .audit_file_dest='/u01/app/oracle/admin/hkrt/adump'*.audit_trail='db'*.compatible='11.2.0.4.0'*.control_files='/u01/app/oracle/oradata/hkrt/control01.dbf' '/ u01 apprenticespact oracle.oradataPlacement hkrtUniverse control02.dbfharm.dbtags blocksizecards 8192. Dblocationdomaincards examples examples .dbaccounnamecodes orcleroids examples. Stickiness destinations cards plaza u01appplet oraclebacks oraclebanks. Chersmakers' (PROTOCOL=TCP)'(SERVICE=hkrtXDB)'(SERVICE=hkrtXDB)'* .log _ archive_dest_1='LOCATION=/u01/arch'*.log_archive_format='%t_%s_%r.dbf'*.memory_target=5034213376*.open_cursors=300*.processes=400
5. After the modification of the parameter file, the rest of the operations are basically in the remote database. Sqlplus enters the empty instance, and then starts to the nomount state according to the modified pfile. (note: the memory configuration and the number of processes in the parameter file should match the remote library memory, otherwise memory overflow will cause startup failure).
Refer to the command:
Startup nomount from pfile='/data/rmanbackup/orclinit.ora'
(because it is a test, all password files are not backed up, and the user password can be reset after the database is restored)
6. Start the database to the nomount state, log in to rman (rman target /), and you can see that the database state is nomount. Then restore the control file, refer to the command:
Restore controlfile from'/ data/rmanbackup//ctl_ORCL_20150830_6552_1'
After performing the control file restore operation, the control file is restored to the directory specified in the parameter file
7. After the control file is restored, it can be started to mount state.
RMAN > alter database mount
Don't rush to restore the database when starting to mount. You need to register the backup set in rman first.
RMAN > catalog start with'/ data/rmanbackup'
(the path is the directory where you store all the backups.)
After the registration is complete, cross-check the backup set:
RMAN > crosscheck backupset
Delete expired backups. Because your backups are off-site, all backups recorded in RAC are expired and cleared.
RMAN > delete expired backup
8. Now start to recover database files, because when RAC database data files, log files, and other storage paths are stored on ASM disks, the paths basically start with'+ DATA', and you need to convert the file paths before executing the restore database command.
First, generate a script about the path conversion of the data file on the original library to facilitate the recovery operation. The script is as follows (the script can be obtained from the query in the original library):
Select 'set newname for datafile' | | a.FILE# | |'to "'| | a.NAME | |'"; 'from v$datafile aunion allselect' set newname for tempfile'| | a.FILE# | |'to "'| | a.NAME | |'"; 'from v$tempfile a
The results are as follows:
SETNEWNAMEFORDATAFILE' | | A.FILE# | |'TO "'| | A.NAME | |'" '- -set newname for datafile 1 to "+ DATA/jmrac/datafile/system.268.877470209" Set newname for datafile 2 to "+ DATA/jmrac/datafile/sysaux.269.877470211"; set newname for datafile 3 to "+ DATA/jmrac/datafile/undotbs1.270.877470213"; set newname for datafile 4 to "+ DATA/jmrac/datafile/users.271.877470213"; set newname for datafile 5 to "+ DATA/jmrac/datafile/example.279.877470401"; set newname for datafile 6 to "+ DATA/jmrac/datafile/undotbs2.280.877470779"; set newname for tempfile 1 to "+ DATA/jmrac/tempfile/temp.278.877470381";
All the data files involved will be displayed. I'll just write a brief outline here and make a simple edit after getting the above script:
Run {allocate channel ch2 device type disk;set newname for datafile 1 to "+ DATA/jmrac/datafile/system.268.877470209"; set newname for datafile 2 to "+ DATA/jmrac/datafile/sysaux.269.877470211"; set newname for datafile 3 to "+ DATA/jmrac/datafile/undotbs1.270.877470213"; set newname for datafile 4 to "+ DATA/jmrac/datafile/users.271.877470213"; set newname for datafile 5 to "+ DATA/jmrac/datafile/example.279.877470401"; set newname for datafile 6 to "+ DATA/jmrac/datafile/undotbs2.280.877470779" Set newname for tempfile 1 to "+ DATA/jmrac/tempfile/temp.278.877470381";. Restore database;switch datafile all;switch tempfile all;}
You can then run the above modified run block (script) in rman for database recovery. I didn't generate a conversion statement about redo logs here, because I'm talking about putting redo log conversion into a run script block to execute a path that always prompts that the path starting with + DATA does not exist, so redo is omitted, but I find that database recovery is not affected, and the redo log path has been changed after recovery.
9. After executing the above run script command, you will be prompted with an error:
RMAN-00571: = = RMAN-00569: = ERROR MESSAGE STACK FOLLOWS = RMAN-00571: = = RMAN-03002: failure of restore command at 03 found to restoreRMAN-06023 25 09:56:55RMAN-06026: some targets not found-aborting restoreRMAN-06023: no backup or copy of datafile 4 found to restoreRMAN-06023: no backup or copy of datafile 3 found to restoreRMAN-06023: no backup or copy of datafile 2 found to restoreRMAN-06023: no backup or copy of datafile 1 found to restore
In fact, all the backups are here, just report this error, and then check the data, you need to do the following:
RMAN > list incarnation
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
11 JBDB 1285701182 PARENT 1 15-AUG-09
2 2 JBDB 1285701182 PARENT 945184 12-JUL-13
Then make the same query on the original library:
RMAN > list incarnation
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
11 JBDB 1285701182 PARENT 1 15-AUG-09
2 2 JBDB 1285701182 PARENT 945184 12-JUL-13
Then reset the incarnation to 2 in the remote library:
RMAN > reset database to incarnation 2
Execute the run script block again after execution:
RMAN > run {allocate channel ch2 device type disk;set newname for datafile 1 to "+ DATA/jmrac/datafile/system.268.877470209"; set newname for datafile 2 to "+ DATA/jmrac/datafile/sysaux.269.877470211"; set newname for datafile 3 to "+ DATA/jmrac/datafile/undotbs1.270.877470213"; set newname for datafile 4 to "+ DATA/jmrac/datafile/users.271.877470213"; set newname for datafile 5 to "+ DATA/jmrac/datafile/example.279.877470401"; set newname for datafile 6 to "+ DATA/jmrac/datafile/undotbs2.280.877470779" Set newname for tempfile 1 to "+ DATA/jmrac/tempfile/temp.278.877470381";. Restore database;switch datafile all;switch tempfile all;}
The execution proceeded normally and there was no problem with the recovery.
10. After the database file is restored, executing recover database will report an error indicating that the archive file is missing:
RMAN > recover database; Starting recover at using channel ORA_DISK_1starting media recoveryRMAN-00571: = = RMAN-00569: = ERROR MESSAGE STACK FOLLOWS = RMAN-00571: = = RMAN-03002: failure of recover command at RMAN-06053: unable to perform media recovery because of missing logRMAN-06025: no backup of archived log for thread 1 with sequence 71125 and starting SCN of 16888076231found to restore
There are two ways:
One is to find the archive file in the original library and transfer it to the remote database server, register the archive information, and then restore the database by recover again, as long as the archive file can be found.
Register the archive information (the archive file is arch_71125_xxxx):
RMAN > catalog archivelog'/ data/rmanbackup/arch_71125_xxxx'
RMAN > recover database
(prompt that an unknow archive cannot be found during recovery, which does not affect the recovery)
The second is to perform incomplete recovery according to the prompted scn:
RAMN > run {
Set until scn 16888076231
Recover database
}
Because I couldn't find the file, it was the second way.
11. Log in to the database after the recovery is complete and open the database (resetlogs mode):
SQL > alter database open resetlogs
Database altered.
At this point, the recovery is complete. The production environment must be backed up again after a successful restore.
The above is a general operation process, for reference only, in the production environment, we must be cautious, do a good data backup, if there are different situations, comments and exchanges are welcome to learn together.
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.