zoukankan      html  css  js  c++  java
  • Linux6(5)安装Oracle Rac11g


    1、创建用户组。以root身份运行以下命令:
    /usr/sbin/groupadd -g 501 oinstall
    /usr/sbin/groupadd -g 502 dba
    /usr/sbin/groupadd -g 504 asmadmin
    /usr/sbin/groupadd -g 506 asmdba
    /usr/sbin/groupadd -g 507 asmoper

    2、创建oracle软件的拥有着账户:
    /usr/sbin/useradd -u 501 -g oinstall -G asmadmin,asmdba,asmoper grid
    /usr/sbin/useradd -u 502 -g oinstall -G dba,asmdba oracle
    passwd oracle
    passwd grid

    grid用户环境变量
    export ORACLE_BASE=/u01/app/grid
    export ORACLE_HOME=/u01/11.2.0/grid
    export ORACLE_SID=+ASM1
    export ORACLE_TERM=xterm
    export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH

    export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
    export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

    export TMP=/tmp
    export TMPDIR=$TMP


    oracle用户环境变量
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
    export ORACLE_SID=tmsdb1
    export ORACLE_TERM=xterm
    export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/usr/sbin:$PATH
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib

    export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
    export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

    export TMP=/tmp
    export TMPDIR=$TMP

    export ORACLE_UNQNAME=tmsdb


    3、vi /etc/hosts
    10.230.39.234 tmsdb1
    10.230.39.235 tmsdb2
    10.230.39.236 tmsdb1-vip
    10.230.39.237 tmsdb2-vip
    10.230.39.238 tmsdbscan.role.db
    192.168.39.234 tmsdb1-priv
    192.168.39.235 tmsdb2-priv

    4、时间同步
    08 01 * * * /usr/sbin/ntpdate -u 10.109.192.10
    08 13 * * * /usr/sbin/ntpdate -u 10.109.192.33

    或者
    配置集群时间同步服务 — (CTSS)
    使用集群时间同步服务在集群中提供同步服务,需要卸载网络时间协议 (NTP) 及其配置。
    要停用 NTP 服务,必须停止当前的 ntpd 服务,从初始化序列中禁用该服务,并删除 ntp.conf 文件。要在 Oracle Enterprise Linux 上完成这些步骤,以 root 用户身份在两个 Oracle RAC 节点上运行以下命令:
    /sbin/service ntpd stop
    chkconfig ntpd off
    mv /etc/ntp.conf /etc/ntp.conf.original

    还要删除以下文件:
    rm /var/run/ntpd.pid
    此文件保存了 NTP 后台程序的 pid。

    当安装程序发现 NTP 协议处于非活动状态时,安装集群时间同步服务将以活动模式自动进行安装并通过所有节点的时间。如果发现配置了 NTP,则以观察者模式启动集群时间同步服务,Oracle Clusterware 不会在集群中进行活动的时间同步。

    在安装后,要确认 ctssd 处于活动状态,请作为网格安装所有者 (grid) 输入以下命令:
    crsctl check ctss
    CRS-4701: The Cluster Time Synchronization Service is in Active mode.
    CRS-4702: Offset (in msec): 0


    5、vi /etc/sysctl.conf

    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    fs.file-max = 6553600
    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 = 1048576


    6、/sbin/sysctl -p

    7、vi /etc/security/limits.conf
    grid soft nproc 2047
    grid hard nproc 16384
    grid soft nofile 1024
    grid hard nofile 65536
    oracle soft nproc 2047
    oracle hard nproc 16384
    oracle soft nofile 1024
    oracle hard nofile 65536

    8、vi /etc/pam.d/login
    session required pam_limits.so

    9、vi /etc/profile
    文件中加入如下内容
    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


    对于 C shell(csh 或 tcsh),通过运行以下命令将以下行添加到 /etc/csh.login 文件:
    if ( /$USER == "oracle" || /$USER == "grid" ) then
    limit maxproc 16384
    limit descriptors 65536
    endif

    10、以root身份执行以下命令创建oracle inventory目录:
    mkdir -p /u01/app/oraInventory
    chown -R grid:oinstall /u01/app/oraInventory
    chmod -R 775 /u01/app/oraInventory
    11、创建oracle grid infrastructure的home目录
    mkdir -p /u01/11.2.0/grid
    mkdir -p /u01/app/grid
    chown -R grid:oinstall /u01/11.2.0/grid
    chown -R grid:oinstall /u01/app/grid
    chmod -R 775 /u01/11.2.0/grid
    chmod -R 775 /u01/app/grid


    12、以root身份执行以下命令创建oracle base目录:
    mkdir -p /u01/app/oracle
    mkdir /u01/app/oracle/cfgtoollogs
    chown -R oracle:oinstall /u01/app/oracle
    chmod -R 775 /u01/app/oracle

    13、以root身份执行以下命令创建oracle RDBMS的home目录:
    mkdir -p /u01/app/oracle/product/11.2.0/db_1
    chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/db_1
    chmod -R 775 /u01/app/oracle/product/11.2.0/db_1

    14、RHEL 5.X 及 RHEL 6.X 安装oracle 11.2.0.3 软件包检查命令:

    rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH}) ' binutils
    compat-libstdc++-33
    elfutils-libelf
    elfutils-libelf-devel
    gcc
    gcc-c++
    glibc
    glibc-common
    glibc-devel
    glibc-headers
    ksh
    libaio
    libaio-devel
    libgcc
    libstdc++
    libstdc++-devel
    make
    sysstat
    unixODBC
    unixODBC-devel


    -------------------------------------------------------------
    存储配置(udev方式)
    # echo "options=--whitelisted --replace-whitespace" >> /etc/scsi_id.config
    # for i in b c d e f g; do echo "KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`", NAME="asm-disk$i", OWNER="grid", GROUP="asmadmin", MODE="0660"" >> /etc/udev/rules.d/99-oracle-asmdevices.rules; done


    # cat /etc/udev/rules.d/99-oracle-asmdevices.rules
    KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36001438005decf680001100005f20000", NAME="asm-diskcrs", OWNER="grid", GROUP="asmadmin", MODE="0660"
    KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36001438005decf680001100005e50000", NAME="asm-disk1", OWNER="grid", GROUP="asmadmin", MODE="0660"
    KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36001438005decf680001100005e90000", NAME="asm-disk2", OWNER="grid", GROUP="asmadmin", MODE="0660"
    KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36001438005decf680001100006250000", NAME="asm-disk3", OWNER="grid", GROUP="asmadmin", MODE="0660"
    KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36001438005decf680001100006290000", NAME="asm-disk4", OWNER="grid", GROUP="asmadmin", MODE="0660"
    KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36001438005decf6800011000062d0000", NAME="asm-disk5", OWNER="grid", GROUP="asmadmin", MODE="0660"
    KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36001438005decf680001100006310000", NAME="asm-disk6", OWNER="grid", GROUP="asmadmin", MODE="0660"

    scp 99-oracle-asmdevices.rules node2:/etc/udev/rules.d/99-oracle-asmdevices.rules

    #
    # /sbin/udevcontrol reload_rules
    Starting udev:
    [root@vrh6 dev]# /sbin/start_udev
    Starting udev: [ OK ]

    # ll /dev/asm*
    brw-rw---- 1 grid asmadmin 66, 192 May 3 02:51 /dev/asm-disk1
    brw-rw---- 1 grid asmadmin 66, 208 May 3 02:51 /dev/asm-disk2
    brw-rw---- 1 grid asmadmin 66, 224 May 3 02:51 /dev/asm-disk3
    brw-rw---- 1 grid asmadmin 66, 240 May 3 02:51 /dev/asm-disk4
    brw-rw---- 1 grid asmadmin 67, 0 May 3 02:51 /dev/asm-disk5
    brw-rw---- 1 grid asmadmin 67, 16 May 3 02:51 /dev/asm-disk6
    brw-rw---- 1 grid asmadmin 66, 176 May 3 02:51 /dev/asm-diskcrs

    ------------------------------------------------------------
    1、VNC的启动/停止/重启
    #service vncserver start/stop/restart
    关闭具体的vncserver命令:vncserver -kill :1 vncserver -kill :2

    2、设置密码
    #vncpasswd

    3、客户端登陆
    在vnc客户端中输入:服务器端IP:1或服务器端IP:2

    ---------------------------------------------------------------


    mkdir -p /u01/stage/gipsu

    unzip -d /u01/11.2.0/grid p6880880_112000_Linux-x86-64.zip



    3. 解压GI PSU 到创建的目录中去。
    # unzip -d /u01/stage/gipsu p20485808_112040_Linux-x86-64.zip


    4. 以GI软件拥有者的身份使用Opatch napply工具应用GI PSU到新安装的11.2.0.2.2 GI Home中去。
    # /u01/11.2.0/grid/OPatch/opatch napply -oh /u01/11.2.0/grid -local /u01/stage/gipsu/20485808


    orcle用户
    unzip -d /u01/app/oracle/product/11.2.0/db_1 p6880880_112000_Linux-x86-64.zip

    cd /u01/stage/orpsu/20299013/

    opatch apply

    opatch lsinventory


    [root@hajydb1 stage]# su - oracle
    [oracle@hajydb1 ~]$ opatch lsinventory
    Oracle Interim Patch Installer version 11.2.0.3.6
    Copyright (c) 2013, Oracle Corporation. All rights reserved.


    Oracle Home : /u01/app/oracle/product/11.2.0/db_1
    Central Inventory : /u01/app/oraInventory
    from : /u01/app/oracle/product/11.2.0/db_1/oraInst.loc
    OPatch version : 11.2.0.3.6
    OUI version : 11.2.0.4.0
    Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-05-03_02-55-16AM_1.log

    Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2015-05-03_02-55-16AM.txt

    --------------------------------------------------------------------------------
    Installed Top-level Products (1):

    Oracle Database 11g 11.2.0.4.0
    There are 1 product(s) installed in this Oracle Home.


    Interim patches (1) :

    Patch 20299013 : applied on Sun May 03 02:06:23 CST 2015
    Unique Patch ID: 18573940
    Patch description: "Database Patch Set Update : 11.2.0.4.6 (20299013)"
    Created on 4 Mar 2015, 02:27:44 hrs PST8PDT
    Sub-patch 19769489; "Database Patch Set Update : 11.2.0.4.5 (19769489)"
    Sub-patch 19121551; "Database Patch Set Update : 11.2.0.4.4 (19121551)"
    Sub-patch 18522509; "Database Patch Set Update : 11.2.0.4.3 (18522509)"
    Sub-patch 18031668; "Database Patch Set Update : 11.2.0.4.2 (18031668)"
    Sub-patch 17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"
    Bugs fixed:
    17288409, 17798953, 18273830, 18607546, 17811429, 17205719, 20506699
    ..................................................................
    18674047, 17672719, 18856999, 12364061, 18783224, 17851160, 17546761
    Rac system comprising of multiple nodes
    Local node = hajydb1
    Remote node = hajydb2

    --------------------------------------------------------------------------------

    OPatch succeeded.


    若执行root.sh后 这样OPATCH

    /u01/11.2.0/grid/OPatch/ocm/bin/emocmrsp
    /u01/11.2.0/grid/OPatch/opatch auto /u01/stage/gipsu/20485808 -oh /u01/app/oracle/product/11.2.0/db_1 -ocmrf ocm.rsp

    TNSMANES:

    idb1=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=IP)(PORT=21521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=idb)))

    idb2=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=IP)(PORT=21521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=idb)))

  • 相关阅读:
    [ProjectEuler.net] 14
    Design patterns
    初等函数定义
    Design patterns 1.6 Design for change
    Programming In Haskell chapter3
    桌面恶心的无法删除的图标之 淘宝购物 删除办法
    程序员学英语三部曲
    e的给定精度求法
    Summary about Architect Visit
    再谈“我是怎么招聘程序员的”(上)
  • 原文地址:https://www.cnblogs.com/datalife/p/4749632.html
Copyright © 2011-2022 走看看