Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6814827
  • 博文数量: 1662
  • 博客积分: 16831
  • 博客等级: 上将
  • 技术积分: 12554
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-25 07:23
个人简介

柔中带刚,刚中带柔,淫荡中富含柔和,刚猛中荡漾风骚,无坚不摧,无孔不入!

文章分类

全部博文(1662)

文章存档

2021年(8)

2020年(24)

2019年(4)

2018年(19)

2017年(66)

2016年(60)

2015年(49)

2014年(201)

2013年(221)

2012年(638)

2011年(372)

分类: Oracle

2011-12-27 13:16:01

Oracle 11g RAC 在 CentOS 5.5 的安装日志
[日期:2011-08-07] 来源:Linux社区  作者:miyatang
 
 
服务器
DELL R410 2台
CPU INTER E5620 .4GHz 12M4C
MEM 64G
DISK 300G
 
存储器
DS3512
DISK 600G*12 RAID5
 
(因为JS以次充好,在服务器光纤卡上,搞了一个月,才把问题解决掉。
 
出现问题:
    1.服务器时不时找不到存储器;
 
    2.在存储器设置端,找不到光纤卡接口。
    3.服务器重启后,找不到存储器,要存储器重启后才可找到
 

最后还是用一块4GB的当了8GB给了我们。速度肯定是打折了。
那个气呀。使用不同的硬件产品,就是麻烦)
 
 
 
软件环境:
CentOS 5.5  64bit
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0(64位)
 

1、服务器本地磁盘分区:
 
Disk /dev/sda: 300.0 GB, 300000000000 bytes
255 heads, 63 sectors/track, 36472 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          25      200781   83  Linux
/dev/sda2              26       36472   292760527+  8e  Linux LVM
 

使用了LVM 分区,后使用卷。
关于LVM 资料如下:
http://hi.baidu.com/dongfangmn/blog/item/23f7ccd813c9213831fa1c67.html
 
2、IP规划
 
[root@rac2 app]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1        localhost.localdomain localhost
#::1        localhost6.localdomain6 localhost6
 

#public ip
192.168.18.101 rac1
192.168.18.103 rac2
 
#priv ip
192.168.0.101     rac1-private
192.168.0.103     rac2-private
 
#vip ip
192.168.18.121      rac1-vip
192.168.18.123      rac2-vip
 
#scan ip
192.168.18.100      rac-scan
 
(注意:All host names must conform to the RFC 952 standard,
which permits alphanumeric characters, Host name using underscores(“_”)
are not allowed.HOSTS 文件中不支持“_” 字符)
 
3、用户/组
 
/usr/sbin/groupadd -g 501 oinstall
/usr/sbin/groupadd -g 502 dba
/usr/sbin/groupadd -g 503 oper
/usr/sbin/groupadd -g 504 asmadmin
/usr/sbin/groupadd -g 505 asmoper
/usr/sbin/groupadd -g 506 asmdba
/usr/sbin/useradd -g oinstall -G dba,asmdba,oper oracle
/usr/sbin/useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
 
[root@ora1 ~]# id oracle
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(oper),506(asmdba)
[root@ora1 ~]# id grid
uid=502(grid) gid=501(oinstall) groups=501(oinstall),502(dba),503(oper),504(asmadmin),505(asmoper),506(asmdba)
 

mkdir -p /opt/app/oraInventory
chown -R grid:oinstall /opt/app/oraInventory
chmod -R 775 /opt/app/oraInventory
 
mkdir -p /opt/app/grid
mkdir -p /opt/app/oracle
chown -R grid:oinstall /opt/app/grid
chown -R oracle:oinstall /opt/app/oracle
chmod -R 775 /opt/app/oracle
chmod -R 775 /opt/app/grid
 
passwd grid
passwd oracle
 
4、修改系统参数:
vi /etc/security/limits.conf
 
#ORACLE SETTING
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
 

vi /etc/pam.d/login
 
#ORACLE SETTING
session    required     pam_limits.so
 
# vi /etc/sysctl.conf
 
#ORACLE SETTING
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
 

5、gird时间同步所需要的设置(11gR2新增检查项)
 
#Network Time Protocol Setting
/sbin/service ntpd stop
chkconfig ntpd off
#rm /etc/ntp.conf
mv /etc/ntp.conf  /etc/ntp.conf.org
 

选择是开启还是关闭SELINUX的工作模式(修改这一项后最好重启一下操作系统)
 
[root@oracle ~]# vi /etc/selinux/config
 
# 设置SELINUX为disabled
 
      SELINUX=disabled
 
6、操作系统版本:
 
[root@rac1 ~]# lsb_release -a
LSB Version:    :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID:    CentOS
Description:    CentOS release 5.5 (Final)
Release:    5.5
Codename:    Final
 
[root@rac1 ~]# uname -a
 
Linux solr03 2.6.18-194.11.4.el5 #1 SMP Tue Sep 21 05:04:09 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@rac1 ~]#
 
7、修改系统的发行版本
 
[root@oracle ~]# vi /etc/RedHat-release
 
将CentOS release 5 (Final) 修改成
#CentOS release 5 (Final)
Red Hat Enterprise Linux AS release 5 (Nahant Update 5)
 
(因为oracle公司没推出CentOS版本的oracle)
 
8、修改gird、oracle用户的.bash_profile文件:
 
#grid 用户配置文件 ORACLE_HOSTNAME请自行设置
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
 
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_BASE=/opt/oracle; export ORACLE_BASE
 
ORACLE_HOME=/opt/oracle/product/11.2.0; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
THREADS_FLAG=native; export THREADS_FLAG
 
PATH=$ORACLE_HOME/bin:$PATH; export PATH
THREADS_FLAG=native; export THREADS_FLAG
 
PATH=$ORACLE_HOME/bin:$PATH; export PATH
 
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
stty erase ^h #删除键可用处理
 

#oracle用户配置文件 ORACLE_HOSTNAME请自行设置
# Oracle Settings oracle
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
 
ORACLE_BASE=/opt/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0; export ORACLE_HOME
ORACLE_SID=racdb1; export ORACLE_SID
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
stty erase ^h #删除键可用处理
 
8、配置信任关系
 
设置SSH,
1).在主节点RAC1上以grid,oracle用户身份生成用户的公匙和私匙
 
# su - oracle
$ mkdir ~/.ssh
$ ssh-keygen -t rsa
$ ssh-keygen -t dsa
 
2).在副节点RAC2上执行相同的操作,确保通信无阻
# ping rac1-eth0
# ping rac1-eth1
# su - oracle
$ mkdir ~/.ssh
$ ssh-keygen -t rsa
$ ssh-keygen -t dsa
 
3).在主节点RAC1上oracle用户执行以下操作
 
$ touch ~/.ssh/authorized_keys
 
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
 
#将RAC2的加入
$ ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
$ scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
 
 
 
4).主节点RAC1上执行检验操作
$ ssh rac1 date
$ ssh rac2 date
$ ssh rac1-private date
$ ssh rac2-private date
 
 
 
5).在副节点RAC2上执行检验操作
$ ssh rac1 date
$ ssh rac2 date
 
$ ssh rac1-private date
$ ssh rac2-private date
 
-------------------------------------------------------------------------------------
9、共享磁盘规划
  
+CRS        三个2G的盘
+DGDATA     四个1T的盘
+DGRECOVERY 两个1T的盘
 
硬盘分区
 
[root@rac1 init.d]# fdisk /dev/sdc
 
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
 
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
 
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
在用fdisk -l 就会看到新的分区sdb1,sdc1,sdd1,sde1,sdf1
 
10、每个节点安装ASM
 
oracleasmlib-2.0.4-1.el5.x86_64.rpm
oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
oracleasm-support-2.1.7-1.el5.x86_64.rpm
 
 
 查看对应的内核,下载对应的支持包
uname -r" command on your machine to determine your kernel version. 
 
The corresponding package has the name oracleasm-
 
 
下载地址:
 

 
 

[root@rac1 oracle]# rpm -ivh oracleasm-support-2.1.7-1.el5.x86_64.rpm
warning: oracleasm-support-2.1.7-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID b38a8516
Preparing...                ########################################### [100%]
   1:oracleasm-support      ########################################### [100%]
 
[root@rac1 oracle]# rpm -ivh oracleasmlib-2.0.4-1.el5.x86_64.rpm
warning: oracleasmlib-2.0.4-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
error: Failed dependencies:
    oracleasm >= 1.0.4 is needed by oracleasmlib-2.0.4-1.el5.x86_64
 
[root@rac1 oracle]# rpm -ivh oracleasm-2.6.18-194.11.4.el5-2.0.5-1.el5.x86_64.rpm
warning: oracleasm-2.6.18-194.11.4.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasm-2.6.18-194.11########################################### [100%]
 
 
 
11、每个节点配置ASM
 
 [root@rac2 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 without typing an
answer will keep that current value.  Ctrl-C will abort.
 
Default user to own the driver interface [grid]:
Default group to own the driver interface [asmadmin]:
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  ]
 
 创建asm盘
  
+CRS        三个2G的盘
+DGDATA     四个1T的盘
+DGRECOVERY 两个1T的盘
 
(以下各分区大小和实际大小不同,以下内容只供借鉴)
CRS1 /dev/sdk: 2147 MB
CRS2 /dev/sdl: 2147 MB
CRS3 /dev/sdm: 2147 MB
 
DGDATA1 /dev/sdn: 1099.5 GB
DGDATA2 /dev/sdo: 1099.5 GB
DGDATA3 /dev/sdp: 1099.5 GB
DGDATA4 /dev/sdq: 1099.5 GB
 
DGRECOVERY1 /dev/sdr: 1099.5 GB
DGRECOVERY2 /dev/sds: 1091.3 GB
 

[root@ora2 asm]# /etc/init.d/oracleasm createdisk CRS1 /dev/sdb1
Marking disk "CRS1" as an ASM disk: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk CRS2 /dev/sdc1
Marking disk "CRS2" as an ASM disk: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk CRS3 /dev/sdd1
Marking disk "CRS3" as an ASM disk: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk DATA1 /dev/sde1
Marking disk "DATA1" as an ASM disk: [FAILED]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk DATA2 /dev/sdf1
Marking disk "DATA1" as an ASM disk: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk DATA3 /dev/sdg1
Marking disk "DATA2" as an ASM disk: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk DATA4 /dev/sdh1
Marking disk "DATA3" as an ASM disk: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk RECOVERY1 /dev/sdi1
Marking disk "REC1" as an ASM disk: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk RECOVERY2 /dev/sdj1
Marking disk "REC2" as an ASM disk: [  OK  ]
 
[root@rac2 ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks:               [  OK  ]
 
[root@rac2 ~]# /etc/init.d/oracleasm listdisks
CRS1
CRS2
CRS3
DATA1
DATA2
DATA3
DATE4
RECOVERY1
RECOVERY2
 
12、安装cvuqdisk包并验证
 
在两个 Oracle RAC 节点上安装操作系统程序包 cvuqdisk。如果没有 cvuqdisk,
集群验证实用程序就无法发现共享磁盘,当运行(手动运行或在 Oracle Grid Infrastructure
安装结束时自动运行)集群验证实用程序时,您会收到这样的错误消息:“Package cvuqdisk not installed”。
 
使用适用于您的硬件体系结构(例如,x86_64 或 i386)的 cvuqdisk RPM。
cvuqdisk RPM 包含在 Oracle Grid Infrastructure 安装介质上的 rpm 目录中。
 

安装cvuqdisk包
 
如果不安装cvuqdisk包, Cluster Verification Utility不能发现共享盘,
当你运行Cluster Verification程序时你将收到"Package cvuqdisk not installed"
 
检查是否已经安装cvuqdisk包
 
# rpm -qi cvuqdisk
 
如果已经安装,则查看版本
 
# rpm -e cvuqdisk
 

在你保存cvuqdisk的目录使用下列命令安装cvuqdisk包如:
 
# rpm -iv cvuqdisk-1.0.7-1.rpm
 
[root@rac1 rpm]# pwd
/home/oracle/grid/grid/rpm
[root@rac1 rpm]# ll
-rw-rw-r-- 1 root root 8173 Jul 15  2009 cvuqdisk-1.0.7-1.rpm
[root@rac1 rpm]# rpm -qi cvuqdisk-1.0.7-1.rpm
package cvuqdisk-1.0.7-1.rpm is not installed
[root@rac1 rpm]# rpm -ivh cvuqdisk-1.0.7-1.rpm
Preparing...                ########################################### [100%]
Using default group oinstall to install package
   1:cvuqdisk               ########################################### [100%]
 
 
 

设置环境变量 CVUQDISK_GRP,使其指向作为 cvuqdisk 的所有者所在的组(本文为 oinstall):
export CVUQDISK_GRP=oinstall
使用 CVU 验证是否满足 Oracle 集群件要求
记住要作为 grid 用户在将要执行 Oracle 安装的节点 (racnode1) 上运行。此外,
必须为 grid 用户配置通过用户等效性实现的 SSH 连通性。
 
检查结点、用户
在grid软件安装目录里运行以下命令:
./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -fixup -verbose
 
[grid@rac1 grid]$ ./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -fixup -verbose
Performing pre-checks for cluster services setup
Checking node reachability...
 
 

检查过程省略...
 
使用 CVU 验证硬件和操作系统设置
./runcluvfy.sh stage -post hwos -n rac1,rac2 -verbose
[grid@rac1 grid]$ ./runcluvfy.sh stage -post hwos -n rac1,rac2 -verbose
Performing post-checks for hardware and operating system setup
Checking node reachability...
 
检查过程省略...
 
 
 
 
13、检查安装要求的支持包
 
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-2.5-24 (32 bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5 (32 bit)
glibc-headers-2.5
ksh-20060214
libaio-0.3.106
libaio-0.3.106 (32 bit)
libaio-devel-0.3.106
libaio-devel-0.3.106 (32 bit)
libgcc-4.1.2
libgcc-4.1.2 (32 bit)
libstdc++-4.1.2
libstdc++-4.1.2 (32 bit)
libstdc++-devel 4.1.2
make-3.81
numactl-devel-0.9.8.x86_64
sysstat-7.0.2
 

Are the following packages installed (assumes CentOS-5 and above distribution)
    command:
    rpm -q binutils \
    compat-libstdc++ \
    elfutils-libelf \
    elfutils-libelf-devel \
    glibc \
    glibc-common \
    glibc-devel \
    glibc-headers \
    gcc \
    gcc-c++ \
    libaio-devel \
    libaio \
    libgcc \
    libstdc++ \
    libstdc++ \
    make \
    sysstat \
    unixODBC \
    unixODBC-devel
 
 
 
    results: binutils-2.17.50.0.6-14.el5
    package compat-libstdc++ is not installed
    elfutils-libelf-0.137-3.el5
    package elfutils-libelf-devel is not installed
    glibc-2.5-49
    glibc-common-2.5-49
    glibc-devel-2.5-49
    glibc-headers-2.5-49
    gcc-4.1.2-48.el5
    package gcc-c++ is not installed
    package libaio-devel is not installed
    libaio-0.3.106-5
    libgcc-4.1.2-48.el5
    libstdc++-4.1.2-48.el5
    libstdc++-4.1.2-48.el5
    make-3.81-3.el5
    package sysstat is not installed
    package unixODBC is not installed
    package unixODBC-devel is not installed
    notes : you will probably get quite a few packages that are not installed with a
    typical installation. You can investigate missing packages with the following command
    making sure you add/subtract from this list if necessary.
    yum list available "compat*" \
    "elfutils*" \
    "gcc*" \
    "libaio*" \
    "sysstat*" \
    "unixODBC*"
    action : Our base installation left us needing to issue the following command to install missing packages.
14、安装GRID RAC 软件
 
su - grid
./runInstaller
 
scan配置:
 
cluster name(集群名称): rac
scanname:  rac-scan
scanport:  1521
 
sys
asmsnp  password: sysPass
 
 
 
/opt/oraInventory/orainstRoot.sh
 
[root@rac1 soft]# /opt/app/oraInventory/orainstRoot.sh
Changing permissions of /opt/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
 
Changing groupname of /opt/oraInventory to oinstall.
The execution of the script. is complete.
 
[root@rac2 soft]# /opt/oraInventory/orainstRoot.sh
Changing permissions of /opt/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
 
Changing groupname of /opt/oraInventory to oinstall.
The execution of the script. is complete.
 
 
 
 
 
/opt/grid/product/11.2.0/root.sh
 
[root@rac1 soft]# /opt/oraInventory/orainstRoot.sh
Changing permissions of /opt/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
 
Changing groupname of /opt/oraInventory to oinstall.
The execution of the script. is complete.
[root@rac1 soft]# /opt/grid/product/11.2.0/root.sh
Running Oracle 11g root.sh script...
 
The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /opt/grid/product/11.2.0
 
Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...
 

Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
 
2010-07-28 16:19:03: Parsing the host name
2010-07-28 16:19:03: Checking for super user privileges
2010-07-28 16:19:03: User has super user privileges
Using configuration parameter file: /opt/grid/product/11.2.0/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
  root wallet
  root wallet cert
  root cert export
  peer wallet
  profile reader wallet
  pa wallet
  peer wallet keys
  pa wallet keys
  peer cert request
  pa cert request
  peer cert
  pa cert
  peer root cert TP
  profile reader root cert TP
  pa root cert TP
  peer pa cert TP
  pa peer cert TP
  profile reader pa cert TP
  profile reader peer cert TP
  peer user cert
  pa user cert
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
CRS-2672: Attempting to start 'ora.gipcd' on 'rac1'
CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1'
CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded
CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1'
CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'
CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'rac1'
CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'
CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded
CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'rac1'
CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded
 
ASM created and started successfully.
 
DiskGroup CRS created successfully.
 
clscfg: -install mode specified
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-2672: Attempting to start 'ora.crsd' on 'rac1'
CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded
CRS-4256: Updating the profile
Successful addition of voting disk a81aaf52b2b74ff5bf7a773e7966ea7c.
Successfully replaced voting disk group with +CRS.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   a81aaf52b2b74ff5bf7a773e7966ea7c (ORCL:CRS1) [CRS]
Located 1 voting disk(s).
CRS-2673: Attempting to stop 'ora.crsd' on 'rac1'
CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'
CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'rac1'
CRS-2677: Stop of 'ora.cssdmonitor' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac1'
CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'
CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'
CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'
CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1'
CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on 'rac1'
CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1'
CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'
CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'rac1'
CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'
CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded
CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'rac1'
CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'rac1'
CRS-2676: Start of 'ora.asm' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'rac1'
CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'rac1'
CRS-2676: Start of 'ora.evmd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'rac1'
CRS-2676: Start of 'ora.asm' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.CRS.dg' on 'rac1'
CRS-2676: Start of 'ora.CRS.dg' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.registry.acfs' on 'rac1'
CRS-2676: Start of 'ora.registry.acfs' on 'rac1' succeeded
 
rac1     2010/07/28 16:31:27     /opt/grid/product/11.2.0/cdata/rac1/backup_20100728_163127.olr
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
Updating inventory properties for clusterware
Starting Oracle Universal Installer...
 
Checking swap space: must be greater than 500 MB.   Actual 971 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /opt/oraInventory
'UpdateNodeList' was successful.
 
 
---------------------- 检测 -----------------------------------------------
 
[grid@rac2 ~]$ srvctl enable oc4j
PRKO-2116 : OC4J is already enabled
[grid@rac2 ~]$ srvctl start oc4j
[grid@rac2 ~]$ srvctl enable nodeapps
PRKO-2415 : VIP is already enabled on node(s): rac1,rac2
PRKO-2416 : Network resource is already enabled.
PRKO-2417 : ONS is already enabled on node(s): rac1,rac2
PRKO-2418 : eONS is already enabled on node(s): rac1,rac2
 
[grid@rac2 ~]$ crs_stat -t
Name           Type           Target    State     Host      
------------------------------------------------------------
ora.CRS.dg     ora....up.type ONLINE    ONLINE    rac1      
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1      
ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac1      
ora.asm        ora.asm.type   ONLINE    ONLINE    rac1      
ora.eons       ora.eons.type  ONLINE    ONLINE    rac1      
ora.gsd        ora.gsd.type   ONLINE    ONLINE    rac1      
ora....network ora....rk.type ONLINE    ONLINE    rac1      
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    rac2      
ora.ons        ora.ons.type   ONLINE    ONLINE    rac1      
ora....SM1.asm application    ONLINE    ONLINE    rac1      
ora....C1.lsnr application    ONLINE    ONLINE    rac1      
ora.rac1.gsd   application    ONLINE    ONLINE    rac1      
ora.rac1.ons   application    ONLINE    ONLINE    rac1      
ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1      
ora....SM2.asm application    ONLINE    ONLINE    rac2      
ora....C2.lsnr application    ONLINE    ONLINE    rac2      
ora.rac2.gsd   application    ONLINE    ONLINE    rac2      
ora.rac2.ons   application    ONLINE    ONLINE    rac2      
ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2      
ora....ry.acfs ora....fs.type ONLINE    ONLINE    rac1      
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac1
 

6、
su - grid
./runInstaller
 
scan配置:
cluster scan: sanclusters
scanname:  racscan
scanport:  1521
 

/opt/oraInventory/orainstRoot.sh
 
[root@rac1 soft]# /opt/oraInventory/orainstRoot.sh
Changing permissions of /opt/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
 
Changing groupname of /opt/oraInventory to oinstall.
The execution of the script. is complete.
 
[root@rac2 soft]# /opt/oraInventory/orainstRoot.sh
Changing permissions of /opt/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
 
Changing groupname of /opt/oraInventory to oinstall.
The execution of the script. is complete.
 
 
 
/opt/grid/product/11.2.0/root.sh
 
[root@rac1 soft]# /opt/oraInventory/orainstRoot.sh
Changing permissions of /opt/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
 
Changing groupname of /opt/oraInventory to oinstall.
The execution of the script. is complete.
[root@rac1 soft]# /opt/grid/product/11.2.0/root.sh
Running Oracle 11g root.sh script...
 
The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /opt/grid/product/11.2.0
 
Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...
 
 
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
2010-07-28 16:19:03: Parsing the host name
2010-07-28 16:19:03: Checking for super user privileges
2010-07-28 16:19:03: User has super user privileges
Using configuration parameter file: /opt/grid/product/11.2.0/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
  root wallet
  root wallet cert
  root cert export
  peer wallet
  profile reader wallet
  pa wallet
  peer wallet keys
  pa wallet keys
  peer cert request
  pa cert request
  peer cert
  pa cert
  peer root cert TP
  profile reader root cert TP
  pa root cert TP
  peer pa cert TP
  pa peer cert TP
  profile reader pa cert TP
  profile reader peer cert TP
  peer user cert
  pa user cert
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
CRS-2672: Attempting to start 'ora.gipcd' on 'rac1'
CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1'
CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded
CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1'
CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'
CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'rac1'
CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'
CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded
CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'rac1'
CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded
ASM created and started successfully.
DiskGroup CRS created successfully.
clscfg: -install mode specified
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-2672: Attempting to start 'ora.crsd' on 'rac1'
CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded
CRS-4256: Updating the profile
Successful addition of voting disk a81aaf52b2b74ff5bf7a773e7966ea7c.
Successfully replaced voting disk group with +CRS.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   a81aaf52b2b74ff5bf7a773e7966ea7c (ORCL:CRS1) [CRS]
Located 1 voting disk(s).
CRS-2673: Attempting to stop 'ora.crsd' on 'rac1'
CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'
CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'rac1'
CRS-2677: Stop of 'ora.cssdmonitor' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac1'
CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'
CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'
CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'
CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1'
CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on 'rac1'
CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1'
CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'
CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'rac1'
CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'
CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded
CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'rac1'
CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'rac1'
CRS-2676: Start of 'ora.asm' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'rac1'
CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'rac1'
CRS-2676: Start of 'ora.evmd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'rac1'
CRS-2676: Start of 'ora.asm' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.CRS.dg' on 'rac1'
CRS-2676: Start of 'ora.CRS.dg' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.registry.acfs' on 'rac1'
CRS-2676: Start of 'ora.registry.acfs' on 'rac1' succeeded
rac1     2010/07/28 16:31:27     /opt/grid/product/11.2.0/cdata/rac1/backup_20100728_163127.olr
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
Updating inventory properties for clusterware
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB.   Actual 971 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /opt/oraInventory
'UpdateNodeList' was successful.
 
[root@rac2 soft]# /opt/grid/product/11.2.0/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /opt/grid/product/11.2.0
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying coraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
2010-08-02 14:32:28: Parsing the host name
2010-08-02 14:32:28: Checking for super user privileges
2010-08-02 14:32:28: User has super user privileges
Using configuration parameter file: /opt/grid/product/11.2.0/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node rac1, number 1, and is terminating
An active cluster was found during exclusive startup, restarting to join the cluster
CRS-2672: Attempting to start 'ora.mdnsd' on 'rac2'
CRS-2676: Start of 'ora.mdnsd' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on 'rac2'
CRS-2676: Start of 'ora.gipcd' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'rac2'
CRS-2676: Start of 'ora.gpnpd' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac2'
CRS-2676: Start of 'ora.cssdmonitor' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'rac2'
CRS-2672: Attempting to start 'ora.diskmon' on 'rac2'
CRS-2676: Start of 'ora.diskmon' on 'rac2' succeeded
CRS-2676: Start of 'ora.cssd' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'rac2'
CRS-2676: Start of 'ora.ctssd' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.drivers.acfs' on 'rac2'
CRS-2676: Start of 'ora.drivers.acfs' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'rac2'
CRS-2676: Start of 'ora.asm' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'rac2'
CRS-2676: Start of 'ora.crsd' on 'rac2' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'rac2'
CRS-2676: Start of 'ora.evmd' on 'rac2' succeeded
rac2     2010/08/02 14:37:51     /opt/grid/product/11.2.0/cdata/rac2/backup_20100802_143751.olr
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
Updating inventory properties for clusterware
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB.   Actual 1202 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /opt/oraInventory
'UpdateNodeList' was successful.
 

Oc4j,gsd服务默认是disable的,如果要启动,启用即可
 
[grid@rac2 ~]$ srvctl enable oc4j
PRKO-2116 : OC4J is already enabled
[grid@rac2 ~]$ srvctl start oc4j
[grid@rac2 ~]$ srvctl enable nodeapps
PRKO-2415 : VIP is already enabled on node(s): rac1,rac2
PRKO-2416 : Network resource is already enabled.
PRKO-2417 : ONS is already enabled on node(s): rac1,rac2
PRKO-2418 : eONS is already enabled on node(s): rac1,rac2
 
[grid@rac2 ~]$ crs_stat -t
Name           Type           Target    State     Host      
------------------------------------------------------------
ora.CRS.dg     ora....up.type ONLINE    ONLINE    rac1      
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1      
ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac1      
ora.asm        ora.asm.type   ONLINE    ONLINE    rac1      
ora.eons       ora.eons.type  ONLINE    ONLINE    rac1      
ora.gsd        ora.gsd.type   ONLINE    ONLINE    rac1      
ora....network ora....rk.type ONLINE    ONLINE    rac1      
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    rac2      
ora.ons        ora.ons.type   ONLINE    ONLINE    rac1      
ora....SM1.asm application    ONLINE    ONLINE    rac1      
ora....C1.lsnr application    ONLINE    ONLINE    rac1      
ora.rac1.gsd   application    ONLINE    ONLINE    rac1      
ora.rac1.ons   application    ONLINE    ONLINE    rac1      
ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1      
ora....SM2.asm application    ONLINE    ONLINE    rac2      
ora....C2.lsnr application    ONLINE    ONLINE    rac2      
ora.rac2.gsd   application    ONLINE    ONLINE    rac2      
ora.rac2.ons   application    ONLINE    ONLINE    rac2      
ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2      
ora....ry.acfs ora....fs.type ONLINE    ONLINE    rac1      
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac1
 
 
资源组状态:
crsctl status resource -t
[grid@rac2 ~]$ crsctl status resource -t
 
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       Local Resources
ora.CRS.dg
               ONLINE  ONLINE       rac1                                       
               ONLINE  ONLINE       rac2                                       
ora.LISTENER.lsnr
               ONLINE  ONLINE       rac1                                       
               ONLINE  ONLINE       rac2                                       
ora.asm
               ONLINE  ONLINE       rac1                     Started           
               ONLINE  ONLINE       rac2                     Started           
ora.eons
               ONLINE  ONLINE       rac1                                       
               ONLINE  ONLINE       rac2                                       
ora.gsd
               ONLINE  ONLINE       rac1                                       
               ONLINE  ONLINE       rac2                                       
ora.net1.network
               ONLINE  ONLINE       rac1                                       
               ONLINE  ONLINE       rac2                                       
ora.ons
               ONLINE  ONLINE       rac1                                       
               ONLINE  ONLINE       rac2                                       
ora.registry.acfs
               ONLINE  ONLINE       rac1                                       
               ONLINE  ONLINE       rac2    
                                  
Cluster Resources
 
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       rac1                                       
ora.oc4j
      1        ONLINE  ONLINE       rac2                                       
ora.rac1.vip
      1        ONLINE  ONLINE       rac1                                       
ora.rac2.vip
      1        ONLINE  ONLINE       rac2                                       
ora.scan1.vip
      1        ONLINE  ONLINE       rac1                                   
 
检查集群节点:
olsnodes -l
检查 Oracle 集群注册表 (OCR):
ocrcheck
[grid@rac1 ~]$  ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2404
         Available space (kbytes) :     259716
         ID                       : 1095774749
         Device/File Name         :       +CRS
                                    Device/File integrity check succeeded
                                    Device/File not configured
                                    Device/File not configured
                                    Device/File not configured
                                    Device/File not configured
         Cluster registry integrity check succeeded
         Logical corruption check bypassed due to non-privileged user
 
 
[grid@rac2 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2404
         Available space (kbytes) :     259716
         ID                       : 1095774749
         Device/File Name         :       +CRS
                                    Device/File integrity check failed
                                    Device/File not configured
                                    Device/File not configured
                                    Device/File not configured
                                    Device/File not configured
         Cluster registry integrity check failed
         Logical corruption check bypassed due to insufficient quorum
检查表决磁盘:
crsctl query css votedisk
[grid@rac1 ~]$ crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   589c0071c9304fecbff651e64eeb281a (ORCL:CRS1) [CRS]
Located 1 voting disk(s).
 
Oc4j,gsd服务默认是disable的,如果要启动,启用即可
 

重启grid cluster
 
为数据和快速恢复区创建 ASM 磁盘组:
asmca
 
安装ORACLE 11G
su - oracle
./runInstaller
[root@rac2 ~]# /opt/oracle/product/11.2.0/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
    ORACLE_OWNER= oracle
 
    ORACLE_HOME=  /opt/oracle/product/11.2.0
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying coraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
 

[root@rac2 ~]# crs_stat -t
 

TAG:
 

    Creating /etc/oratab file...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root.sh script.
    Now product-specific root actions will be performed.
    2010-07-28 16:19:03: Parsing the host name
    2010-07-28 16:19:03: Checking for super user privileges
    2010-07-28 16:19:03: User has super user privileges
    Using configuration parameter file: /opt/grid/product/11.2.0/crs/install/crsconfig_params
    Creating trace directory
    LOCAL ADD MODE
    Creating OCR keys for user 'root', privgrp 'root'..
    Operation successful.
      root wallet
      root wallet cert
      root cert export
      peer wallet
      profile reader wallet
      pa wallet
      peer wallet keys
      pa wallet keys
      peer cert request
      pa cert request
      peer cert
      pa cert
      peer root cert TP
      profile reader root cert TP
      pa root cert TP
      peer pa cert TP
      pa peer cert TP
      profile reader pa cert TP
      profile reader peer cert TP
      peer user cert
      pa user cert
    Adding daemon to inittab
    CRS-4123: Oracle High Availability Services has been started.
    ohasd is starting
    CRS-4123: Oracle High Availability Services has been started.
    ohasd is starting
    CRS-2672: Attempting to start 'ora.gipcd' on 'rac1'
    CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1'
    CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded
    CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1'
    CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'
    CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.cssd' on 'rac1'
    CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'
    CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded
    CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.ctssd' on 'rac1'
    CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded
    ASM created and started successfully.
    DiskGroup CRS created successfully.
    clscfg: -install mode specified
    Successfully accumulated necessary OCR keys.
    Creating OCR keys for user 'root', privgrp 'root'..
    Operation successful.
    CRS-2672: Attempting to start 'ora.crsd' on 'rac1'
    CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded
    CRS-4256: Updating the profile
    Successful addition of voting disk a81aaf52b2b74ff5bf7a773e7966ea7c.
    Successfully replaced voting disk group with +CRS.
    CRS-4256: Updating the profile
    CRS-4266: Voting file(s) successfully replaced
    ##  STATE    File Universal Id                File Name Disk group
    --  -----    -----------------                --------- ---------
    1. ONLINE   a81aaf52b2b74ff5bf7a773e7966ea7c (ORCL:CRS1) [CRS]
    Located 1 voting disk(s).
    CRS-2673: Attempting to stop 'ora.crsd' on 'rac1'
    CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded
    CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
    CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded
    CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'
    CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded
    CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'rac1'
    CRS-2677: Stop of 'ora.cssdmonitor' on 'rac1' succeeded
    CRS-2673: Attempting to stop 'ora.cssd' on 'rac1'
    CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded
    CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'
    CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded
    CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'
    CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded
    CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'
    CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1'
    CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.gipcd' on 'rac1'
    CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1'
    CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'
    CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.cssd' on 'rac1'
    CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'
    CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded
    CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.ctssd' on 'rac1'
    CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.asm' on 'rac1'
    CRS-2676: Start of 'ora.asm' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.crsd' on 'rac1'
    CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.evmd' on 'rac1'
    CRS-2676: Start of 'ora.evmd' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.asm' on 'rac1'
    CRS-2676: Start of 'ora.asm' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.CRS.dg' on 'rac1'
    CRS-2676: Start of 'ora.CRS.dg' on 'rac1' succeeded
    CRS-2672: Attempting to start 'ora.registry.acfs' on 'rac1'
    CRS-2676: Start of 'ora.registry.acfs' on 'rac1' succeeded
    rac1     2010/07/28 16:31:27     /opt/grid/product/11.2.0/cdata/rac1/backup_20100728_163127.olr
    Configure Oracle Grid Infrastructure for a Cluster ... succeeded
    Updating inventory properties for clusterware
    Starting Oracle Universal Installer...
    Checking swap space: must be greater than 500 MB.   Actual 971 MB    Passed
    The inventory pointer is located at /etc/oraInst.loc
    The inventory is located at /opt/oraInventory
    'UpdateNodeList' was successful.
 
    [root@rac2 soft]# /opt/grid/product/11.2.0/root.sh
    Running Oracle 11g root.sh script...
    The following environment variables are set as:
        ORACLE_OWNER= grid
        ORACLE_HOME=  /opt/grid/product/11.2.0
    Enter the full pathname of the local bin directory: [/usr/local/bin]:
    The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
    [n]: y
       Copying dbhome to /usr/local/bin ...
    The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
    [n]: y
       Copying oraenv to /usr/local/bin ...
    The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
    [n]: y
       Copying coraenv to /usr/local/bin ...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root.sh script.
    Now product-specific root actions will be performed.
    2010-08-02 14:32:28: Parsing the host name
    2010-08-02 14:32:28: Checking for super user privileges
    2010-08-02 14:32:28: User has super user privileges
    Using configuration parameter file: /opt/grid/product/11.2.0/crs/install/crsconfig_params
    Creating trace directory
    LOCAL ADD MODE
    Creating OCR keys for user 'root', privgrp 'root'..
    Operation successful.
    Adding daemon to inittab
    CRS-4123: Oracle High Availability Services has been started.
    ohasd is starting
    CRS-4402: The CSS daemon was started in exclusive mode but found an active
    CSS daemon on node rac1, number 1, and is terminating
    An active cluster was found during exclusive startup, restarting to join the cluster
    CRS-2672: Attempting to start 'ora.mdnsd' on 'rac2'
    CRS-2676: Start of 'ora.mdnsd' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.gipcd' on 'rac2'
    CRS-2676: Start of 'ora.gipcd' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.gpnpd' on 'rac2'
    CRS-2676: Start of 'ora.gpnpd' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac2'
    CRS-2676: Start of 'ora.cssdmonitor' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.cssd' on 'rac2'
    CRS-2672: Attempting to start 'ora.diskmon' on 'rac2'
    CRS-2676: Start of 'ora.diskmon' on 'rac2' succeeded
    CRS-2676: Start of 'ora.cssd' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.ctssd' on 'rac2'
    CRS-2676: Start of 'ora.ctssd' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.drivers.acfs' on 'rac2'
    CRS-2676: Start of 'ora.drivers.acfs' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.asm' on 'rac2'
    CRS-2676: Start of 'ora.asm' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.crsd' on 'rac2'
    CRS-2676: Start of 'ora.crsd' on 'rac2' succeeded
    CRS-2672: Attempting to start 'ora.evmd' on 'rac2'
    CRS-2676: Start of 'ora.evmd' on 'rac2' succeeded
    rac2     2010/08/02 14:37:51     /opt/grid/product/11.2.0/cdata/rac2/backup_20100802_143751.olr
    Configure Oracle Grid Infrastructure for a Cluster ... succeeded
    Updating inventory properties for clusterware
    Starting Oracle Universal Installer...
    Checking swap space: must be greater than 500 MB.   Actual 1202 MB    Passed
    The inventory pointer is located at /etc/oraInst.loc
    The inventory is located at /opt/oraInventory
    'UpdateNodeList' was successful.
 
 
 

    --查看归档丢失的情况:
 
    SELECT THREAD#,LOW_SEQUENCE#,HIGH_SEQUENCE# from v$archive_gap;
 

    --启动闪回
 
    alter system set db_recovery_file_dest_size=2g scope=both;
 
    alter system set db_recovery_file_dest='+DG_RECOVERY' scope=both;
 
    alter database flashback ON;
 
    SQL> show parameter recovery  
 
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    db_recovery_file_dest                string      +DG_RECOVERY
    db_recovery_file_dest_size           big integer 2G
    recovery_parallelism                 integer     0
 

---------------------------------------------------------------------------------------
    tnsnames:
     
      RACDB1 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.21)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = racdb)
          (INSTANCE_NAME = racdb1)
        )
      )
 
    RACDB =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.21)(PORT = 1521))
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.22)(PORT = 1521))
        (LOAD_BALANCE = yes)
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = racdb)
          (FAILOVER_MODE =
            (TYPE = SELECT)
            (METHOD = BASIC)
            (RETRIES = 180)
            (DELAY = 5)
          )
        )
      )
 
    LISTENERS_RACDB =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.21)(PORT = 1521))
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.22)(PORT = 1521))
      )
     
    LISTENERS_RACDB1 =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.21)(PORT = 1521))
      )
 
    LISTENERS_RACDB2 =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.22)(PORT = 1521))
      )
     
     
    EXTPROC_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
        )
        (CONNECT_DATA =
          (SID = PL***tProc)
          (PRESENTATION = RO)
        )
      )
 
    RACDB2 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.22)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = racdb)
          (INSTANCE_NAME = racdb2)
        )
      )
     
     
    alter system set LOCAL_LISTENER = 'LISTENERS_RACDB1' scope=both sid='racdb1';
    alter system set REMOTE_LISTENER = 'LISTENERS_RACDB' scope=both sid='racdb1';
 
    alter system set LOCAL_LISTENER = 'LISTENERS_RACDB2' scope=both sid='racdb2';
    alter system set REMOTE_LISTENER = 'LISTENERS_RACDB' scope=both sid='racdb2';
 
    ############################################
    10、配置启动归档及闪回
 
    --先配归档才可以启动闪回
 
    alter system set cluster_database=false scope=spfile
 
    #alter system set db_recovery_file_dest='+recovery' scope=both;
 
    alter system switch logfile;
 
    startup mount
 
    alter database archivelog;
 
    alter system set cluster_database=true scope=spfile
 
    shutdown immediate;
 
    startup
 

    [root@rac2 ~]# crs_stat -t
    Name           Type           Target    State     Host       
    ------------------------------------------------------------
    ora....SM1.asm application    ONLINE    ONLINE    rac1       
    ora....C1.lsnr application    ONLINE    ONLINE    rac1       
    ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
    ora.rac1.ons   application    ONLINE    ONLINE    rac1       
    ora.rac1.vip   application    ONLINE    ONLINE    rac1       
    ora....SM2.asm application    ONLINE    ONLINE    rac2       
    ora....C2.lsnr application    ONLINE    ONLINE    rac2       
    ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
    ora.rac2.ons   application    ONLINE    ONLINE    rac2       
    ora.rac2.vip   application    ONLINE    ONLINE    rac2       
    ora.racdb.db   application    ONLINE    ONLINE    rac1       
    ora....b1.inst application    ONLINE    ONLINE    rac1       
    ora....b2.inst application    ONLINE    ONLINE    rac2       
    ora....db_s.cs application    ONLINE    ONLINE    rac1       
    ora....db1.srv application    ONLINE    ONLINE    rac1       
    ora....db2.srv application    ONLINE    ONLINE    rac2       
 
    与之前不同service名后,则数据库会自己变为新的service名字,如下:
 
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    service_names                        string      racdb_s
 

    7、crs_stat -t
 
    [oracle@rac2 bin]$ crs_stat -t           
    Name           Type           Target    State     Host       
    ------------------------------------------------------------
    ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
    ora.rac1.ons   application    ONLINE    ONLINE    rac1       
    ora.rac1.vip   application    ONLINE    ONLINE    rac1       
    ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
    ora.rac2.ons   application    ONLINE    ONLINE    rac2       
    ora.rac2.vip   application    ONLINE    ONLINE    rac2       
 

    ALTER DISKGROUP RACDISK DROP DISK RACDISK_0001 REBALANCE POWER 11;
 

    8、rac status
 
    [oracle@rac2 bin]$ crs_stat -t
    Name           Type           Target    State     Host       
    ------------------------------------------------------------
    ora....SM1.asm application    ONLINE    ONLINE    rac1       
    ora....C1.lsnr application    ONLINE    ONLINE    rac1       
    ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
    ora.rac1.ons   application    ONLINE    ONLINE    rac1       
    ora.rac1.vip   application    ONLINE    ONLINE    rac1       
    ora....SM2.asm application    ONLINE    ONLINE    rac2       
    ora....C2.lsnr application    ONLINE    ONLINE    rac2       
    ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
    ora.rac2.ons   application    ONLINE    ONLINE    rac2       
    ora.rac2.vip   application    ONLINE    ONLINE    rac2       
    ora.racdb.db   application    ONLINE    ONLINE    rac2       
    ora....acdb.cs application    ONLINE    ONLINE    rac1       
    ora....db1.srv application    ONLINE    ONLINE    rac1       
    ora....db2.srv application    ONLINE    ONLINE    rac2       
    ora....b1.inst application    ONLINE    ONLINE    rac1       
    ora....b2.inst application    ONLINE    ONLINE    rac2     
 
    ############################################
 
9、listener.ora与tnsnames.ora
 
使用 netca 或是netmgr 设置好监听和tnsnames.ora
 
cat /opt/app/grid/network/admin/listener.ora
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))       # line added by Agent
 
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))        # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON        # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON        # line added by Agent
 
 
 
---------------------------------------------
cat /opt/app/oracle/product/11.2.0/network/admin/listener.ora
# listener.ora Network Configuration File: /opt/app/oracle/product/11.2.0/network/admin/listener.ora
# Generated by Oracle configuration tools.
 
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.18.103)(PORT = 1521))
    )
  )
 
ADR_BASE_LISTENER = /opt/app/oracle
 

----------------------------------------------------
# tnsnames.ora Network Configuration File: /opt/app/oracle/product/11.2.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
 
RACDB1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = racdb1)
    )
  )
 
RACDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = racdb)
    )
  )
 
RACDB2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))
 
 
 
***************************************************************************
 
配置建立数据库
    su - oracle
    ./dbca
 
本篇文章来源于 Linux公社网站()  原文链接:
阅读(2731) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~