In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "what are the methods of OCR backup and recovery in RAC". In the daily operation, I believe that many people have doubts about the methods of OCR backup and recovery in RAC. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "what are the methods of OCR backup and recovery in RAC?" Next, please follow the editor to study!
Ocr stores the list of nodes in rac, the association of instances and nodes, and the information of various resources (VIP, monitoring, etc.) in rac.
If the disk or array on which the ocr resides does not use raid, it is strongly required to mirror the ocr.
Because OCR is also very important, in addition to mirror, we should also make a full backup.
There are two ways to back up ocr:
[@ more@] 1. Ocr automatic backup and recovery method
1) automatic backup
Oracle backs up ocr every hour. The default path for automatic backup is: $CRS_HOME/cdata/$CRS_NAME. You can use ocrconfig to view the information of automatic backup, such as:
[oracle@dwdb01 backup] $ocrconfig-showbackup
Dwdb03 2011-04-26 13:22:47 / oracle/product/10.2.0/crs/cdata/crs
Dwdb03 2011-04-26 09:22:47 / oracle/product/10.2.0/crs/cdata/crs
Dwdb03 2011-04-26 05:22:47 / oracle/product/10.2.0/crs/cdata/crs
Dwdb03 2011-04-25 13:22:46 / oracle/product/10.2.0/crs/cdata/crs
Dwdb03 2011-04-14 09:22:28 / oracle/product/10.2.0/crs/cdata/crs
Automatic backups are performed on only one node. If the node used for backup has an exception, oracle automatically switches to another node for backup.
By default, oracle keeps the last five ocr backups: three recent, one from yesterday, and one from last week.
Automatic backups are performed on only one node, and for security reasons, files generated by field backups should be copied to all nodes on a regular basis.
To achieve this function, first configure mutual authentication between the two nodes so that mutual access does not require a password:
-- execute on all nodes as root:
Mkdir / .ssh
Chmod 700. ssh
Ssh-keygen-t rsa
Ssh-keygen-t dsa
-- execute on one of the nodes as root (select dwdb01 here):
Touch / .ssh/authorized_keys
Cd / .ssh
Ssh dwdb01 cat ~ / .ssh/id_rsa.pub > > authorized_keys
Ssh dwdb01 cat ~ / .ssh/id_rsa.pub > > authorized_keys
Ssh dwdb02 cat ~ / .ssh/id_rsa.pub > > authorized_keys
Ssh dwdb02 cat ~ / .ssh/id_rsa.pub > > authorized_keys
Ssh dwdb03 cat ~ / .ssh/id_rsa.pub > > authorized_keys
Ssh dwdb03 cat ~ / .ssh/id_rsa.pub > > authorized_keys
Ssh dwdb04 cat ~ / .ssh/id_rsa.pub > > authorized_keys
Ssh dwdb04 cat ~ / .ssh/id_rsa.pub > > authorized_keys
Scp authorized_keys dwdb02: `pwd`
Scp authorized_keys dwdb03: `pwd`
Scp authorized_keys dwdb04: `pwd`
-- all nodes execute
Chmod 600 ~ / .ssh/authorized_keys
-- testing in dwdb01
Ssh dwdb02 date
Ssh dwdb03 date
Ssh dwdb04 date
2) restore
Automatic backup is a physical backup, similar to rman in database backup, which needs to be restored by restore. Recovery steps:
A) use the ocrconfig-showbackup command to see the location of the automatic backup files (on that node, under that path)
B) validate ocr information with ocrdump, such as:
Execute as root:
/ opt/oracle/product/10.2/crs/bin/ocrdump-backupfile / opt/oracle/product/10.2/crs/cdata/crs/week.ocr
This command will generate a file under the current path: OCRDUMPFILE. Just look at this file.
C) stop crs on all nodes
/ etc/init.d/init.crs stop
D) user ocrconfig restore
Ocrconfig-restore file_name
-- file_name is the path and name of the automatically backed up ocr file
E) start crs on all nodes
/ etc/init.d/init.crs start
F) cluvfy can be used to verify that ocr is correct
Cluvfy comp ocr-n all [- verbose]
2 manual backup (logical backup) and recovery method
We cannot modify the timing and frequency of ocr automatic backups, but oracle provides us with another backup method that allows us to back up ocr manually.
Manual backup is very simple, we can use the ocrconfig command, such as:
Ocrconfig-export / tmp/ocr.bak
Note that this command can only be executed as root.
This backup method is logical backup, which is similar to exp in database backup, and needs to be restored by imp.
To be on the safe side, it is best to have automatic backup and manual backup performed on different nodes, and put manual export files on the local hard drives of all nodes to avoid array failure. The following maintenance example:
Vi backup_ocr.sh
#! / bin/bash
#
# Name: backup_ocr.sh
# Author: Shengkai Su
# Date: 04/25/2011
#
# Description: backup ocr manually
#
#
# Usage:. / backup_ocr.sh
#
#
# Prerequisite: run under root
#
#
# Modifications:
#
# When Who What
# =
# 04/25/2011 shengkai su start developing the script
#
#
# #
# set env
# #
. / home/oracle/.bash_profile
DATE= `date +% Y% m% d`
DIRNAME= `dirname $0`
SCRIPT= `basename $0`
KEYWORD= "ocr"
MYPATH=$ {DIRNAME} / rac_comp/$ {KEYWORD}
NODELIST= "dwdb02 dwdb03 dwdb04"
DEST=$ {MYPATH} / ${KEYWORD}. ${DATE}
# #
# backup ocr disk via dd
# #
Echo "= start at `date` ="
# dd if file not exists
If [- f ${DEST}]; then
Echo "file exists"
Exit 1
Else
${ORA_CRS_HOME} / bin/ocrconfig-export $DEST-s online
Fi
# # #
# copy ocr disk backup file to other nodes
# # #
For N in `echo ${NODELIST} `; do
Scp ${DEST} ${N}: `cd ${MYPATH}; pwd`
Done
Echo "= end at `date` ="
-define scheduled tasks every six hours
# backup ocr every 6 hours
10 * / 6 * / oracle/DBA/backup/backup_ocr.sh
As mentioned above, backing up with export is a logical backup. If ocr is damaged and needs to be restored, you need to import the exported content by import. The steps are as follows:
A) the location of the file using ocrconfig-export
B) stop crs on all nodes
/ etc/init.d/init.crs stop
C) user ocrconfig restore
Ocrconfig-import file_name
-- file_name is the path and name of the ocr file from export
D) start crs on all nodes
/ etc/init.d/init.crs start
E) you can use cluvfy to verify that ocr is correct
Cluvfy comp ocr-n all [- verbose]
At this point, the study of "what are the methods of OCR backup and recovery in RAC" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.