vbox中模拟
新增4块共享盘
fdisk完毕
Disk /dev/sdg: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdg1 1 261 2096451 83 Linux
Disk /dev/sdh: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdh1 1 261 2096451 83 Linux
Disk /dev/sdi: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdi1 1 261 2096451 83 Linux
Disk /dev/sdj: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdj1 1 261 2096451 83 Linux
[root@rac1 ~]#
创建asm disk
[root@rac1 ~]# /etc/init.d/oracleasm createdisk CRS1 /dev/sdg1
Marking disk "CRS1" as an ASM disk: [ OK ]
[root@rac1 ~]# /etc/init.d/oracleasm createdisk CRS2 /dev/sdh1
Marking disk "CRS2" as an ASM disk: [ OK ]
[root@rac1 ~]# /etc/init.d/oracleasm createdisk CRS3 /dev/sdi1
Marking disk "CRS3" as an ASM disk: [ OK ]
[root@rac1 ~]# /etc/init.d/oracleasm createdisk CRS4 /dev/sdj1
Marking disk "CRS4" as an ASM disk: [ OK ]
两个节点都扫一下
[root@rac2 ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@rac2 ~]# /etc/init.d/oracleasm listdisks
CRS1
CRS2
CRS3
CRS4
VDKBACK
VDKDATA
VDKOCR1
VDKOCR2
VDKVOTE
[root@rac2 ~]#
创建diskgroup
asmca或者sqlplus都可以
[grid@rac1 ~]$ export DISPLAY=192.168.100.1:0.0
[grid@rac1 ~]$ xhost +
access control disabled, clients can connect from any host
xhost: must be on local machine to enable or disable access control.
[grid@rac1 ~]$ asmca
[grid@rac1 ~]$ sqlplus "/as sysasm"
SQL*Plus: Release 11.2.0.1.0 Production on Thu May 9 17:30:24 2019
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> select name from v$asm_diskgroup;
NAME
------------------------------
OCR
DATA
BACK
ARCH
OCRTEMP
OCRNEW
6 rows selected.
SQL>
[root@rac1 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2780
Available space (kbytes) : 259340
ID : 1749057863
Device/File Name : +OCR
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check succeeded
我靠复制错了,结果研究了半天PROT-30,原来是名字写错了,晕
ocrconfig -add +CRSTEMP
[root@rac1 ~]# ocrconfig -add +CRSTEMP
PROT-30: The Oracle Cluster Registry location to be added is not accessible
[root@rac1 ~]# oerr PROT 30
00030, 0, "The Oracle Cluster Registry location to be added is not accessible"
// *Cause: The Oracle Cluster Registry location to be added did not exist,
// wasn't mounted, or did not have the required permissions.
// *Action: Ensure that the location exists, that it is mounted and visible to
// all nodes in the cluster, and that its permissions are correct.
[root@rac1 ~]# ocrconfig -add +OCRTEMP
[root@rac1 ~]#
ocrcheck
[root@rac1 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2760
Available space (kbytes) : 259360
ID : 1749057863
Device/File Name : +OCR
Device/File integrity check succeeded
Device/File Name : +OCRTEMP
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
[root@rac1 ~]# ocrconfig -replace +OCR -replacement +OCRNEW
[root@rac1 ~]#
ocrcheck
[root@rac1 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2760
Available space (kbytes) : 259360
ID : 1749057863
Device/File Name : +OCRNEW
Device/File integrity check succeeded
Device/File Name : +OCRTEMP
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check succeeded
crsctl replace votedisk +OCRNEW
[root@rac1 ~]# crsctl replace votedisk +OCRNEW
Successful addition of voting disk 03a74ebaa3d34f21bf867218705e4005.
Successful addition of voting disk 2ed09796dd024f2dbf0a7b0598f5233f.
Successful addition of voting disk 298ed82368994f79bf7f9044a1e5ce76.
Successful deletion of voting disk 066b704e38164f4ebf2417cbf2caaa26.
Successfully replaced voting disk group with +OCRNEW.
CRS-4266: Voting file(s) successfully replaced
crsctl query css votedisk
[root@rac1 ~]# crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 03a74ebaa3d34f21bf867218705e4005 (ORCL:CRS2) [OCRNEW]
2. ONLINE 2ed09796dd024f2dbf0a7b0598f5233f (ORCL:CRS3) [OCRNEW]
3. ONLINE 298ed82368994f79bf7f9044a1e5ce76 (ORCL:CRS4) [OCRNEW]
Located 3 voting disk(s).
[root@rac1 ~]#