欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

Oracle RAC常用管理命令

程序员文章站 2022-06-09 10:40:29
...

欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入 1. 可以配置一些Oracle用到的变量 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1 export ORACLE_SID=NEWRAC2 ORACLE_HOSTNAME="newrac01.hq.lumigen

欢迎进入Oracle社区论坛,与200万技术人员互动交流 >>进入

  1. 可以配置一些Oracle用到的变量

  export ORACLE_BASE=/u01/app/oracle

  export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1

  export ORACLE_SID=NEWRAC2

  ORACLE_HOSTNAME="newrac01.hq.lumigent.int"

  export PATH=/u01/app/oracle/product/11.1.0/db_1/bin:$PATH

  export ORA_CRS_HOME=/u01/app/crs/product/11.1.0/crs

  export PATH=/u01/app/crs/product/11.1.0/crs/bin:$PATH

  export ORACLE_USER=orarac

  2. crsctl ,检查crs

  crsctl check crs 检查crs状态

  crsctl start crs 启动crs

  crsctl stop crs

  crsctl check crsd

  crs_stat -t

  等等,其 /etc/init.d/init.crs stop /etc/init.d/init.crsd stop 等开机启动service 脚本如果

  如果你发现crs不能正常工作可以检查调试一下这些脚本,检查一下进程是不是这个脚本可以正常工作。

  crs的启动log 在 $ORA_CRS_HOME/log $ORA_CRS_HOME/log/client 下面可以找到。出现错误可以检查一下对应的log

  3. srvctl 启动数据库与实例

  srvctl start database -d NEWRAC 启动名字为NEWRAC的数据库

  查看当前数据库的状态

  [root@newrac02 ~]# srvctl status database -d NEWRAC

  Instance NEWRAC1 is running on node newrac01

  Instance NEWRAC2 is running on node newrac02

  srvctl start instance -d NEWRAC -i newrac1 启动某一个实例

  4、检查rac的配置文件 ,可以在里面找到数据库的名字等

  /u01/oradata/NEWRAC/spfileNEWRAC.ora

  /u01/app/oracle/admin/NEWRAC/pfile/init.ora.5302010204445

  另附网络上找到的几篇文章:

  Day-to-day management of Oraclehttp://www.6api.com/day-to-day-management-of-oracle-10g-rac/

  ==================================================

  Day-to-day management of Oracle 10G RAC

  CRS management

  rnCRSCTL command control of the CRS Services local node (Oracle clusterware processes)

  rn stop CRS:

  rn $ crsctl stop crs or

  rn $ / etc / init.crs stop or

  rn $ crs_stop-all

  rn start CRS:

  rn $ crsctl start crs or

  rn $ / etc / init.crs start

  rn prohibited Clusterware restart automatically at system startup methods:

  rn $ / etc / init.crs disable

  rn start Clusterware restart automatically at system startup methods:

  rn $ / etc / init.crs enable

  rn view the status CRS Services

  rn $ crsctl check crs

  rnOCR resource management

  rnOCR resources, when the RAC cluster up and running successfully, you can use the instrument crs_stat see the following:

  rn $ ORA_CRS_HOME / bin / crs_stat

  rn general, the status of all resources should be online. In addition, OCR will be four hours each to back up first. Have some cases you can restore the OCR configuration file to restore problems OCR.

  rn such as the use of the following situations occur:

  rn $ crs_stat-t

  rnCRS-0184: Cannot communicate with the CRS daemon.

  rn $ crsctl check boot

  rnFailure 4 at procr_open_key with status 4.

  rnPROC-4: The cluster registry key to be operated on does not exist.

  rn $ crsctl check crs

  rnFailure 1 contacting CSS daemon

  rnCannot communicate with CRS

  rnCannot communicate with EVM

  rn caused this error may be due to a lost OCR configuration. We can use this backup to restore the previous configuration.

[1] [2] [3] [4] [5]

Oracle RAC常用管理命令