In the previous test environment, the device symbols were directly used to map the binding method. In this case, the hard disk was added due to insufficient space, as a result, the new hard disk occupies the original ocr/dev/sdb, which will cause the entire database to fail to start and use.
We can see that many people on the internet recommend using scsi_id to bind, so I want to convert the existing one. I did not expect that the 1st problem was that vmware workstation could not identify scsi_id. it would be okay if we used vbox. Fortunately, we found a solution on the network and added parameters to edit the VM:
Disk. EnableUUID = "TRUE"
In this way, vmware workstation can correctly identify scsi_id.
The binding rules are as follows:
/Dev/sdb/dev/raw/raw1 ocr
/Dev/sdc/dev/raw/raw2 voting
/Dev/sdd/dev/raw/raw3 asmdisk1
/Dev/sde/dev/raw/raw4 asmdisk2
Configure the new rule and create a file 99-Oracle.rules in the/etc/udev/rules. d directory. The content is as follows:
KERNEL = "sd *", BUS = "scsi", PROGRAM = "/sbin/scsi_id-g-u-s % p", RESULT = "36000c297628f8969e1738bd9218aa814 ", RUN + = "/bin/raw/dev/raw/raw1% N", NAME = "ocr-disk", OWNER = "oracle", GROUP = "oinstall ", MODE = "0640"
KERNEL = "sd *", BUS = "scsi", PROGRAM = "/sbin/scsi_id-g-u-s % p", RESULT = "36000c290c598768a2edf15a267e4d52c ", RUN + = "/bin/raw/dev/raw/raw2% N", NAME = "voting-disk", OWNER = "oracle", GROUP = "oinstall ", MODE = "0640"
KERNEL = "sd *", BUS = "scsi", PROGRAM = "/sbin/scsi_id-g-u-s % p", RESULT = "36000c2996ec122dead7aee84b7295271 ", RUN + = "/bin/raw/dev/raw/raw3% N", NAME = "asm-disk1", OWNER = "oracle", GROUP = "oinstall ", MODE = "0640"
KERNEL = "sd *", BUS = "scsi", PROGRAM = "/sbin/scsi_id-g-u-s % p", RESULT = "36000c29a6c4e9283e031dfbf1_b7ae8 ", RUN + = "/bin/raw/dev/raw/raw4% N", NAME = "asm-disk2", OWNER = "oracle", GROUP = "oinstall ", MODE = "0640"
In addition, if you have permission issues, use/etc/rc. d/rc. local to start the instance and perform authorization. Add the following content:
Chown oracle: oinstall/dev/raw/raw1
Chown oracle: oinstall/dev/raw/raw2
Chown oracle: oinstall/dev/raw/raw3
Chown oracle: oinstall/dev/raw/raw4
Chmod 640/dev/raw/raw1
Chmod 640/dev/raw/raw2
Chmod 640/dev/raw/raw3
Chmod 640/dev/raw/raw4
Remove the original binding rule file.
Start udev
/Sbin/udevcontrol reload_rules
/Sbin/start_udev
Verify the result after the system is restarted.
[Root @ R1 ~] # Ll/dev/*-disk *
Brw-r ----- 1 oracle oinstall 8, 65 02-03 20:00/dev/asm-disk1
Brw-r ----- 1 oracle oinstall 8, 81 02-03 20:00/dev/asm-disk2
Brw-r ----- 1 oracle oinstall 8, 33 02-03 20:00/dev/ocr-disk
Brw-r ----- 1 oracle oinstall 8, 49 02-03 20:00/dev/voting-disk
[Root @ R1 ~] # Ll/dev/raw *
Crw-r ----- 1 oracle oinstall 162, 1 02-03/dev/raw/raw1
Crw-r ----- 1 oracle oinstall 162, 2 02-03/dev/raw/raw2
Crw-r ----- 1 oracle oinstall 162, 3 02-03/dev/raw/raw3
Crw-r ----- 1 oracle oinstall 162, 4 02-03/dev/raw/raw4
In this way, the database can be used normally, and new devices do not have to worry about problems.
To obtain the device commands and parameters:
Scsi_id-g-v-s/block/sda
Or
For I in;
Do
Echo "sd $ I" "'scsi _ id-g-u-s/block/sd $ I '";
Done
Or
For I in B c d e;
Do
Echo "KERNEL = \" sd * \ ", BUS = \" scsi \", PROGRAM = \ "/sbin/scsi_id-g-u-s % p \", RESULT = \ "'scsi _ id-g-u-s/block/sd $ I '\", NAME = \ "asm-disk $ I \", OWNER = \ "oracle \", GROUP = \ "oinstall \", MODE = \ "0660 \""
Done
Note that the links generated by default are under/dev. If you want to specify parameters that are needed in different places like me, refer to the RUN section above.
-The End-