Linux下ASM实例的安装
说明:
OS Version: 2.6.9-22.ELsmp
ORACLE Version: Oracle 10g R2
安装ASMLib
[root@TEST asm]# rpm -Uvh oracleasm*
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.9-22.ELsm########################################### [ 67%]
3:oracleasmlib ########################################### [100%]
配置oracleasm
[root@TEST asm]# /etc/init.d/oracleasm configure
Configuring 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 an
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 []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
创建ASM disk,若使用rawdevice不需要这一步
[root@TEST init.d]# /etc/init.d/oracleasm createdisk disk1 /dev/cciss/c0d0p6
[root@TEST init.d]# /etc/init.d/oracleasm createdisk disk2 /dev/cciss/c0d0p7
[root@TEST init.d]# /etc/init.d/oracleasm createdisk disk3 /dev/cciss/c0d0p8
[root@TEST init.d]# /etc/init.d/oracleasm createdisk disk4 /dev/cciss/c0d0p9
在/tmp目录下创建一个名为内容如下
INSTANCE_TYPE=ASM
启动ASM实例
[oracle@TEST tmp]$ export ORACLE_SID=+ASM
连接到数据库
[oracle@TEST tmp]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Mar 16 16:07:43 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
创建spfile
SQL> create spfile from pfile='/tmp/init+ASM.ora';
File created.
启动数据库到nomount状态
SQL> startup nomount;
ORA-29701: unable to connect to Cluster Manager
对上面的错误以root用户运行$ORACLE_HOME/bin下的localconfig添加CSS服务即可解决
/u01/app/oracle/product/10.2.0/db_1/bin/localconfig add
SQL> startup nomount
ASM instance started
Total System Global Area 79691776 bytes
Fixed Size 1217812 bytes
Variable Size 53308140 bytes
ASM Cache 25165824 bytes
创建DISKGROUP
修改asm_diskstring参数指定discovery set
SQL> alter system set asm_diskstring='/dev/oracleasm/disks/DISK*';
System altered.
SQL> create diskgroup diskgroup1 external redundancy
2 disk
3 '/dev/oracleasm/disks/DISK1' name disk1,
4 '/dev/oracleasm/disks/DISK2' name disk2;
Diskgroup created.
SQL> select DISK_NUMBER ,MOUNT_STATUS,NAME, TOTAL_MB from v$asm_disk;
查看ASM_DISK信息
DISK_NUMBER MOUNT_S NAME TOTAL_MB
----------- ------- --------------- ------------- ---------- ----------
4 CLOSED 78442
5 CLOSED 78442
1 CACHED DISK2 78416
0 CACHED DISK1 55440
oracle关于ASMLib安装的文件(针对oracle 10g R1)上说在指定asm_diskstring时要使用ORCL:前缀是必须,上面的例子说明在oracle 10g R2不是必须的
http://www.oracle.com/technology/tech/linux/asmlib/install.html下面使用ORCL:前缀做测试
SQL> alter system set asm_diskstring='ORCL:DISK*';
System altered.
SQL> create diskgroup diskgroup1 external redundancy
2 disk
3 'ORCL:DISK1' name disk1,
4 'ORCL:DISK2' name disk2;
Diskgroup created.
查看ASM_DISK信息
SQL> select DISK_NUMBER ,MOUNT_STATUS,NAME, TOTAL_MB from v$asm_disk;
DISK_NUMBER MOUNT_S NAME TOTAL_MB
----------- ------- --------------- ------------- ---------- ------------------
6 CLOSED 78442
7 CLOSED 78442
0 CACHED DISK1 55466
1 CACHED DISK2 78442
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7419833/viewspace-567564/
,如需转载,请注明出处,否则将追究法律责任。