在oracle 10g里面,我们可以使用ASMLib库创建asm实例,oracle在RHEL 6后好多是不单独提供下载,放在了Enterprise Linux Server镜像中。所以我们为了管理方便使用udev管理使用的设备映射。在oracle 11g中,推荐使用clusterware来管理资源情况,如果我们安装grid单实例,配置过程是一样的。
软件环境:
1、检查基本信息
[[email protected] ~]# lsb_release -idDistributor ID: RedHatEnterpriseServerDescription: Red Hat Enterprise Linux Server release 6.5 (Santiago)[[email protected] ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 10.24.34.37 rh-asm-37
2、添加用户和组配置环境变量
# groupadd -g 1000 oinstall # groupadd -g 1300 dba # groupadd -g 1301 oper # groupadd -g 1200 asmadmin # groupadd -g 1201 asmdba # groupadd -g 1202 asmoper # useradd -m -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -d /home/grid -s /bin/bash -c "Grid Infrastructure Owner" grid # useradd -m -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
3、验证用户
# id oracle uid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1300(dba),1301(oper),1201(asmdba) # id grid uid=1100(grid) gid=1000(oinstall) groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper)
4、修改用户密码
# echo ‘navinfo1!‘ |passwd --stdin oracle # echo ‘navinfo1!‘ |passwd --stdin grid
5、配置oracle及grid环境变量
--grid用户 # --------------------------------------------------- # .bash_profile # --------------------------------------------------- # OS User: grid # Application: Oracle Grid Infrastructure # Version: Oracle 11g Release 2 # --------------------------------------------------- export TEMP=/tmp export TMPDIR=/tmp export ORACLE_SID=+ASM export GRID_BASE=/u01/grid export ORACLE_BASE=$GRID_BASE export GRID_HOME=/u01/11.2.0/grid export ORACLE_HOME=$GRID_HOME export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib export ORACLE_PATH=/u01/oracle/dba_scripts/sql:$ORACLE_HOME/rdbms/admin export SQLPATH=/u01/oracle/dba_scripts/sql:$ORACLE_HOME/rdbms/admin export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/jdk/bin:/usr/sbin:$PATH:$HOME/bin export ORACLE_TERM=xterm stty erase ^H --oracle用户 # --------------------------------------------------- # .bash_profile # --------------------------------------------------- # OS User: oracle # Application: Oracle Database Software Owner # Version: Oracle 11g Release 2 # --------------------------------------------------- export TEMP=/tmp export TMPDIR=/tmp export ORACLE_UNQNAME=rhnode export ORACLE_SID=rhnode export ORACLE_BASE=/u01/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib export ORACLE_PATH=/u01/oracle/dba_scripts/sql:$ORACLE_HOME/rdbms/admin export SQLPATH=/u01/oracle/dba_tools/dba_scripts/sql export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/jdk/bin:/usr/sbin:$PATH:$HOME/bin export ORACLE_TERM=xterm stty erase ^H
时间: 2024-10-25 05:55:33