我的RAC 虚拟机在安装RAC的时候,我有2个ASM DISKGROUP分别是 +DG, +RECOVERYDEST,现在两上
group的空间都不足,安装的时候又没有创建多余的ASMDISK,只有现在亡羊补牢,在2个节点同时用
虚拟机创建ASMDISK,然后用 alter diskgroup add disk 命令增加SIZE。具体步骤如下:
1.先shutdown 掉两个虚拟机,通过vmware-vdiskmanager.exe命令产生一个disk文件:
C:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 1
0Gb -a lsilogic -t 2 "G:\Virtual Machines\RAC2008"\data2.vmdk
Creating disk 'G:\Virtual Machines\RAC2008\data2.vmdk'
Create: 100% done.
Virtual disk creation successful.
在两个节点的配置文件增加以下内容:
scsi1:6.present = "TRUE"
scsi1:6.mode = "independent-persistent"
scsi1:6.filename = "G:\Virtual Machines\RAC2008\data2.vmdk"
scsi1:6.deviceType = "disk"
scsi1:6.redo = ""
2.启动两个虚拟机,在node1上配置asm disk
[root@node1pub ~]# fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 140 1020127+ 82 Linux swap
/dev/sda3 141 1305 9357862+ 83 Linux
Disk /dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 130 1044193+ 83 Linux
Disk /dev/sdd: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 130 1044193+ 83 Linux
Disk /dev/sde: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 130 1044193+ 83 Linux
Disk /dev/sdf: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdf1 1 130 1044193+ 83 Linux
Disk /dev/sdg: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdg doesn't contain a valid partition table
系统发现了/dev/sdg,先进行分区:
[root@node1pub ~]# fdisk /dev/sdg
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklab
el
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1305, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305):
Using default value 1305
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
建立asm磁盘
[root@node1pub init.d]# /etc/init.d/oracleasm createdisk VOL5 /dev/sdg1
Marking disk "/dev/sdg1" as an ASM disk: [ OK ]
[root@node1pub init.d]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
VOL5
在node2上检查一下:
[root@node2pub ~]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
[root@node2pub ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
VOL5
3.登入ASM实例
[oracle@node1pub ~]$ export ORACLE_SID=+ASM1
[oracle@node1pub ~]$ asmcmd
ASMCMD> exit
[oracle@node1pub ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Aug 30 17:02:31 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> select path from v$asm_disk;
PATH
--------------------------------------------------------------------------------
ORCL:VOL5
ORCL:VOL1
ORCL:VOL2
ORCL:VOL3
ORCL:VOL4
SQL> select group_number,name,state,total_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
------------ ------------------------------ ----------- ----------
1 DATA MOUNTED 2038
2 FLASH_RECOVERY_AREA MOUNTED 2038
SQL> select group_number, name, total_mb, free_mb, total_mb-free_mb used_mb from v
$asm_disk_stat;
GROUP_NUMBER NAME TOTAL_MB FREE_MB USED_MB
------------ ------------------------------ ---------- ---------- ----------
0 10236 0 10236
1 VOL1 1019 9 1010
1 VOL2 1019 9 1010
2 VOL3 1019 30 989
2 VOL4 1019 0 1019
SQL> select name, total_mb, free_mb from v$asm_disk_stat;
NAME TOTAL_MB FREE_MB
------------------------------ ---------- ----------
10236 0
VOL1 1019 9
VOL2 1019 9
VOL3 1019 30
VOL4 1019 0
SQL> select * from v$asm_operation;
no rows selected
SQL> create diskgroup data2 external redundancy disk 'ORCL:VOL5';
Diskgroup created.
SQL> select group_number,name,state,total_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
------------ ------------------------------ ----------- ----------
1 DATA MOUNTED 2038
2 FLASH_RECOVERY_AREA MOUNTED 2038
3 DATA2 MOUNTED 10236
SQL> select group_number, name, total_mb, free_mb, total_mb-free_mb used_mb from v
$asm_disk_stat;
GROUP_NUMBER NAME TOTAL_MB FREE_MB USED_MB
------------ ------------------------------ ---------- ---------- ----------
1 VOL1 1019 9 1010
1 VOL2 1019 9 1010
2 VOL3 1019 30 989
2 VOL4 1019 0 1019
3 VOL5 10236 10186 50
4.需要在第二个节点手动mount4.需要在第二个节点手动mount
[oracle@node2pub ~]$ export ORACLE_SID=+ASM2
[oracle@node2pub ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Aug 30 17:22:43 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> altselect group_number,name,state,total_mb from v$asm_diskgroup;
SQL> select group_number,name,state,total_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
------------ ------------------------------ ----------- ----------
1 DATA MOUNTED 2038
2 FLASH_RECOVERY_AREA MOUNTED 2038
0 DATA2 DISMOUNTED 0
SQL> alter diskgroup data2 mount;
Diskgroup altered.
SQL> select group_number,name,state,total_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
------------ ------------------------------ ----------- ----------
1 DATA MOUNTED 2038
2 FLASH_RECOVERY_AREA MOUNTED 2038
3 DATA2 MOUNTED 10236