1、Oracle 11g安装
略
详细过程请参考:
http://blog.sina.com.cn/s/blog_7c5a82970101excf.html
2、安装Oracleasm软件包
rpm -ivh oracleasm-support-2.1.7-1.el5.x86_64.rpm oracleasmlib-2.0.4-1.el5.x86_64.rpm oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm
一共三个
下载位置:
http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html
3、配置oracleasm并安装磁盘组
/etc/init.d/oracleasm configure
/etc/init.d/oracleasm createdisk V1 /dev/sdb1
/etc/init.d/oracleasm createdisk V2 /dev/sdc1
4、安装Oracle Grid Infrastructure
(1) 配置grid用户
vim /etc/security/limits.conf
------------------------------------------
#Oracle configure shell parameters
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
grid soft nofile 65536
grid hard nofile 65536
grid soft nproc 16384
grid hard nproc 16384
vim /home/grid/.bashrc
export ORACLE_HOME=/u01/app/11.2.0/grid
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_OWNER=oracle
export ORACLE_SID=+ASM
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LANG=en_US
alias sqlplus='rlwrap sqlplus'
alias lsnrctl='rlwrap lsnrctl'
alias asmcmd='rlwrap asmcmd'
(2) oracle和grid用户分别要属于相应的用户组
useradd -g oinstall -G dba,oper,asmdba,asmadmin oracle
useradd -g oinstall -G dba,asmadmin,asmdba,asmoper grid
(3) 安装软件
./runInstaller
选择Install and Configure Gride Infrastructure for a Standalone Server
(4)指定磁盘位置
/dev/oracleasm/disks
5、使用dbca创建基于ASM的实例
注意:
一定要让oracle在oinstall和asmadmin组和asmdba中,否则在oracle用户下创建数据库会无法识别oracleasm磁盘组
如果出现asmca needs oracle grid infrastructure to configure asm的错误。那一般是因为在单节点安装grid出现的常见问题,一种方法是重新运行一次grid下面的runInstaller(不推荐)。
还有一种方法是安装后执行一个Perl脚本/u01/app/grid/product/11.2.0/grid/perl/bin/perl -I /u01/app/grid/product/11.2.0/grid/perl/lib/ -I /u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/crs/install/roothas.pl
这样就可以了。