redhat6.2安裝oracle11.2.0.3RAC

jelephant發表於2014-02-07
起初安裝的是11.2.0.1,結果遇到各種意想不到的問題,一步步解決,最終碰到一個CRS錯誤,經查詢說是bug,苦命人啊,忙了好幾天後,最終選擇11.2.0.3,安裝還算順利

針對linux6.2安裝oracle11gR2的準備工作記錄如下:

規劃

server

Hostname

Short

hostname

type

IP

interface

node1

node1.localdomain

node1

public IP

192.168.88.31

eth0

node1-vip.localdomain

node1-vip

Virtual IP

192.168.88.33

eth0:1

node1-priv.localdomain

node1-priv

private IP

192.168.50.1

eth1

node2

node2.localdomain

node2

public IP

192.168.88.32

eth0

node2-vip.localdomain

node2-vip

virtual IP

192.168.88.34

eth0:1

node2-priv.localdomain

node2-priv

private IP

192.168.50.2

eth1

scan

scan-cluster.localdomian

scan-cluster

scan IP

192.168.88.40



在node1、node2上建立使用者、改口令、修改 使用者配置檔案

 

group name

group id

group info

oracle user

grid user

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

asmoper

1202

osoper for asm

 

Y

透過執行附件指令碼來建立使用者(1preuser.sh)

在node1、node2上建立路徑、改許可權

 

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

prod1

ORACLE_SID [node2]

+ASM2

prod2

透過執行附件指令碼建立目錄(2predir.sh)

在node1、node2上修改/etc/security/limits.conf,配置oracle、grid使用者的shell限制

透過執行附件指令碼更改(3prelimits.sh)

在node1、node2上修改/etc/pam.d/login配置檔案

透過執行附件指令碼修改(4prelogin.sh)

在node1、node2上修改/etc/profile檔案

透過執行附件指令碼修改(5preprofile.sh)

在node1、node2上修改核心配置檔案

透過執行附件指令碼修改(6presysctl.sh)

在node1、node2上停止ntp服務,11gR2新增檢查項

在node1、node2上配置Oracle、grid使用者ssh對等性

停止防火牆

配置ASM磁碟
建立檔案99-oracle-asmdevices.rules

KERNEL=="sd?1",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u /dev/$name",RESULT=="36000c29ac3dc0a38f880a73864ee781f",NAME="data", OWNER="grid", GROUP="asmadmin",MODE="0660"

KERNEL=="sd?1",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u /dev/$name", RESULT=="36000c296e7c90d0e6737d1436c23d109",NAME="flash", OWNER="grid", GROUP="asmadmin",MODE="0660"

KERNEL=="sd?1",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u /dev/$name",RESULT=="36000c295365b60fa28c6cdd3ab0b9ed2",NAME="ocr1", OWNER="grid", GROUP="asmadmin",MODE="0660"
KERNEL=="sd?1",BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u /dev/$name",RESULT=="36000c299d38e10f7aebff9d7ac9eada6",NAME="ocr2", OWNER="grid", GROUP="asmadmin",MODE="0660"

安裝前預檢

./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -fixup -verbose

安裝GridInfrastructure

安裝Oracle軟體

建立ASM磁碟

建立資料庫

附件指令碼

1、 preuser.sh

#!/bin/bash

#Purpose:Create 6 groups named 'oinstall','dba','asmadmin','asmdba','asmoper','oper', plus 2 users named 'oracle','grid'.

#Also setting the Environment

#variable for oracle user.

#variable for grid user.

#Usage:Log on as the superuser('root'),and then execute the command:#./1preusers.sh

echo "Now create 6 groups named 'oinstall','dba','asmadmin','asmdba','asmoper','oper'"

echo "Plus 2 users named 'oracle','grid',Also setting the Environment"

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 grid

#echo 'export PS1="`/bin/hostname -s`-> "'>> /home/grid/.bash_profile

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 NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss'" >> /home/grid/.bash_profile

echo 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /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 CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib'>> /home/grid/.bash_profile

echo "export EDITOR=vi" >> /home/grid/.bash_profile

echo "export LANG=en_US" >> /home/grid/.bash_profile

#echo "export NLS_LANG=american_america.AL32UTF8" >> /home/grid/.bash_profile

echo "export NLS_LANG=american_america.ZHS16GBK" >>/home/grid/.bash_profile

echo "umask 022">> /home/grid/.bash_profile

#groupadd -g 1300 dba

#groupadd -g 1301 oper

useradd -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle

echo "oracle" | passwd --stdin oracle

#echo 'export PS1="`/bin/hostname -s`-> "'>> /home/oracle/.bash_profile

echo "export TMP=/tmp">> /home/oracle/.bash_profile

echo 'export TMPDIR=$TMP'>> /home/oracle/.bash_profile

echo "export ORACLE_HOSTNAME=node1.localdomain">> /home/oracle/.bash_profile

echo "export ORACLE_SID=prod1">> /home/oracle/.bash_profile

echo "export ORACLE_BASE=/u01/app/oracle">> /home/oracle/.bash_profile

echo 'export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1'>> /home/oracle/.bash_profile

echo "export ORACLE_UNQNAME=prod">> /home/oracle/.bash_profile

echo 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /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 CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib'>> /home/oracle/.bash_profile

echo "export EDITOR=vi" >> /home/oracle/.bash_profile

echo "export LANG=en_US" >> /home/oracle/.bash_profile

#echo "export NLS_LANG=american_america.AL32UTF8" >>/home/oracle/.bash_profile

echo "export NLS_LANG=american_america.ZHS16GBK" >>/home/oracle/.bash_profile

echo "export NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss'" >>/home/oracle/.bash_profile

echo "umask 022">> /home/oracle/.bash_profile

echo "The Groups and users has been created"

echo "The Environment for grid,oracle also has been set successfully"

 

2、 predir.sh

#!/bin/bash

#Purpose:Create the necessary directory for oracle,grid users and change the authention to oracle,grid users.

#Usage:Log on as the superuser('root'),and then execute the command:#./2predir.sh

#Author:tw han 

echo "Now create the necessary directory for oracle,grid users and change the authention to oracle,grid users..."

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

chown -R grid:oinstall /u01/app/11.2.0

chmod -R 775 /u01

echo "The necessary directory for oracle,grid users and change the authention to oracle,grid users has been finished"

 

3、 prelimits.sh

#!/bin/bash

#Purpose:Change the /etc/security/limits.conf.

#Usage:Log on as the superuser('root'),and then execute the command:#./3prelimits.sh

#Author:tw han

echo "Now modify the /etc/security/limits.conf,but backup it named /etc/security/limits.conf.bak before"

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

echo "Modifing the /etc/security/limits.conf has been succeed."

 

4、 prelogin.sh

#!/bin/bash

#Purpose:Modify the /etc/pam.d/login.

#Usage:Log on as the superuser('root'),and then execute the command:#./4prelimits.sh

#Author:tw han

echo "Now modify the /etc/pam.d/login,but with a backup named /etc/pam.d/login.bak"

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

echo "Modifing the /etc/pam.d/login has been succeed."

 

5、 preprofile.sh

#!/bin/bash

#Purpose:Modify the /etc/profile.

#Usage:Log on as the superuser('root'),and then execute the command:#./5preprofile.sh

#Author:tw han

echo "Now modify the /etc/profile,but with a backup named /etc/profile.bak"

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

echo "Modifing the /etc/profile has been succeed."

 

6、 presysctl.sh

#!/bin/bash

#Purpose:Modify the /etc/sysctl.conf.

#Usage:Log on as the superuser('root'),and then execute the command:#./6presysctl.sh

#Author:tw han

echo "Now modify the /etc/sysctl.conf,but with a backup named /etc/sysctl.bak"

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

echo "Modifing the /etc/sysctl.conf has been succeed."

echo "Now make the changes take effect....."

sysctl –p



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29337971/viewspace-1077531/,如需轉載,請註明出處,否則將追究法律責任。

相關文章