天天看点

oracle11g 创建ASM实例

        oracle11g的ASM创建放在grid里面了,所以要先安装grid.

        一:初始化环境  

Last login: Thu May 22 11:26:13 2014
[[email protected] ~]# groupadd -g 500 oinstall
[[email protected] ~]# 
[[email protected] ~]# groupadd -g 501 dba
[[email protected] ~]# 
[[email protected] ~]# groupadd -g 502 oper
[[email protected] ~]# 
[[email protected] ~]# groupadd -g 600 asmadmin
[[email protected] ~]# 
[[email protected] ~]# groupadd -g 601 asmoper
[[email protected] ~]# 
[[email protected] ~]# groupadd -g 602 asmdba
[[email protected] ~]# 
[[email protected] ~]# useradd -g oinstall -G dba,asmdba,oper oracle
[[email protected] ~]# 
[[email protected] ~]# useradd -g oinstall -G asmadmin,asmdba,asmoper,dba grid
[[email protected] ~]# 
[[email protected] ~]# mkdir -p /u01/app/oracle/product/grid
[[email protected] ~]# 
[[email protected] ~]# mkdir -p /u01/app/oracle/product/db_1
[[email protected] ~]# 
[[email protected] ~]# chown -R grid:oinstall /u01
[[email protected] ~]# 
[[email protected] ~]# chown -R oracle:oinstall /u01/app/oracle/product/db_1
[[email protected] ~]# 
[[email protected] ~]# chmod -R 775 /u01
[[email protected] ~]# 
[[email protected] ~]# passwd oracle
Changing password for user oracle.
New UNIX password: 
BAD PASSWORD: it is too simplistic/systematic
Retype new UNIX password: 
passwd: all authentication tokens updated successfully.
[[email protected] ~]# 
[[email protected] ~]# 
[[email protected] ~]# passwd grid
Changing password for user grid.
New UNIX password: 
BAD PASSWORD: it is too simplistic/systematic
Retype new UNIX password: 
passwd: all authentication tokens updated successfully.
[[email protected] ~]# 
           

       二:编辑用户环境

配置 grid 用户环境变量:
[[email protected] /]# vi /home/grid/.bash_profile
export ORACLE_SID=+ASM
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid
export ORACLE_TERM=xterm
export TMP=/tmp
export TMPDIR=$TMP
PATH=$PATH:$HOME/bin
export PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
[[email protected] /]# source /home/grid/.bash_profile
配置oracle 用户环境变量:
[[email protected] /]# vi /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=ora11g
export ORACLE_OWNER=oracle
export ORACLE_TERM=vt100
export PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
[[email protected] /]#source /home/oracle/.bash_profile
           

       除了这个以外还要修改limits.conf     /etc/pam.d/login   /etc/profile    /etc/sysctl.conf 等系统相关文件这里不再列出。

三:配置raw设备

     可参靠我之前写的:http://blog.csdn.net/suyishuai/article/details/26344107

     配置好以后,验证

[[email protected] dev]# 
[[email protected] dev]# ls -al asm-disk*
brw-rw---- 1 grid oinstall 8, 17 May 22 17:24 asm-disk1
brw-rw---- 1 grid oinstall 8, 33 May 22 17:24 asm-disk2
brw-rw---- 1 grid oinstall 8, 49 May 22 17:04 asm-disk3
[[email protected] dev]# 
[[email protected] dev]# 
           

四:用grid用户运行安装包,界面如下

oracle11g 创建ASM实例
oracle11g 创建ASM实例
oracle11g 创建ASM实例
oracle11g 创建ASM实例
oracle11g 创建ASM实例

如果这个时候,你选择路径后,不出来,检查raw的宿主。如下图

oracle11g 创建ASM实例

继续

oracle11g 创建ASM实例
oracle11g 创建ASM实例
oracle11g 创建ASM实例
oracle11g 创建ASM实例

提示少rpm包。这个比10G太先进了。。。自己找包安装吧

oracle11g 创建ASM实例
oracle11g 创建ASM实例
oracle11g 创建ASM实例

五:安装成功验证

[[email protected] dev]# su - grid
[[email protected] ~]$ 
[[email protected] ~]$ 
[[email protected] ~]$ 
[[email protected] ~]$ srvctl status asm
ASM is running on shu3
[[email protected] ~]$ 
[[email protected] ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): shu3
[[email protected] ~]$ 
[[email protected] ~]$ asmca --出现下面界面
           
oracle11g 创建ASM实例

 在11.2.0.4这个版本里面,ASM是开机启动的。

继续阅读