OCR磁盘的导出和导入、备份和恢复以及移动(ocrconfig命令的应用)

本文涉及的产品
自定义KV模板,自定义KV模板 500次/账号
个人证照识别,个人证照识别 200次/月
OCR统一识别,每月200次
简介:

数据库版本:10.2.0.1

一,使用导出、导入进行备份和恢复

Oracle推荐在对集群做调整时,比如增加、删除节点之前,应该对OCR做一个备份,可以使用export 备份到指定文件。如果做了replace或restore等操作,Oracle建议使用"cluvfy comp ocr -n all" 命令做一次全面检查。

1.首先关闭所有节点的CRS

复制代码
复制代码
[oracle@rac3 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac3        
ora....C3.lsnr application    ONLINE    ONLINE    rac3        
ora.rac3.gsd   application    ONLINE    ONLINE    rac3        
ora.rac3.ons   application    ONLINE    ONLINE    rac3        
ora.rac3.vip   application    ONLINE    ONLINE    rac3        
ora....SM2.asm application    ONLINE    ONLINE    rac4        
ora....C4.lsnr application    ONLINE    ONLINE    rac4        
ora.rac4.gsd   application    ONLINE    ONLINE    rac4        
ora.rac4.ons   application    ONLINE    ONLINE    rac4        
ora.rac4.vip   application    ONLINE    ONLINE    rac4        
ora.racdb.db   application    ONLINE    ONLINE    rac3        
ora....b1.inst application    ONLINE    ONLINE    rac3        
ora....b2.inst application    ONLINE    ONLINE    rac4        
ora....rver.cs application    ONLINE    ONLINE    rac3        
ora....db2.srv application    ONLINE    ONLINE    rac3  


[root@rac3 bin]# ./crsctl stop crs
Stopping resources.
Successfully stopped CRS resources 
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
复制代码
复制代码
复制代码
复制代码
[oracle@rac4 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac3        
ora....C3.lsnr application    ONLINE    ONLINE    rac3        
ora.rac3.gsd   application    ONLINE    ONLINE    rac3        
ora.rac3.ons   application    ONLINE    ONLINE    rac3        
ora.rac3.vip   application    ONLINE    ONLINE    rac3        
ora....SM2.asm application    ONLINE    ONLINE    rac4        
ora....C4.lsnr application    ONLINE    ONLINE    rac4        
ora.rac4.gsd   application    ONLINE    ONLINE    rac4        
ora.rac4.ons   application    ONLINE    ONLINE    rac4        
ora.rac4.vip   application    ONLINE    ONLINE    rac4        
ora.racdb.db   application    ONLINE    ONLINE    rac3        
ora....b1.inst application    ONLINE    ONLINE    rac3        
ora....b2.inst application    ONLINE    ONLINE    rac4        
ora....rver.cs application    ONLINE    ONLINE    rac3        
ora....db2.srv application    ONLINE    ONLINE    rac3        


[root@rac4 bin]# ./crsctl stop crs
Stopping resources.
Successfully stopped CRS resources 
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
复制代码
复制代码

 


2.导出OCR内容(需要root用户导出)

[root@rac4 bin]# ./ocrconfig -export /home/oracle/ocr.exp
[root@rac4 bin]# ll /home/oracle/ocr.exp 
-rw-r--r--  1 root root 98847 Jan 27 11:23 /home/oracle/ocr.exp

 

3.重新启动CRS

复制代码
复制代码
[root@rac3 bin]# ./crsctl start crs
Attempting to start CRS stack 
The CRS stack will be started shortly


[root@rac4 bin]# ./crsctl start crs
Attempting to start CRS stack 
The CRS stack will be started shortly
复制代码
复制代码

 

4.检查CRS状态

复制代码
复制代码
[root@rac3 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy

[root@rac4 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
复制代码
复制代码

 

5.破坏ocr内容

[root@rac4 bin]# dd if=/dev/zero of=/dev/raw/raw1 bs=1M count=120
dd: writing `/dev/raw/raw1': No space left on device
102+0 records in
101+0 records out

 

6.现在检查ocr一致性

[root@rac4 bin]# ./ocrcheck
PROT-601: Failed to initialize ocrcheck

[root@rac3 bin]# ./ocrcheck
PROT-601: Failed to initialize ocrcheck

 

7.使用cluvfy工具检查一致性

复制代码
复制代码
[root@rac3 cluvfy]# pwd
/opt/clusterware/cluvfy
[root@rac3 cluvfy]# ./runcluvfy.sh  comp ocr -n all

Verifying OCR integrity 
Unable to retrieve nodelist from Oracle clusterware.

Verification cannot proceed.
复制代码
复制代码

同样是检查失败

 

8.现在查看集群状态

[oracle@rac3 ~]$ crs_stat -t    --ocr被破坏,集群已经宕掉
CRS-0184: Cannot communicate with the CRS daemon.

[oracle@rac4 ~]$ crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.

 

9.使用import恢复OCR内容

[root@rac4 bin]# ./ocrconfig -import /home/oracle/ocr.exp 
[root@rac4 bin]#

 

10.再次检查OCR

复制代码
复制代码
[root@rac4 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     104344
         Used space (kbytes)      :       4340
         Available space (kbytes) :     100004
         ID                       :  945144556
         Device/File Name         : /dev/raw/raw1
                                    Device/File integrity check succeeded

                                    Device/File not configured

         Cluster registry integrity check succeeded
复制代码
复制代码
复制代码
复制代码
[root@rac3 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     104344
         Used space (kbytes)      :       4340
         Available space (kbytes) :     100004
         ID                       :  945144556
         Device/File Name         : /dev/raw/raw1
                                    Device/File integrity check succeeded

                                    Device/File not configured

         Cluster registry integrity check succeeded
复制代码
复制代码

 

11.检查通过,用cluvfy工具检查

复制代码
复制代码
[oracle@rac3 cluvfy]$ ./runcluvfy.sh  comp ocr -n all

Verifying OCR integrity 

Checking OCR integrity...

Checking the absence of a non-clustered configuration...
All nodes free of non-clustered, local-only configurations.

Uniqueness check for OCR device passed.

Checking the version of OCR...
OCR of correct Version "2" exists.

Checking data integrity of OCR...
Data integrity check for OCR passed.

OCR integrity check passed.

Verification of OCR integrity was successful. 
复制代码
复制代码

 

12.启动CRS

复制代码
复制代码
[root@rac3 bin]# ./crsctl start crs
Attempting to start CRS stack 
The CRS stack will be started shortly


[root@rac4 bin]# ./crsctl start crs
Attempting to start CRS stack 
The CRS stack will be started shortly
复制代码
复制代码
复制代码
复制代码
[oracle@rac4 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....SM1.asm application    ONLINE    OFFLINE               
ora....C3.lsnr application    ONLINE    OFFLINE               
ora.rac3.gsd   application    ONLINE    OFFLINE               
ora.rac3.ons   application    ONLINE    OFFLINE               
ora.rac3.vip   application    ONLINE    OFFLINE               
ora....SM2.asm application    ONLINE    OFFLINE               
ora....C4.lsnr application    ONLINE    OFFLINE               
ora.rac4.gsd   application    ONLINE    OFFLINE               
ora.rac4.ons   application    ONLINE    OFFLINE               
ora.rac4.vip   application    ONLINE    OFFLINE               
ora.racdb.db   application    ONLINE    OFFLINE               
ora....b1.inst application    ONLINE    OFFLINE               
ora....b2.inst application    ONLINE    OFFLINE               
ora....rver.cs application    ONLINE    OFFLINE               
ora....db2.srv application    ONLINE    OFFLINE 
复制代码
复制代码

 

13.最后检查CRS的状态

复制代码
复制代码
[root@rac3 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy

[root@rac4 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
复制代码
复制代码

 

二,移动OCR文件的位置

以下示例将演示如何把OCR从/dev/raw/raw1移动到/dev/raw/raw8上

1.首先查看是否有最近的OCR备份

复制代码
复制代码
[root@rac3 bin]# ./ocrconfig -showbackup

rac4     2015/01/23 17:54:53     /opt/ora10g/product/10.2.0/crs_1/cdata/crs

rac3     2014/10/10 16:51:14     /opt/ora10g/product/10.2.0/crs_1/cdata/crs

rac3     2014/10/10 12:51:11     /opt/ora10g/product/10.2.0/crs_1/cdata/crs

rac4     2015/01/23 17:54:53     /opt/ora10g/product/10.2.0/crs_1/cdata/crs

rac4     2015/01/23 17:54:53     /opt/ora10g/product/10.2.0/crs_1/cdata/crs
复制代码
复制代码

 

更改备份位置 ocrconfig -backuploc /oracle/backup/ocr

如果没有备份,可以立即执行一次导出作为备份

[root@rac3 bin]# ./ocrconfig -export /home/oracle/ocr.bak2 -s online

[root@rac3 bin]#

 

 

2.查看当前ocr配置

复制代码
复制代码
[root@rac3 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     104344
         Used space (kbytes)      :       4340
         Available space (kbytes) :     100004
         ID                       :  945144556
         Device/File Name         : /dev/raw/raw1
                                    Device/File integrity check succeeded

                                    Device/File not configured

         Cluster registry integrity check succeeded
复制代码
复制代码

输出显示当前只有一个Primary OCR,位于 /dev/raw/raw1,没有Mirror OCR

 

 

3.因为现在只有一个OCR文件,位于/dev/raw/raw1,所以不能直接改变这个OCR的位置,
必须先添加镜像后再修改,否则会出现错误:

[root@rac3 bin]# ./ocrconfig -replace ocr /dev/raw/raw8
PROT-16: Internal Error

 

4.添加一个Mirror OCR

[root@rac3 bin]# ./ocrconfig -replace ocrmirror /dev/raw/raw7
[root@rac3 bin]# 

 

5.确认添加成功

复制代码
复制代码
[root@rac3 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     104344
         Used space (kbytes)      :       4340
         Available space (kbytes) :     100004
         ID                       :  945144556
         Device/File Name         : /dev/raw/raw1
                                    Device/File integrity check succeeded
         Device/File Name         : /dev/raw/raw7    --新添加的Mirror OCR
                                    Device/File integrity check succeeded

         Cluster registry integrity check succeeded
复制代码
复制代码

现在有两个OCR了,可以修改原来的Primary OCR了

 

6.修改Primary OCR为/dev/raw/raw8

 

[root@rac3 bin]# ./ocrconfig -replace ocr /dev/raw/raw8
[root@rac3 bin]# 

 

7.确认修改成功

复制代码
复制代码
[root@rac3 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :    2096364
         Used space (kbytes)      :       4340
         Available space (kbytes) :    2092024
         ID                       :  945144556
         Device/File Name         : /dev/raw/raw8   --Primary OCR改变了
                                    Device/File integrity check succeeded
         Device/File Name         : /dev/raw/raw7
                                    Device/File integrity check succeeded

         Cluster registry integrity check succeeded
复制代码
复制代码

 

8.确认修改被同步到了其他节点

--在另一节点也能看到更新的信息

复制代码
复制代码
[root@rac4 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :    2096364
         Used space (kbytes)      :       4340
         Available space (kbytes) :    2092024
         ID                       :  945144556
         Device/File Name         : /dev/raw/raw8
                                    Device/File integrity check succeeded
         Device/File Name         : /dev/raw/raw7
                                    Device/File integrity check succeeded

         Cluster registry integrity check succeeded
复制代码
复制代码

 

9.使用ocrconfig -replace命令后,所有节点上的/etc/oracle/ocr.loc文件内容也都自动同步了,
如果有点节点没有同步,也可以手工修改使其同步:

[root@rac4 bin]# more /etc/oracle/ocr.loc 
#Device/file /dev/raw/raw1 getting replaced by device /dev/raw/raw8 
ocrconfig_loc=/dev/raw/raw8
ocrmirrorconfig_loc=/dev/raw/raw7
local_only=false

 

 

三,解决PROT-22: Storage too small错误

现在我想改回原来的Primary OCR

[root@rac3 bin]# ./ocrconfig -replace ocr /dev/raw/raw1
PROT-22: Storage too small

查询metalink发现,这是一个10.2.0.1上的bug,要求ocrmirror设备的大小要比原始ocr设备大128M,详细描述可以参考:ID 317628.1。

 

那如何更改过来????  可参考 http://blog.itpub.net/14284241/viewspace-442842/
尝试直接修改/etc/oracle/orc.loc文件

1.查看目前的OCR配置

复制代码
复制代码
[root@rac3 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :    2096364
         Used space (kbytes)      :       4340
         Available space (kbytes) :    2092024
         ID                       :  945144556
         Device/File Name         : /dev/raw/raw8
                                    Device/File integrity check succeeded
         Device/File Name         : /dev/raw/raw7
                                    Device/File integrity check succeeded

         Cluster registry integrity check succeeded
复制代码
复制代码

 

2.对目前的OCR备份

[root@rac3 bin]# ./ocrconfig -export /home/oracle/ocr.bak3 -s online
[root@rac3 bin]# 

 

3.停掉所有节点的CRS

复制代码
复制代码
[root@rac3 bin]# ./crsctl stop crs
Stopping resources.
Successfully stopped CRS resources 
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.


[root@rac4 bin]# ./crsctl stop crs
Stopping resources.
Error while stopping resources. Possible cause: CRSD is down.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
复制代码
复制代码

 

4.手动修改所有节点的/etc/oracle/ocr.loc文件

复制代码
复制代码
[root@rac3 bin]# more /etc/oracle/ocr.loc 
#Device/file /dev/raw/raw1 getting replaced by device /dev/raw/raw8 
ocrconfig_loc=/dev/raw/raw8
ocrmirrorconfig_loc=/dev/raw/raw7
local_only=false
[root@rac3 bin]# vi /etc/oracle/ocr.loc
[root@rac3 bin]# more /etc/oracle/ocr.loc 
#Device/file /dev/raw/raw1 getting replaced by device /dev/raw/raw8 
ocrconfig_loc=/dev/raw/raw1
#ocrmirrorconfig_loc=/dev/raw/raw7
local_only=false


[root@rac4 bin]# more /etc/oracle/ocr.loc 
#Device/file /dev/raw/raw1 getting replaced by device /dev/raw/raw8 
ocrconfig_loc=/dev/raw/raw8
ocrmirrorconfig_loc=/dev/raw/raw7
local_only=false
[root@rac4 bin]# vi /etc/oracle/ocr.loc
[root@rac4 bin]# more /etc/oracle/ocr.loc 
#Device/file /dev/raw/raw1 getting replaced by device /dev/raw/raw8 
ocrconfig_loc=/dev/raw/raw1
#ocrmirrorconfig_loc=/dev/raw/raw7
local_only=false
复制代码
复制代码

 

5.检查一下ocr  

--可以看到ocr现在检查报错

[root@rac3 bin]# ./ocrcheck
PROT-601: Failed to initialize ocrcheck

 

6.导入之前备份的OCR数据

[root@rac3 bin]# ./ocrconfig -import /home/oracle/ocr.bak3

 

7.现在检查ocr 

--两个节点检查正常,且ocr盘实现已经改过来了

复制代码
复制代码
[root@rac3 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     104344
         Used space (kbytes)      :       4340
         Available space (kbytes) :     100004
         ID                       : 1887132889
         Device/File Name         : /dev/raw/raw1
                                    Device/File integrity check succeeded

                                    Device/File not configured

         Cluster registry integrity check succeeded



[root@rac4 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     104344
         Used space (kbytes)      :       4340
         Available space (kbytes) :     100004
         ID                       : 1887132889
         Device/File Name         : /dev/raw/raw1
                                    Device/File integrity check succeeded

                                    Device/File not configured

         Cluster registry integrity check succeeded
复制代码
复制代码

 

8.启动crs

复制代码
复制代码
[root@rac3 bin]# ./crsctl start crs
Attempting to start CRS stack 
The CRS stack will be started shortly


[root@rac4 bin]# ./crsctl start crs
Attempting to start CRS stack 
The CRS stack will be started shortly
复制代码
复制代码
复制代码
复制代码
[oracle@rac3 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac3        
ora....C3.lsnr application    ONLINE    ONLINE    rac3        
ora.rac3.gsd   application    ONLINE    ONLINE    rac3        
ora.rac3.ons   application    ONLINE    ONLINE    rac3        
ora.rac3.vip   application    ONLINE    ONLINE    rac3        
ora....SM2.asm application    ONLINE    ONLINE    rac4        
ora....C4.lsnr application    ONLINE    ONLINE    rac4        
ora.rac4.gsd   application    ONLINE    ONLINE    rac4        
ora.rac4.ons   application    ONLINE    ONLINE    rac4        
ora.rac4.vip   application    ONLINE    ONLINE    rac4        
ora.racdb.db   application    ONLINE    ONLINE    rac4        
ora....b1.inst application    ONLINE    ONLINE    rac3        
ora....b2.inst application    ONLINE    ONLINE    rac4        
ora....rver.cs application    ONLINE    ONLINE    rac3        
ora....db2.srv application    ONLINE    ONLINE    rac4
复制代码
复制代码

 

9.检查crs状态

复制代码
复制代码
[root@rac3 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy


[root@rac4 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
复制代码
复制代码

至此我么把ocr盘通过手动的方式更改过来了,RAC正常。

 

--本文章 部分参考张晓明<<大话Oracle RAC>>及其他

 转:http://www.cnblogs.com/myrunning/p/4253696.html



本文转自 张冲andy 博客园博客,原文链接: http://www.cnblogs.com/andy6/p/5898015.html  ,如需转载请自行联系原作者


相关文章
|
3月前
|
文字识别 并行计算 PyTorch
MiniCPM-V 系列模型在多模态文档 RAG 中的应用(无需OCR的多模态文档检索+生成)
现在我们以 OpenBMB 基于 MiniCPM-V-2.0 训练的端到端多模态检索模型 MiniCPM-Visual-Embedding-v0 为例,实现无需OCR的多模态文档检索与问答。
MiniCPM-V 系列模型在多模态文档 RAG 中的应用(无需OCR的多模态文档检索+生成)
|
4月前
|
机器学习/深度学习 人工智能 文字识别
文本,文字扫描01,OCR文本识别技术展示,一个安卓App,一个简单的设计,文字识别可以应用于人工智能,机器学习,车牌识别,身份证识别,银行卡识别,PaddleOCR+SpringBoot+Andr
文本,文字扫描01,OCR文本识别技术展示,一个安卓App,一个简单的设计,文字识别可以应用于人工智能,机器学习,车牌识别,身份证识别,银行卡识别,PaddleOCR+SpringBoot+Andr
|
4月前
|
存储 文字识别 算法
印刷文字识别使用问题之在企业信息化中有哪些应用解决方案
印刷文字识别产品,通常称为OCR(Optical Character Recognition)技术,是一种将图像中的印刷或手写文字转换为机器编码文本的过程。这项技术广泛应用于多个行业和场景中,显著提升文档处理、信息提取和数据录入的效率。以下是印刷文字识别产品的一些典型使用合集。
|
4月前
|
文字识别 监控 算法
印刷文字识别使用问题之调用次数数据怎么导出
印刷文字识别产品,通常称为OCR(Optical Character Recognition)技术,是一种将图像中的印刷或手写文字转换为机器编码文本的过程。这项技术广泛应用于多个行业和场景中,显著提升文档处理、信息提取和数据录入的效率。以下是印刷文字识别产品的一些典型使用合集。
|
6月前
|
文字识别
分享:如何ocr识别身份证复印件并导出至excel表格 ? 图片批量识别导出excel表格应用,图片批量识别转excel表格的方法
该软件是一款OCR身份证识别工具,能批量处理图片,自动提取身份证信息并导出为Excel。支持百度网盘和腾讯云盘下载。用户界面直观,操作简单,适合新手。识别过程包括:打开图片、一键识别、导出结果。特别注意,此程序仅适用于身份证识别,不适用于其他类型的图片识别。
250 1
分享:如何ocr识别身份证复印件并导出至excel表格 ? 图片批量识别导出excel表格应用,图片批量识别转excel表格的方法
|
6月前
|
文字识别 开发工具 数据安全/隐私保护
印刷文字识别产品使用合集之教育场景识别,是否支持以Word文档的形式批量导入题目呢
印刷文字识别(Optical Character Recognition, OCR)技术能够将图片、扫描文档或 PDF 中的印刷文字转化为可编辑和可搜索的数据。这项技术广泛应用于多个领域,以提高工作效率、促进信息数字化。以下是一些印刷文字识别产品使用的典型场景合集。
|
存储 人工智能 文字识别
极速搭建基于人工智能的OCR识别应用
本场景将使用阿里云函数计算,Serverless 应用中心,带大家 1分钟 Serverless 极速部署基于人工智能的OCR识别应用。
|
6月前
|
机器学习/深度学习 人工智能 文字识别
印刷文字识别:技术与应用的新纪元
印刷文字识别:技术与应用的新纪元
|
文字识别
使用ModelScope社区搭建表格OCR应用
使用ModelScope社区搭建表格OCR应用
|
文字识别
使用ModelScope社区搭建OCR应用
使用ModelScope社区搭建OCR应用

热门文章

最新文章

下一篇
无影云桌面