`
nzhzds
  • 浏览: 40067 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
最近访客 更多访客>>
社区版块
存档分类
最新评论

Oracle 10g R2 RAC之Linux 安装记录

    博客分类:
  • RAC
阅读更多
http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel4-092650.html
http://blog.csdn.net/zzuiezhangqihui/article/details/6153215

hosts文件        IP Alias Name
127.0.0.1       localhost.localdomain   localhost
#Pubilc
192.168.1.101   rac1.boobooke.com       rac1
192.168.1.102   rac2.boobooke.com       rac2
#Private
192.168.150.101   rac1-priv.boobooke.com  rac1-priv
192.168.150.102   rac2-priv.boobooke.com  rac2-priv
#Virtual
192.168.1.111   rac1-vip.boobooke.com   rac1-vip
192.168.1.112   rac2-vip.boobooke.com   rac2-vip

vi /etc/sysctl.conf                        
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144

/sbin/sysctl -p

/etc/security/limits.conf
*              soft    nproc   2047
*              hard    nproc   16384
*              soft    nofile  1024
*              hard    nofile  65536

vi /etc/pam.d/login
session    required     /lib/security/pam_limits.so


cat /etc/selinux/config

service iptables status

/etc/modprobe.conf
options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180

modprobe -v hangcheck-timer

[root@rac1 rpm]# groupadd oinstall
[root@rac1 rpm]# groupadd dba
[root@rac1 rpm]# groupadd oper
[root@rac1 rpm]# useradd -g oinstall -G dba oracle
[root@rac1 rpm]# passwd oracle
[root@rac1 rpm]# mkdir -p /oracle/product/10.2.0/crs
[root@rac1 rpm]# mkdir -p /oracle/product/10.2.0/asm
[root@rac1 rpm]# mkdir -p /oracle/product/10.2.0/db_1
[root@rac1 rpm]# chown -R oracle:oinstall /oracle
[root@rac1 rpm]# chkconfig rsh on
[root@rac1 rpm]# chkconfig rlogin on
[root@rac1 rpm]# service xinetd reload

# Oracle Settions
export PS1="`/bin/hostname -s`->"
export EDITOR=vi
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/oracle
export ASM_HOME=/oracle/product/10.2.0/asm
export ORA_CRS_HOME=/oracle/product/10.2.0/crs
export ORACLE_HOME=/oracle/product/10.2.0/db_1
export ORACLE_SID=king1
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap ramn"
stty erase ^H
umask 002

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

source .bash_profile


rac1/rhel4.vmx

disk.locking = "FALSE"
diskLib.dataCacheMaxSize = "0"
scsi1.sharedBus = "virtual"

scsi1:0.deviceType = "disk"       "plainDisk"


rac2
vi /etc/sysconfig/network


hostname rac2

/etc/init.d/network restart

[root@rac1 ~]# chkconfig ntpd on
[root@rac1 ~]# service ntpd status
ntpd is stopped
[root@rac1 ~]# service ntpd start              rac2要关闭
[root@rac2 ~]# system-config-date 

[root@rac2 ~]# vi /etc/rc.local
while [ 1 ]; do ntpdate rac1 1>/dev/null 2>&1; sleep 2; done &

[root@rac1 ~]# su - oracle
rac1->mkdir ~/.ssh
rac1->chmod 700 ~/.ssh
rac1->ssh-keygen -t rsa
rac1->ssh-keygen -t dsa

[root@rac2 ~]# su - oracle
rac2->mkdir ~/.ssh
rac2->chmod 700 ~/.ssh
rac2->ssh-keygen -t rsa
rac2->ssh-keygen -t dsa

rac1->cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
rac1->cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
rac1->ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
rac1->ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

rac1->scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys

rac1->ssh rac1 date
rac1->ssh rac2 date
rac1->ssh rac1.boobooke.com date
rac1->ssh rac2.boobooke.com date
rac1->ssh rac1-priv date
rac1->ssh rac2-priv date
rac1->ssh rac1-priv.boobooke.com date date
rac1->ssh rac2-priv.boobooke.com date date

rac1->exec /usr/bin/ssh-agent $SHELL     当前会话生效
rac1->/usr/bin/ssh-add

rac2->exec /usr/bin/ssh-agent $SHELL
rac2->/usr/bin/ssh-add



[root@rac1 ~]# fdisk -l
[root@rac1 ~]# fdisk /dev/sdb

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-204, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-204, default 204):
Using default value 204

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
-----------------------------------------------
[root@rac2 ~]# partprobe
[root@rac2 ~]# fdisk -l

[root@rac1 ~]# vi /etc/sysconfig/rawdevices
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdc1

[root@rac1 ~]# vi /etc/udev/permissions.d/50-udev.permissions
# raw devices
ram*:root:disk:0660
#raw/*:root:disk:0660
raw/*:oracle:dba:0660

[root@rac1 ~]# chkconfig --list rawdevices
[root@rac1 ~]# service rawdevices status
[root@rac1 ~]# service rawdevices start

[root@rac1 ~]# cd /dev/raw
[root@rac1 raw]# ll

[root@rac2 ~]# vi /etc/sysconfig/rawdevices
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdc1

[root@rac2 ~]# vi /etc/udev/permissions.d/50-udev.permissions
# raw devices
ram*:root:disk:0660
#raw/*:root:disk:0660
raw/*:oracle:dba:0660

[root@rac2 ~]# chkconfig --list rawdevices
[root@rac2 ~]# service rawdevices status
[root@rac2 ~]# service rawdevices start

[root@rac2 ~]# cd /dev/raw
[root@rac2 raw]# ll


[root@rac1 asm]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface [oracle]:
Default group to own the driver interface [dba]:
Start Oracle ASM library driver on boot (y/n) [y]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [  OK  ]
Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@rac1 asm]# lsmod | grep asm
[root@rac1 asm]# cat /proc/filesystems
[root@rac1 asm]# df -ha

[root@rac1 asm]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdd1
Marking disk "VOL1" as an ASM disk: [  OK  ]
[root@rac1 asm]# /etc/init.d/oracleasm createdisk VOL2 /dev/sde1
Marking disk "VOL2" as an ASM disk: [  OK  ]
[root@rac1 asm]# /etc/init.d/oracleasm createdisk VOL3 /dev/sdf1
Marking disk "VOL3" as an ASM disk: [  OK  ]
[root@rac1 asm]# /etc/init.d/oracleasm createdisk VOL4 /dev/sdg1
Marking disk "VOL4" as an ASM disk: [  OK  ]

[root@rac1 disks]# /etc/init.d/oracleasm listdisks


[root@rac1 disks]# /etc/init.d/oracleasm querydisk VOL1

[root@rac1 asm]# cd /dev/oracleasm/disks
[root@rac1 disks]# ll




[root@rac2 asm]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [  OK  ]
[root@rac2 asm]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [  OK  ]
Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@rac2 asm]# /etc/init.d/oracleasm listdisks


rac1->exec /usr/bin/ssh-agent $SHELL
rac1->/usr/bin/ssh-add
rac1->clusterware/cluvfy/runcluvfy.sh stage -pre crsinst -n rac1,rac2

[root@rac2 ~]# export DISPLAY=192.168.1.100:0.0
[root@rac2 ~]# /oracle/product/10.2.0/crs/bin/vipca


rac1-> olsnodes -n -p -i
rac1-> crsctl check crs
rac1-> crs_stat -t -v

rac2-> olsnodes -n -p -i
rac2-> crsctl check crs
rac2-> crs_stat -t -v              完成集群件安装  
Name           Type           R/RA   F/FT   Target    State     Host       
----------------------------------------------------------------------
ora.rac1.gsd   application    0/5    0/0    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    0/3    0/0    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    0/0    0/0    ONLINE    ONLINE    rac1       
ora.rac2.gsd   application    0/5    0/0    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    0/3    0/0    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    0/0    0/0    ONLINE    ONLINE    rac2


rac2->crs_stat -t -v  完成监听安装
Name           Type           R/RA   F/FT   Target    State     Host       
----------------------------------------------------------------------
ora....C1.lsnr application    0/5    0/0    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    0/5    0/0    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    0/3    0/0    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    0/0    0/0    ONLINE    ONLINE    rac1       
ora....C2.lsnr application    0/5    0/0    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    0/5    0/0    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    0/3    0/0    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    0/0    0/0    ONLINE    ONLINE    rac2

rac2->crs_stat -t -v           完成ASM安装
Name           Type           R/RA   F/FT   Target    State     Host       
----------------------------------------------------------------------
ora....SM1.asm application    0/5    0/0    ONLINE    ONLINE    rac1       
ora....C1.lsnr application    0/5    0/0    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    0/5    0/0    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    0/3    0/0    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    0/0    0/0    ONLINE    ONLINE    rac1       
ora....SM2.asm application    0/5    0/0    ONLINE    ONLINE    rac2       
ora....C2.lsnr application    0/5    0/0    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    0/5    0/0    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    0/3    0/0    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    0/0    0/0    ONLINE    ONLINE    rac2 

rac2->crs_stat -t -v  完成数据库安装
Name           Type           R/RA   F/FT   Target    State     Host       
----------------------------------------------------------------------
ora.king.db    application    0/1    0/1    ONLINE    ONLINE    rac1       
ora....g1.inst application    0/5    0/0    ONLINE    ONLINE    rac1       
ora....g2.inst application    0/5    0/0    ONLINE    ONLINE    rac2       
ora....SM1.asm application    0/5    0/0    ONLINE    ONLINE    rac1       
ora....C1.lsnr application    0/5    0/0    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    0/5    0/0    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    0/3    0/0    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    0/0    0/0    ONLINE    ONLINE    rac1       
ora....SM2.asm application    0/5    0/0    ONLINE    ONLINE    rac2       
ora....C2.lsnr application    0/5    0/0    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    0/5    0/0    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    0/3    0/0    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    0/0    0/0    ONLINE    ONLINE    rac2  


rac1->export ORACLE_SID=+ASM1
rac1->asmcmd -p
ASMCMD [+] > help

rac1->srvctl status nodeapps -n rac1
rac1->srvctl status nodeapps -n rac2

rac1->srvctl status asm -n rac1
rac1->srvctl status asm -n rac2

rac1->srvctl status database -d king
rac1->srvctl status service -d king

STARTUP:
node1$ srvctl start nodeapps -n rac1
node1$ srvctl start nodeapps -n rac2
node1$ srvctl start asm -n rac1
node1$ srvctl start asm -n rac2
node1$ srvctl start database -d king
node1$ srvctl start service -d king
node1$ crs_stat -t
SHUTDOWN:
node1$ srvctl stop service -d king
node1$ srvctl stop database -d king
node1$ srvctl stop asm -n rac2
node1$ srvctl stop asm -n rac1
node1$ srvctl stop nodeapps -n rac2
node1$ srvctl stop nodeapps -n rac1
node1$ crs_stat -t

rac1->crsctl check crs

SQL> select instance_name, host_name, archiver, thread#, status from gv$instance;

rac1->sqlplus system/123456@king1
rac1->sqlplus system/123456@king2
rac1->sqlplus system/123456@king

rac1->/etc/init.d/init.crs stop
rac2->/etc/init.d/init.crs stop
rac1->/etc/init.d/init.crs start
rac2->/etc/init.d/init.crs start

SQL> select file_name, bytes/1024/1024 from dba_data_files;


king =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT =1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT =1521))
    )
    (LOAD_BALANCE = yes)
    (CONNECT_DATA =
      (SERVICE_NAME = king)
      (SERVER = DEDICATED)
      (FAILOVER_MODE=
(TYPE = session)
(METHOD = basic)
(RETRIES = 180)
(DELAY = 5)
      )
    )
  )

$ORA_CRS_HOME/bin/crs_start -all
此命令用来启动所有的集群服务,但是启动的前提是 资源状态State不能是UNKNOWN。
$ORA_CRS_HOME/bin/crs_start 集群服务名(集群服务名可以通过$ORA_CRS_HOME/bin/crs_stat得到)
$ORA_CRS_HOME/bin/crs_stop -all
$ORA_CRS_HOME/bin/crs_stop 集群服务名(集群服务名可以通过$ORA_CRS_HOME/bin/crs_stat得到)

[oracle@rac1 ~]$ $ORA_CRS_HOME/bin/crs_stat (此命令可以查看各个资源的完整服务名称)

分享到:
评论

相关推荐

    Linux +Oracle 11g R2 RAC 安装配置详细过程V2.1

    Linux +Oracle 11g R2 RAC 安装配置详细过程 Linux +Oracle 11g R2 RAC 安装配置详细过程

    Redhat Enterprice linux Server 5上安装 Oracle 10G R2 RAC参考手册.pdf

    Redhat Enterprice linux Server 5上安装 Oracle 10G R2 RAC参考手册.pdf

    oracle 11G R2 RAC

    ### Oracle 11g R2 RAC 安装与配置详解 #### 一、Oracle 11g R2 RAC 概述 Oracle Real Application Clusters (RAC) 是 Oracle 数据库的一个关键特性,它提供了高可用性和负载均衡功能。在 Oracle 11g Release 2 ...

    ORACLE 10G R2 RAC详解

    本文将详细介绍如何在Red Hat Enterprise Linux (RHEL) 操作系统上,利用HP ProLiant服务器和MSA1000存储设备部署Oracle 10g R2 RAC环境。 #### 二、安装环境 ##### 2.1 硬件环境 - **节点1**: HP ProLiant DL580...

    【Oracle-RAC】Linux--Oracle-11g-R2-RAC-安装配置详细过程V3.0(图文并茂)

    根据提供的文档信息,本文将详细解析Oracle 11g R2 RAC(Real Application Clusters)在Linux环境下的安装配置过程。此文档适用于希望在Linux平台上部署Oracle 11g R2 RAC集群的IT专业人士。 ### Oracle 11g R2 RAC...

    Linux Oracle 11g R2 RAC 安装配置详细过程

    Linux Oracle 11g R2 RAC(Real Application Clusters)安装配置涉及的技术内容相当广泛,涵盖操作系统配置、网络设置、用户和组管理、磁盘规划、软件安装以及集群配置等众多步骤。本文档旨在提供一个详细过程,以便...

    Oracle 11g R2 RAC + DG高端实战[黄伟-专题]

    文档《Oracle 11g R2 RAC + DG高端实战[黄伟-专题]》是一份详尽的实战指南,主要讲述如何在OEL5.5(Oracle Enterprise Linux 5.5)的64位系统上安装和配置Oracle 11g R2(版本**.*.*.*.0),涉及RAC和Active Data ...

    ORACLE 11G R2 RAC 详细安装步骤

    以下是对Oracle 11g R2 RAC安装过程的详细概述: **一、环境准备** 1. **硬件配置**:确保所有节点具有足够的内存、CPU资源,并且存储设备支持共享,如SAN(Storage Area Network)或NFS(Network File System)。 ...

    Oracle 10g R2 RAC for Redhat Linux AS 4 u5安装文档

    Oracle 10g R2 RAC for Redhat Linux AS 4 u5安装文档.doc

    手把手教你用VMware在Linux下安装Oracle 10g RAC

    ### 手把手教你用VMware在Linux下安装Oracle 10g RAC #### 一、准备工作 在开始安装Oracle 10g RAC之前,需要确保已经做好充分的准备工作。这包括安装必要的软件和配置合适的环境。 ##### 必备软件 1. **VMware ...

    oracle11g R2 RAC安装注意事项

    在安装Oracle 11g R2 RAC时,有很多关键步骤和注意事项需要考虑,以确保安装过程的成功和系统的稳定运行。 首先,硬件配置是RAC安装的基础。由于RAC需要多个服务器节点共享数据,因此,必须有可靠的网络连接,例如...

    Oracle 11g R2 RAC Red Hat5.3安装文档

    在Red Hat Enterprise Linux 5.3(RHEL5.3)操作系统环境下安装Oracle 11g R2 RAC,需要遵循一系列严格的步骤和前提条件,以确保集群环境的稳定和数据库的正常运行。本文档将详细介绍Oracle 11g R2 RAC在RHEL5.3上的...

    如何使用虚拟机搭建Oracle11g R2 RAC学习环境.pdf

    2. **安装Linux操作系统**:选择支持Oracle 11g R2 RAC的Linux发行版,如RHEL或CentOS。 3. **配置iSCSI服务器**:在Linux服务器上安装和配置iSCSI服务,以模拟共享存储设备。 4. **安装Oracle Grid ...

    Linux + Oracle 11g R2 RAC 安装配置详细过程V2.0(图文并茂)

    本文将详细介绍如何在Linux环境下配置Oracle 11g Release 2 (11g R2) RAC,提供一个详尽的步骤指南。 首先,让我们了解Linux和Oracle 11g R2 RAC的基础知识。Linux是一个开源的操作系统,以其稳定性和安全性受到...

    oracle 11g r2 rac 安装

    在CentOS 5.5 64位环境下安装Oracle 11g R2 RAC涉及多个步骤,以下是一份详细的安装指南: **安装前的问题解答:** 1. **VNC远程连接Linux**: - 在Linux上安装VNC服务,检查是否已安装,然后启动服务。 - 修改 ...

    一步一步在Linux上部署Oracle 10g R2 RAC

    某客户需要将一套Oracle 10gR2 双节点RAC 生产数据库升级至Oracle 11gR2 RAC,所以便有了本系列实战的教程。 为更贴切还原生产过程中的实际操作,本系列教程一个分两大部分: 第一部分:从零开始一步一步搭建一套在...

    linux AS3下安装oracle11g R2 RAC

    ### Linux AS3 下安装 Oracle 11g R2 RAC 的详细步骤 #### 清理工作 在开始安装 Oracle 11g R2 RAC 之前,需要对系统进行一定的清理工作,确保安装环境干净,避免出现由于环境残留导致的问题。 - 删除临时目录中的...

    Oracle 12c R2 RAC安装配置指南.docx

    Oracle 12c R2 RAC 安装配置指南是指在 CentOS 7、RHEL 7 或者 Oracle Linux 7 操作系统上安装 Oracle 12c R2 RAC 的配置指南,涵盖了从安装操作系统到创建 Oracle 用户和组、安装 Oracle 预安装包、创建安装目录、...

Global site tag (gtag.js) - Google Analytics