--破坏OLR
[[email protected] 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
[[email protected] oracle] # /u01/app/12.1.0/grid/cdata/rac2.olr /u01/app/12.1.0/grid/cdata/rac2.olr_bak
--关闭crs
[[email protected] oracle] # crsctl stop crs
--启动crs报错
[[email protected] 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启动
[[email protected] oracle] # strace crsctl start crs
……
uname ({sys= "Linux" , node= "rac2" , ...}) = 0
open ( "/etc/oracle/olr.loc" , 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, "olrconfig_loc=/u01/app/12.1.0/gr" ..., 4096) = 80
read (14, "" , 4096) = 0
close(14) = 0
munmap(0x7fd8ac628000, 4096) = 0
stat( "/u01/app/12.1.0/grid/cdata/rac2.olr" , 0x7fffa215a580) = -1 ENOENT (No such file or directory)
--这里可以看到先是读取 /etc/oracle/olr .loc,然后获取 /u01/app/12 .1.0 /grid/cdata/rac2 .olr失败
……
--确定ohasd.bin关闭
[[email protected] cdata] # ps -ef|grep ohasd
root 15715 31578 0 14:34 pts /3 00:00:00 grep ohasd
--还原OLR
[[email protected] 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
[[email protected] oracle] # cd /u01/app/12.1.0/grid/cdata/
[[email protected] cdata] # ls
localhost rac12c-cluster rac2 rac2.olr_bak
[[email protected] cdata] # touch rac2.olr
[[email protected] cdata] # chmod 600 rac2.olr
[[email protected] cdata] # ocrconfig -local -restore /u01/app/12.1.0/grid/cdata/rac2/backup_20131124_200238.olr
--确定还原成功
[[email protected] 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
[[email protected] cdata] # crsctl start crs
CRS-4123: Oracle High Availability Services has been started.
|