Oracle 10g R2创建ASM实例
实验环境:
VMware + RHEL 5.4 + Oracle 10g R2
Linux的内核为:
[root@rac1 ~]# uname -rm
2.6.18-164.el5 i686
创建ASM实例有5个步骤:
1.安装ASM包
2.启用css服务(Cluster Synchronization Services )
3.创建ASM参数文件
4.创建密码文件及spfile参数文件
1.安装ASM包
使用ASM实例,需要到Oracle官方网站下载所需的ASM包。下载路径:ASMLib下载
注意下载支持该内核的包,分为两部分,一是Library and Tools,二是Drivers for kernel
我的Linux的内核为:
[root@rac1 ~]# uname -rm
2.6.18-164.el5 i686
则下载对应的包为:
Library and Tools
oracleasmlib-2.0.4-1.el5.x86_64.rpm
oracleasm-support-2.1.3-1.el5.i386.rpm
Drivers for kernel 2.6.18-164.el5
oracleasm-2.6.18-164.el5xen-2.0.5-1.el5.i686.rpm
oracleasm-2.6.18-164.el5debug-2.0.5-1.el5.i686.rpm
oracleasm-2.6.18-164.el5PAE-2.0.5-1.el5.i686.rpm
oracleasm-2.6.18-164.el5-debuginfo-2.0.5-1.el5.i686.rpm
oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm
安装ASMLib的RPM软件包
[root@rac1 asm]# rpm -Uvh oracleasm-support-2.1.3-1.el5.i386.rpm
验证安装的包
[root@rac1 asm]# rpm -qa | grep asm
oracleasm-support-2.1.3-1.el5
oracleasm-2.6.18-164.el5-debuginfo-2.0.5-1.el5
oracleasm-2.6.18-164.el5-2.0.5-1.el5
2.启用css服务(Cluster Synchronization Services )
用于同步ASM实例与RDBMS实例
使用root帐户进行配置,配置程序位于$ORACLE_HOME/bin
[root@rac1 ~]# /u01/oracle/10g/bin/localconfig add
/etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized
Adding to inittab
Startup will be queued to init within 90 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
devdb
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
3.创建ASM参数文件
[oracle@rac1 dbs]$ cat /u01/oracle/10g/dbs/init+ASM.ora
*.asm_diskstring='' #为空表示可以搜索任意的ASM磁盘
*.background_dump_dest='/u01/oracle/admin/+ASM/bdump' #后台进程存放位置
*.core_dump_dest='/u01/oracle/admin/+ASM/cdump' #核心进程存放位置
*.user_dump_dest='/u01/oracle/admin/+ASM/udump' #用户进程存放位置
*.instance_type='ASM' #实例类型,普通实例默认则为RDBMS
*.instance_name='+ASM' #实例名字
*.large_pool_size=12M #为实例分配large_pool的大小
*.remote_login_passwordfile='SHARED' #登陆认证方式
*.asm_power_limit=1 #控制均衡操作的资源,缺省为 1
创建ASM后台进程目录,参照参数文件中的配置来创建
[oracle@rac1 ~]$ echo $ORACLE_BASE
/u01/oracle/10g
[oracle@rac1 ~]$ mkdir -p $ORACLE_BASE/admin/+ASM/bdump
[oracle@rac1 ~]$ mkdir -p $ORACLE_BASE/admin/+ASM/udump
[oracle@rac1 ~]$ mkdir -p $ORACLE_BASE/admin/+ASM/cdump
4.创建密码文件及spfile参数文件
[oracle@rac1 ~]$ orapwd file=$ORACLE_HOME/dbs/orapw+ASM password=RedHat entries=8
[oracle@rac1 ~]$ export ORACLE_SID=+ASM
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup
ASM instance started
ORA-15110: no diskgroups mounted
SQL> create spfile from pfile;
SQL> select * from v$asm_diskgroup;
no rows selected
下一节介绍如何创建ASM磁盘,注意:不是创建磁盘组