11G R2 Oracle Local Registry(OLR)
从oracle 11R2版本起在网格计算领域引进了新特性,其中之一就是grid Oracle Local Registry(OLR),做为oracle clusterware的一部分,有些人喜欢叫Oracle Local Repository,因为这repositery记录了本地资源的信息和配置,OCR文件被OHASD管理,并有多个进程读写,它只记录本节点信息。在GI的结构中RAC 环境下配置文件包含共享OCR和每个节点上的OLR,而在ORACLE RESTART环境下只有OLR。
在ocr 启动的过程中,OCR_HOME/LOG 的alert
2012-07-17 13:43:04.651
[ohasd(14704)]CRS-2112:The OLR service started on node znode1.
2012-07-17 13:43:04.677
[ohasd(14704)]CRS-1301:Oracle High Availability Service started on node znode1.
2012-07-17 13:43:04.695
[ohasd(14704)]CRS-8017:location: /etc/oracle/lastgasp has 2 reboot advisory log files, 0 were announced and 0 errors occurred
2012-07-17 13:43:19.386
[gpnpd(14863)]CRS-2328:GPNPD started on node znode1.
2012-07-17 13:43:22.697
[cssd(14947)]CRS-1713:CSSD daemon is started in clustered mode
启动顺序是clusterware>>asm instance(if use asm)>>oracle instance,11g r2版本之前asm是集成在rdbms软件中,这也是是为什么clusterware 的两个文件ocr 和voting disk非要在raw device不能
放在ASM中的原因,11gr2 asm 从rdbms转移到了GI软件中它的启动过程更加有意思,因为从OLR中可以揭秘,本站下篇会理一下。
看下OLR在linux环境中配置文件路径在/etc/oracle目录下
[grid@znode1 cdata]$ cd /etc/oracle
[grid@znode1 oracle]$ ll
total 1932
drwxrwx— 2 root oinstall 4096 Jul 6 12:16 lastgasp
-rw-r–r– 1 root oinstall 38 Jul 6 12:11 ocr.loc
-rw-r–r– 1 root root 0 Jul 6 12:11 ocr.loc.orig
-rw-r–r– 1 root oinstall 82 Jul 6 12:11 olr.loc
-rw-r–r– 1 root root 0 Jul 6 12:11 olr.loc.orig
drwxrwxr-x 5 root oinstall 4096 Jul 6 12:11 oprocd
drwxr-xr-x 3 root oinstall 4096 Jul 6 12:11 scls_scr
-rws–x— 1 root oinstall 1950234 Jul 6 12:11 setasmgid
[grid@znode1 oracle]$ cat olr.loc
olrconfig_loc=/u01/app/11.2.0/grid/cdata/znode1.olr
crs_home=/u01/app/11.2.0/grid
默认情况下olr 文件路径就是$GRID_HOME/cdata/
在grid 用户下执行
[grid@znode1 oracle]$ ocrcheck -config -local
Oracle Local Registry configuration is :
Device/File Name : /u01/app/11.2.0/grid/cdata/znode1.olr
在root用户下可以显示更多的信息
[root@znode1 ~]# $OCR_HOME/bin/ocrcheck -config
Oracle Cluster Registry configuration is :
Device/File Name : +crsdg
[root@znode1 ~]# $OCR_HOME/bin/ocrcheck -local
Status of Oracle Local Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2644
Available space (kbytes) : 259476
ID : 1587240313
Device/File Name : /u01/app/11.2.0/grid/cdata/znode1.olr
Device/File integrity check succeeded
Local registry integrity check succeeded
Logical corruption check succeeded
查看OLR文件的内容
# ocrdump -local -stdout
也可以用ocrdump -local file_name内容生成可读文件
就会看到那分支树结构的内容
里面的内容包含太多如home,version,GPnP details,ocr backup info..
其它一些管理命令
To export OLR to a file:
# ocrconfig –local –export file_name
To import a specified file to OLR:
# ocrconfig –local –import file_name
To import a specified file to OLR:
# ocrconfig –local –import file_name
To manually back up OLR:
# ocrconfig –local –manualbackup
To view the contents of the OLR backup file:
ocrdump -local -backupfile olr_backup_file_name
To change the OLR backup location:
ocrconfig -local -backuploc new_olr_backup_path
To restore OLR:
# crsctl stop crs
# ocrconfig -local -restore file_name
# ocrcheck -local
# crsctl start crs
$ cluvfy comp olr
了解OCR,OLR官方文档http://docs.oracle.com/cd/E11882_01/rac.112/e16794/votocr.htm#CWADD70700
对不起,这篇文章暂时关闭评论。