知识大全 OracleRAC常用管理命令

Posted 数据库

篇首语:历史是一面镜子,它照亮现实,也照亮未来。本文由小常识网(cha138.com)小编为大家整理,主要介绍了知识大全 OracleRAC常用管理命令相关的知识,希望对你有一定的参考价值。

OracleRAC常用管理命令  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!

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

  export ORACLE_BASE=/u /app/oracle

  export ORACLE_HOME=/u /app/oracle/product/ /db_

  export ORACLE_SID=NEWRAC

  ORACLE_HOSTNAME= newrac hq lumigent int

  export PATH=/u /app/oracle/product/ /db_ /bin:$PATH

  export ORA_CRS_HOME=/u /app/crs/product/ /crs

  export PATH=/u /app/crs/product/ /crs/bin:$PATH

  export ORACLE_USER=orarac

      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

   srvctl 启动数据库与实例

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

  查看当前数据库的状态

  [root@newrac ~]# srvctl status database d NEWRAC

  Instance NEWRAC is running on node newrac

  Instance NEWRAC is running on node newrac

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

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

  /u /oradata/NEWRAC/spfileNEWRAC ora

  /u /app/oracle/admin/NEWRAC/pfile/init ora

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

  Day to day management of Oracle G RAC   原文地址

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

  Day to day management of Oracle G RAC

  CRS management

  rnCRSCTL mand 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 : Cannot municate with the CRS daemon

  rn $ crsctl check boot

  rnFailure at procr_open_key with status

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

  rn $ crsctl check crs

  rnFailure contacting CSS daemon

  rnCannot municate with CRS

  rnCannot municate with EVM

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

  rn # / etc / init crs disable

  rn # / etc / init crs stop

  rn before the crs process to ensure that all stopped

  rn # su oracle

  rn $ cd $ ORA_CRS_HOME / bin

  rn $ / ocrconfig restore / opt / app / oracle / crs / cdata / crs / week ocr

  rn then switch to the root user the re enable CRS

  rn # / etc / init crs enable

  Finally reboot both node rn

  Introduction rnSRVCTL order

  rnSRVCTL order to control the RAC database instance listener as well as services

  rn at SRVCTL usually carried out under ORACLE user Us to introduce the following mand srvctl

  rn through SRVCTL mand to start / stop / check all of the examples:

  rn $ srvctl start | stop | status database d

  rn start / stop the specified instance:

  rn $ srvctl start | stop | status instance d i

  rn list all of the current RAC

  rn $ srvctl config database d

  rn start / stop / check all nodeapps such as: VIP GSD listener ONS:

  rn $ srvctl start | stop | status nodeapps n

  rn if you use ASM srvctl can also start / stop ASM instance:

  rn $ srvctl start | stop asm n [ i] [ o]

  rn access to all environmental information:

  rn $ srvctl getenv database d [ i]

  rn set the overall environment and the variables:

  rn $ srvctl setenv database d t LANG = en

  rn have been deleted from the OCR databases:

  rn $ srvctl remove database d

  rn to the OCR to add a database:

  rn $ srvctl add database d o

  rn [ m] [ p] [ A / netmask] [ r (PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY)] [ s]

  rn to the OCR to add a database instance:

  rn $ srvctl add instance d i n

  rn $ srvctl add instance d i n

  rn to the OCR Add a ASM instance:

  rn $ srvctl add asm n i o

  rn add a service

  rn $ srvctl add service d s r [ a] [ P] [ u]

  rn modified on other nodes in the service

  rn $ srvctl modify service d s I t

  rn relocate a service node to other nodes

  rnsrvctl relocate service d s I

  and related services rnCRS mon mand demo

  rn view order status

  rn # su oracle to switch to the oracle user

  rn $ crs_stat t check crs and all of the service status

  rn $ crsctl check crs use crsctl order to check the status of related services crs

  rn $ srvctl status nodeapps n db (db ) use srvctl to view the services on all nodes and whether it is normal

  rn $ srvctl status database d db the database using srvctl status view

  rn turn off start up and related services in order

  rn # su oracle

  rn $ crs_start all start all crs Service

  rn $ crs_stop all to stop all of the Services crs

  rn $ crsctl start crs Services start crs

  rn $ crsctl stop crs stop crs Service

  rn $ srvctl start nodeapps n db (db ) Start a node on the application of all

  rn $ srvctl stop nodeapps n db (db ) stop a node on the application of all

  rn $ srvctl start listener n db (db ) Start a node listener

  rn $ srvctl stop listener n db (db ) The listener to stop a node

  rn $ srvctl start instance d db i db (db ) start an instance

  rn $ srvctl stop instance d db i db (db ) to stop a particular instance

  rn $ srvctl start database d db startup database

  rn $ srvctl stop database d db to stop the database

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

  RAC mon mand description 原文地址

  oracle rac database of monly used mands:

   The state of all instances and services

  srvclt status database d orcl

  A single instance of state:

  srvctl status instance d orcl i orcl /orcl

  Global names in the database status of the service:

  srvctl status service d orcl s orcltest

  Application specific node state:

  srvctl status nodeapps n linux

  srvctl status nodeapps n linux

  ASM instance state

  srvctl status asm n linux

  Lists all database configuration:

  srvctl config database

  Display RAC database configuration information:

  srvctl config database d orcl

  Show all services specified cluster database

  srvctl config service d orcl

  Display node application configuration information (VIP GSD ONS Listener etc )

  srvctl config nodeapps n linux a g s l

  Shows the configuration of ASM instance

  srvctl config asm n linux

  Cluster all running instances:

  select

  inst_id instance_number inst_no instance_name is inst_name

  parallel status database_status db_status

  active_state state host_name host from gv $ instance

  order by inst_id;

  In the disk group all data files:

  select name from v $ datafile

  union

  select member from v $ logfile

  union

  select name from v $ controlfile

  union

  select name from v $ tempfile;

  Start and stop RAC databases:

  su oracle

  hostname

  Stop oracle rac g environment:

  The first step: stop oracle instance when this instance (and related services) closed shut down ASM instances and finally close the node applications (Virtual IP GSD TNS Listener and ONS)

  export oracle_sid = orcl

  emctl stop dbconsole

  srvclt stop instance d orcl i orcl

  srvctl stop asm n rac

  srvctl stop nodeapps n rac

  Start RAC environment:

  The first step is to start the node applications (Virtual IP GSD TNS listener and ONS

  ) When the successful launch of the node application start the ASM instance and finally start the ORACLE instance (and related services) and Enterprise Manager Database console

  export oracle_sid = orcl

  srvctl start nodeapps n rac

  srvctl start asm n rac

  srvctl start instance d orcl i orcl

  emctl start dbconsole

  Practical srvclt start to stop all instances of:

  srvclt start database d orcl

  srvctl stop database d orcl

  Start stop the listener:

  lsnrctl start listener_hostb

  lsnrctl stop listener

  **************************************************

  ************************************************** ************************

  Oracle G R RAC daily management

  CRS management

  CRSCTL mand controls the local node s CRS services (Oracle clusterware processes)

  Stop CRS:

  $ Crsctl stop crs or

  $ / Etc / init crs stop or

  $ Crs_stop all

  Start CRS:

  $ Crsctl start crs or

  $ / Etc / init crs start

  Prohibition Clusterware restart automatically after system start method:

  $ / Etc / init crs disable

  Start Clusterware automatically start after reboot the system approach:

  $ / Etc / init crs enable

  See CRS service status

  $ Crsctl check crs

  OCR resource management

  OCR resources when the RAC cluster up and running after success you can use crs_stat tools see the following:

  $ ORA_CRS_HOME / bin / crs_stat

  Typically the state of all resources should be online In addition OCR will backup every hours once In some cases you can restore the OCR configuration file to restore the problem of OCR

  Such as use of the following situations occur:

  $ Crs_stat t

  CRS : Cannot municate with the CRS daemon

  $ Crsctl check boot

  Failure at procr_open_key with status

  PROC : The cluster registry key to be operated on does not exist

  $ Crsctl check crs

  Failure contacting CSS daemon

  Cannot municate with CRS

  Cannot municate with EVM

  A possible cause of this error because the OCR configuration lost We can use this backup to restore the previous configuration

  # / Etc / init crs disable

  # / Etc / init crs stop

  First ensure that all of the crs process all the stops

  # Su oracle

  $ Cd $ ORA_CRS_HOME / bin

  $ / Ocrconfig restore / opt / app / oracle / crs / cdata / crs / week ocr

  Then switch to the root user the re enable CRS

  # / Etc / init crs enable

  Finally reboot the o nodes

  SRVCTL mand description

  SRVCTL mand can control the RAC database instance listener and services

  Usually SRVCTL executed in the ORACLE user Here s a srvctl mand

   by SRVCTL mand to start / stop / check all of the examples:

  $ Srvctl start | stop | status database d <db_name>

   start / stop the specified instance:

  $ Srvctl start | stop | status instance d <db_name> i <instance_name>

   lists all the current RAC under

  $ Srvctl config database d <db_name>

   start / stop / check all the nodeapps such as: VIP GSD listener ONS:

  $ Srvctl start | stop | status nodeapps n <node_name>

   if you use ASM srvctl can also start / stop ASM instance:

  $ Srvctl start | stop asm n <node_name> [ i <asm_inst_name>] [ o <oracle_home>]

   can get all of the environmental information:

  $ Srvctl getenv database d <db_name> [ i <instance_name>]

   set the global environment and the variables:

  $ Srvctl setenv database d <db_name> t LANG = en

   to remove from the existing OCR databases:

  $ Srvctl remove database d <db_name>

   add a database to OCR:

  $ Srvctl add database d <db_name> o <oracle_home>

  [ M <domain_name>] [ p <spfile>] [ A <name|ip> / netmask] [ r (PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY)] [ s <start_options>]

   to the OCR to add a database instance:

  $ Srvctl add instance d <db_name> i <instance_name> n <node >

  $ Srvctl add instance d <db_name> i <instance_name> n <node >

   to add an OCR ASM instance:

  $ Srvctl add asm n <node_name> i <asm_inst_name> o <oracle_home>

   add a service

  $ Srvctl add service d <db_name> s <service_name> r <preferred_list> [ a <available_list>] [ P <TAF_policy>] [ u]

   modify the service to other nodes

  $ Srvctl modify service d <db_name> s <service_name> I <orig_instance_name> t <target_instance_name>

   relocate to a service node to other nodes

  srvctl relocate service d <db_name> s <service_name> I

  CRS and related services a demonstration of mon mands

   view the status of the mand

  # Su oracle first switch to the oracle user

  $ Crs_stat t View crs and all the service of the state

  $ Crsctl check crs use crsctl mand to check the status of related services crs

  $ Srvctl status nodeapps n db (db ) use the srvctl view the services on all nodes are normal

  $ Srvctl status database d db the database using srvctl view the status of startup and shutdown mands related services

  # Su oracle

  $ Crs_start all start all the crs service

  $ Crs_stop all to stop all the crs service

  $ Crsctl start crs starts crs Service

  $ Crsctl stop crs stop crs service

  $ Srvctl start nodeapps n db (db ) start all applications in a node

  $ Srvctl stop nodeapps n db (db ) Stop all applications on a node

  $ Srvctl start listener n db (db ) Start a node listener

  $ Srvctl stop listener n db (db ) The listener to stop a node

  $ Srvctl start instance d db i db (db ) start an instance

  $ Srvctl stop instance d db i db (db ) stop an instance

  $ Srvctl start database d db Startup Database

  $ Srvctl stop database d db Stop database

cha138/Article/program/Oracle/201311/17756

相关参考

知识大全 oracle 中的常用命令重点展播

  第一章日志管理  forcinglogswitches  sql>altersystemswitchlogfile;    forcingcheckpoints  sql>alters

知识大全 详细讲解Oracle服务器的常用命令行

详细讲解Oracle服务器的常用命令行  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!数据库管理相关

知识大全 常用MySQL的命令集锦

常用MySQL的命令集锦  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!  一连接MySQL  格式

知识大全 Memcached常用命令以及使用说明详解

Memcached常用命令以及使用说明详解  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!一存储命令

知识大全 OracleDataGuard常用维护命令参考手册

OracleDataGuard常用维护命令参考手册  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧! 

知识大全 Oracle 10g RAC 常用维护命令

Oracle10gRAC常用维护命令  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!  所有实例和服

知识大全 Oracle数据库基本常用命令汇总

Oracle数据库基本常用命令汇总  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!以下是对Oracl

知识大全 DB2 常用命令速查(备忘)

DB2常用命令速查(备忘)  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!dasauto-自动启动D

知识大全 Oracle服务器常用命令行工具一览

Oracle服务器常用命令行工具一览  以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!  ()数据库管

知识大全 linux shell命令的常用快捷键

Ctrl+a切换到命令行开始Ctrl+e切换到命令行末尾Ctrl+l清除屏幕内容Ctrl+u清除剪切光标之前的内容Ctrl+k剪切清除光标之后的内容Ctrl+y复制剪切板里的内容Ctrl+h类似于退格