oracle rac常用的命令

本文介绍了Oracle RAC中的一些重要命令,如'srvctl start database -d racdb',用于启动数据库。参考了相关专家的文章和专业书籍,提供日常维护操作的指导。
摘要由CSDN通过智能技术生成
oracle rac常用的命令
节点层:olsnodes
网络层: oifcfg
集群层:crsctl,ocrcheck,ocrdump,ocrconfig
应用层:srvctl,onsctl,crs_stat


一.节点层:
olsnodes 用来显示集群点列表,可以混用
[root@rac1 bin]# ./olsnodes -help
Usage: olsnodes [-n] [-p] [-i] [<node> | -l] [-g] [-v]
        where
                -n print node number with the node name
                -p print private interconnect name with the node name
                -i print virtual IP name with the node name
                <node> print information for the specified node
                -l print information for the local node 
                -g turn on logging 
                -v run in verbose mode 
[root@rac1 bin]# ./olsnodes -n -p -i
rac1    1       rac1-priv       rac1-vip
rac2    2       rac2-priv       rac2-vip
[root@rac1 bin]# ./olsnodes -v
prlslms: Initializing LXL global
prlsndmain: Initializing CLSS context
prlsmemberlist: No of cluster members configured = 256
prlsmemberlist: Getting information for nodenum = 1
prlsmemberlist: node_name = rac1
prlsmemberlist: ctx->lsdata->node_num = 1
prls_printdata: Printing the node data
rac1
prlsmemberlist: Getting information for nodenum = 2
prlsmemberlist: node_name = rac2
prlsmemberlist: ctx->lsdata->node_num = 2
prls_printdata: Printing the node data
rac2
prlsndmain: olsnodes executed successfully
prlsndterm: Terminating LSF


二.网络层:
网络层由各个节点的网络组件组成,包括2个物理网卡和3个IP 地址。 也只有一个命令:oifcfg.
 Oifctg 命令用来定义和修改Oracle 集群需要的网卡属性,这些属性包括网卡的网段地址,子网掩码,接口类型等。 要想正确的使用这个命令, 必须先知道Oracle 是如何定义网络接口的,Oracle的每个网络接口包括名称,网段地址,接口类型3个属性。
 这些属性中没有IP地址,但接口类型有两种,public和private,前者说明接口用于外部通信,用于Oracle Net和VIP 地址,而后者说明接口用于Interconnect。
接口的配置方式分为两类: global 和node-specific。 前者说明集群所有节点的配置信息相同,也就是说所有节点的配置是对称的;而后者意味着这个节点的配置和其他节点配置不同,是非对称的。


[root@rac1 bin]# ./oifcfg


Name:
        oifcfg - Oracle Interface Configuration Tool.


Usage:  oifcfg iflist [-p [-n]]
        oifcfg setif {-node <nodename> | -global} {<if_name>/<subnet>:<if_type>}...
        oifcfg getif [-node <nodename> | -global] [ -if <if_name>[/<subnet>] [-type <if_type>] ]
        oifcfg delif [-node <nodename> | -global] [<if_name>[/<subnet>]]
        oifcfg [-help]


        <nodename> - name of the host, as known to a communications network
        <if_name>  - name by which the interface is configured in the system
        <subnet>   - subnet address of the interface
        <if_type>  - type of the interface { cluster_interconnect | public | storage }


1.iflist:显示网口列表
[root@rac1 bin]# ./oifcfg iflist -p -n
eth0  192.168.90.0  PRIVATE  255.255.255.0
eth1  192.168.91.0  PRIVATE  255.255.255.0


2.getif: 获得单个网口信息
[root@rac1 bin]# ./oifcfg getif
eth0  192.168.90.0  global  public
eth1  192.168.91.0  global  cluster_interconnect
还可以查看网卡类型
[root@rac1 bin]# ./oifcfg getif -type public
eth0  192.168.90.0  global  public


3.delif:删除接口配置
[root@rac1 bin]# ./oifcfg delif -global
[root@rac1 bin]# ./oifcfg getif 


4.setif:配置单个网口
[root@rac1 bin]# ./oifcfg getif
eth0  192.168.90.2  global  public
eth1  192.168.91.3  global  cluster_interconnect


三.集群层:
集群层是指由Clusterware组成的核心集群, 这一层负责维护集群内的共享设备,并为应用集群提供完整的集群状态视图,应用集群依据这个视图进行调整。 这一层共有4个命令: crsctl, ocrcheck,ocrdump,ocrconfig. 后三个是针对OCR 磁盘的。
3.1 CRSCTL
CRSCTL 命令可以用来检查CRS进程栈,每个crs进程状态,管理Votedisk,跟踪CRS进程功能。
[oracle@rac1 bin]$ ./crsctl
Usage: crsctl check  crs          - checks the viability of the CRS stack
       crsctl check  cssd         - checks the viability of CSS
       crsctl check  crsd         - checks the viability of CRS
       crsctl check  evmd         - checks the viability of EVM
       crsctl set    css <parameter> <value> - sets a parameter override
       crsctl get    css <parameter> - gets the value of a CSS parameter
       crsctl unset  css <parameter> - sets CSS parameter to its default
       crsctl query  css votedisk    - lists the voting disks used by CSS
       crsctl add    css votedisk <path> - adds a new voting disk
       crsctl delete css votedisk <path> - removes a voting disk
       crsctl enable  crs    - enables startup for all CRS daemons
       crsctl disable crs    - disables startup for all CRS daemons
       crsctl start crs  - starts all CRS daemons.
--     crsctl stop  crs  - stops all CRS daemons. Stops CRS resources in case of cluster.
       crsctl start resources  - starts CRS resources. 
       crsctl stop resources  - stops  CRS resources. 
       crsctl debug statedump evm  - dumps state info for evm objects
       crsctl debug statedump crs  - dumps state info for crs objects
       crsctl debug statedump css  - dumps state info for css objects
       crsctl debug log css [module:level]{,module:level} ... 
                             - Turns on debugging for CSS 
       crsctl debug trace css - dumps CSS in-memory tracing cache
       crsctl debug log crs [module:level]{,module:level} ... 
                             - Turns on debugging for CRS 
       crsctl debug trace crs - dumps CRS in-memory tracing cache
       crsctl debug log evm [module:level]{,module:level} ... 
                             - Turns on debugging for EVM
       crsctl debug trace evm - dumps EVM in-memory tracing cache
       crsctl debug log res <resname:level> turns on debugging for resources
       crsctl query crs softwareversion [<nodename>] - lists the version of CRS software installed
       crsctl query crs activeversion - lists the CRS software operating version
       crsctl lsmodules css - lists the CSS modules that can be used for debugging
       crsctl lsmodules crs - lists the CRS modules that can be used for debugging
       crsctl lsmodules evm - lists the EVM modules that can be used for debugging


 If necesary any of these commands can be run with additional tracing by
 adding a "trace" argument at the very front.
 Example: crsctl trace check css


 1.检测crs状态:
 [oracle@rac1 bin]$ crsctl check  crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
--单个检测cssd,crsd,evmd状态
[oracle@rac1 bin]$ crsctl check  cssd
CSS appears healthy
[oracle@rac1 bin]$ crsctl check  crsd
CRS appears healthy
[oracle@rac1 bin]$ crsctl check  evmd
EVM appears healthy


2.配置CRS栈是否开机自启动   //这个命令需要root用户执行
[oracle@rac1 bin]$ crsctl disable crs
Insufficient user privileges.
[oracle@rac1 bin]$ crsctl enable crs
Insufficient user privileges.
实际修改这个文件中内容
[oracle@rac1 bin]$ cat /etc/oracle/scls_scr/rac1/root/crsstart 
enable


3.启动、停止CRS资源
[root@rac1 bin]# ./crsctl start resources
[root@rac1 bin]# ./crsctl stop resources


4.启动、停止CRS栈
oracle 10.1之前,必须通过重启系统重启Clusterware,但是从10.2开始,可以通过命令来启动和停止CRS。
[root@rac1 bin]# ./crsctl stop crs
Stopping resources.
Successfully stopped CRS resources 
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@rac1 bin]# ./crsctl start crs
Attempting to start CRS stack 
The CRS stack will be started shortly


5.查看Votedisk磁盘位置
[root@rac1 bin]# ./crsctl query css votedisk
 0.     0    /dev/raw/raw2


located 1 votedisk(s).


6.查看和修改CRS参数
[root@rac1 bin]# ./crsctl get css misscount
60
--修改参数:功能慎用
[root@rac1 bin]# ./crsctl set css misscount 60
Configuration parameter misscount is now set to 60.
[root@rac1 bin]# ./crsctl get css misscount
60
--重置CRS参数
[root@rac1 bin]# ./crsctl unset css misscount
Configuration parameter misscount is now undefined.
[root@rac1 bin]# ./crsctl get css misscount
Configuration parameter misscount is not defined.


7,跟踪CRS模块,提供辅助功能
CRS由CRS、CSS、EVM三个服务组成,每个服务又是由一系列module组成,crsctl允许每个module进行跟踪,并把跟踪内容记录到日志中。
[root@rac1 bin]# ./crsctl lsmodules css
The following are the CSS modules :: 
    CSSD
    COMMCRS
    COMMNS
[root@rac1 bin]# ./crsctl lsmodules crs
The following are the CRS modules :: 
    CRSUI
    CRSCOMM
    CRSRTI
    CRSMAIN
    CRSPLACE
    CRSAPP
    CRSRES
    CRSCOMM
    CRSOCR
    CRSTIMER
    CRSE
  • 1
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值