Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7171762
  • 博文数量: 3857
  • 博客积分: 6409
  • 博客等级: 准将
  • 技术积分: 15948
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-02 16:48
个人简介

迷彩 潜伏 隐蔽 伪装

文章分类

全部博文(3857)

文章存档

2017年(5)

2016年(63)

2015年(927)

2014年(677)

2013年(807)

2012年(1241)

2011年(67)

2010年(7)

2009年(36)

2008年(28)

分类: Oracle

2013-06-05 10:02:47

原文地址:response方式install grid 之2 作者:摸_摸

response方式install grid  之2

换成三个节点的rac,node1 node2 node3

操作系统已经通过kickstart+puppet装好,系统装完以后oracle用户、组、环境变量、ssh互信环境等等已经建好,各种内核参数也已经设置,只需要加一下共享存储,使用的iscsi+udev,过程略。本文档从设置完UDEV开始。

1. ntp

[root@node1 ~]# mv /etc/ntp.conf /etc/ntp.conf.orig
[root@node1 ~]#

另外两个节点同样操作

2. cvuqdisk

[root@node1 ~]# rpm -Uhv /nfs/oracle11G/i386/grid/rpm/cvuqdisk-1.0.9-1.rpm
Preparing...                ########################################
   1:cvuqdisk               ########################################
[root@node1 ~]#

[root@node2 ~]#  rpm -Uhv /nfs/oracle11G/i386/grid/rpm/cvuqdisk-1.0.9-1.rpm
Preparing...                ########################################### [100%]
   1:cvuqdisk               ########################################### [100%]
[root@node2 ~]#

[root@node3 ~]# rpm -Uhv /nfs/oracle11G/i386/grid/rpm/cvuqdisk-1.0.9-1.rpm
Preparing...                ########################################### [100%]
   1:cvuqdisk               ########################################### [100%]
[root@node3 ~]#

 

3.  使用默认的 response文件生成 grid_install.rsp

[oracle@node1 ~]$ pwd
/home/oracle
[oracle@node1 ~]$ cd /nfs/oracle11G/i386/grid/
[oracle@node1 grid]$ pwd
/nfs/oracle11G/i386/grid
[oracle@node1 grid]$ cd response/
[oracle@node1 response]$ ls
grid_install.rsp*  grid_install.rsp.orig*
[oracle@node1 response]$

最终生成的response文件:

[oracle@node1 ~]$ more grid_install_config.rsp |grep  ^[^#$]
oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v11_2_0
ORACLE_HOSTNAME=node1.momo.org
INVENTORY_LOCATION=/u01/app/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN
oracle.install.option=CRS_CONFIG
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/grid/11.2.3
oracle.install.asm.OSDBA=oinstall
oracle.install.asm.OSOPER=oinstall
oracle.install.asm.OSASM=oinstall
oracle.install.crs.config.gpnp.scanName=rac-scan1.momo.org
oracle.install.crs.config.gpnp.scanPort=1521
oracle.install.crs.config.clusterName=rac-scan1
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.gpnp.gnsSubDomain=
oracle.install.crs.config.gpnp.gnsVIPAddress=
oracle.install.crs.config.autoConfigureClusterNodeVIP=false
oracle.install.crs.config.clusterNodes=node1.momo.org:node1-vip.momo.org,node2.momo.org:node2-vip.momo.org,node3.momo.org:node3-vip.momo.org
oracle.install.crs.config.networkInterfaceList=eth0:10.101.0.0:1,eth1:192.168.199.0:2
oracle.install.crs.config.storageOption=ASM_STORAGE
oracle.install.crs.config.sharedFileSystemStorage.diskDriveMapping=
oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations=
oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=NORMAL
oracle.install.crs.config.sharedFileSystemStorage.ocrLocations=
oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=NORMAL
oracle.install.crs.config.useIPMI=false
oracle.install.crs.config.ipmi.bmcUsername=
oracle.install.crs.config.ipmi.bmcPassword=
oracle.install.asm.SYSASMPassword=
oracle.install.asm.diskGroup.name=OCR1
oracle.install.asm.diskGroup.redundancy=NORMAL
oracle.install.asm.diskGroup.AUSize=1
oracle.install.asm.diskGroup.disks=/dev/asm-diskf,/dev/asm-diskg,/dev/asm-diskh
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm*
oracle.install.asm.monitorPassword=
oracle.install.crs.upgrade.clusterNodes=
oracle.install.asm.upgradeASM=false
oracle.installer.autoupdates.option=SKIP_UPDATES
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
PROXY_HOST=
PROXY_PORT=0
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
[oracle@node1 ~]$

4. 安装前环境检查

开始安装前用 runcluvfy.sh stage -pre crsinst -n node1,node2,node3 –verbose 检查一下,免得中间报错,或者加上fixup参数

runcluvfy.sh stage -pre crsinst -n node1,node2,node3 -fixup –verbose  ,fixup会生产runfixup.sh脚本,文档的介绍应该是能解决发现的问题,并且做一些基本配置,比如系统内核一类的。

image

可以试一下看看

[root@node1 CVU_11.2.0.3.0_oracle]# ./runfixup.sh
Response file being used is :./fixup.response
Enable file being used is :./fixup.enable
Log file location: ./orarun.log
Nothing to fix!!

4.  使用静默方式开始安装grid

./runInstaller –help 可以查看命令帮助及可选的参数

摘录几个用到的参数解释:

-ignorePrereq
        To ignore running the prerequisite checks.
-ignoreSysPrereqs 
        For ignoring the results of the system pre-requisite checks.
-responseFile  
        Specifies the response file and path to use.
-silent 
        For silent mode operations, the inputs can be a response file or a list of command line variable value pairs.

-showProgress
       To show the installation progress on the console. This option is supported only in case of silent installation.

 ./runInstaller -showProgress -ignoreSysPrereqs -ignorePrereq \
 -silent "oracle.install.asm.SYSASMPassword=111111" "oracle.install.asm.monitorPassword=222222" \
 -responseFile /home/oracle/grid_install_config.rsp
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

 

[oracle@node1 grid]$ DISPLAY=10.101.5.66:0.0; export DISPLAY
[oracle@node1 grid]$
[oracle@node1 grid]$
[oracle@node1 grid]$ grid_env
+ASM1
[oracle@node1 grid]$

[oracle@node1 grid]$  ./runInstaller -showProgress -ignoreSysPrereqs -ignorePrereq \
>  -silent "oracle.install.asm.SYSASMPassword=111111" "oracle.install.asm.monitorPassword=222222" \
>  -responseFile /home/oracle/grid_install_config.rsp
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 8312 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 8191 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-06-04_03-34-04PM. Please wait ...

No protocol specified

[WARNING] [INS-30011] The SYS password entered does not conform to the Oracle recommended standards.
   CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
   ACTION: Provide a password that conforms to the Oracle recommended standards.
[WARNING] [INS-30011] The ASMSNMP password entered does not conform to the Oracle recommended standards.
   CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
   ACTION: Provide a password that conforms to the Oracle recommended standards.
[WARNING] [INS-41813] OSDBA for ASM, OSOPER for ASM, and OSASM are the same OS group.
   CAUSE: The group you selected for granting the OSDBA for ASM group for database access, and the OSOPER for ASM group for startup and shutdown of Oracle ASM, is the same group as the OSASM group, whose members have SYSASM privileges on Oracle ASM.
   ACTION: Choose different groups as the OSASM, OSDBA for ASM, and OSOPER for ASM groups.
You can find the log of this install session at:
/u01/app/oracle/oraInventory/logs/installActions2013-06-04_03-34-04PM.log

Prepare in progress.
..................................................   5% Done.

Prepare successful.

Copy files in progress.
..................................................   10% Done.
..................................................   16% Done.
..................................................   21% Done.
..................................................   26% Done.
..........
Copy files successful.

Link binaries in progress.

Link binaries successful.
..................................................   34% Done.

Setup files in progress.

Setup files successful.
..................................................   41% Done.

Perform remote operations in progress.
..................................................   48% Done.

Perform remote operations successful.
The installation of Oracle Grid Infrastructure was successful.
Please check '/u01/app/oracle/oraInventory/logs/silentInstall2013-06-04_03-34-04PM.log' for more details.
..................................................   97% Done.

Execute Root Scripts in progress.

As a root user, execute the following script(s):
        1. /u01/app/grid/11.2.3/root.sh

Execute /u01/app/grid/11.2.3/root.sh on the following nodes:
[node1, node2, node3]

..................................................   100% Done.

Execute Root Scripts successful.
As install user, execute the following script to complete the configuration.
        1. /u01/app/grid/11.2.3/cfgtoollogs/configToolAllCommands

        Note:
        1. This script must be run on the same system from where installer was run.
        2. This script needs a small password properties file for configuration assistants that require passwords (refer to install guide documentation).

Successfully Setup Software.

[oracle@node1 grid]$

 

按提示运行/u01/app/grid/11.2.3/root.sh 

node1:

[root@node1 ~]# /u01/app/grid/11.2.3/root.sh
Check /u01/app/grid/11.2.3/install/root_node1_2013-06-04_15-58-19.log for the output of root script
[root@node1 ~]#
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

 

另开个窗口tail日志

[root@node1 ~]# tail -f /u01/app/grid/11.2.3/install/root_node1_2013-06-04_15-58-19.log
  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 Clusterware entries to upstart
CRS-2672: Attempting to start 'ora.mdnsd' on 'node1'
CRS-2676: Start of 'ora.mdnsd' on 'node1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'node1'
CRS-2676: Start of 'ora.gpnpd' on 'node1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'node1'
CRS-2672: Attempting to start 'ora.gipcd' on 'node1'
CRS-2676: Start of 'ora.cssdmonitor' on 'node1' succeeded
CRS-2676: Start of 'ora.gipcd' on 'node1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'node1'
CRS-2672: Attempting to start 'ora.diskmon' on 'node1'
CRS-2676: Start of 'ora.diskmon' on 'node1' succeeded
CRS-2676: Start of 'ora.cssd' on 'node1' succeeded

ASM created and started successfully.

Disk Group OCR1 created successfully.

clscfg: -install mode specified
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4256: Updating the profile
Successful addition of voting disk 98d4325d7e504ffebf20a05c5265410b.
Successful addition of voting disk 81f09fa8802e4f0ebf684d96baff6ab8.
Successful addition of voting disk 8d0f799890154fedbf29a4410bb194a2.
Successfully replaced voting disk group with +OCR1.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   98d4325d7e504ffebf20a05c5265410b (/dev/asm-diskf) [OCR1]
 2. ONLINE   81f09fa8802e4f0ebf684d96baff6ab8 (/dev/asm-diskg) [OCR1]
 3. ONLINE   8d0f799890154fedbf29a4410bb194a2 (/dev/asm-diskh) [OCR1]
Located 3 voting disk(s).

CRS-2672: Attempting to start 'ora.asm' on 'node1'
CRS-2676: Start of 'ora.asm' on 'node1' succeeded
CRS-2672: Attempting to start 'ora.OCR1.dg' on 'node1'
CRS-2676: Start of 'ora.OCR1.dg' on 'node1' succeeded

Configure Oracle Grid Infrastructure for a Cluster ... succeeded
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

 

node2 node3 依次执行……

 

 

 

安装节点也就是node1上运行 /u01/app/grid/11.2.3/cfgtoollogs/configToolAllCommands

[oracle@node1 grid]$ /u01/app/grid/11.2.3/cfgtoollogs/configToolAllCommands 
Setting the invPtrLoc to /u01/app/grid/11.2.3/oraInst.loc

perform - mode is starting for action: configure

perform - mode finished for action: configure

You can see the log file: /u01/app/grid/11.2.3/cfgtoollogs/oui/configActions2013-06-04_04-30-34-PM.log
[oracle@node1 grid]$ 


[oracle@node1 grid]$ more  /u01/app/grid/11.2.3/cfgtoollogs/oui/configActions2013-06-04_04-30-34-PM.log
###################################################
The action configuration is performing
------------------------------------------------------
The plug-in Update Inventory is running


/u01/app/grid/11.2.3/oui/bin/runInstaller -nowait -noconsole -waitforcompletion -ignoreSysPrereqs -updateNodeList -silent CRS=true "
CLUSTER_NODES={node1,node2,node3}" ORACLE_HOME=/u01/app/grid/11.2.3 
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 8002 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oracle/oraInventory

The plug-in Update Inventory has successfully been performed
------------------------------------------------------
------------------------------------------------------
The plug-in Oracle Net Configuration Assistant is running


Parsing command line arguments:
    Parameter "orahome" = /u01/app/grid/11.2.3
    Parameter "orahnam" = Ora11g_gridinfrahome1
    Parameter "instype" = typical
    Parameter "inscomp" = client,oraclenet,javavm,server
    Parameter "insprtcl" = tcp
    Parameter "cfg" = local
    Parameter "authadp" = NO_VALUE
    Parameter "responsefile" = /u01/app/grid/11.2.3/network/install/netca_typ.rsp
    Parameter "silent" = true
    Parameter "silent" = true
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Profile configuration complete.
Profile configuration complete.
node1...
node2...
node3...
Oracle Net Listener Startup:
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0

The plug-in Oracle Net Configuration Assistant has successfully been performed
------------------------------------------------------
------------------------------------------------------
The plug-in Automatic Storage Management Configuration Assistant is running


The plug-in Automatic Storage Management Configuration Assistant has failed its perform method
------------------------------------------------------
The action configuration has failed its perform method
###################################################
[oracle@node1 grid]$ 
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

忽略

 

 

 5.   安装后任务

检查服务状态

[root@node1 ~]# /u01/app/grid/11.2.3/bin/crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
[root@node1 ~]#

[root@node2 ~]# /u01/app/grid/11.2.3/bin/crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
[root@node2 ~]#

[root@node3 ~]# /u01/app/grid/11.2.3/bin/crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
[root@node3 ~]#
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

 

 

 

[root@node1 ~]# su - oracle
[oracle@node1 ~]$ grid_env
+ASM1
[oracle@node1 ~]$ crsctl check cluster -all
**************************************************************
node1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
node2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
node3:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
[oracle@node1 ~]$


[root@node2 ~]# su - oracle
[oracle@node2 ~]$ grid_env
+ASM2
[oracle@node2 ~]$ crsctl check cluster -all
**************************************************************
node1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
node2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
node3:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
[oracle@node2 ~]$


[root@node3 ~]# su - oracle
-bash-4.1$ grid_env
+ASM3
-bash-4.1$ crsctl check cluster -all
**************************************************************
node1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
node2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
node3:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
-bash-4.1$
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

 

[oracle@node1 ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....ER.lsnr ora....er.type ONLINE    ONLINE    node1
ora....N1.lsnr ora....er.type ONLINE    ONLINE    node1
ora.OCR1.dg    ora....up.type ONLINE    ONLINE    node1
ora.asm        ora.asm.type   ONLINE    ONLINE    node1
ora.cvu        ora.cvu.type   ONLINE    ONLINE    node1
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE
ora....network ora....rk.type ONLINE    ONLINE    node1
ora....SM1.asm application    ONLINE    ONLINE    node1
ora....E1.lsnr application    ONLINE    ONLINE    node1
ora.node1.gsd  application    OFFLINE   OFFLINE
ora.node1.ons  application    ONLINE    ONLINE    node1
ora.node1.vip  ora....t1.type ONLINE    ONLINE    node1
ora....SM2.asm application    ONLINE    ONLINE    node2
ora....E2.lsnr application    ONLINE    ONLINE    node2
ora.node2.gsd  application    OFFLINE   OFFLINE
ora.node2.ons  application    ONLINE    ONLINE    node2
ora.node2.vip  ora....t1.type ONLINE    ONLINE    node2
ora....SM3.asm application    ONLINE    ONLINE    node3
ora....E3.lsnr application    ONLINE    ONLINE    node3
ora.node3.gsd  application    OFFLINE   OFFLINE
ora.node3.ons  application    ONLINE    ONLINE    node3
ora.node3.vip  ora....t1.type ONLINE    ONLINE    node3
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    node1
ora.ons        ora.ons.type   ONLINE    ONLINE    node1
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    node1
[oracle@node1 ~]$

[root@node1 bin]# pwd
/u01/app/grid/11.2.3/bin
[root@node1 bin]# ll |grep crs_stat
-rwxr-xr-x 1 oracle oinstall      8136 May 31 17:42 crs_stat
-rwxr-xr-x 1 oracle oinstall   4919196 May 31 17:02 crs_stat.bin
[root@node1 bin]# vi crs_stat.sh
[root@node1 bin]# ll |grep crs_stat
-rwxr-xr-x 1 oracle oinstall      8136 May 31 17:42 crs_stat
-rwxr-xr-x 1 oracle oinstall   4919196 May 31 17:02 crs_stat.bin
-rw-r--r-- 1 root   root           566 Jun  3 11:22 crs_stat.sh
[root@node1 bin]# chmod 755 crs_stat.sh
[root@node1 bin]# chown oracle:oinstall crs_stat.sh
[root@node1 bin]# ll |grep crs_stat
-rwxr-xr-x 1 oracle oinstall      8136 May 31 17:42 crs_stat
-rwxr-xr-x 1 oracle oinstall   4919196 May 31 17:02 crs_stat.bin
-rwxr-xr-x 1 oracle oinstall       566 Jun  3 11:22 crs_stat.sh

[root@node1 bin]# more crs_stat.sh

 

awk \
  'BEGIN {printf "%-30s %-10s %-10s %-10s\n","Name                          ","Target    ","State     ","Host   ";
          printf "%-30s %-10s %-10s %-10s\n","------------------------------","----------", "---------","-------";}'

crs_stat | awk \
'BEGIN { FS="=| ";state = 0;}
  $1~/NAME/ {appname = $2; state=1};
  state == 0 {next;}
  $1~/TARGET/ && state == 1 {apptarget = $2; state=2;}
  $1~/STATE/ && state == 2 {appstate = $2; apphost = $4; state=3;}
  state == 3 {printf "%-30s %-10s %-10s %-10s\n", appname,apptarget,appstate,apphost; state=0;}'
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

 

[root@node1 bin]#

[oracle@node1 ~]$ crs_stat.sh
Name                           Target     State      Host
------------------------------ ---------- ---------  -------
ora.LISTENER.lsnr              ONLINE     ONLINE     node1
ora.LISTENER_SCAN1.lsnr        ONLINE     ONLINE     node1
ora.OCR1.dg                    ONLINE     ONLINE     node1
ora.asm                        ONLINE     ONLINE     node1
ora.cvu                        ONLINE     ONLINE     node1
ora.gsd                        OFFLINE    OFFLINE
ora.net1.network               ONLINE     ONLINE     node1
ora.node1.ASM1.asm             ONLINE     ONLINE     node1
ora.node1.LISTENER_NODE1.lsnr  ONLINE     ONLINE     node1
ora.node1.gsd                  OFFLINE    OFFLINE
ora.node1.ons                  ONLINE     ONLINE     node1
ora.node1.vip                  ONLINE     ONLINE     node1
ora.node2.ASM2.asm             ONLINE     ONLINE     node2
ora.node2.LISTENER_NODE2.lsnr  ONLINE     ONLINE     node2
ora.node2.gsd                  OFFLINE    OFFLINE
ora.node2.ons                  ONLINE     ONLINE     node2
ora.node2.vip                  ONLINE     ONLINE     node2
ora.node3.ASM3.asm             ONLINE     ONLINE     node3
ora.node3.LISTENER_NODE3.lsnr  ONLINE     ONLINE     node3
ora.node3.gsd                  OFFLINE    OFFLINE
ora.node3.ons                  ONLINE     ONLINE     node3
ora.node3.vip                  ONLINE     ONLINE     node3
ora.oc4j                       ONLINE     ONLINE     node1
ora.ons                        ONLINE     ONLINE     node1
ora.scan1.vip                  ONLINE     ONLINE     node1
[oracle@node1 ~]$

 


备份 root.sh 

 

cp /u01/app/grid/11.2.3/root.sh /u01/app/grid/11.2.3/root.sh.${HOSTNAME}.`date +%Y%m%d%H%M`

[root@node1 bin]# cp /u01/app/grid/11.2.3/root.sh /u01/app/grid/11.2.3/root.sh.${HOSTNAME}.`date +%Y%m%d%H%M`
[root@node1 bin]#

[root@node2 ~]# cp /u01/app/grid/11.2.3/root.sh /u01/app/grid/11.2.3/root.sh.${HOSTNAME}.`date +%Y%m%d%H%M`
[root@node2 ~]#

[root@node3 ~]# cp /u01/app/grid/11.2.3/root.sh /u01/app/grid/11.2.3/root.sh.${HOSTNAME}.`date +%Y%m%d%H%M`
[root@node3 ~]#

 

       创建 FRA diskgroup

[oracle@node1 ~]$ grid_env
+ASM1
[oracle@node1 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Tue Jun 4 16:58:24 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Real Application Clusters and Automatic Storage Management options

SQL> set lines 500
SQL> set pages 500
SQL> select NAME,ALLOCATION_UNIT_SIZE,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB  from GV$ASM_DISKGROUP;


NAME                           ALLOCATION_UNIT_SIZE STATE       TYPE     TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
------------------------------ -------------------- ----------- ------ ---------- ---------- ----------------------- --------------
OCR1                                        1048576 MOUNTED     NORMAL       6144       5092                    2048           1522
OCR1                                        1048576 MOUNTED     NORMAL       6144       5092                    2048           1522
OCR1                                        1048576 MOUNTED     NORMAL       6144       5092                    2048           1522

SQL> SQL> select NAME,ALLOCATION_UNIT_SIZE,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB  from V$ASM_DISKGROUP;

NAME                           ALLOCATION_UNIT_SIZE STATE       TYPE     TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
------------------------------ -------------------- ----------- ------ ---------- ---------- ----------------------- --------------
OCR1                                        1048576 MOUNTED     NORMAL       6144       5092                    2048           1522

SQL> host ls -l /dev/asm-disk*
brw-rw---- 1 oracle oinstall 8,  32 Jun  4 16:59 /dev/asm-diskf
brw-rw---- 1 oracle oinstall 8,  48 Jun  4 16:59 /dev/asm-diskg
brw-rw---- 1 oracle oinstall 8,  64 Jun  4 16:59 /dev/asm-diskh
brw-rw---- 1 oracle oinstall 8,  80 Jun  4 10:02 /dev/asm-diski
brw-rw---- 1 oracle oinstall 8,  96 Jun  4 10:02 /dev/asm-diskj
brw-rw---- 1 oracle oinstall 8, 112 Jun  4 10:02 /dev/asm-diskk
brw-rw---- 1 oracle oinstall 8, 128 Jun  4 10:02 /dev/asm-diskl

SQL> create diskgroup FRA external redundancy DISK '/dev/asm-diskl';

Diskgroup created.

SQL>
SQL> select NAME,ALLOCATION_UNIT_SIZE,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB  from V$ASM_DISKGROUP;

NAME                           ALLOCATION_UNIT_SIZE STATE       TYPE     TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
------------------------------ -------------------- ----------- ------ ---------- ---------- ----------------------- --------------
OCR1                                        1048576 MOUNTED     NORMAL       6144       5092                    2048           1522
FRA                                         1048576 MOUNTED     EXTERN      10240      10190                       0          10190

SQL>
SQL> select NAME,INST_ID,ALLOCATION_UNIT_SIZE,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB  from GV$ASM_DISKGROUP;

NAME                              INST_ID ALLOCATION_UNIT_SIZE STATE       TYPE     TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
------------------------------ ---------- -------------------- ----------- ------ ---------- ---------- ----------------------- --------------
OCR1                                    1              1048576 MOUNTED     NORMAL       6144       5092                    2048      1522
FRA                                     1              1048576 MOUNTED     EXTERN      10240      10190                       0     10190
OCR1                                    3              1048576 MOUNTED     NORMAL       6144       5092                    2048      1522
FRA                                     3                    0 DISMOUNTED                  0          0                       0         0
OCR1                                    2              1048576 MOUNTED     NORMAL       6144       5092                    2048      1522
FRA                                     2                    0 DISMOUNTED                  0          0                       0         0

6 rows selected.

SQL>
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

 

[oracle@node2 ~]$ grid_env
+ASM2
[oracle@node2 ~]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Tue Jun 4 17:01:41 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Real Application Clusters and Automatic Storage Management options

SQL> 
SQL> set lines 500
SQL> set pages 500
SQL> select NAME,ALLOCATION_UNIT_SIZE,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB  from V$ASM_DISKGROUP;

NAME                           ALLOCATION_UNIT_SIZE STATE       TYPE     TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
------------------------------ -------------------- ----------- ------ ---------- ---------- ----------------------- --------------
OCR1                                        1048576 MOUNTED     NORMAL       6144       5092                    2048           1522
FRA                                               0 DISMOUNTED                  0          0                       0              0

SQL> alter diskgroup fra mount;

Diskgroup altered.

SQL> select NAME,ALLOCATION_UNIT_SIZE,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB  from V$ASM_DISKGROUP;

NAME                           ALLOCATION_UNIT_SIZE STATE       TYPE     TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
------------------------------ -------------------- ----------- ------ ---------- ---------- ----------------------- --------------
OCR1                                        1048576 MOUNTED     NORMAL       6144       5092                    2048           1522
FRA                                         1048576 MOUNTED     EXTERN      10240      10105                       0          10105

SQL> show parameter disk

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups                       string      FRA
asm_diskstring                       string      /dev/asm*
SQL>

.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

-bash-4.1$ grid_env
+ASM3
-bash-4.1$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Tue Jun 4 17:02:40 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Real Application Clusters and Automatic Storage Management options

SQL> set lines 500
SQL> set pages 500
SQL>
SQL> select NAME,ALLOCATION_UNIT_SIZE,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB  from V$ASM_DISKGROUP;

NAME                           ALLOCATION_UNIT_SIZE STATE       TYPE     TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
------------------------------ -------------------- ----------- ------ ---------- ---------- ----------------------- --------------
OCR1                                        1048576 MOUNTED     NORMAL       6144       5092                    2048           1522
FRA                                               0 DISMOUNTED                  0          0                       0              0

SQL> alter diskgroup fra mount;

Diskgroup altered.

SQL> select NAME,ALLOCATION_UNIT_SIZE,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB  from V$ASM_DISKGROUP;

NAME                           ALLOCATION_UNIT_SIZE STATE       TYPE     TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
------------------------------ -------------------- ----------- ------ ---------- ---------- ----------------------- --------------
OCR1                                        1048576 MOUNTED     NORMAL       6144       5092                    2048           1522
FRA                                         1048576 MOUNTED     EXTERN      10240      10105                       0          10105

SQL> show parameter disk

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups                       string      FRA
asm_diskstring                       string      /dev/asm*
SQL>
SQL>  select NAME,INST_ID,ALLOCATION_UNIT_SIZE,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB  from GV$ASM_DISKGROUP;

NAME                              INST_ID ALLOCATION_UNIT_SIZE STATE       TYPE     TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
------------------------------ ---------- -------------------- ----------- ------ ---------- ---------- ----------------------- --------------
OCR1                                    1              1048576 MOUNTED     NORMAL       6144       5092                    2048           1522
FRA                                     1              1048576 MOUNTED     EXTERN      10240      10105                       0          10105
OCR1                                    3              1048576 MOUNTED     NORMAL       6144       5092                    2048           1522
FRA                                     3              1048576 MOUNTED     EXTERN      10240      10105                       0          10105
OCR1                                    2              1048576 MOUNTED     NORMAL       6144       5092                    2048           1522
FRA                                     2              1048576 MOUNTED     EXTERN      10240      10105                       0          10105

6 rows selected.

SQL>
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

 

SQL> create diskgroup ASM1 external redundancy DISK '/dev/asm-diski';

Diskgroup created.

SQL> select NAME,ALLOCATION_UNIT_SIZE,STATE,TYPE,TOTAL_MB,FREE_MB,REQUIRED_MIRROR_FREE_MB,USABLE_FILE_MB  from V$ASM_DISKGROUP;

NAME                           ALLOCATION_UNIT_SIZE STATE       TYPE     TOTAL_MB    FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
------------------------------ -------------------- ----------- ------ ---------- ---------- ----------------------- --------------
OCR1                                        1048576 MOUNTED     NORMAL       6144       5092                    2048           1522
FRA                                         1048576 MOUNTED     EXTERN      10240      10105                       0          10105
ASM1                                        1048576 MOUNTED     EXTERN      30720      30585                       0          30585

SQL>

..............................
.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }
阅读(804) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~