RHEL6.5安裝 Oracle 11g + udev + ASM安裝部署詳解

RHEL6.5安裝 Oracle 11g + udev + ASM安裝部署詳解

[日期:2017-05-26] 來源:Linux社區  作者:sound [字體: ]
 
 

最近在學Oracle體系結構等理論知識,在這裏總結RHEL6.5下安裝 Oracle 11g + udev + ASM安裝部署流程。

實驗環境

  RedHat Enterprise Linux 6.5 x86_64    IP地址:192.168.60.100
  Oracle 11g release 11.2.0.4

系統安裝在此略過,IP地址已經更改完成,首先通過ssh協議登陸到RHEL系統,配置YUM本地源環境,安裝Oracle所必須的軟件依賴包;

[c:\~]$  ssh  [email protected]
[root@rhel6 ~] # vi /etc/yum.conf
[ local ]                                              // 修改本地YUM源環境;
name= local
baseurl= file : ///mnt
gpgcheck=0
enabled=1
[root@rhel6 ~] # mount /dev/sr0 /mnt/                //掛載本地光盤作爲YUM源;
mount : block device  /dev/sr0  is write-protected, mounting  read -only
[root@rhel6 ~] # yum repolist                        //檢測本地YUM源配置是否正確;
Loaded plugins: product- id , refresh-packagekit, security,
              : subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
local                                        | 3.9 kB     00:00 ... 
local /primary_db                              | 3.1 MB     00:00 ... 
repo  id                          repo name                     status
local                            local                          3,690
repolist: 3,690
[root@rhel6 ~] #yum install binutils -y            //通過YUM安裝Oracle所必須的軟件包;
[root@rhel6 ~] #yum install compat-libcap1 -y
[root@rhel6 ~] #yum install compat-libstdc++-33 -y
[root@rhel6 ~] #yum install gcc -y
[root@rhel6 ~] #yum install gcc-c++ -y
[root@rhel6 ~] #yum install glibc -y
[root@rhel6 ~] #yum install glibc-devel -y
[root@rhel6 ~] #yum install ksh -y
[root@rhel6 ~] #yum install libgcc -y
[root@rhel6 ~] #yum install libstdc++ -y
[root@rhel6 ~] #yum install libstdc++-devel -y
[root@rhel6 ~] #yum install libaio -y
[root@rhel6 ~] #yum install libaio-devel -y
[root@rhel6 ~] #yum install libXext -y
[root@rhel6 ~] #yum install libXtst -y
[root@rhel6 ~] #yum install libX11 -y
[root@rhel6 ~] #yum install libXau -y
[root@rhel6 ~] #yum install libxcb -y
[root@rhel6 ~] #yum install libXi -y
[root@rhel6 ~] #yum install make -y
[root@rhel6 ~] #yum install sysstat -y
[root@rhel6 ~] #yum install unixODBC -y
[root@rhel6 ~] #yum install unixODBC-devel -y

修改相應的系統主機名以及IP地址

[root@rhel6 ~] # vi /etc/hosts 
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.60.100  rhel6

添加相應的grid用戶及用戶組

[root@rhel6 ~] # groupadd -g 501 oinstall
[root@rhel6 ~] # groupadd -g 502 dba
[root@rhel6 ~] # groupadd -g 503 oper
[root@rhel6 ~] # groupadd -g 504 asmadmin
[root@rhel6 ~] # groupadd -g 505 asmoper
[root@rhel6 ~] # groupadd -g 506 asmdba
[root@rhel6 ~] # useradd -g oinstall -G dba,asmdba,oper oracle
[root@rhel6 ~] # useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
[root@rhel6 ~] # passwd oracle
[root@rhel6 ~] # passwd grid

創建Grid Infrastructure組件安裝目錄

[root@rhel6 ~] # mkdir -p /u01/app/grid
[root@rhel6 ~] # mkdir -p /u01/app/11.2.0/grid
[root@rhel6 ~] # chown -R grid:oinstall /u01
[root@rhel6 ~] # mkdir -p /u01/app/oraInventory
[root@rhel6 ~] # chown -R grid:oinstall /u01/app/oraInventory
[root@rhel6 ~] # mkdir -p /u01/app/oracle
[root@rhel6 ~] # chown -R oracle:oinstall /u01/app/oracle
[root@rhel6 ~] # chmod -R 775 /u01

修改操作系統參數

[root@rhel6 ~] # vi /etc/security/limits.conf
grid       soft   nproc   2047 
grid       hard   nproc   16384
grid       soft   nofile  1024
grid       hard   nofile  65536
grid       soft   stack   10240
grid       hard   stack   32768
oracle     soft   nproc   2047
oracle     hard   nproc   16384
oracle     soft   nofile  1024
oracle     hard   nofile  65536
oracle     soft   stack   10240
oracle     hard   stack   32768

修改Linux服務器ulmits限制

[root@rhel6 ~] # vi /etc/security/limits.d/90-nproc.conf
#*          soft    nproc     1024
* - nproc 16384

禁用SELINUX安全限制

[root@rhel6 ~] # vi /etc/selinux/config
SELINUX=disabled                                // 修改配置文件永久關閉selinux;
[root@rhel6 ~] # setenforce 0

關閉IPTABLES防火牆

[root@rhel6 ~] # service iptables stop
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ] 
[root@rhel6 ~] # chkconfig --level 35 iptables off          //3、5級別永久關閉iptables;

修改Linux操作系統的登陸配置文件

[root@rhel6 ~] # vi /etc/pam.d/login
session    required     pam_limits.so

修改Linux系統內核Kernel配置

[root@rhel6 ~] # vi /etc/sysctl.conf
#kernel.shmmax = 68719476736                //註釋掉原先的系統的配置;
#kernel.shmall = 4294967296
fs.aio-max-nr = 1048576
fs. file -max = 6815744
kernel.shmmax = 858993459                    // 大於SGA,小於物理內存;
kernel.shmall = 1048576                      // 物理內存%4K;
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
[root@rhel6 ~] # sysctl -p

配置grid和oracle用戶的環境變量

[root@rhel6 ~] # su - grid                        //grid用戶環境變量配置;
[grid@rhel6 ~]$  vi  .bash_profile 
PS1= "[`whoami`@`hostname`:" '$PWD]$'
export  PS1
umask  022
export  TMP= /tmp
export  LANG=en_US
export  TMPDIR=$TMP
export  ORACLE_HOSTNAME=rhel6
ORACLE_SID=+ASM;  export  ORACLE_SID
ORACLE_TERM=xterm;  export  ORACLE_TERM
ORACLE_BASE= /u01/app/grid export  ORACLE_BASE
ORACLE_HOME= /u01/app/11 .2.0 /grid export  ORACLE_HOME
NLS_DATE_FORMAT= "yyyy-mm-dd HH24:MI:SS" export  NLS_DATE_FORMAT
PATH=.:$PATH:$HOME /bin :$ORACLE_HOME /bin export  PATH
THREADS_FLAG=native;  export  THREADS_FLAG
if  [ $USER =  "oracle"  ] || [ $USER =  "grid"  ];  then
        if  [ $SHELL =  "/bin/ksh"  ];  then
            ulimit  -p 16384
              ulimit  -n 65536
  else
    ulimit  -u 16384 -n 65536
      fi
    umask  022
fi
----------------------------------------------------------------------------
[root@rhel6 ~] # su - oracle
[oracle@rhel6 ~]$  vi  .bash_profile 
TMP= /tmp export  TMP
TMPDIR=$TMP;  export  TMPDIR
export  LANG=en_US
ORACLE_BASE= /u01/app/oracle export  ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE /product/11 .2.0;  export  ORACLE_HOME
ORACLE_SID=itpuxdb;  export  ORACLE_SID
export  ORACLE_UNQNAME=orcl
ORACLE_TERM=xterm;  export  ORACLE_TERM
PATH= /usr/sbin :$PATH;  export  PATH
PATH=$ORACLE_HOME /bin :$PATH;  export  PATH
LD_LIBRARY_PATH=$ORACLE_HOME /lib : /lib : /usr/lib export  LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME /JRE :$ORACLE_HOME /jlib :$ORACLE_HOME /rdbms/jlib export  CLASSPATH
NLS_DATE_FORMAT= "yyyy-mm-dd HH24:MI:SS" export  NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK; export  NLS_LANG
if  [ $USER =  "oracle"  ] || [ $USER =  "grid"  ];  then
        if  [ $SHELL =  "/bin/ksh"  ];  then
          ulimit  -p 16384
              ulimit  -n 65536
        else
              ulimit  -u 16384 -n 65536
        fi
        umask  022
fi

配置udev配置ASM(在此係統所用磁盤爲/dev/sda),

[root@rhel6 ~]# fdisk /dev/(sdb\sdc\sdd\sde\sdf)          //對磁盤進行分區;
[root@rhel6 ~]# vi /etc/udev/rules.d/ 99 -oracle-asmdevices.rules
KERNEL== "sdb1" , NAME= "asm_grid1" , OWNER= "grid" , GROUP= "asmadmin" , MODE= "0660"
KERNEL== "sdc1" , NAME= "asm_system" , OWNER= "grid" , GROUP= "asmadmin" , MODE= "0660"
KERNEL== "sdd1" , NAME= "asm_recovery" , OWNER= "grid" , GROUP= "asmadmin" , MODE= "0660"
KERNEL== "sde1" , NAME= "asm_data01" , OWNER= "grid" , GROUP= "asmadmin" , MODE= "0660"
KERNEL== "sdf1" , NAME= "asm_data02" , OWNER= "grid" , GROUP= "asmadmin" , MODE= "0660"
[root@rhel6 ~]# partprobe /dev/sdb1
[root@rhel6 ~]# partprobe /dev/sdc1
[root@rhel6 ~]# partprobe /dev/sdd1
[root@rhel6 ~]# partprobe /dev/sde1
[root@rhel6 ~]# partprobe /dev/sdf1
[root@rhel6 ~]# udevadm control --reload-rules 
[root@rhel6 ~]# start_udev 
Starting udev:                                             [  OK  ]
[root@rhel6 ~]# ls -lsa /dev/asm*
0  brw-rw----.  1  grid asmadmin  8 65  May  24  05 : 48  /dev/asm_data01
0  brw-rw----.  1  grid asmadmin  8 81  May  24  05 : 48  /dev/asm_data02
0  brw-rw----.  1  grid asmadmin  8 17  May  24  05 : 48  /dev/asm_grid1
0  brw-rw----.  1  grid asmadmin  8 49  May  24  05 : 48  /dev/asm_recovery
0  brw-rw----.  1  grid asmadmin  8 33  May  24  05 : 48  /dev/asm_system

上傳Oracle安裝包到服務器

[root@rhel6 ~] #yum -y install lrzsz            //安裝xshell所用的FTP軟件;
[root@rhel6 ~] #unzip  p13390677_112040_Linux-x86-64_3of7.zip 
[root@rhel6 ~] # chown -R grid:oinstall  /opt/grid/

配置VNC遠程桌面

[root@rhel6 ~] # yum -y install vnc-server
[root@rhel6 opt] # su - grid
[grid@rhel6: /home/grid ]$vncserver 
You will require a password to access your desktops.
Password:
Verify:
xauth:  creating new authority  file  /home/grid/ .Xauthority
New  'rhel6:1 (grid)'  desktop is rhel6:1
Creating default startup script  /home/grid/ .vnc /xstartup
Starting applications specified  in  /home/grid/ .vnc /xstartup
Log  file  is  /home/grid/ .vnc /rhel6 :1.log

 VNC遠程桌面連接配置安裝Grid Infrastructure組件

[grid@rhel6 ~]$  cd  /opt/grid/
[grid@rhel6 grid]$ . /runInstaller

選擇單節點安裝配置Grid Infrastructure

wKioL1kkTJ3Rdk2MAARQ2GFhwr0774.jpg-wh_50

選擇語言環境

RHEL6.5安裝 Oracle 11g + udev + ASM安裝部署詳解

掃描ASM磁盤

RHEL6.5安裝 Oracle 11g + udev + ASM安裝部署詳解

更多詳情見請繼續閱讀下一頁的精彩內容http://www.linuxidc.com/Linux/2017-05/144271p2.htm

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章