对Oracle10g rac srvctl命令使用理解

srvctl命令是RAC维护中最常用到的命令,也最为复杂,使用这个命令可以操作CRS上的Database,Instance,
ASM,Service、Listener和Node Application资源,其中Node Application资源又包括了GSD、ONS、VIP。这些
资源还有独立的管理工具,比如
ONS可以使用onsctl命令进行管理:  http://www.cnblogs.com/myrunning/p/4265522.html
listener还可以通过lsnrctl命令进行管理:http://www.cnblogs.com/myrunning/p/3977931.html

[[email protected] ~]$ srvctl -help
Usage: srvctl <command> <object> [<options>]
    command: enable|disable|start|stop|relocate|status|add|remove|modify|getenv|setenv|unsetenv|config
    objects: database|instance|service|nodeapps|asm|listener
For detailed help on each command and object and its options use:
    srvctl <command> <object> -h

1.使用config查看配置

<1>查看数据库配置

srvctl config database   --查看在ocr注册的所有数据库
srvctl config database -d  racdb   --使用-d选项查看某个具体的数据库配置
srvctl config database -d racdb -a   --使用-a选项查看更详细的配置

[[email protected] ~]$ srvctl config database
racdb

[[email protected] ~]$ srvctl config database -d racdb
rac4 racdb2 /opt/ora10g/product/10.2.0/db_1
rac3 racdb1 /opt/ora10g/product/10.2.0/db_1

[[email protected] ~]$ srvctl config database -d racdb -a
rac4 racdb2 /opt/ora10g/product/10.2.0/db_1
rac3 racdb1 /opt/ora10g/product/10.2.0/db_1
DB_NAME: racdb
ORACLE_HOME: /opt/ora10g/product/10.2.0/db_1
SPFILE: +DATA/racdb/spfileracdb.ora
DOMAIN: null
DB_ROLE: null
START_OPTIONS: null
POLICY:  AUTOMATIC
ENABLE FLAG: DB ENABLED

<2>查看Node Application的配置

--srvctl config nodeapps -n rac3 不带任何参数返回节点实例的$ORACLE_HOME

[[email protected] ~]$ srvctl config nodeapps -n rac3
rac3 racdb1 /opt/ora10g/product/10.2.0/db_1

--使用-a选项,查看vip配置

[[email protected] ~]$ srvctl config nodeapps -n rac3 -a
VIP exists.: /rac3-vip/192.168.1.203/255.255.255.0/eth0:eth1

--使用-g选项,查看gsd:

[[email protected] ~]$ srvctl config nodeapps -n rac3 -g
GSD exists.

--使用-s选项,查看ons:

[[email protected] ~]$ srvctl config nodeapps -n rac3 -s
ONS daemon exists.

--使用-l选项,查看listener:

[[email protected] ~]$ srvctl config nodeapps -n rac3 -l
Listener exists.

<3>查看Listener的配置

[[email protected] ~]$ srvctl config listener -n rac3
rac3 LISTENER_RAC3
[[email protected] ~]$ srvctl config listener -n rac4
rac4 LISTENER_RAC4

显示出了节点上Listener的名称

<4>查看asm

[[email protected] ~]$ srvctl config asm -n rac3
+ASM1 /opt/ora10g/product/10.2.0/db_1
[[email protected] ~]$ srvctl config asm -n rac4
+ASM2 /opt/ora10g/product/10.2.0/db_1

显示出了每个节点上的ASM实例名和$ORACLE_HOME

<5>查看Service

--查看数据库的所有Service配置:

[[email protected] ~]$ srvctl config service -d racdb -a
racdbserver PREF: racdb2 AVAIL: racdb1 TAF: basic

--查看那某个Service配置:

[[email protected] ~]$ srvctl config service -d racdb -s racdbserver
racdbserver PREF: racdb2 AVAIL: racdb1
[[email protected] ~]$ srvctl config service -d racdb -s racdbserver -a   --增加-a选项可以查看TAF策略
racdbserver PREF: racdb2 AVAIL: racdb1 TAF: basic

输出racdbserver这个服务,racdb2是首选实例,racdb1是可选实例  TAF策略是basic

2.使用remove删除对象

注意:使用remove命令删除的只是对象在OCR中的定义信息,对象本身比如数据库的数据文件等不会被删除,以后可以随时使用add命令重新添加到ocr中.

<1>删除Service

在删除之前,命令会给出确认提示,最后两行就是我们的service信息

[[email protected] ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac3
ora....C3.lsnr application    ONLINE    ONLINE    rac3
ora.rac3.gsd   application    ONLINE    ONLINE    rac3
ora.rac3.ons   application    ONLINE    OFFLINE
ora.rac3.vip   application    ONLINE    ONLINE    rac3
ora....SM2.asm application    ONLINE    ONLINE    rac4
ora....C4.lsnr application    ONLINE    ONLINE    rac4
ora.rac4.gsd   application    ONLINE    ONLINE    rac4
ora.rac4.ons   application    ONLINE    ONLINE    rac4
ora.rac4.vip   application    ONLINE    ONLINE    rac4
ora.racdb.db   application    ONLINE    ONLINE    rac4
ora....b1.inst application    ONLINE    ONLINE    rac3
ora....b2.inst application    ONLINE    ONLINE    rac4
ora....rver.cs application    ONLINE    ONLINE    rac3
ora....db2.srv application    ONLINE    ONLINE    rac4  

--删除失败,提示我们service正在运行

[[email protected] ~]$ srvctl remove service -d racdb -s racdbserver
racdbserver PREF: racdb2 AVAIL: racdb1
Remove service racdbserver from the database racdb? (y/[n]) y
PRKP-1024 : The service racdbserver is still running.   
[[email protected] ~]$ srvctl stop service -d racdb -s racdbserver
[[email protected] ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac3
ora....C3.lsnr application    ONLINE    ONLINE    rac3
ora.rac3.gsd   application    ONLINE    ONLINE    rac3
ora.rac3.ons   application    ONLINE    OFFLINE
ora.rac3.vip   application    ONLINE    ONLINE    rac3
ora....SM2.asm application    ONLINE    ONLINE    rac4
ora....C4.lsnr application    ONLINE    ONLINE    rac4
ora.rac4.gsd   application    ONLINE    ONLINE    rac4
ora.rac4.ons   application    ONLINE    ONLINE    rac4
ora.rac4.vip   application    ONLINE    ONLINE    rac4
ora.racdb.db   application    ONLINE    ONLINE    rac4
ora....b1.inst application    ONLINE    ONLINE    rac3
ora....b2.inst application    ONLINE    ONLINE    rac4
ora....rver.cs application    OFFLINE   OFFLINE
ora....db2.srv application    OFFLINE   OFFLINE
[[email protected] ~]$ srvctl remove service -d racdb -s racdbserver
racdbserver PREF: racdb2 AVAIL: racdb1
Remove service racdbserver from the database racdb? (y/[n]) y
[[email protected] ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac3
ora....C3.lsnr application    ONLINE    ONLINE    rac3
ora.rac3.gsd   application    ONLINE    ONLINE    rac3
ora.rac3.ons   application    ONLINE    OFFLINE
ora.rac3.vip   application    ONLINE    ONLINE    rac3
ora....SM2.asm application    ONLINE    ONLINE    rac4
ora....C4.lsnr application    ONLINE    ONLINE    rac4
ora.rac4.gsd   application    ONLINE    ONLINE    rac4
ora.rac4.ons   application    ONLINE    ONLINE    rac4
ora.rac4.vip   application    ONLINE    ONLINE    rac4
ora.racdb.db   application    ONLINE    ONLINE    rac4
ora....b1.inst application    ONLINE    ONLINE    rac3
ora....b2.inst application    ONLINE    ONLINE    rac4

可以看到通过crs_stat -t命令已经看不到service信息了

<2>删除实例

删除两个实例,命令会给出确认提示:

[[email protected] ~]$ srvctl remove instance -d racdb -i racdb1
Remove instance racdb1 from the database racdb? (y/[n]) y
PRKP-1023 : The instance {0} is still running.racdb

[[email protected] ~]$ srvctl stop instance -d racdb -i racdb1
[[email protected] ~]$ srvctl stop instance -d racdb -i racdb2

[[email protected] ~]$ srvctl remove instance -d racdb -i racdb1
Remove instance racdb1 from the database racdb? (y/[n]) y
[[email protected] ~]$ srvctl remove instance -d racdb -i racdb2
Remove instance racdb2 from the database racdb? (y/[n]) y
[[email protected] ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac3
ora....C3.lsnr application    ONLINE    ONLINE    rac3
ora.rac3.gsd   application    ONLINE    ONLINE    rac3
ora.rac3.ons   application    ONLINE    ONLINE    rac3
ora.rac3.vip   application    ONLINE    ONLINE    rac3
ora....SM2.asm application    ONLINE    ONLINE    rac4
ora....C4.lsnr application    ONLINE    ONLINE    rac4
ora.rac4.gsd   application    ONLINE    ONLINE    rac4
ora.rac4.ons   application    ONLINE    ONLINE    rac4
ora.rac4.vip   application    ONLINE    ONLINE    rac4
ora.racdb.db   application    OFFLINE   OFFLINE       

可以看到通过crs_stat -t 命令已经看不到实例的信息了

<3>删除数据库

[[email protected] ~]$ srvctl remove database -d racdb
Remove the database racdb? (y/[n]) y
[[email protected] ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac3
ora....C3.lsnr application    ONLINE    ONLINE    rac3
ora.rac3.gsd   application    ONLINE    ONLINE    rac3
ora.rac3.ons   application    ONLINE    ONLINE    rac3
ora.rac3.vip   application    ONLINE    ONLINE    rac3
ora....SM2.asm application    ONLINE    ONLINE    rac4
ora....C4.lsnr application    ONLINE    ONLINE    rac4
ora.rac4.gsd   application    ONLINE    ONLINE    rac4
ora.rac4.ons   application    ONLINE    ONLINE    rac4
ora.rac4.vip   application    ONLINE    ONLINE    rac4 

可以看到crs_stat -t 已经看不到数据库在ocr的注册信息了

3.使用add添加对象

一般情况下,应用层的资源都是在图形界面的帮组下注册到OCR中的,比如vip、ons是在安装最后的阶段创建的(这些资源也是集群中必须有的,为集群机制服务的), 而数据库、ASM是在执行DBCA的过程中自动注册到OCR中的,Listener是通过NETCA工具自动注册到OCR中的。 有时候我们需要通过手工的方式把资源注册到OCR中,这时就用到了add命令。

通过上面的说明,我们可以想到假如OCR损坏且没有备份的情况下,我们可以手动的方式重建OCR。

<1>添加数据库

[[email protected] ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac3
ora....C3.lsnr application    ONLINE    ONLINE    rac3
ora.rac3.gsd   application    ONLINE    ONLINE    rac3
ora.rac3.ons   application    ONLINE    ONLINE    rac3
ora.rac3.vip   application    ONLINE    ONLINE    rac3
ora....SM2.asm application    ONLINE    ONLINE    rac4
ora....C4.lsnr application    ONLINE    ONLINE    rac4
ora.rac4.gsd   application    ONLINE    ONLINE    rac4
ora.rac4.ons   application    ONLINE    ONLINE    rac4
ora.rac4.vip   application    ONLINE    ONLINE    rac4
[[email protected] ~]$
[[email protected] ~]$ srvctl add database -d racdb -o $ORACLE_HOME
[[email protected] ~]$
[[email protected] ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac3
ora....C3.lsnr application    ONLINE    ONLINE    rac3
ora.rac3.gsd   application    ONLINE    ONLINE    rac3
ora.rac3.ons   application    ONLINE    ONLINE    rac3
ora.rac3.vip   application    ONLINE    ONLINE    rac3
ora....SM2.asm application    ONLINE    ONLINE    rac4
ora....C4.lsnr application    ONLINE    ONLINE    rac4
ora.rac4.gsd   application    ONLINE    ONLINE    rac4
ora.rac4.ons   application    ONLINE    ONLINE    rac4
ora.rac4.vip   application    ONLINE    ONLINE    rac4
ora.racdb.db   application    OFFLINE   OFFLINE    

通过上面的信息可以看到数据已经被成功注册到OCR中.

<2>添加实例

[[email protected] ~]$ srvctl add instance -d racdb -n rac3 -i racdb1
[[email protected] ~]$ srvctl add instance -d racdb -n rac4 -i racdb2
[[email protected] ~]$
[[email protected] ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac3
ora....C3.lsnr application    ONLINE    ONLINE    rac3
ora.rac3.gsd   application    ONLINE    ONLINE    rac3
ora.rac3.ons   application    ONLINE    ONLINE    rac3
ora.rac3.vip   application    ONLINE    ONLINE    rac3
ora....SM2.asm application    ONLINE    ONLINE    rac4
ora....C4.lsnr application    ONLINE    ONLINE    rac4
ora.rac4.gsd   application    ONLINE    ONLINE    rac4
ora.rac4.ons   application    ONLINE    ONLINE    rac4
ora.rac4.vip   application    ONLINE    ONLINE    rac4
ora.racdb.db   application    OFFLINE   OFFLINE
ora....b1.inst application    OFFLINE   OFFLINE
ora....b2.inst application    OFFLINE   OFFLINE 

通过上面的信息可以看到实例已经被成功注册到OCR中

<3>添加服务

添加服务需要使用4个参数 -s  服务名 -r  首选实例 -a  备选实例 -P  TAF策略,可选值为NONE(缺省值)、BASIC、PRECONNECT

[[email protected] ~]$ srvctl add service -d racdb -s racdbservice -r racdb1 -a racdb2 -P BASIC
[[email protected] ~]$
[[email protected] ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac3
ora....C3.lsnr application    ONLINE    ONLINE    rac3
ora.rac3.gsd   application    ONLINE    ONLINE    rac3
ora.rac3.ons   application    ONLINE    ONLINE    rac3
ora.rac3.vip   application    ONLINE    ONLINE    rac3
ora....SM2.asm application    ONLINE    ONLINE    rac4
ora....C4.lsnr application    ONLINE    ONLINE    rac4
ora.rac4.gsd   application    ONLINE    ONLINE    rac4
ora.rac4.ons   application    ONLINE    ONLINE    rac4
ora.rac4.vip   application    ONLINE    ONLINE    rac4
ora.racdb.db   application    OFFLINE   OFFLINE
ora....b1.inst application    OFFLINE   OFFLINE
ora....b2.inst application    OFFLINE   OFFLINE
ora....vice.cs application    OFFLINE   OFFLINE
ora....db1.srv application    OFFLINE   OFFLINE
[[email protected] ~]$
[[email protected] ~]$ srvctl config service -d racdb -s racdbservice -a
racdbservice PREF: racdb1 AVAIL: racdb2 TAF: BASIC

通过上面的信息可以看到服务已经被成功注册到OCR中,而且通过命令srvctl config service -d racdb -s racdbservice -a
确认能够得到正确的添加信息.

4.使用enable/disable启动、禁用对象

<1>配置数据库随crs的启动而自动自动

--关闭数据库自动启动特性:

[[email protected] ~]$ srvctl config database -d racdb -a
rac3 racdb1 /opt/ora10g/product/10.2.0/db_1
rac4 racdb2 /opt/ora10g/product/10.2.0/db_1
DB_NAME: null
ORACLE_HOME: /opt/ora10g/product/10.2.0/db_1
SPFILE: null
DOMAIN: null
DB_ROLE: null
START_OPTIONS: null
POLICY:  AUTOMATIC
ENABLE FLAG: DB ENABLED
[[email protected] ~]$ srvctl disable database -d racdb
[[email protected] ~]$
[[email protected] ~]$ srvctl config database -d racdb -a
rac3 racdb1 /opt/ora10g/product/10.2.0/db_1
rac4 racdb2 /opt/ora10g/product/10.2.0/db_1
DB_NAME: null
ORACLE_HOME: /opt/ora10g/product/10.2.0/db_1
SPFILE: null
DOMAIN: null
DB_ROLE: null
START_OPTIONS: null
POLICY:  MANUAL
ENABLE FLAG: DB DISABLED, INST DISABLED ON racdb1 racdb2

通过最后一行的输出可以数据库和两个实例都被设置成了disable

--启用数据库自动启动特性:

[[email protected] ~]$ srvctl enable database -d racdb
[[email protected] ~]$
[[email protected] ~]$ srvctl config database -d racdb -a
rac3 racdb1 /opt/ora10g/product/10.2.0/db_1
rac4 racdb2 /opt/ora10g/product/10.2.0/db_1
DB_NAME: null
ORACLE_HOME: /opt/ora10g/product/10.2.0/db_1
SPFILE: null
DOMAIN: null
DB_ROLE: null
START_OPTIONS: null
POLICY:  AUTOMATIC
ENABLE FLAG: DB ENABLED

<2>关闭某个实例的自动启动

注意:却省时实例都是自动启动的

[[email protected] ~]$ srvctl disable instance -d racdb -i racdb1
[[email protected] ~]$
[[email protected] ~]$ srvctl config database -d racdb -a
rac3 racdb1 /opt/ora10g/product/10.2.0/db_1
rac4 racdb2 /opt/ora10g/product/10.2.0/db_1
DB_NAME: null
ORACLE_HOME: /opt/ora10g/product/10.2.0/db_1
SPFILE: null
DOMAIN: null
DB_ROLE: null
START_OPTIONS: null
POLICY:  AUTOMATIC
ENABLE FLAG: DB ENABLED, INST DISABLED ON racdb

最后一行可以看到有提示racdb1实例被关闭

启动:srvctl enable instance -d racdb -i racdb1

<3>禁止服务在某个实例上运行

禁止服务在racdb1上运行:

[[email protected] ~]$ srvctl disable service -d  racdb -s racdbservice -i racdb1
[[email protected] ~]$
[[email protected] ~]$ srvctl config service -d racdb -a
racdbservice PREF: racdb1 AVAIL: racdb2 TAF: BASIC
Service racdbservice is disabled on instance(s) racdb1.

最后一行提示了racdbservice在实例racdb1上被禁止了

启用:srvctl enable service -d  racdb -s racdbservice -i racdb1

5.启动/停止对象与查看对象

在RAC环境下启动、关闭数据库虽然仍然可以使用SQL*Plus方法,但是更推荐使用srvctl命令来做这些工作, 这可以保证及时更新crs中的运行信息。

可以使用start/stop命令启动、停止对象,然后使用status命令查看对象状态。

<1>启动数据库,缺省是启动到open状态

[[email protected] ~]$ srvctl start database -d racdb
[[email protected] ~]$
[[email protected] ~]$ sqlplus ‘/as sysdba‘

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 28 15:35:15 2015

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

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> 

<2>启动实例到指定状态

--启动实例1到mount状态

[[email protected] ~]$ srvctl start instance -d racdb -i racdb1 -o mount
[[email protected] ~]$
[[email protected] ~]$ sqlplus ‘/as sysdba‘

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 28 15:39:53 2015

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

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SQL> select status from v$instance;

STATUS
------------
MOUNTED

--启动实例2到nomount状态

[[email protected] ~]$ srvctl start instance -d racdb -i racdb2 -o nomount
[[email protected] ~]$
[[email protected] ~]$ sqlplus ‘/as sysdba‘

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 28 15:45:18 2015

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

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SQL> select status from v$instance;

STATUS
------------
STARTED

SQL> 

<3>关闭对象并指定关闭方式

--以immediate方式关闭racdb1实例

[[email protected] ~]$ srvctl stop instance -d racdb -i racdb1 -o immediate

--以abort方式关闭racdb2实例

[[email protected] ~]$ srvctl stop instance -d racdb -i racdb2 -o abort

<4>在指定的实例上启动服务

[[email protected] ~]$ srvctl start service -d racdb -s racdbservice -i racdb1
[[email protected] ~]$
[[email protected] ~]$ srvctl status service -d racdb -v
Service racdbservice is running on instance(s) racdb1

最后一行提示racdbservice服务运行在racdb1上

--查看帮助

[[email protected] ~]$ srvctl status service -d racdb -h
Usage: srvctl status service -d <name> [-s "<service_name_list>"] [-f] [-v] [-S <level>]
    -d <name>           Unique name for the database
    -s "<serv,...>"     Comma separated service names
    -f                  Include disabled applications
    -v                  Verbose output
    -S <level>          Additional information for EM Console
    -h                  Print usage

<5>关闭指定的实例上的服务

[[email protected] ~]$ srvctl stop service -d racdb -s racdbservice -i racdb1
[[email protected] ~]$ srvctl status service -d racdb -v
Service racdbservice is running on instance(s)

6.跟踪srvctl

在ORACLE10g 中要跟踪srvctl非常简单,只需要设置SRVM_TRACE=true 这个OS环境变量即可。
设置完后这个命令的所有函数调用就会输出到屏幕上,可以帮组用户进行诊断。

[[email protected] ~]$ export SRVM_TRACE=true
[[email protected] ~]$ srvctl stop database -d racdb
/opt/ora10g/product/10.2.0/db_1/jdk/jre/bin/java -classpath /opt/ora10g/product/10.2.0/db_1/jlib/netcfg.jar:/opt/ora10g/product/10.2.0/db_1/jdk/jre/lib/rt.jar:/opt/ora10g/product/10.2.0/db_1/jdk/jre/lib/i18n.jar:/opt/ora10g/product/10.2.0/db_1/jlib/srvm.jar:/opt/ora10g/product/10.2.0/db_1/jlib/srvmhas.jar:/opt/ora10g/product/10.2.0/db_1/jlib/srvmasm.jar:/opt/ora10g/product/10.2.0/db_1/srvm/jlib/srvctl.jar -DTRACING.ENABLED=true -DTRACING.LEVEL=2 oracle.ops.opsctl.OPSCTLDriver stop database -d racdb
[main] [16:2:1:17] [OPSCTLDriver.setInternalDebugLevel:165]  tracing is true at level 2 to file null
[main] [16:2:1:60] [OPSCTLDriver.<init>:95]  Security manager is set
[main] [16:2:1:77] [CommandLineParser.parse:173]  parsing cmdline args
[main] [16:2:1:78] [CommandLineParser.parse2WordCommandOptions:940]  parsing 2-word cmdline
[main] [16:2:1:78] [OPSCTLDriver.execute:174]  executing srvctl command
[main] [16:2:1:78] [OPSCTLDriver.execute:199]  executing 2-word command verb=4 noun=101
[main] [16:2:1:96] [CommandLineParser.obtainOPS:1352]  srvctl: get reference to : racdb
[main] [16:2:1:118] [GetActiveNodes.create:213]  Going into GetActiveNodes constructor...

....................

致谢:本文章参考了张晓明<<大话Oracle RAC>>

时间: 2024-10-10 06:30:51

对Oracle10g rac srvctl命令使用理解的相关文章

Oracle10g RAC 关闭及启动

情况1: 保养数据库及操作系统,服务器,需要关闭DB(所有实例),OS 及Server . a. 首先停止Oracle10g 环境 $ lsnrctl stop (每个节点上停止监听,也可以用srvctl 来操作,每个节点上执行) $ emctl stop dbconsole (每个节点停止dbconsole) $ srvctl stop database -d tpc (停止数据库所有实例,一个节点上执行即可) $ srvctl stop nodeapps -n gnd-rac01 (停节点1

RAC6——crsctl 和 srvctl 命令的区别理解

Oracle Clusterware提供了丰富的工具,我们把常用的工具按照rac的四层机构做了划分,然后分别介绍: 节点层: olsnodes 参数-n -i -p 网络层: oifcfg 四个子命令可以通过oifcfg -help查看下 iflist 显示网口列表 getif 可以获得单个网口信息 setif 配置单个网口 delif 删除网口 集群层: crstcl .orccheck .ocrdump.ocrconfig 应用层: srvctl .onsctl.crs_stat ----=

Pcserver+oracle10g+rac

成本的相对廉价,技术的成熟,功能的强大此方案将越来越受中小企业的青睐. ????一.实验前准备 虚拟机版本:Vwareserver1.0.6 Linux版本:redhat5.5enterprise服务器版 Oralce版本:oracle10g10.2.1 Oracle集群软件:clusterware VwareWorkstation版本在共享磁盘上没有很好的解决办法.Vwareserver在windows7安装可能存在一定的驱动问题.本实验是在xp系统上完成,下图给出虚拟机的ip及主机名配置 N

管理oracle 11g RAC 常用命令

1).检查集群状态: [[email protected] ~]$ crsctl check cluster CRS-4537: Cluster Ready Services is online CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online 2).所有 Oracle 实例 —(数据库状态): [[email protected] ~]$ srvctl status da

IOT/Abort trap(coredump) oracle10g rac asm aix5错误

起因: 两台ibm 小型机搭建的oracle10g rac环境,使用asm磁盘组,运行了多年没有问题,今天机房要计划停电,正常关机后,开机后数据库节点1无法自动启动,使用ps -ef |grep d.bin查看,有crs进程.但是使用crs_stat -t 命令查看,报IOT/Abort trap(coredump) 解决: 上网查了一下,解决方法比较简单,使用root用户在$CRS_HOME/crs/下简历auth目录即可. 这是oracle的一个bug导致的,bug number:Bug 5

oracle srvctl 命令

SRVCTL命令可以控制RAC数据库中的instance,listener以及services. 通常SRVCTL在ORACLE用户下执行.下面我们来介绍srvctl命令. 1.通过SRVCTL命令来start/stop/check所有的实例:$ srvctl start|stop|status database -d 2.start/stop指定的实例: $ srvctl start|stop|status instance -d -i 3.列出当前RAC下所有数据库 $ srvctl con

srvctl 命令

SRVCTL命令可以控制RAC数据库中的instance,listener以及services.通常SRVCTL在ORACLE用户下执行.下面我们来介绍srvctl命令.1.通过SRVCTL命令来start/stop/check所有的实例:$ srvctl start|stop|status database -d <db_name>2.start/stop指定的实例:$ srvctl start|stop|status instance -d <db_name> -i <i

oracle 10g RAC中DRM的理解

关于DRM的一些总结 1. 什么是DRM DRM(Dynamic Resource Management)是oracle 10g的一个新特性,在oracle rac环境中,ORACLE使用GRD(Global Resource Service)来记录各个节点的资源信息,具体是通过GCS(Global Cache Service)和GES(Global Enqueue Service)这两个服务进行管理.由于RAC中每个节点都有自己的SGA和buffer cache,为了保证所有节点cache 资

Linux命令行–理解Linux文件权限(转)

6.1.1 /etc/passwd文件 /etc/passwd:包含系统用户账户列表以及每个用户的基本配置信息 每个条目有七个字段,每个字段用冒号隔开 登录用户名 用户密码 用户账户的UID 用户账户的GID 用户账户的文本描述 用户HOME目录的位置 1 rich:x:501:501:Rich Blum:/home/rich:/bin/bash 默认情况下,bash shell启动时会自动处理用户主目录下.bashrc文件中的命令 linux系统将用户密码保存在另一个单独的文件中(称为shad