配置11gR2 RAC需要安装Oracle Grid Infrastructure软件、Oracle数据库软件,其中Grid软件等同于Oracle 10g的Clusterware集群件。Oracle建议以不同的用户分别安装Grid Infrastructure软件、Oracle数据库软件,我们这里以grid用户安装Grid Infrastructure,oracle用户安装Oracle数据库软件。并且grid、oracle用户需要属于不同的用户组。在配置RAC时,还要求这两个用户在RAC的不同节点上uid、gid要一致。用户、组的对应信息见下表:

Group Name

Group ID

Group Info

Oracle User(1100)

Grid User(1101)

oinstall

1000

Inventory Group

Y

Y

dba

1300

OSDBA Group

Y

oper

1301

OSOPER Group

Y

asmadmin

1200

OSASM

Y

asmdba

1201

OSDBA for ASM

Y

Y

asmoper

1202

OSOPER for ASM

Y

1.创建用户和组

groupadd -g 1000 oinstall

groupadd -g 1200 asmadmin
groupadd -g 1201 asmdba
groupadd -g 1202 asmoper

groupadd -g 1300 dba
groupadd -g 1301 oper

useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,dba -d /home/grid -s /bin/bash -c "grid Infrastructure Owner" grid
echo "grid" | passwd --stdin grid2014
echo "export TMP=/tmp">> /home/grid/.bash_profile
echo 'export TMPDIR=$TMP'>>/home/grid/.bash_profile
echo "export ORACLE_SID=+ASM1">> /home/grid/.bash_profile
echo "export ORACLE_BASE=/u01/app/grid">> /home/grid/.bash_profile
echo "export ORACLE_HOME=/u01/app/11.2.0/grid">> /home/grid/.bash_profile
echo "export ORACLE_TERM=xterm">> /home/grid/.bash_profile
echo 'export PATH=/usr/sbin:$PATH'>> /home/grid/.bash_profile
echo 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/grid/.bash_profile
echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>> /home/grid/.bash_profile
echo "export EDITOR=vi" >> /home/grid/.bash_profile
echo "umask 022">> /home/grid/.bash_profile

useradd -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
echo "oracle" | passwd --stdin oracle2014
echo "export TMP=/tmp">> /home/oracle/.bash_profile
echo 'export TMPDIR=$TMP'>>/home/oracle/.bash_profile
echo "export ORACLE_HOSTNAME=rac1.db.com">> /home/oracle/.bash_profile
echo "export ORACLE_SID=orcl1">> /home/oracle/.bash_profile
echo "export ORACLE_BASE=/u01/app/oracle">> /home/oracle/.bash_profile
echo 'export ORACLE_HOME=$ORACLE_BASE/11.2.0/db_1'>> /home/oracle/.bash_profile
echo "export ORACLE_TERM=xterm">> /home/oracle/.bash_profile
echo 'export PATH=/usr/sbin:$PATH'>> /home/oracle/.bash_profile
echo 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/oracle/.bash_profile
echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>> /home/oracle/.bash_profile
echo "export EDITOR=vi" >> /home/oracle/.bash_profile
echo "umask 022">> /home/oracle/.bash_profile

测试

[root@node1 shell]# id grid

uid=1100(grid) gid=1000(oinstall) groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper)

[root@node1 shell]# id oracle

uid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper)

[root@node1 shell]#

说明:在节点node2上执行该脚本时,需要将grid用户环境变量ORACLE_SID修改为+ASM2,oracle用户环境变量ORACLE_SID修改为devdb2,ORACLE_HOSTNAME环境变量修改为node2.localdomain

2.建路径、改权限

关于grid、oracle用户的环境变量配置信息,见下述表格。

Environment Variable

Grid User

Oracle User

ORACLE_BASE

/u01/app/grid

/u01/app/oracle

ORACLE_HOME

/u01/app/11.2.0/grid

/u01/app/oracle/product/11.2.0/db_1

ORACLE_SID [node1]

+ASM1

devdb1

ORACLE_SID [node2]

+ASM2

devdb2

mkdir -p /u01/app/grid
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
chown -R grid:oinstall /u01/app/grid
chmod -R 775 /u01

[root@node1 shell]# cd /u01/app/

[root@node1 app]# ll

total 12

drwxrwxr-x 3 grid   oinstall 4096 Apr 24 10:06 11.2.0

drwxrwxr-x 2 grid   oinstall 4096 Apr 24 10:06 grid

drwxrwxr-x 2 oracle oinstall 4096 Apr 24 10:06 oracle

[root@node1 app]#

3. 修改/etc/security/limits.conf,配置oracle、grid用户的shell限制

cp /etc/security/limits.conf /etc/security/limits.conf.bak
echo "oracle soft nproc 2047" >>/etc/security/limits.conf
echo "oracle hard nproc 16384" >>/etc/security/limits.conf
echo "oracle soft nofile 1024" >>/etc/security/limits.conf
echo "oracle hard nofile 65536" >>/etc/security/limits.conf
echo "grid soft nproc 2047" >>/etc/security/limits.conf
echo "grid hard nproc 16384" >>/etc/security/limits.conf
echo "grid soft nofile 1024" >>/etc/security/limits.conf
echo "grid hard nofile 65536" >>/etc/security/limits.conf

4. 修改/etc/pam.d/login配置文件

   

cp /etc/pam.d/login /etc/pam.d/login.bak
echo "session required /lib/security/pam_limits.so" >>/etc/pam.d/login
echo "session required pam_limits.so" >>/etc/pam.d/login

5. 修改/etc/profile文件

 

cp /etc/profile /etc/profile.bak
echo 'if [ $USER = "oracle" ]||[ $USER = "grid" ]; then' >> /etc/profile
echo 'if [ $SHELL = "/bin/ksh" ]; then' >> /etc/profile
echo 'ulimit -p 16384' >> /etc/profile
echo 'ulimit -n 65536' >> /etc/profile
echo 'else' >> /etc/profile
echo 'ulimit -u 16384 -n 65536' >> /etc/profile
echo 'fi' >> /etc/profile
echo 'fi' >> /etc/profile

6.修改内核配置文件

cp /etc/sysctl.conf /etc/sysctl.conf.bak
echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
echo "fs.file-max = 6815744" >> /etc/sysctl.conf
echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
echo "kernel.shmmax = 1054472192" >> /etc/sysctl.conf
echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586" >> /etc/sysctl.conf
echo "net.ipv4.tcp_wmem = 262144 262144 262144" >> /etc/sysctl.conf
echo "net.ipv4.tcp_rmem = 4194304 4194304 4194304" >> /etc/sysctl.conf

7. 停止ntp服务,11gR2新增的检查项

[root@node1 ~]# service ntpd status

ntpd is stopped

[root@node1 ~]# chkconfig ntpd off

[root@node1 ~]# cat /etc/ntp

ntp/      ntp.conf

[root@node1 ~]# cp /etc/ntp.conf /etc/ntp.conf.bak

[root@node1 ~]# rm -rf /etc/ntp.conf

[root@node1 ~]#

8. node2准备工作

我们已经在node1完成基本准备配置工作,在node2上重复上述1到7中准备工作,以完成节点2的准备工作。

Linux下搭建Oracle11g RAC(3)----创建用户及配置相关文件的更多相关文章

  1. Linux下搭建Oracle11g RAC(9)----创建RAC数据库

    接下来,使用DBCA来创建RAC数据库. ① 以oracle用户登录图形界面,执行dbca,进入DBCA的图形界面,选择第1项,创建RAC数据库: ② 选择创建数据库选项,Next: ③ 选择创建通用 ...

  2. Linux下搭建Oracle11g RAC(8)----创建ASM磁盘组

    以grid用户创建ASM磁盘组,创建的ASM磁盘组为下一步创建数据库提供存储. ① grid用户登录图形界面,执行asmca命令来创建磁盘组: ② 进入ASMCA配置界面后,单击Create,创建新的 ...

  3. Linux下搭建Oracle11g RAC(1)----IP分配与配置IP

    首先需要说明的,我的RAC搭建不是在虚拟机上完成的,而是在实际部署中,二者之间有些许差异,本人水平有限,请见谅. 其中,每台机器至少需要配置3个IP地址,在安装操作系统的过程中,我们需要配置公网IP和 ...

  4. Linux下搭建Oracle11g RAC(5)----配置ASM磁盘

    将共享磁盘格式化.然后用asmlib将其配置为ASM磁盘,用于将来存放OCR.Voting Disk和数据库用. 注意:只需在其中1个节点上格式化就可以,接下来我们选择在node1节点上格式化. 这里 ...

  5. Linux下搭建Oracle11g RAC(2)----配置DNS服务器,确认SCAN IP可以被解析

    从Oracle 11gR2开始,引入SCAN(Single Client Access Name) IP的概念,相当于在客户端和数据库之间增加一层虚拟的网络服务层,即是SCAN IP和SCAP IP  ...

  6. Linux下搭建Oracle11g RAC(4)----配置oracle,grid用户SSH对等性

    虽然在安装软件的过程中,oracle会自动配置SSH对等性,建议在安装软件之前手工配置. 配置oracle用户对等性: node1: [root@node1 ~]# su - oracle node1 ...

  7. Linux下搭建Oracle11g RAC(7)----安装Oracle 软件

    从此步骤开始,我们正式安装oracle软件: ① 以oracle用户登录图形界面,执行/home/oracle/database/runInstaller,进入OUI的图形安装界面: ② 进入OUI安 ...

  8. Linux下搭建Oracle11g RAC(6)----安装Grid Infrastructure

    从此步骤开始,我们正式安装Grid软件: ① 以grid用户登录图形界面,执行/home/grid/grid/runInstaller,进入OUI的图形安装界面: ② 进入OUI安装界面后,选择第3项 ...

  9. linux下一个Oracle11g RAC建立(五岁以下儿童)

    linux下一个Oracle11g RAC建立(五岁以下儿童) 四.建立主机之间的信任关系(node1.node2) 建立节点之间oracle .grid 用户之间的信任(通过ssh 建立公钥和私钥) ...

随机推荐

  1. javascript mvc

    http://www.webjx.com/javascript/jsajax-15996.html http://blog.csdn.net/jjfat/article/details/7963608 ...

  2. linux 监控

    http://www.iyunv.com/thread-50606-1-1.html http://segmentfault.com/a/1190000002537665 http://blog.cs ...

  3. 安装Chive提示CDbConnection failed to open the DB connection.

    最近初学PHP,看到Chive这个好玩的数据库管理工具,在登录时遇到这样的错误提示信息: CDbConnection failed to open the DB connection. 我的PHP版本 ...

  4. Learning WCF Chapter2 Service Description

    While messaging protocols are responsible for message serialization formats,there must be a way to c ...

  5. ELK之topbeat部署

    topbeat定期收集系统信息如每个进程信息.负载.内存.磁盘等等,然后将数据发送到elasticsearch进行索引,最后通过kibana进行展示. 下面是具体的安装及配置步骤: 1.安装topbe ...

  6. SharePoint 2010 母版页定制小思路介绍

    转:http://tech.ddvip.com/2013-11/1384521515206064.html 介绍:我们使用SharePoint2010做门户网站,经常需要定制母版页,但是2010提供的 ...

  7. “面包屑导航”——SiteMapPath控件的使用(ASP.NET)(转)

    转自:http://www.cnblogs.com/ball-head/archive/2010/09/28/1837253.html 最近在博客里写了一些日志,主要都是我在实际编程过程中遇到的问题. ...

  8. Selenium WebDriver + Grid2 + RSpec之旅(五)---面向对象设计用例

    Selenium WebDriver + Grid2 + RSpec之旅(五) ----面向对象设计用例 前几节讲了怎么一步一步的从零开始到编写出一个简单的测试用例,这一节将要讲一下怎么让测试用例变得 ...

  9. 【转】shell 教程——06 Shell变量:Shell变量的定义、删除变量、只读变量、变量类型

    Shell支持自定义变量. 定义变量 定义变量时,变量名不加美元符号($),如: variableName="value" 注意,变量名和等号之间不能有空格,这可能和你熟悉的所有编 ...

  10. __attribute__机制介绍 (转)

    1. __attribute__ GNU C的一大特色(却不被初学者所知)就是__attribute__机制. __attribute__可以设置函数属性(Function Attribute).变量 ...