My RAC Virtual Machine reported that diskgroup space was insufficient during Backup yesterday, so I added asmdisk to my schedule. When installing RAC, I had 2 ASM diskgroups + DG, respectively, + recoverydest: Now + recoverydest has insufficient space, and no redundant asmdisk is created during installation. Only now can the remaining space be recovered. At the same time, two nodes can create asmdisk with virtual machines, then, run the alter diskgroup add disk command to increase the size. The procedure is as follows,
1. Shut down the VM first, and click Edit => hard disk => Add => Create new Virtual Disk => SCSI to start the VM.
2,Create a disk partition for Oracle ASM.
Prepare a group of original disks for Oracle ASM/dev/sdb.
On Rac1, run as the root user
# Fdisk/dev/SDB
Command (M for help): n
Command action
E extended
P primary partition (1-4) P
Partition Number (1-4): 1
First cylinder (1-512, default 1 ):
Using default value 1
Last cylinder or + size or + sizem or + sizek (1-2610, default 2610 ):
Using default value 2610
Command (M for help): W
The partition table has been altered!
Calling IOCTL () to re-read partition table.
Syncing disks.
3,Map the original device to the ASM disk.
Only when
You plan to use standard Linux I/O to create an ASM disk before you need to map the original device. Another way to create an ASM disk is to use the ASM library driver provided by Oracle.
Program. Later, you will use the ASM library driver to configure the ASM disk.
Perform the following tasks to map the original device to the previously created shared partition. Each time you boot a cluster node, the original device must be bound to the block device.
Add the following lines to/etc/sysconfig/rawdevices.
/Dev/raw/raw4/dev/sdb1
(In this case, each person is in a different situation and operates by actual partition)
To make the ing take effect immediately, run the following command as the root user:
#/Sbin/service rawdevices restart
[Root @ Rac1 ~] # Chown ORACLE: DBA/dev/raw/raw4 (Change permissions here)
[Root @ Rac1 ~] # Chmod 660/dev/raw/raw4
[Root @ Rac1 ~] # Ls-LAT/dev/raw/raw4
CrW-RW ---- 1 Oracle DBA 162, 4 Mar 3/dev/raw/raw4
CrW-RW ---- 1 Oracle DBA 162, 3 Mar 3/dev/raw/raw3
CrW-RW ---- 1 Oracle DBA 162, 2 Mar 3/dev/raw/raw2
CrW-RW ---- 1 Oracle DBA 162, 1 Mar 3/dev/raw/raw1
Run as an oracle user
Rac1-> ln-SF/dev/raw/raw4/u01/oradata/devdb/asmdisk4
4. Configure Oracle Automatic Storage Management (ASM)
Oracle ASM is closely integrated with Oracle databases and works with Oracle data management tools. It simplifies database storage management and provides raw magnetic
Disk I/O performance.
Configure asmlib.
Configure asmlib on two nodes as the root user.
#/Etc/init. d/oracleasm configure
Processing the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM Library
Driver. The following questions will determine whether the driver is
Loaded on boot and what permissions it will have. The current values
Will be shown in brackets ('[]'). Hitting without typing
Answer will keep that current value. CTRL-C will abort.
Default User to own the driver interface []: Oracle
Default group to own the driver interface []: DBA
Start Oracle ASM library driver on boot (y/n) [N]: Y
Fix permissions of Oracle ASM disks on boot (y/n) [y]: Y
Writing Oracle ASM library driver configuration: [OK]
Loading module "oracleasm": [OK]
Mounting asmlib driver filesystem: [OK]
Scanning System for ASM disks: [OK]
Create an ASM disk.
Create an ASM disk on any node as the root user.
#/Etc/init. d/oracleasm createdisk vol4/dev/sdb1
Marking disk "/dev/sdb1" as an ASM Disk: [OK]
#/Etc/init. d/oracleasm listdisks
Vol1
Vol2
Vol3
Vol4
So far, the OS level asmdisk settings are complete, and the next step is to set Oracle RAC. (I want to sell a token here. If this is the case, you must first think about it.
Where is the problem ?)
Start to enter Oracle and run the following command
[Oracle @ Rac1 bin] $ export oracle_sid = devdb1
[Oracle @ Rac1 bin] $ srvctl start nodeapps-N Rac1
PRKH-1010: unable to communicate with CRS services.
[OCR error (native: prsr_initclss: [21])]
[Oracle @ Rac1 bin] $ srvctl start ASM-N Rac1
PRKH-1010: unable to communicate with CRS services.
Then check [root @ Rac1 bin] #/etc/init. d/o2cb status
Module "configfs": loaded
Filesystem "configfs": mounted
Module "ocfs2_nodemanager": loaded
Module "ocfs2_dlm": loaded
Module "ocfs2_dlmfs": loaded
Filesystem "ocfs2_dlmfs": mounted
Checking o2cb cluster ocfs2: Online
Heartbeat dead threshold: 61
Network idle Timeout: 30000
Network keepalive delay: 2000
Network reconnect delay: 2000
Checking o2cb heartbeat: Not active
The problem is that ocfs2 is faulty. ocfs2 is a general cluster file system developed by Oracle and is integrated with the Enterprise Linux kernel. It allows
All nodes share files on the cluster file system, eliminating the need to manage original devices. Here, you will host OCR and voting disks in the ocfs2 file system.
You can obtain other information about ocfs2 from the ocfs2 user guide.
I think right, why is this error? It turns out that when you add a virtual machine hard disk, the virtual machine automatically uses the new disk as/dev/SDB, that is, the original disk
The ocfs2 disk is pushed to/dev/SDC. You need to reset it here.
Mount the file system.
To mount a file system, run the following command on two nodes.
# Mount-T ocfs2-O datavolume, nointr/dev/sdc1/ocfs
To mount the file system during boot, add the following lines to/etc/fstab on the two nodes.
/Etc/fstab
/Dev/sdc1/ocfs ocfs2 _ netdev, datavolume, nointr 0
Run [root @ Rac1 bin] #/etc/init. d/o2cb status
Module "configfs": loaded
Filesystem "configfs": mounted
Module "ocfs2_nodemanager": loaded
Module "ocfs2_dlm": loaded
Module "ocfs2_dlmfs": loaded
Filesystem "ocfs2_dlmfs": mounted
Checking o2cb cluster ocfs2: Online
Heartbeat dead threshold: 61
Network idle Timeout: 3000
Network keepalive delay: 2000
Network reconnect delay: 2000
Checking o2cb heartbeat: Active
The problem is solved.
[Oracle @ Rac1 bin] $ export oracle_sid = devdb1
[Oracle @ Rac1 bin] $ srvctl start nodeapps-N Rac1
[Oracle @ Rac1 bin] $ srvctl start ASM-N Rac1
[Oracle @ Rac1 bin] $ srvctl start instance-D devdb-I devdb1
[Oracle @ Rac1 bin] $ sqlplus '/As sysdba'
SQL * Plus: Release 10.2.0.1.0-production on Thu Mar 3 13:10:43 2011
Copyright (c) 1982,200 5, Oracle. All rights reserved.
Connected:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-productiowith the partitioning,
Real Application Clusters, OLAP and Data Mining options
SQL> select open_mode from V $ Database
Open_mode
----------
Read Write
(Continuous ....)