查看: 140399|回复: 196

[原创] ~~【Oracle RAC安装】Linux + Oracle 11g R2 RAC 安装配置详细过程~更新v3.0~精华

[复制链接]
论坛徽章:
5
2011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:23:26ITPUB 11周年纪念徽章
日期:2012-10-09 18:08:152013年新春福章
日期:2013-02-25 14:51:24优秀写手
日期:2013-12-18 09:29:09
跳转到指定楼层
1#
发表于 2010-10-27 09:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 mfkqwyc86 于 2016-1-15 21:04 编辑

【Oracle RAC】Linux + Oracle 11g R2 RAC 安装配置详细过程,本文是v1.0。
最新版本为v3.0,本文已整理成PDF格式及视频地址是:http://www.itpux.com/thread-81-1-1.html

环境:
Oracle Linux AS 5.5两台
Oracle 11g R2
1、IP规划
127.0.0.1 localhost.localdomain localhost
#public ip
192.168.10.211  itpux1
192.168.10.212 itpux2
#priv ip
10.10.10.211  itpux1prv
10.10.10.212 itpux2prv
#vip ip
192.168.10.213  itpux1vip
192.168.10.214 itpux2vip
#scan ip
192.168.10.215  racscan
2、磁盘规划

+CRS        三个2G的盘
+DGDATA     三个10G的盘
+DGRECOVERY 两个5G的盘
/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 /oracle/app/
chown -R grid:oinstall /oracle/app/
chmod -R 775 /oracle/app/
mkdir -p /oracle/app/oraInventory
chown -R grid:oinstall /oracle/app/oraInventory
chmod -R 775 /oracle/app/oraInventory
mkdir -p /oracle/app/grid
mkdir -p /oracle/app/oracle
chown -R grid:oinstall /oracle/app/grid
chown -R oracle:oinstall /oracle/app/oracle
chmod -R 775 /oracle/app/oracle
chmod -R 775 /oracle/app/grid

passwd grid
passwd oracle
2、操作系统版本:
[root@itpux1 ~]# lsb_release -a
LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: EnterpriseEnterpriseServer
Description:    Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
Release:        5.5
Codename:       Carthage
[root@itpux1 ~]# uname -a
Linux itpux1 2.6.18-194.el5 #1 SMP Mon Mar 29 20:06:41 EDT 2010 i686 i686 i386 GNU/Linux
[root@itpux1 ~]#
修改系统参数:
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

gird时间同步所需要的设置(11gR2新增检查项)
#Network Time Protocol Setting
/sbin/service ntpd stop
chkconfig ntpd off
rm /etc/ntp.conf
mv /etc/ntp.conf to /etc/ntp.conf.org
/dev/shm 共享内存不足的处理
解决方法:
例如:为了将/dev/shm的大小增加到1GB,修改/etc/fstab的这行:默认的:
none     /dev/shm       tmpfs   defaults        0 0
改成:
none     /dev/shm       tmpfs   defaults,size=1024m        0 0
size参数也可以用G作单位:size=1G。
重新mount /dev/shm使之生效:
# mount -o remount /dev/shm
或者:
# umount /dev/shm
# mount -a
马上可以用"df -h"命令检查变化。

修改gird、oracle用户的.bash_profile文件:
#grid 用户配置文件 ORACLE_HOSTNAME请自行设置
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=/oracle/app/grid/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

#oracle用户配置文件 ORACLE_HOSTNAME请自行设置
# Oracle Settings oracle
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0; export ORACLE_HOME
ORACLE_SID=itpuxdb1; 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

配置信任关系
设置SSH,
1).在主节点itpux1上以grid,oracle用户身份生成用户的公匙和私匙
# ping itpux2-eth0
# ping itpux2-eth1
# su - oracle
$ mkdir ~/.ssh
$ ssh-keygen -t rsa
$ ssh-keygen -t dsa
2).在副节点itpux2、RAC3上执行相同的操作,确保通信无阻
# ping itpux1-eth0
# ping itpux1-eth1
# su - oracle
$ mkdir ~/.ssh
$ ssh-keygen -t rsa
$ ssh-keygen -t dsa
3).在主节点itpux1上oracle用户执行以下操作
$ cat ~/.ssh/id_rsa.pub >> ./.ssh/authorized_keys
$ cat ~/.ssh/id_dsa.pub >> ./.ssh/authorized_keys
$ ssh itpux2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ ssh itpux2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
$ scp ~/.ssh/authorized_keys itpux2:~/.ssh/authorized_keys
4).主节点itpux1上执行检验操作
$ ssh itpux1 date
$ ssh itpux2 date
$ ssh itpux1priv date
$ ssh itpux2priv date

5).在副节点itpux2上执行检验操作
$ ssh itpux1 date
$ ssh itpux2 date
$ ssh itpux1priv date
$ ssh itpux2priv date




安装ASM
oracleasm-2.6.18-194.el5-2.0.5-1.el5.i686.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm
oracleasm-support-2.1.3-1.el5.i386.rpm

格式化硬盘

Disk /dev/sdd: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1         261     2096451   83  Linux
Disk /dev/sde: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1         261     2096451   83  Linux
Disk /dev/sdf: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1         261     2096451   83  Linux
Disk /dev/sdg: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1               1        1305    10482381   83  Linux
Disk /dev/sdh: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdh1               1        1305    10482381   83  Linux
Disk /dev/sdi: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdi1               1        1305    10482381   83  Linux
Disk /dev/sdj: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdj1               1         652     5237158+  83  Linux
Disk /dev/sdk: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdk1               1         652     5237158+  83  Linux


配置ASM

[root@ora1 ~]# /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 []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: 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     三个10G的盘
+DGRECOVERY 两个5G的盘
/dev/sdd:   2097152
/dev/sde:   2097152
/dev/sdf:   2097152
/dev/sdg:  10485760
/dev/sdh:  10485760
/dev/sdi:  10485760
/dev/sdj:   5242880
/dev/sdk:   5242880
[root@ora2 asm]# /etc/init.d/oracleasm createdisk CRS1 /dev/sdd1
Marking disk "CRS1" as an ASM disk: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk CRS2 /dev/sde1
Marking disk "CRS2" as an ASM disk: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk CRS3 /dev/sdf1
Marking disk "CRS3" as an ASM disk: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk DATA1 /dev/sdg1
Marking disk "DATA1" as an ASM disk: [FAILED]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk DATA1 /dev/sdg1
Marking disk "DATA1" as an ASM disk: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk DATA2 /dev/sdh1
Marking disk "DATA2" as an ASM disk: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk DATA3 /dev/sdi1
Marking disk "DATA3" as an ASM disk: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk REC1 /dev/sdj1
Marking disk "REC1" as an ASM disk: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm createdisk REC2 /dev/sdk1
Marking disk "REC2" as an ASM disk: [  OK  ]

[root@ora2 asm]# /etc/init.d/oracleasm scandisks               
Scanning the system for Oracle ASMLib disks: [  OK  ]
[root@ora2 asm]# /etc/init.d/oracleasm listdisks
CRS1
CRS2
CRS3
DATA1
DATA2
DATA3
REC1
REC2

安装cvuqdisk包并验证
在两个 Oracle RAC 节点上安装操作系统程序包 cvuqdisk。如果没有 cvuqdisk,集群验证实用程序就无法发现共享磁盘,当运行(手动运行或在 Oracle Grid Infrastructure 安装结束时自动运行)集群验证实用程序时,您会收到这样的错误消息:“Package cvuqdisk not installed”。使用适用于您的硬件体系结构(例如,x86_64 或 i386)的 cvuqdisk RPM。
cvuqdisk RPM 包含在 Oracle Grid Infrastructure 安装介质上的 rpm 目录中。
设置环境变量 CVUQDISK_GRP,使其指向作为 cvuqdisk 的所有者所在的组(本文为 oinstall):
export CVUQDISK_GRP=oinstall
使用 CVU 验证是否满足 Oracle 集群件要求
记住要作为 grid 用户在将要执行 Oracle 安装的节点 (racnode1) 上运行。此外,必须为 grid 用户配置通过用户等效性实现的 SSH 连通性。

在grid软件目录里运行以下命令:
./runcluvfy.sh stage -pre crsinst -n itpux1,itpux2 -fixup -verbose

[grid@itpux1 grid]$ ./runcluvfy.sh stage -pre crsinst -n itpux1,itpux2 -fixup -verbose
Performing pre-checks for cluster services setup
Checking node reachability...

检查过程省略...


使用 CVU 验证硬件和操作系统设置
./runcluvfy.sh stage -post hwos -n itpux1,itpux2 -verbose
[grid@itpux1 grid]$ ./runcluvfy.sh stage -post hwos -n itpux1,itpux2 -verbose
Performing post-checks for hardware and operating system setup
Checking node reachability...

检查过程省略...

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

/oracle/app/oraInventory/orainstRoot.sh
[root@itpux1 soft]# /oracle/app/oraInventory/orainstRoot.sh
Changing permissions of /oracle/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /oracle/app/oraInventory to oinstall.
The execution of the script. is complete.
[root@itpux2 soft]# /oracle/app/oraInventory/orainstRoot.sh
Changing permissions of /oracle/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /oracle/app/oraInventory to oinstall.
The execution of the script. is complete.


/oracle/app/grid/product/11.2.0/root.sh
[root@itpux1 soft]# /oracle/app/oraInventory/orainstRoot.sh
Changing permissions of /oracle/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /oracle/app/oraInventory to oinstall.
The execution of the script. is complete.
[root@itpux1 soft]# /oracle/app/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=  /oracle/app/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: /oracle/app/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 'itpux1'
CRS-2672: Attempting to start 'ora.mdnsd' on 'itpux1'
CRS-2676: Start of 'ora.gipcd' on 'itpux1' succeeded
CRS-2676: Start of 'ora.mdnsd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'itpux1'
CRS-2676: Start of 'ora.gpnpd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'itpux1'
CRS-2676: Start of 'ora.cssdmonitor' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'itpux1'
CRS-2672: Attempting to start 'ora.diskmon' on 'itpux1'
CRS-2676: Start of 'ora.diskmon' on 'itpux1' succeeded
CRS-2676: Start of 'ora.cssd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'itpux1'
CRS-2676: Start of 'ora.ctssd' on 'itpux1' 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 'itpux1'
CRS-2676: Start of 'ora.crsd' on 'itpux1' 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 'itpux1'
CRS-2677: Stop of 'ora.crsd' on 'itpux1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'itpux1'
CRS-2677: Stop of 'ora.asm' on 'itpux1' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'itpux1'
CRS-2677: Stop of 'ora.ctssd' on 'itpux1' succeeded
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'itpux1'
CRS-2677: Stop of 'ora.cssdmonitor' on 'itpux1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'itpux1'
CRS-2677: Stop of 'ora.cssd' on 'itpux1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'itpux1'
CRS-2677: Stop of 'ora.gpnpd' on 'itpux1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'itpux1'
CRS-2677: Stop of 'ora.gipcd' on 'itpux1' succeeded
CRS-2673: Attempting to stop 'ora.mdnsd' on 'itpux1'
CRS-2677: Stop of 'ora.mdnsd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.mdnsd' on 'itpux1'
CRS-2676: Start of 'ora.mdnsd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on 'itpux1'
CRS-2676: Start of 'ora.gipcd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'itpux1'
CRS-2676: Start of 'ora.gpnpd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'itpux1'
CRS-2676: Start of 'ora.cssdmonitor' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'itpux1'
CRS-2672: Attempting to start 'ora.diskmon' on 'itpux1'
CRS-2676: Start of 'ora.diskmon' on 'itpux1' succeeded
CRS-2676: Start of 'ora.cssd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'itpux1'
CRS-2676: Start of 'ora.ctssd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'itpux1'
CRS-2676: Start of 'ora.asm' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'itpux1'
CRS-2676: Start of 'ora.crsd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'itpux1'
CRS-2676: Start of 'ora.evmd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'itpux1'
CRS-2676: Start of 'ora.asm' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.CRS.dg' on 'itpux1'
CRS-2676: Start of 'ora.CRS.dg' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.registry.acfs' on 'itpux1'
CRS-2676: Start of 'ora.registry.acfs' on 'itpux1' succeeded
itpux1     2010/07/28 16:31:27     /oracle/app/grid/product/11.2.0/cdata/itpux1/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 /oracle/app/oraInventory
'UpdateNodeList' was successful.

[root@itpux2 soft]# /oracle/app/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=  /oracle/app/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: /oracle/app/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 itpux1, 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 'itpux2'
CRS-2676: Start of 'ora.mdnsd' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on 'itpux2'
CRS-2676: Start of 'ora.gipcd' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'itpux2'
CRS-2676: Start of 'ora.gpnpd' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'itpux2'
CRS-2676: Start of 'ora.cssdmonitor' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'itpux2'
CRS-2672: Attempting to start 'ora.diskmon' on 'itpux2'
CRS-2676: Start of 'ora.diskmon' on 'itpux2' succeeded
CRS-2676: Start of 'ora.cssd' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'itpux2'
CRS-2676: Start of 'ora.ctssd' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.drivers.acfs' on 'itpux2'
CRS-2676: Start of 'ora.drivers.acfs' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'itpux2'
CRS-2676: Start of 'ora.asm' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'itpux2'
CRS-2676: Start of 'ora.crsd' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'itpux2'
CRS-2676: Start of 'ora.evmd' on 'itpux2' succeeded
itpux2     2010/08/02 14:37:51     /oracle/app/grid/product/11.2.0/cdata/itpux2/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 /oracle/app/oraInventory
'UpdateNodeList' was successful.

[grid@itpux2 ~]$ srvctl enable oc4j
PRKO-2116 : OC4J is already enabled
[grid@itpux2 ~]$ srvctl start oc4j
[grid@itpux2 ~]$ srvctl enable nodeapps
PRKO-2415 : VIP is already enabled on node(s): itpux1,itpux2
PRKO-2416 : Network resource is already enabled.
PRKO-2417 : ONS is already enabled on node(s): itpux1,itpux2
PRKO-2418 : eONS is already enabled on node(s): itpux1,itpux2
[grid@itpux2 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.CRS.dg     ora....up.type ONLINE    ONLINE    itpux1        
ora....ER.lsnr ora....er.type ONLINE    ONLINE    itpux1        
ora....N1.lsnr ora....er.type ONLINE    ONLINE    itpux1        
ora.asm        ora.asm.type   ONLINE    ONLINE    itpux1        
ora.eons       ora.eons.type  ONLINE    ONLINE    itpux1        
ora.gsd        ora.gsd.type   ONLINE    ONLINE    itpux1        
ora....network ora....rk.type ONLINE    ONLINE    itpux1        
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    itpux2        
ora.ons        ora.ons.type   ONLINE    ONLINE    itpux1        
ora....SM1.asm application    ONLINE    ONLINE    itpux1        
ora....C1.lsnr application    ONLINE    ONLINE    itpux1        
ora.itpux1.gsd   application    ONLINE    ONLINE    itpux1        
ora.itpux1.ons   application    ONLINE    ONLINE    itpux1        
ora.itpux1.vip   ora....t1.type ONLINE    ONLINE    itpux1        
ora....SM2.asm application    ONLINE    ONLINE    itpux2        
ora....C2.lsnr application    ONLINE    ONLINE    itpux2        
ora.itpux2.gsd   application    ONLINE    ONLINE    itpux2        
ora.itpux2.ons   application    ONLINE    ONLINE    itpux2        
ora.itpux2.vip   ora....t1.type ONLINE    ONLINE    itpux2        
ora....ry.acfs ora....fs.type ONLINE    ONLINE    itpux1        
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    itpux1  
6、
su - grid
./runInstaller
scan配置:
cluster scan: sanclusters
scanname:  racscan
scanport:  1521

/oracle/app/oraInventory/orainstRoot.sh
[root@itpux1 soft]# /oracle/app/oraInventory/orainstRoot.sh
Changing permissions of /oracle/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /oracle/app/oraInventory to oinstall.
The execution of the script. is complete.
[root@itpux2 soft]# /oracle/app/oraInventory/orainstRoot.sh
Changing permissions of /oracle/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /oracle/app/oraInventory to oinstall.
The execution of the script. is complete.


/oracle/app/grid/product/11.2.0/root.sh
[root@itpux1 soft]# /oracle/app/oraInventory/orainstRoot.sh
Changing permissions of /oracle/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /oracle/app/oraInventory to oinstall.
The execution of the script. is complete.
[root@itpux1 soft]# /oracle/app/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=  /oracle/app/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 ...


论坛徽章:
5
2011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:23:26ITPUB 11周年纪念徽章
日期:2012-10-09 18:08:152013年新春福章
日期:2013-02-25 14:51:24优秀写手
日期:2013-12-18 09:29:09
2#
 楼主| 发表于 2010-10-27 09:54 | 只看该作者
本帖最后由 mfkqwyc86 于 2016-1-15 21:05 编辑

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: /oracle/app/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 'itpux1'
CRS-2672: Attempting to start 'ora.mdnsd' on 'itpux1'
CRS-2676: Start of 'ora.gipcd' on 'itpux1' succeeded
CRS-2676: Start of 'ora.mdnsd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'itpux1'
CRS-2676: Start of 'ora.gpnpd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'itpux1'
CRS-2676: Start of 'ora.cssdmonitor' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'itpux1'
CRS-2672: Attempting to start 'ora.diskmon' on 'itpux1'
CRS-2676: Start of 'ora.diskmon' on 'itpux1' succeeded
CRS-2676: Start of 'ora.cssd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'itpux1'
CRS-2676: Start of 'ora.ctssd' on 'itpux1' 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 'itpux1'
CRS-2676: Start of 'ora.crsd' on 'itpux1' 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 'itpux1'
CRS-2677: Stop of 'ora.crsd' on 'itpux1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'itpux1'
CRS-2677: Stop of 'ora.asm' on 'itpux1' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'itpux1'
CRS-2677: Stop of 'ora.ctssd' on 'itpux1' succeeded
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'itpux1'
CRS-2677: Stop of 'ora.cssdmonitor' on 'itpux1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'itpux1'
CRS-2677: Stop of 'ora.cssd' on 'itpux1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'itpux1'
CRS-2677: Stop of 'ora.gpnpd' on 'itpux1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'itpux1'
CRS-2677: Stop of 'ora.gipcd' on 'itpux1' succeeded
CRS-2673: Attempting to stop 'ora.mdnsd' on 'itpux1'
CRS-2677: Stop of 'ora.mdnsd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.mdnsd' on 'itpux1'
CRS-2676: Start of 'ora.mdnsd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on 'itpux1'
CRS-2676: Start of 'ora.gipcd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'itpux1'
CRS-2676: Start of 'ora.gpnpd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'itpux1'
CRS-2676: Start of 'ora.cssdmonitor' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'itpux1'
CRS-2672: Attempting to start 'ora.diskmon' on 'itpux1'
CRS-2676: Start of 'ora.diskmon' on 'itpux1' succeeded
CRS-2676: Start of 'ora.cssd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'itpux1'
CRS-2676: Start of 'ora.ctssd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'itpux1'
CRS-2676: Start of 'ora.asm' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'itpux1'
CRS-2676: Start of 'ora.crsd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'itpux1'
CRS-2676: Start of 'ora.evmd' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'itpux1'
CRS-2676: Start of 'ora.asm' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.CRS.dg' on 'itpux1'
CRS-2676: Start of 'ora.CRS.dg' on 'itpux1' succeeded
CRS-2672: Attempting to start 'ora.registry.acfs' on 'itpux1'
CRS-2676: Start of 'ora.registry.acfs' on 'itpux1' succeeded
itpux1     2010/07/28 16:31:27     /oracle/app/grid/product/11.2.0/cdata/itpux1/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 /oracle/app/oraInventory
'UpdateNodeList' was successful.

[root@itpux2 soft]# /oracle/app/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=  /oracle/app/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: /oracle/app/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 itpux1, 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 'itpux2'
CRS-2676: Start of 'ora.mdnsd' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on 'itpux2'
CRS-2676: Start of 'ora.gipcd' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'itpux2'
CRS-2676: Start of 'ora.gpnpd' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'itpux2'
CRS-2676: Start of 'ora.cssdmonitor' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'itpux2'
CRS-2672: Attempting to start 'ora.diskmon' on 'itpux2'
CRS-2676: Start of 'ora.diskmon' on 'itpux2' succeeded
CRS-2676: Start of 'ora.cssd' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'itpux2'
CRS-2676: Start of 'ora.ctssd' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.drivers.acfs' on 'itpux2'
CRS-2676: Start of 'ora.drivers.acfs' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'itpux2'
CRS-2676: Start of 'ora.asm' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'itpux2'
CRS-2676: Start of 'ora.crsd' on 'itpux2' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'itpux2'
CRS-2676: Start of 'ora.evmd' on 'itpux2' succeeded
itpux2     2010/08/02 14:37:51     /oracle/app/grid/product/11.2.0/cdata/itpux2/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 /oracle/app/oraInventory
'UpdateNodeList' was successful.

[grid@itpux2 ~]$ srvctl enable oc4j
PRKO-2116 : OC4J is already enabled
[grid@itpux2 ~]$ srvctl start oc4j
[grid@itpux2 ~]$ srvctl enable nodeapps
PRKO-2415 : VIP is already enabled on node(s): itpux1,itpux2
PRKO-2416 : Network resource is already enabled.
PRKO-2417 : ONS is already enabled on node(s): itpux1,itpux2
PRKO-2418 : eONS is already enabled on node(s): itpux1,itpux2
[grid@itpux2 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.CRS.dg     ora....up.type ONLINE    ONLINE    itpux1        
ora....ER.lsnr ora....er.type ONLINE    ONLINE    itpux1        
ora....N1.lsnr ora....er.type ONLINE    ONLINE    itpux1        
ora.asm        ora.asm.type   ONLINE    ONLINE    itpux1        
ora.eons       ora.eons.type  ONLINE    ONLINE    itpux1        
ora.gsd        ora.gsd.type   ONLINE    ONLINE    itpux1        
ora....network ora....rk.type ONLINE    ONLINE    itpux1        
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    itpux2        
ora.ons        ora.ons.type   ONLINE    ONLINE    itpux1        
ora....SM1.asm application    ONLINE    ONLINE    itpux1        
ora....C1.lsnr application    ONLINE    ONLINE    itpux1        
ora.itpux1.gsd   application    ONLINE    ONLINE    itpux1        
ora.itpux1.ons   application    ONLINE    ONLINE    itpux1        
ora.itpux1.vip   ora....t1.type ONLINE    ONLINE    itpux1        
ora....SM2.asm application    ONLINE    ONLINE    itpux2        
ora....C2.lsnr application    ONLINE    ONLINE    itpux2        
ora.itpux2.gsd   application    ONLINE    ONLINE    itpux2        
ora.itpux2.ons   application    ONLINE    ONLINE    itpux2        
ora.itpux2.vip   ora....t1.type ONLINE    ONLINE    itpux2        
ora....ry.acfs ora....fs.type ONLINE    ONLINE    itpux1        
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    itpux1  





资源组状态:
crsctl status resource -t
[grid@itpux2 ~]$ crsctl status resource -t

NAME           TARGET  STATE        SERVER                   STATE_DETAILS       Local Resources
ora.CRS.dg
               ONLINE  ONLINE       itpux1                                         
               ONLINE  ONLINE       itpux2                                         
ora.LISTENER.lsnr
               ONLINE  ONLINE       itpux1                                         
               ONLINE  ONLINE       itpux2                                         
ora.asm
               ONLINE  ONLINE       itpux1                     Started            
               ONLINE  ONLINE       itpux2                     Started            
ora.eons
               ONLINE  ONLINE       itpux1                                         
               ONLINE  ONLINE       itpux2                                         
ora.gsd
               ONLINE  ONLINE       itpux1                                         
               ONLINE  ONLINE       itpux2                                         
ora.net1.network
               ONLINE  ONLINE       itpux1                                         
               ONLINE  ONLINE       itpux2                                         
ora.ons
               ONLINE  ONLINE       itpux1                                         
               ONLINE  ONLINE       itpux2                                         
ora.registry.acfs
               ONLINE  ONLINE       itpux1                                         
               ONLINE  ONLINE       itpux2     

Cluster Resources

ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       itpux1                                         
ora.oc4j
      1        ONLINE  ONLINE       itpux2                                         
ora.itpux1.vip
      1        ONLINE  ONLINE       itpux1                                         
ora.itpux2.vip
      1        ONLINE  ONLINE       itpux2                                         
ora.scan1.vip
      1        ONLINE  ONLINE       itpux1                                    

检查集群节点:
olsnodes -l
检查 Oracle 集群注册表 (OCR):
ocrcheck
[grid@itpux1 ~]$  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@itpux2 ~]$ 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@itpux1 ~]$ 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的,如果要启动,启用即可
[node1:grid]srvctl status oc4j
OC4J is disabled
[node1: grid]srvctl status nodeapps
VIP node1-vip is enabled
VIP node1-vip is running on node: node1
VIP node2-vip is enabled
VIP node2-vip is running on node: node2
Network is enabled
Network is running on node: node1
Network is running on node: node2
GSD is disabled
GSD is not running on node: node1
GSD is not running on node: node2
ONS is enabled
ONS daemon is running on node: node1
ONS daemon is running on node: node2
eONS is enabled
eONS daemon is running on node: node1
eONS daemon is running on node: node2
[node1:grid]$srvctl enable oc4j
[node1:grid]$srvctl start oc4j
[node1:grid]$srvctl enable nodeapps
[node1:grid]$srvctl start nodeapps
重启grid cluster

为数据和快速恢复区创建 ASM 磁盘组:
asmca


su - oracle
./runInstaller
[root@itpux2 ~]# /oracle/app/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=  /oracle/app/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@itpux2 ~]# crs_stat -t
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     11
Next log sequence to archive   12
Current log sequence           12

SQL> select max(sequence#) from v$archived_log

col NAME format a80

SQL>  select SEQUENCE#,NAME,FIRST_TIME, NEXT_TIME FROM v$ARCHIVED_LOG ORDER BY SEQUENCE#;


SEQUENCE#  NAME                                                                                                                                               FIRST_TIME   NEXT_TIME
---------- -----------------------------
        11 +DG_RECOVERY/itpuxdb/archivelog/2010_05_18/thread_2_seq_11.257.719357641           18-MAY-10    18-MAY-10

--查看归档丢失的情况:

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

使用道具 举报

回复
论坛徽章:
5
2011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:23:26ITPUB 11周年纪念徽章
日期:2012-10-09 18:08:152013年新春福章
日期:2013-02-25 14:51:24优秀写手
日期:2013-12-18 09:29:09
3#
 楼主| 发表于 2010-10-27 09:55 | 只看该作者
本帖最后由 mfkqwyc86 于 2016-1-15 21:02 编辑

tnsnames:

  ITPUXDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.21)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ITPUXDB)
      (INSTANCE_NAME = ITPUXDB1)
    )
  )

ITPUXDB =
  (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 = ITPUXDB)
      (FAILOVER_MODE =
        (TYPE = SELECT)
        (METHOD = BASIC)
        (RETRIES = 180)
        (DELAY = 5)
      )
    )
  )

LISTENERS_ITPUXDB =
  (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.21)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.22)(PORT = 1521))
  )

LISTENERS_ITPUXDB1 =
  (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.21)(PORT = 1521))
  )

LISTENERS_ITPUXDB2 =
  (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 = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

ITPUXDB2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.22)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ITPUXDB)
      (INSTANCE_NAME = ITPUXDB2)
    )
  )


alter system set LOCAL_LISTENER = 'LISTENERS_ITPUXDB1' scope=both sid='ITPUXDB1';
alter system set REMOTE_LISTENER = 'LISTENERS_ITPUXDB' scope=both sid='ITPUXDB1';

alter system set LOCAL_LISTENER = 'LISTENERS_ITPUXDB2' scope=both sid='ITPUXDB2';
alter system set REMOTE_LISTENER = 'LISTENERS_ITPUXDB' scope=both sid='ITPUXDB2';

############################################
10、配置启动归档及闪回

--先配归档才可以启动闪回

alter system set cluster_database=false scope=spfile

#alter system set db_recovery_file_dest='D:\oracle\flashdb' scope=both;

alter system switch logfile;

startup mount

alter database archivelog;

alter system set cluster_database=true scope=spfile

shutdown immediate;

startup

使用道具 举报

回复
论坛徽章:
5
2011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:23:26ITPUB 11周年纪念徽章
日期:2012-10-09 18:08:152013年新春福章
日期:2013-02-25 14:51:24优秀写手
日期:2013-12-18 09:29:09
4#
 楼主| 发表于 2010-10-27 09:55 | 只看该作者
本帖最后由 mfkqwyc86 于 2016-1-15 21:06 编辑

[root@ITPUX2 ~]# crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    ITPUX1        
ora....C1.lsnr application    ONLINE    ONLINE    ITPUX1        
ora.ITPUX1.gsd   application    ONLINE    ONLINE    ITPUX1        
ora.ITPUX1.ons   application    ONLINE    ONLINE    ITPUX1        
ora.ITPUX1.vip   application    ONLINE    ONLINE    ITPUX1        
ora....SM2.asm application    ONLINE    ONLINE    ITPUX2        
ora....C2.lsnr application    ONLINE    ONLINE    ITPUX2        
ora.ITPUX2.gsd   application    ONLINE    ONLINE    ITPUX2        
ora.ITPUX2.ons   application    ONLINE    ONLINE    ITPUX2        
ora.ITPUX2.vip   application    ONLINE    ONLINE    ITPUX2        
ora.racdb.db   application    ONLINE    ONLINE    ITPUX1        
ora....b1.inst application    ONLINE    ONLINE    ITPUX1        
ora....b2.inst application    ONLINE    ONLINE    ITPUX2        
ora....db_s.cs application    ONLINE    ONLINE    ITPUX1        
ora....db1.srv application    ONLINE    ONLINE    ITPUX1        
ora....db2.srv application    ONLINE    ONLINE    ITPUX2        

与之前不同service名后,则数据库会自己变为新的service名字,如下:

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      racdb_s


7、crs_stat -t

[oracle@ITPUX2 bin]$ crs_stat -t            
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.ITPUX1.gsd   application    ONLINE    ONLINE    ITPUX1        
ora.ITPUX1.ons   application    ONLINE    ONLINE    ITPUX1        
ora.ITPUX1.vip   application    ONLINE    ONLINE    ITPUX1        
ora.ITPUX2.gsd   application    ONLINE    ONLINE    ITPUX2        
ora.ITPUX2.ons   application    ONLINE    ONLINE    ITPUX2        
ora.ITPUX2.vip   application    ONLINE    ONLINE    ITPUX2        


ALTER DISKGROUP RACDISK DROP DISK RACDISK_0001 REBALANCE POWER 11;


8、rac status

[oracle@ITPUX2 bin]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    ITPUX1        
ora....C1.lsnr application    ONLINE    ONLINE    ITPUX1        
ora.ITPUX1.gsd   application    ONLINE    ONLINE    ITPUX1        
ora.ITPUX1.ons   application    ONLINE    ONLINE    ITPUX1        
ora.ITPUX1.vip   application    ONLINE    ONLINE    ITPUX1        
ora....SM2.asm application    ONLINE    ONLINE    ITPUX2        
ora....C2.lsnr application    ONLINE    ONLINE    ITPUX2        
ora.ITPUX2.gsd   application    ONLINE    ONLINE    ITPUX2        
ora.ITPUX2.ons   application    ONLINE    ONLINE    ITPUX2        
ora.ITPUX2.vip   application    ONLINE    ONLINE    ITPUX2        
ora.racdb.db   application    ONLINE    ONLINE    ITPUX2        
ora....acdb.cs application    ONLINE    ONLINE    ITPUX1        
ora....db1.srv application    ONLINE    ONLINE    ITPUX1        
ora....db2.srv application    ONLINE    ONLINE    ITPUX2        
ora....b1.inst application    ONLINE    ONLINE    ITPUX1        
ora....b2.inst application    ONLINE    ONLINE    ITPUX2      

############################################
9、listener.ora与tnsnames.ora

listener.ora:

LISTENER_ITPUX1 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.21)(PORT = 1521)(IP = FIRST))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.11)(PORT = 1521)(IP = FIRST))
    )
  )

SID_LIST_LISTENER_ITPUX1 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /oracle/app/product/10.2.0/db_1)
      (PROGRAM = extproc)
    )
  )

使用道具 举报

回复
论坛徽章:
5
2011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:23:26ITPUB 11周年纪念徽章
日期:2012-10-09 18:08:152013年新春福章
日期:2013-02-25 14:51:24优秀写手
日期:2013-12-18 09:29:09
5#
 楼主| 发表于 2010-10-27 09:56 | 只看该作者
Name           Type           Target    State     Host        
ora.CRS.dg     ora....up.type ONLINE    ONLINE    rac1        
ora.DGDATA.dg  ora....up.type ONLINE    ONLINE    rac1        
ora....VERY.dg ora....up.type ONLINE    ONLINE    rac1        
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1        
ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac2        
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    rac2




su - oracle
./dbca


手工配置services


(命令注册不能用与DB相同的service名)

srvctl add service -d &lt;name&gt; -s &lt;service_name&gt; -r &quot;&lt;preferred_list&gt;&quot; [-a &quot;&lt;available_list&gt;&quot;] [-P &lt;TAF_policy&gt;]

[root@rac1 backup]# srvctl add service -h   
Usage: srvctl add service -d &lt;name&gt; -s &lt;service_name&gt; -r &quot;&lt;preferred_list&gt;&quot; [-a &quot;&lt;available_list&gt;&quot;] [-P &lt;TAF_policy&gt;]
    -d &lt;name&gt;           Unique name for the database
    -s &lt;service&gt;        Service name
    -r &quot;&lt;pref_list&gt;&quot;    List of preferred instances
    -a &quot;&lt;avail_list&gt;&quot;   List of available instances
    -P &lt;TAF_policy&gt;     TAF policy (NONE, BASIC, or PRECONNECT)
Usage: srvctl add service -d &lt;name&gt; -s &lt;service_name&gt; -u {-r &quot;&lt;new_pref_inst&gt;&quot; | -a &quot;&lt;new_avail_inst&gt;&quot;}
    -d &lt;name&gt;           Unique name for the database
    -s &lt;service&gt;        Service name
    -u                  Add a new instance to service configuration
    -r &lt;new_pref_inst&gt;  Name of new preferred instance
    -a &lt;new_avail_inst&gt; Name of new available instance
    -h                  Print usage

/oracle/app/crs/bin/srvctl add service -d racdb -s racdb_s racdb1 -a racdb2 -P BASIC

/oracle/app/crs/bin/srvctl add service -d racdb -s racdb_s -r racdb1,racdb2 -P BASIC
(建议)

使用道具 举报

回复
论坛徽章:
5
2011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:23:26ITPUB 11周年纪念徽章
日期:2012-10-09 18:08:152013年新春福章
日期:2013-02-25 14:51:24优秀写手
日期:2013-12-18 09:29:09
6#
 楼主| 发表于 2010-10-27 09:58 | 只看该作者
su - oracle
./runInstaller

[root@rac2 ~]# /oracle/app/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=  /oracle/app/oracle/product/11.2.0

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file &quot;dbhome&quot; already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying dbhome to /usr/local/bin ...
The file &quot;oraenv&quot; already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file &quot;coraenv&quot; 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

使用道具 举报

回复
论坛徽章:
5
2011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:23:26ITPUB 11周年纪念徽章
日期:2012-10-09 18:08:152013年新春福章
日期:2013-02-25 14:51:24优秀写手
日期:2013-12-18 09:29:09
7#
 楼主| 发表于 2010-10-27 09:59 | 只看该作者
本帖最后由 mfkqwyc86 于 2016-1-15 21:07 编辑

检查集群节点:
olsnodes -l

检查 Oracle 集群注册表 (OCR):

ocrcheck

[grid@itpux1 ~]$  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@itpux2 ~]$ 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@itpux1 ~]$ 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的,如果要启动,启用即可
[node1:grid]srvctl status oc4j
OC4J is disabled

[node1: grid]srvctl status nodeapps
VIP node1-vip is enabled
VIP node1-vip is running on node: node1
VIP node2-vip is enabled
VIP node2-vip is running on node: node2
Network is enabled
Network is running on node: node1
Network is running on node: node2
GSD is disabled
GSD is not running on node: node1
GSD is not running on node: node2
ONS is enabled
ONS daemon is running on node: node1
ONS daemon is running on node: node2
eONS is enabled
eONS daemon is running on node: node1
eONS daemon is running on node: node2

[node1:grid]$srvctl enable oc4j
[node1:grid]$srvctl start oc4j
[node1:grid]$srvctl enable nodeapps
[node1:grid]$srvctl start nodeapps

重启grid cluster


为数据和快速恢复区创建 ASM 磁盘组:
asmca

使用道具 举报

回复
论坛徽章:
5
2011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:23:26ITPUB 11周年纪念徽章
日期:2012-10-09 18:08:152013年新春福章
日期:2013-02-25 14:51:24优秀写手
日期:2013-12-18 09:29:09
8#
 楼主| 发表于 2010-10-27 10:00 | 只看该作者
本帖最后由 mfkqwyc86 于 2016-1-15 21:07 编辑

资源组状态:
crsctl status resource -t

[grid@itpux2 ~]$ crsctl status resource -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS      
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.CRS.dg
               ONLINE  ONLINE       itpux1                                         
               ONLINE  ONLINE       itpux2                                         
ora.LISTENER.lsnr
               ONLINE  ONLINE       itpux1                                         
               ONLINE  ONLINE       itpux2                                         
ora.asm
               ONLINE  ONLINE       itpux1                     Started            
               ONLINE  ONLINE       itpux2                     Started            
ora.eons
               ONLINE  ONLINE       itpux1                                         
               ONLINE  ONLINE       itpux2                                         
ora.gsd
               ONLINE  ONLINE       itpux1                                         
               ONLINE  ONLINE       itpux2                                         
ora.net1.network
               ONLINE  ONLINE       itpux1                                         
               ONLINE  ONLINE       itpux2                                         
ora.ons
               ONLINE  ONLINE       itpux1                                         
               ONLINE  ONLINE       itpux2                                         
ora.registry.acfs
               ONLINE  ONLINE       itpux1                                         
               ONLINE  ONLINE       itpux2                                         
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       itpux1                                         
ora.oc4j
      1        ONLINE  ONLINE       itpux2                                         
ora.itpux1.vip
      1        ONLINE  ONLINE       itpux1                                         
ora.itpux2.vip
      1        ONLINE  ONLINE       itpux2                                         
ora.scan1.vip
      1        ONLINE  ONLINE       itpux1

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
20
祖国60周年纪念徽章
日期:2009-10-09 08:28:00数据库板块每日发贴之星
日期:2011-02-20 01:01:01ITPUB季度 技术新星
日期:2011-04-02 10:31:09ITPUB十周年纪念徽章
日期:2011-11-01 16:24:042012新春纪念徽章
日期:2012-01-04 11:54:26玉石琵琶
日期:2012-02-21 15:04:38最佳人气徽章
日期:2012-03-13 17:39:18ITPUB 11周年纪念徽章
日期:2012-10-09 18:09:192013年新春福章
日期:2013-02-25 14:51:242011新春纪念徽章
日期:2011-02-18 11:43:33
9#
发表于 2010-10-27 10:47 | 只看该作者
又是一个新星啊

使用道具 举报

回复
论坛徽章:
5
2011新春纪念徽章
日期:2011-02-18 11:43:35ITPUB十周年纪念徽章
日期:2011-11-01 16:23:26ITPUB 11周年纪念徽章
日期:2012-10-09 18:08:152013年新春福章
日期:2013-02-25 14:51:24优秀写手
日期:2013-12-18 09:29:09
10#
 楼主| 发表于 2010-10-27 11:39 | 只看该作者
老大,是我

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表