<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>惜分飞 &#187; OLR</title>
	<atom:link href="https://www.xifenfei.com/tag/olr/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Sun, 22 Nov 2026 15:21:14 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>OLR相关维护</title>
		<link>https://www.xifenfei.com/2013/12/olr%e7%9b%b8%e5%85%b3%e7%bb%b4%e6%8a%a4.html</link>
		<comments>https://www.xifenfei.com/2013/12/olr%e7%9b%b8%e5%85%b3%e7%bb%b4%e6%8a%a4.html#comments</comments>
		<pubDate>Sun, 22 Dec 2013 06:34:49 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle RAC]]></category>
		<category><![CDATA[OLR]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=5028</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2013/12/olr%e7%9b%b8%e5%85%b3%e7%bb%b4%e6%8a%a4.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="xifenfeicopyright">
<p>联系：<a href="https://www.xifenfei.com/about_xifenfei" target="_blank">手机/微信(+86 17813235971)   QQ(107644445)</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&#038;uin=107644445&#038;site=qq&#038;menu=yes"><img src="https://www.xifenfei.com/wp-content/themes/img/site_qq.jpg" alt="QQ咨询惜分飞" title="QQ咨询惜分飞"/></a></p>
<p>标题：<a href="https://www.xifenfei.com/2013/12/olr%e7%9b%b8%e5%85%b3%e7%bb%b4%e6%8a%a4.html" target="_blank">OLR相关维护</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p><strong>官方关于OLR描述</strong><br />
OLR is a registry similar to OCR located on each node in a cluster, but contains information specific to each node. It contains manageability information about Oracle Clusterware, including dependencies between various services. Oracle High Availability Services uses this information. OLR is located on local storage on each node in a cluster. Its default location is in the path Grid_home/cdata/host_name.olr, where Grid_home is the Oracle Grid Infrastructure home, and host_name is the host name of the node.<br />
OLR是类似OCR的东西，存储在集群的每个节点本地<br />
<br />
<strong>查看OLR位置</strong></p>
<pre class="brush: bash; title: ; notranslate">
[root@rac2 cdata]# cd /etc/oracle
[root@rac2 oracle]# ls -l
total 2868
drwxrwx--- 2 root oinstall    4096 Nov 24 20:00 lastgasp
drwxrwxrwt 2 root oinstall    4096 Dec 21 20:51 maps
-rw-r--r-- 1 root oinstall      96 Nov 25 18:38 ocr.loc
-rw-r--r-- 1 root root           0 Nov 24 19:58 ocr.loc.orig
-rw-r--r-- 1 root oinstall      80 Nov 24 19:58 olr.loc
-rw-r--r-- 1 root root           0 Nov 24 19:58 olr.loc.orig
drwxrwxr-x 5 root oinstall    4096 Nov 24 19:57 oprocd
drwxr-xr-x 3 root oinstall    4096 Nov 24 19:57 scls_scr
-rws--x--- 1 root oinstall 2904377 Nov 24 19:57 setasmgid
[root@rac2 oracle]# more olr.loc
olrconfig_loc=/u01/app/12.1.0/grid/cdata/rac2.olr
crs_home=/u01/app/12.1.0/grid
--在部分平台olr.loc文件可能在/var/opt/oracle/目录下

[root@rac2 oracle]#  ocrcheck -config -local
Oracle Local Registry configuration is :
         Device/File Name         : /u01/app/12.1.0/grid/cdata/rac2.olr

[root@rac2 oracle]# ocrcheck -local
Status of Oracle Local Registry is as follows :
         Version                  :          4
         Total space (kbytes)     :     409568
         Used space (kbytes)      :        996
         Available space (kbytes) :     408572
         ID                       :  816087519
         Device/File Name         : /u01/app/12.1.0/grid/cdata/rac2.olr
                                    Device/File integrity check succeeded

         Local registry integrity check succeeded

         Logical corruption check succeeded

[root@rac2 oracle]# ls -l /u01/app/12.1.0/grid/cdata/rac2.olr
-rw------- 1 root oinstall 503484416 Dec 22 12:09 /u01/app/12.1.0/grid/cdata/rac2.olr
</pre>
<p><strong>查看OLR备份</strong></p>
<pre class="brush: bash; title: ; notranslate">
[root@rac2 oracle]# ocrconfig -local -showbackup

rac2     2013/11/24 20:02:38     /u01/app/12.1.0/grid/cdata/rac2/backup_20131124_200238.olr
</pre>
<p><strong>备份OLR</strong></p>
<pre class="brush: bash; title: ; notranslate">
[root@rac2 oracle]# ocrconfig -local -manualbackup

rac2     2013/12/22 12:09:33     /u01/app/12.1.0/grid/cdata/rac2/backup_20131222_120933.olr

rac2     2013/11/24 20:02:38     /u01/app/12.1.0/grid/cdata/rac2/backup_20131124_200238.olr

[root@rac2 oracle]# ls -l /u01/app/12.1.0/grid/cdata/rac2/
total 1908
-rw-r--r-- 1 root root  860160 Nov 24 20:02 backup_20131124_200238.olr
-rw-r--r-- 1 root root 1085440 Dec 22 12:09 backup_20131222_120933.olr
</pre>
<p><strong>OLR异常恢复</strong></p>
<pre class="brush: bash; title: ; notranslate">
--破坏OLR
[root@rac2 oracle]# ls -l /u01/app/12.1.0/grid/cdata/rac2.olr
-rw------- 1 root oinstall 503484416 Dec 22 12:09 /u01/app/12.1.0/grid/cdata/rac2.olr
[root@rac2 oracle]# /u01/app/12.1.0/grid/cdata/rac2.olr /u01/app/12.1.0/grid/cdata/rac2.olr_bak

--关闭crs
[root@rac2 oracle]# crsctl stop crs

--启动crs报错
[root@rac2 oracle]# crsctl start crs
PROCL-26: Error while accessing the physical storage Operating System error [No such file or directory] [2]
CRS-4000: Command Start failed, or completed with errors.

--跟踪crs启动
[root@rac2 oracle]# strace crsctl start crs
……
uname({sys=&quot;Linux&quot;, node=&quot;rac2&quot;, ...})  = 0
open(&quot;/etc/oracle/olr.loc&quot;, O_RDONLY)   = 14
fstat(14, {st_mode=S_IFREG|0644, st_size=80, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd8ac628000
read(14, &quot;olrconfig_loc=/u01/app/12.1.0/gr&quot;..., 4096) = 80
read(14, &quot;&quot;, 4096)                      = 0
close(14)                               = 0
munmap(0x7fd8ac628000, 4096)            = 0
stat(&quot;/u01/app/12.1.0/grid/cdata/rac2.olr&quot;, 0x7fffa215a580) = -1 ENOENT (No such file or directory)
--这里可以看到先是读取/etc/oracle/olr.loc,然后获取/u01/app/12.1.0/grid/cdata/rac2.olr失败
……
--确定ohasd.bin关闭
[root@rac2 cdata]# ps -ef|grep ohasd
root     15715 31578  0 14:34 pts/3    00:00:00 grep ohasd

--还原OLR
[root@rac2 oracle]# ocrconfig -local -restore /u01/app/12.1.0/grid/cdata/rac2/backup_20131124_200238.olr
PROTL-35: The configured OLR location is not accessible
[root@rac2 oracle]# cd /u01/app/12.1.0/grid/cdata/
[root@rac2 cdata]# ls
localhost  rac12c-cluster  rac2  rac2.olr_bak
[root@rac2 cdata]# touch rac2.olr
[root@rac2 cdata]# chmod 600 rac2.olr
[root@rac2 cdata]# ocrconfig -local -restore /u01/app/12.1.0/grid/cdata/rac2/backup_20131124_200238.olr

--确定还原成功
[root@rac2 cdata]# ls -l
total 84200
drwxr-xr-x 2 grid oinstall      4096 Nov 24 19:37 localhost
drwxrwxr-x 2 grid oinstall      4096 Dec 22 09:07 rac12c-cluster
drwxr-xr-x 2 grid oinstall      4096 Dec 22 12:09 rac2
-rw------- 1 root root     503484416 Dec 22 14:29 rac2.olr
-rw------- 1 root oinstall 503484416 Dec 22 12:43 rac2.olr_bak

--启动crs
[root@rac2 cdata]# crsctl start crs
CRS-4123: Oracle High Availability Services has been started.
</pre>
<p><strong>其他OLR命令</strong></p>
<pre class="brush: bash; title: ; notranslate">
To export OLR to a file:
# ocrconfig –local –export file_name

To import a specified file to OLR:
# ocrconfig –local –import file_name

To view the contents of the OLR file:
ocrdump -local file_name

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
</pre>
<p>当OLR异常时,RAC节点不能正常启动,而且OLR不像OCR会定时自动备份,建议人工定时备份OLR</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/04/ocrvote-disk-maintenance-operations-addremovereplacemove.html" rel="bookmark" class="crp_title">OCR/Vote disk 维护操作</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/07/oracle-rac10g-unknown%e8%a7%a3%e5%86%b3.html" rel="bookmark" class="crp_title">Oracle RAC10g UNKNOWN解决</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/12/oracle-12c-rac-hub-and-leaf-%e7%9b%b8%e4%ba%92%e8%bd%ac%e6%8d%a2.html" rel="bookmark" class="crp_title">ORACLE 12C RAC hub AND leaf 相互转换</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2021/09/error-4-opening-dom-asmself-in.html" rel="bookmark" class="crp_title">19c 非第一个节点执行root.sh报Error 4 opening dom ASM/Self in 错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2015/09/ora-crf%e8%b5%84%e6%ba%90%e5%bc%82%e5%b8%b8-%e4%b8%b4%e6%97%b6%e5%81%9c%e6%ad%a2%e5%92%8c%e7%a6%81%e7%94%a8.html" rel="bookmark" class="crp_title">ora.crf资源异常&#8212;临时停止和禁用</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/08/1384.html" rel="bookmark" class="crp_title">RAC维护命令</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/04/%e7%bd%91%e5%85%b3%e4%b8%8d%e9%80%9a%e8%87%b4%e4%bd%bfviplsnr%e8%b5%84%e6%ba%90%e5%bc%82%e5%b8%b8.html" rel="bookmark" class="crp_title">网关不通致使vip/lsnr资源异常</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/07/crs-10-2-0-1-bug%ef%bc%88%e5%85%ac%e7%bd%91ip%e4%b8%ba%e7%a7%81%e6%9c%89ip%e6%97%b6%ef%bc%89.html" rel="bookmark" class="crp_title">crs 10.2.0.1 bug（公网ip为私有ip时）</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/04/rac-10g%e5%8d%87%e7%ba%a7%e5%88%b010-2-0-5.html" rel="bookmark" class="crp_title">RAC 10g升级到10.2.0.5</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2018/07/kfed-error-could-not-initialize-the-diag-context.html" rel="bookmark" class="crp_title">KFED &#8211; ERROR!!! could not initialize the diag context</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/03/%e5%9c%a8rac%e4%b8%adlsnrctl%e5%92%8csrvctl%e6%93%8d%e4%bd%9c%e7%9b%91%e5%90%ac%e5%8c%ba%e5%88%ab.html" rel="bookmark" class="crp_title">在RAC中lsnrctl和srvctl操作监听区别</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2015/06/%e8%ae%b0%e5%bd%95%e8%a7%a3%e5%86%b3%e4%b8%80%e6%ac%a1listener%e7%8a%b6%e6%80%81%e4%b8%banot-all-endpoints-registered%e7%9a%84%e6%95%85%e9%9a%9c.html" rel="bookmark" class="crp_title">记录解决一次Listener状态为Not All Endpoints Registered的故障</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2013/12/olr%e7%9b%b8%e5%85%b3%e7%bb%b4%e6%8a%a4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
