Starting and shutting down Oracle RAC database cluster

Riveore 2021-11-25 18:44:14
starting shutting oracle rac database

Like learning the operating system , installed RAC After cluster , The first thing is to learn how to start and shut down , Startup and shutdown rac There are three general ways :sqlplus,srvctl as well as dbconsole perhaps oracle grid control, This section briefly describes the use of srvctl Startup and shutdown rac Database cluster !

Use crs_stat The command can query the current rac Under each node asm example , Monitor ,global service daemon,oracle notification server,vip, Whether the database instance is normal !

[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ crs_stat -t -v
Name           Type           R/RA   F/FT   Target    State     Host        
----------------------------------------------------------------------
ora....SM1.asm application    0/5    0/0    ONLINE    ONLINE    rac1        
ora....C1.lsnr application    0/5    0/0    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    0/5    0/0    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    0/3    0/0    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    0/0    0/0    ONLINE    ONLINE    rac1        
ora....SM2.asm application    0/5    0/0    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    0/5    0/0    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    0/5    0/0    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    0/3    0/0    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    0/0    0/0    ONLINE    ONLINE    rac2        
ora.racdb.db   application    0/1    0/1    ONLINE    ONLINE    rac1        
ora....b1.inst application    0/5    0/0    ONLINE    ONLINE    rac1        
ora....b2.inst application    0/5    0/0    ONLINE    ONLINE    rac2   

srvctl Use of commands
srvctl yes service control Abbreviation , The basic usage is srvctl <command> <object> [<options>], Use srvctl command , It can be done to rac Database instance of each node ,asm Instances, listeners, etc , Very convenient tool

[oracle@rac2 ~]$ srvctl 
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

Get more detailed help
[oracle@rac2 ~]$ srvctl start asm -h
Usage: srvctl start asm -n <node_name> [-i <asm_inst_name>] [-o <start_options>] [-c <connect_str> | -q]
    -n <node>           Node name
    -i <asm_inst_name>  ASM instance name
    -o <start_options>  Options to startup command (e.g. open, mount, or nomount)
    -c <connstr>        Connect string (default: / as sysdba)
    -q                  Query connect string from standard input
    -h                  Print usage

close rac database

[oracle@rac2 ~]$ srvctl stop database -d racdb 
[oracle@rac2 ~]$ crs_stat -t -v
Name           Type           R/RA   F/FT   Target    State     Host        
----------------------------------------------------------------------
ora....SM1.asm application    0/5    0/0    ONLINE    ONLINE    rac1        
ora....C1.lsnr application    0/5    0/0    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    0/5    0/0    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    0/3    0/0    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    0/0    0/0    ONLINE    ONLINE    rac1        
ora....SM2.asm application    0/5    0/0    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    0/5    0/0    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    0/5    0/0    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    0/3    0/0    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    0/0    0/0    ONLINE    ONLINE    rac2        
ora.racdb.db   application    0/1    0/1    OFFLINE   OFFLINE               
ora....b1.inst application    0/5    0/0    OFFLINE   OFFLINE               
ora....b2.inst application    0/5    0/0    OFFLINE   OFFLINE    

Turn off the nodes asm example

[oracle@rac2 ~]$ srvctl stop asm -n rac1 
[oracle@rac2 ~]$ srvctl stop asm -n rac2
[oracle@rac2 ~]$ crs_stat -t -v
Name           Type           R/RA   F/FT   Target    State     Host        
----------------------------------------------------------------------
ora....SM1.asm application    0/5    0/0    OFFLINE   OFFLINE               
ora....C1.lsnr application    0/5    0/0    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    0/5    0/0    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    0/3    0/0    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    0/0    0/0    ONLINE    ONLINE    rac1        
ora....SM2.asm application    0/5    0/0    OFFLINE   OFFLINE               
ora....C2.lsnr application    0/5    0/0    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    0/5    0/0    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    0/3    0/0    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    0/0    0/0    ONLINE    ONLINE    rac2        
ora.racdb.db   application    0/1    0/1    OFFLINE   OFFLINE               
ora....b1.inst application    0/5    0/0    OFFLINE   OFFLINE               
ora....b2.inst application    0/5    0/0    OFFLINE   OFFLINE  

Turn off the service of each node , Include gsd,ons,vip And the monitor

[oracle@rac2 ~]$ srvctl stop nodeapps -n rac1
[oracle@rac2 ~]$ srvctl stop nodeapps -n rac2
[oracle@rac2 ~]$ crs_stat -t -v
Name           Type           R/RA   F/FT   Target    State     Host        
----------------------------------------------------------------------
ora....SM1.asm application    0/5    0/0    OFFLINE   OFFLINE               
ora....C1.lsnr application    0/5    0/0    OFFLINE   OFFLINE               
ora.rac1.gsd   application    0/5    0/0    OFFLINE   OFFLINE               
ora.rac1.ons   application    0/3    0/0    OFFLINE   OFFLINE               
ora.rac1.vip   application    0/0    0/0    OFFLINE   OFFLINE               
ora....SM2.asm application    0/5    0/0    OFFLINE   OFFLINE               
ora....C2.lsnr application    0/5    0/0    OFFLINE   OFFLINE               
ora.rac2.gsd   application    0/5    0/0    OFFLINE   OFFLINE               
ora.rac2.ons   application    0/3    0/0    OFFLINE   OFFLINE               
ora.rac2.vip   application    0/0    0/0    OFFLINE   OFFLINE               
ora.racdb.db   application    0/1    0/1    OFFLINE   OFFLINE               
ora....b1.inst application    0/5    0/0    OFFLINE   OFFLINE               
ora....b2.inst application    0/5    0/0    OFFLINE   OFFLINE

rac The closing order of data is : Close the cluster database instance -- Turn off the nodes ASM example -- Close the services of each node , The order of startup is the opposite !

[oracle@rac2 ~]$ srvctl start nodeapps -n rac1
[oracle@rac2 ~]$ srvctl start nodeapps -n rac2
[oracle@rac2 ~]$ srvctl start asm -n rac1
[oracle@rac2 ~]$ srvctl start asm -n rac2
[oracle@rac2 ~]$ srvctl start instance -d racdb -i racdb1 -o mount
[oracle@rac2 ~]$ srvctl start instance -d racdb -i racdb2 -o open

[oracle@rac2 ~]$ sqlplus sys/123456@racdb1 as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Nov 26 12:15:57 2011
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 open_mode,name  from v$database;

OPEN_MODE                      NAME
------------------------------ ---------------------------
MOUNTED                        RACDB

SQL> conn sys/123456@racdb2 as sysdba
Connected.
SQL> select open_mode,name  from v$database;

OPEN_MODE                      NAME
------------------------------ ---------------------------
READ WRITE                     RACDB

close rac An instance in the node

[oracle@rac2 ~]$ srvctl stop instance -d racdb -i racdb1 -o immediate
[oracle@rac2 ~]$ srvctl stop asm -n rac1
[oracle@rac2 ~]$ srvctl stop nodeapps -n rac1
[oracle@rac2 ~]$ crs_stat -t -v
Name           Type           R/RA   F/FT   Target    State     Host        
----------------------------------------------------------------------
ora....SM1.asm application    0/5    0/0    OFFLINE   OFFLINE               
ora....C1.lsnr application    0/5    0/0    OFFLINE   OFFLINE               
ora.rac1.gsd   application    0/5    0/0    OFFLINE   OFFLINE               
ora.rac1.ons   application    0/3    0/0    OFFLINE   OFFLINE               
ora.rac1.vip   application    0/0    0/0    OFFLINE   OFFLINE               
ora....SM2.asm application    0/5    0/0    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    0/5    0/0    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    0/5    0/0    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    0/3    0/0    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    0/0    0/0    ONLINE    ONLINE    rac2        
ora.racdb.db   application    0/1    0/1    ONLINE    ONLINE    rac2        
ora....b1.inst application    0/5    0/0    OFFLINE   OFFLINE               
ora....b2.inst application    0/5    0/0    ONLINE    ONLINE    rac2  

prohibit asm Instance and database instance start automatically

[oracle@rac2 ~]$ srvctl disable asm -n rac1
[oracle@rac2 ~]$ srvctl disable asm -n rac2
[oracle@rac2 ~]$ srvctl disable database -d racdb
[oracle@rac1 ~]$ uptime 
 21:46:45 up 2 min,  1 user,  load average: 2.03, 0.78, 0.28
[oracle@rac1 ~]$ crs_stat -t -v
Name           Type           R/RA   F/FT   Target    State     Host        
----------------------------------------------------------------------
ora....SM1.asm application    0/5    0/0    ONLINE    OFFLINE               
ora....C1.lsnr application    0/5    0/0    ONLINE    ONLINE    rac1        
ora.rac1.gsd   application    0/5    0/0    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    0/3    0/0    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    0/0    0/0    ONLINE    ONLINE    rac1        
ora....SM2.asm application    0/5    0/0    ONLINE    OFFLINE               
ora....C2.lsnr application    0/5    0/0    ONLINE    ONLINE    rac2        
ora.rac2.gsd   application    0/5    0/0    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    0/3    0/0    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    0/0    0/0    ONLINE    ONLINE    rac2        
ora.racdb.db   application    0/1    0/1    OFFLINE   OFFLINE               
ora....b1.inst application    0/1    0/0    OFFLINE   OFFLINE               
ora....b2.inst application    0/1    0/0    OFFLINE   OFFLINE      
版权声明
本文为[Riveore]所创,转载请带上原文链接,感谢
https://javamana.com/2021/11/20211109102332558Z.html

  1. Microservice mode: business process saga mode of spring boot + Kafka - vinsguru
  2. Linux / MacOS 修改 ls 显示年月日的时间格式
  3. Linux / MacOS modify the time format of LS display date
  4. 7、Spring Boot检索
  5. 7. Spring boot search
  6. 7、Spring Boot检索
  7. 7. Spring boot search
  8. 10、Spring Boot分布式
  9. 10. Spring boot distributed
  10. Did you know that artifact can also manage SUSE Linux system dependencies
  11. 3、Spring Cloud Rest工程建立(通過IDEA建立)
  12. 3. Spring cloud rest project establishment (through idea)
  13. 4、Spring Cloud Eureka
  14. 4、Spring Cloud Eureka
  15. Did you know that artifact can also manage SUSE Linux system dependencies
  16. k8s搭建zk&pulsar集群——三节点
  17. 7、Spring Cloud Hystrix
  18. Dubbo series -- source code analysis of local service publishing
  19. Netty启动对HTTP/3的孵化器支持
  20. Netty launches incubator support for HTTP / 3
  21. Spring Webflux security configuration tutorial and source code - vinsguru
  22. WebClient: Spring的新的HTTP反应式客户端 - spring.io
  23. Webclient: spring's new HTTP reactive client- spring.io
  24. 使用Project Reactor进行反应式数据流 - spring.io
  25. Using project reactor for reactive data flow- spring.io
  26. Humor: k8s is not so hard to deploy on kubernetes personal blog
  27. UNIX domain socket tutorial for java16 - nipafx
  28. Using netty to realize the source code and tutorial of http2 server / client baeldung
  29. Using spring boot reactive r2dbc to realize crud operation source code of PostgreSQL Rajesh
  30. Spring Boot Liquibase基础教程 - josdem
  31. Vlad mihalcea: the best way to map query results to dto using JPA and Hibernate
  32. Using java enumeration in spring boot to automatically serialize parameters and save database - Dario
  33. In depth study of spring cloud load balancer - Piotr
  34. How to use completable future in springboot 2
  35. Basic course of spring boot liquibase - josdem
  36. Volatile side effect in Java: not using CPU cache
  37. Using redis PubSub and spring boot to realize microservice message model vinsguru
  38. Fault tolerant and reliable messaging of Apache Kafka and spring boot – Arnold galovics
  39. Java exception and tuning one stop solution
  40. Using playwright to implement automatic visual testing for Java API - applitools
  41. Oracle database official statement does not support VMWare
  42. [function] Oracle function series (1) -- character function
  43. [function] Oracle function series (1) -- character function
  44. Oracle character set simple diagram, Chinese garbled solution
  45. Oracle lock series
  46. No.2 process kthread of Linux kernel learning
  47. [password] Oracle user password series
  48. [Linux] migrate Oracle installation directory from root directory to logical volume
  49. Oracle 12cr1 RAC installation on VMware Workstation (middle) - graphical interface installation
  50. Driving of Oracle hint_ SITE
  51. Oracle 12cr1 RAC installation on VMware Workstation (middle) - graphical interface installation
  52. [knowledge point sorting] comparison of redo, undo and execution speed under nologing, append, archive and parallel in Oracle
  53. Introduction to Oracle parameters
  54. [method] how to limit IP access to Oracle database
  55. Oracle 12cr1 RAC installation on VMware Workstation (middle) - graphical interface installation
  56. Linux free - M command
  57. Oracle fast recovery area (FRA)
  58. Docker install MySQL 5.7
  59. Oracle 12C EM Express Series
  60. [DG] Oracle 19C uses DBCA to build physical DG