如何在linux系统的Oracle 10gR2 rac中新增ASM磁盘组
如何在linux系统的Oracle 10gR2 rac中新增ASM磁盘组
1.需要对新增加的设备在每个节点进行授权 使oracle用户能操作
[root@rac1 oracle]# chown oracle:dba /dev/raw/raw6
[root@rac1 oracle]# chmod 660 /dev/raw/raw6
[root@rac2 oracle]# chown oracle:dba /dev/raw/raw6
[root@rac2 oracle]# chmod 660 /dev/raw/raw6
2.oracle用户扫描磁盘路径 能让asm认到设备
select path from v$asm_disk;
设置asm设备搜索路径
alter system set asm_diskstring='ORCL:VOL*','/dev/raw/raw*';
3.在rac1节点进行操作
[oracle@rac1 ~]$ export ORACLE_SID=+ASM1
[oracle@rac1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jun 27 09:03:28 2008
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 group_number,name,state,total_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
------------ ------------------------------ ----------- ----------
2 DATA MOUNTED 3057
SQL> create diskgroup testdg external redundancy disk '/dev/raw/raw6';
Diskgroup created.
SQL> select group_number,name,state,total_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
------------ ------------------------------ ----------- ----------
1 TESTDG MOUNTED 2047
2 DATA MOUNTED 3057
SQL> exit
4.在rac2节点进行操作
[oracle@rac2 dbs]$ export ORACLE_SID=+ASM2
[oracle@rac2 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jun 27 09:08:26 2008
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 group_number,name,state,total_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
------------ ------------------------------ ----------- ----------
2 DATA MOUNTED 3057
SQL> alter diskgroup testdg mount;
alter diskgroup testdg mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficient number of disks for diskgroup
"TESTDG"
这是因为没在节点2进行授权 所以报这个错 按照1点 进行授权后就正常了
SQL> select group_number,name,state,total_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
------------ ------------------------------ ----------- ----------
0 TESTDG DISMOUNTED 0
2 DATA MOUNTED 3057
SQL> alter diskgroup testdg mount;
Diskgroup altered.
SQL> select group_number,name,state,total_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
------------ ------------------------------ ----------- ----------
1 TESTDG MOUNTED 2047
2 DATA MOUNTED 3057
SQL>