在 Vmware上安装Oracle 11gR2 的安装简易手册

作者: nick 分类: linux, oracle 发布时间: 2010-05-23 08:38 ė 61条评论

1. 运行如下的rpm命令,找到安装Oracle需要而没有安装的rpm包.并mount Redat安装盘安装这些包.

rpm -qv binutils-2.17.50.0.6 \
compat-libstdc++-33-3.2.3 \
elfutils-libelf-0.125 \
elfutils-libelf-devel-0.125 \
elfutils-libelf-devel-static-0.125 \
gcc-4.1.2 \
gcc-c++-4.1.2 \
glibc-2.5-24 \
glibc-common-2.5 \
glibc-devel-2.5 \
glibc-headers-2.5 \
kernel-headers-2.6.18  \
ksh-20060214 \
libaio-0.3.106 \
libgcc-4.1.2 \
libgomp-4.1.2 \
libstdc++-4.1.2  \
libstdc++-devel-4.1.2 \
make-3.81 \
sysstat-7.0.2 \
libaio-devel-0.3.106  \
unixODBC-2.2.11  \
unixODBC-devel-2.2.11
mkdir /media/cdrom/
mount -t iso9660 /dev/cdrom /media/cdrom/
cd /media/cdrom/Server/
rpm -ivh sysstat-7.0.2-1.el5.i386.rpm libaio-devel-0.3.106-3.2.i386.rpm unixODBC-2.2.11-7.1.i386.rpm unixODBC-devel-2.2.11-7.1.i386.rpm

2. 关闭大部分无用的服务(可能因人因环境而异,这只是我的个人喜好).

chkconfig NetworkManager --level 2345 off
chkconfig NetworkManagerDispatcher --level 2345 off
chkconfig acpid --level 2345 off
chkconfig apmd --level 2345 off
chkconfig auditd --level 2345 off
chkconfig avahi-dnsconfd --level 2345 off
chkconfig bluetooth --level 2345 off
chkconfig capi --level 2345 off
chkconfig conman --level 2345 off
chkconfig cpuspeed --level 2345 off
chkconfig cups --level 2345 off
chkconfig dhcdbd --level 2345 off
chkconfig dund --level 2345 off
chkconfig firstboot --level 2345 off
chkconfig haldaemon --level 2345 off
chkconfig hidd --level 2345 off
chkconfig ip6tables --level 2345 off
chkconfig ipmi --level 2345 off
chkconfig iptables --level 2345 off
chkconfig irda --level 2345 off
chkconfig isdn --level 2345 off
chkconfig kdump --level 2345 off
chkconfig kudzu --level 2345 off
chkconfig lvm2-monitor --level 2345 off
chkconfig mcstrans --level 2345 off
chkconfig mdmonitor --level 2345 off
chkconfig mdmpd --level 2345 off
chkconfig messagebus --level 2345 off
chkconfig microcode_ctl --level 2345 off
chkconfig multipathd --level 2345 off
chkconfig netconsole --level 2345 off
chkconfig netfs --level 2345 off
chkconfig netplugd --level 2345 off
chkconfig nfs --level 2345 off
chkconfig nfslock --level 2345 off
chkconfig nscd --level 2345 off
chkconfig ntpd --level 2345 off
chkconfig pand --level 2345 off
chkconfig pcscd --level 2345 off
chkconfig portmap --level 2345 off
chkconfig psacct --level 2345 off
chkconfig rdisc --level 2345 off
chkconfig readahead_later --level 2345 off
chkconfig restorecond --level 2345 off
chkconfig rhnsd --level 2345 off
chkconfig rpcgssd --level 2345 off
chkconfig rpcidmapd --level 2345 off
chkconfig rpcsvcgssd --level 2345 off
chkconfig saslauthd --level 2345 off
chkconfig sendmail --level 2345 off
chkconfig setroubleshoot --level 2345 off
chkconfig smartd --level 2345 off
chkconfig vncserver --level 2345 off
chkconfig vsftpd --level 2345 off
chkconfig wdaemon --level 2345 off
chkconfig winbind --level 2345 off
chkconfig wpa_supplicant --level 2345 off
chkconfig ypbind --level 2345 off

3. 修改系统参数(这只是我的测试环境,具体环境需要做适应性的调整,而且我这个虚拟机,毋需考虑BigPage,生产环境可能需要考虑,特别是64位环境下 的11g环境).

--修改/etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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

--修改完毕后, 运行sysctl -p使其生效.

4. 添加用户/组信息.

groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 505 asmdba
groupadd -g 506 asmoper

useradd -g oinstall -G dba,oper,asmdba oracle
useradd -g oinstall -G asmadmin,asmdba,asmoper grid

5. 修改安全配置信息,

  • 1) . Add the following lines to the /etc/security/limits.conf file: (the following example shows the software account owner oracle):
  • oracle              soft    nproc   2047
    oracle              hard    nproc   16384
    oracle              soft    nofile  1024
    oracle              hard    nofile  65536
    
    grid              soft    nproc   2047
    grid              hard    nproc   16384
    grid              soft    nofile  1024
    grid              hard    nofile  65536
    
  • 2). Add or edit the following line in the /etc/pam.d/login file, if it does not already exist:
  • session    required     pam_limits.so
    

    6. 修改/etc/profile 信息,修改Oracle/grid用户登陆后的系统权限.
    For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file (or the file
    on
    SUSE Linux Enterprise Server systems /etc/profile.local):

    if [ $USER = "oracle" ]; then
      if [ $SHELL = "/bin/ksh" ]; then
        ulimit -p 16384
        ulimit -n 65536
      else
        ulimit -u 16384 -n 65536
      fi
      umask 022
    fi
    
    if [ $USER = "grid" ]; then
      if [ $SHELL = "/bin/ksh" ]; then
        ulimit -p 16384
        ulimit -n 65536
      else
        ulimit -u 16384 -n 65536
      fi
      umask 022
    fi
    

    7. 创建基本的安装目录.并赋予其权限.

    mkdir -p /opt/app/
    mkdir -p /opt/app/oracle/products/11.2.0/
    chown -R oracle:oinstall /opt/app/oracle
    
    mkdir -p /opt/app/grid/products/11.2.0/
    chown -R grid:oinstall /opt/app/grid
    
    chown grid:oinstall /opt/
    chown grid:oinstall /opt/app/
    chown grid:oinstall /opt/app/oracle/
    

    8. 修改用户profile信息.

  • 1). 修改grid用户的profile文件/home/grid/.bash_profile
  • export ORACLE_BASE=/opt/app/oracle
    export ORACLE_HOME=/opt/app/grid/products/11.2.0
    export ORACLE_SID=+ASM1
    CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
    export ORACLE_BASE ORACLE_HOME ORACLE_SID ORA_NLS33 PATH  CLASSPATH TNS_ADMIN
    
    PATH=$ORACLE_HOME/bin:/usr/bin:/etc:/usr/bin/X11:/usr/ccs/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin:.:$PATH
    export  PATH
    export PATH=$PATH:$ORACLE_HOME/OPatch
    
    # ORACLE_TERM=xterm; export ORACLE_TERM
    NLS_LANG=AMERICAN_AMERICA.US7ASCII; export NLS_LANG
    
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/openwin/lib
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/td/lib:/usr/ucblib:/usr/local/lib
    export LD_LIBRARY_PATH
    export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
    export UDUMP=/opt/oracle/admin/forum/udump
    export BDUMP=/opt/oracle/admin/forum/bdump
    export SQLPATH=$ORACLE_HOME/sqlplus/admin:~/admin/sql/:~/admin/mysql
    alias sql='sqlplus /nolog'
    alias lm='ls -al'
    export DISPLAY=192.168.68.1:0.0
    
  • 2). 修改Oracle用户profile信息.
  • export ORACLE_BASE=/opt/app/oracle
    export ORACLE_HOME=/opt/app/grid/products/11.2.0
    export ORACLE_SID=rac1
    CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
    export ORACLE_BASE ORACLE_HOME ORACLE_SID ORA_NLS33 PATH  CLASSPATH TNS_ADMIN
    
    PATH=$ORACLE_HOME/bin:/usr/bin:/etc:/usr/bin/X11:/usr/ccs/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin:/usr/local/bin:.:$PATH
    export  PATH
    export PATH=$PATH:$ORACLE_HOME/OPatch
    
    # ORACLE_TERM=xterm; export ORACLE_TERM
    NLS_LANG=AMERICAN_AMERICA.US7ASCII; export NLS_LANG
    
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/openwin/lib
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/td/lib:/usr/ucblib:/usr/local/lib
    export LD_LIBRARY_PATH
    export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
    export UDUMP=/opt/oracle/admin/forum/udump
    export BDUMP=/opt/oracle/admin/forum/bdump
    export SQLPATH=$ORACLE_HOME/sqlplus/admin:~/admin/sql/:~/admin/mysql
    alias sql='sqlplus /nolog'
    alias lm='ls -al'
    

    9. 修改/etc/hosts信息,配置RAC信息.

    192.168.68.128    rac1-priv.localdomain rac1-priv
    192.168.68.129    rac2-priv.localdomain rac2-priv
    
    192.168.130.128    rac1.localdomain rac1
    192.168.130.129    rac2.localdomain rac2
    
    192.168.130.200   rac-cluster
    192.168.130.210   rac1-vip.localdomain rac1-vip
    192.168.130.220   rac2-vip.localdomain rac2-vip
    

    10. 配置两台主机的ssh 通道.
    分别在root/oracle/grid用户下运行下述命令.

    ssh-keygen -b 1024 -t dsa
    

    11. 关闭两个VM节点, 为其添加一块基于Nat的网卡,以及新增两块磁盘(一块作为OCR/Voting Disk用,一块作为SharedStorage使用).
    修改VM文件的配置,新增的磁盘配置为.

    disk.locking = "FALSE"
    diskLib.dataCacheMaxSize = "0"
    diskLib.dataCacheMaxReadAheadSize = "0"
    diskLib.dataCacheMinReadAheadSize = "0"
    diskLib.dataCachePageSize = "4096"
    diskLib.maxUnsyncedWrites = "0"
    
    scsi1.present = "TRUE"
    scsi1.virtualDev = "lsilogic"
    scsi1.sharedBus = "VIRTUAL"
    
    scsi1:0.redo = ""
    scsi1:0.present = "TRUE"
    scsi1:0.fileName = "E:\vm\SharedDisk\OCRDisk.vmdk"
    scsi1:0.mode = "independent-persistent"
    scsi1:0.deviceType = "disk"
    
    scsi1:1.redo = ""
    scsi1:1.present = "TRUE"
    scsi1:1.fileName = "E:\vm\SharedDisk\RacShareDisk.vmdk"
    scsi1:1.mode = "independent-persistent"
    scsi1:1.deviceType = "disk"
    

    12. 运行下面的脚本给/dev/sdb;/dev/sdc 进行分区

    fdisk /dev/sdc <<_END_
    n
    e
    1
    
    n
    l
    1
    128
    n
    l
    
    256
    n
    l
    
    384
    n
    l
    
    512
    n
    l
    
    640
    n
    l
    
    p
    w
    _END_
    

    13. 在/etc/udev/rules.d/50-udev.rules中添加下面这行配置.

    KERNEL=="sd[bc]*",OWNER="grid",GROUP="oinstall",MODE="0660",OPTIONS="last_rule"
    

    并运行/sbin/start_udev使其权限修改生效,否则每次Os重启,文件的权限都会被改成root:disk

    本文出自 传播、沟通、分享,转载时请注明出处及相应链接。

    本文永久链接: https://www.nickdd.cn/?p=547

    发表评论

    您的电子邮箱地址不会被公开。

    Ɣ回顶部