当前位置:数据库 > Oracle >>

Oracle RAC日常管理命令

Oracle RAC日常管理命令
 
一、查看RAC环境
RAC架构,2节点信息
节点1
SQL> show parameter instance
NAME TYPE VALUE
------------------------------------ ----------- -----------------------------------------------
active_instance_count integer
cluster_database_instances integer 2
instance_groups string
instance_name string RACDB1
instance_number Integer 1
instance_type string RDBMS
open_links_per_instance integer 4
parallel_instance_group string
parallel_server_instances integer 2
节点2
SQL> show parameter instance、
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
active_instance_count integer
cluster_database_instances integer 2
instance_groups string
instance_name string RACDB2
instance_number integer 2
instance_type string RDBMS
open_links_per_instance integer 4
parallel_instance_group string
parallel_server_instances integer 2
数据库版本
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
操作系统信息
节点1
[oracle@rac1 ~]$ uname -a
Linux rac1 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:02 EDT 2007 i686 i686 i386 GNU/Linux
节点2
[oracle@rac2 ~]$ uname -a
Linux rac2 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:02 EDT 2007 i686 i686 i386 GNU/Linux
[oracle@leonarding1 admin]$ uname -a
Linux leonarding1.oracle.com 2.6.32-200.13.1.el5uek #1 SMP Wed Jul 27 21:02:33 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
RAC所有资源信息
[oracle@rac2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....B1.inst application ONLINE ONLINE rac1
ora....B2.inst application ONLINE ONLINE rac2
ora....DB1.srv application ONLINE ONLINE rac2
ora.....TAF.cs application ONLINE ONLINE rac2
ora.RACDB.db application ONLINE ONLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
 
二启动和关闭crs主进程
(1)简单说说RAC日常管理都有哪些内容
1.节点管理:node日常管理
2.网络管理:例如网卡配置 VIP虚拟ip外部网络 内部网络
3.集群管理:CRS集群资源管理 OCR oracle集群注册表 srv服务管理 votedisk表决磁盘
4.应用管理:数据库、实例、易做图、虚拟ip、注册到RAC中的各种资源
(2)RAC集群守护进程
[oracle@rac1 init.d]$ pwd
/etc/init.d
[oracle@rac1 init.d]$ ll | grep init*
init.crsd:# init.crsd - Control script for the CRS daemon.
init.crsd:# only be invoked from init.crs or from inittab.
init.crsd:# No manual invocation of init.crsd is supported.
init.crsd:# or on an automatic startup, this file will exist. init.crsd run will
init.cssd:# directory. It should only be invoked from init.crs.
init.evmd:# be invoked from init.crs.
[oracle@rac1 init.d]$ ls init*
init.crs init.crsd init.cssd init.evmd
这些就是RAC集群守护进程,存放在Linux开机启动的脚本目录下,可以随操作系统的启动而启动。
./init.crs start启动集群进程
./init.crs stop停止集群进程
./init.crs enable随操作系统的启动而启动
./init.crs disable不随操作系统的启动而启动
注:init.crs脚本是init.crsd init.cssd init.evmd脚本的引导脚本
crs主要进程
(1)crsd
负责管理HA 高可靠性操作
管理crs资源,如linstener,vip,ons,gsn等
由root用户管理、启动
(2)ocssd
管理各节点的关系,用于节点间通信
由oracle用户运行管理
(3)oprocd
集群进程管理 —Process monitor for the cluster.集群监控进程
仅在没有使用vendor的集群软件状态下运行
(4)evmd
事件检测进程,由oracle用户运行管理
(5)主要log位置
$ORA_CRS_HOME/log/节点主机名(rac1 rac2)/racg 节点日志
$ORA_CRS_HOME/log/节点主机名(rac1 rac2)/crsd集群软件日志
$ORA_CRS_HOME/crs/init
$ORA_CRS_HOME/css/log 节点间通信的日志
$ORA_CRS_HOME/css/init
$ORA_CRS_HOME/evm/log 事件监控日志
$ORA_CRS_HOME/evm/init
$ORA_CRS_HOME/srvm/log
演示
[oracle@rac1 init.d]$ su – root必须使用root用户执行RAC集群脚本
Password:
[root@rac1 ~]# cd /etc/init.d
[root@rac1 init.d]# ./init.crs disable
Automatic startup disabled for system boot.
[root@rac1 init.d]# ./init.crs enable
Automatic startup enabled for system boot.
[root@rac1 init.d]# ./init.crs stop停止CRS主进程
Shutting down Oracle Cluster Ready Services (CRS):
Stopping resources.
Successfully stopped CRS resources包含crsd
Stopping CSSD.
Shutting down CSS daemon.包含cssd
Shutdown request successfully issued.
Shutdown has begun. The daemons should exit soon.
[root@rac1 init.d]# ./init.crs start启动CRS主进程
Startup will be queued to init within 90 seconds.启动将会在90秒内完成
[root@rac1 init.d]# crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....B1.inst application ONLINE ONLINE rac1
ora....B2.inst application ONLINE ONLINE rac2
ora....DB1.srv application ONLINE ONLINE rac2
ora.....TAF.cs application ONLINE ONLINE rac2
ora.RACDB.db application ONLINE ONLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
等待一会并不一定是90秒,CRS集群资源全部启动了
(3)RAC集群命令集目录
$ORACLE_HOME/crs_1/bin
所有集群命令都放在这个目录下
(4)节点层命令
[oracle@rac1 init.d]$ olsnodes -n
rac1 1
rac2 2
[oracle@rac1 init.d]$ olsnodes -n -p
rac1 1 rac1-priv
rac2 2 rac2-priv
[oracle@rac1 init.d]$ olsnodes -n -p -i
rac1 1 rac1-priv rac1-vip
rac2 2 rac2-priv rac2-vip
这个命令用来显示集群节点的信息
参数解释:n打印节点号
P 打印私有网络名
i 打印虚拟ip
(2)网络层命令
[oracle@rac1 init.d]$ oifc
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,