In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
In the Oracle 10g era, we envy those DBA who understand Oracle9i, and unwittingly passed the Oracle11g and welcomed the 12c era, but there are still many DBA accustomed to the management thinking of Oracle 10g, especially when managing or installing Oracle11g RAC.
In RAC under Oracle 11gR2, the architecture has changed, with more grid users, a change in the location of warning logs, and so on. The information of CRS is also placed in the ASM instance, so to turn off asm, you must close crs, in Oracle
The hierarchical structure between 11g environment RAC + ASM is shown in the following figure:
In the RAC environment of Oracle10g, the information of CRS is placed on the bare device, so it is correct to turn off CRS only after closing asm.
In addition to the above resources, we also need to understand OHASD resources, which can be explained as follows:
Oracle High Availability Services Daemon (OHASD): This process anchors the lower part of the Oracle Clusterware stack, which consists of processes that facilitate cluster operations.
When you start CRS in 11gR2, you will be prompted that ohasd has been started. So what resources does this OHASD contain? You can view it with the following command:
[grid@oracle1] $crsctl status resource-t
NAME TARGET STATE SERVER STATE_DETAILS
Local Resources
Ora.DATADG.dg
ONLINE ONLINE oracle1
ONLINE ONLINE oracle2
Ora.FRADG.dg
ONLINE ONLINE oracle1
ONLINE ONLINE oracle2
Ora.LISTENER.lsnr
ONLINE ONLINE oracle1
ONLINE ONLINE oracle2
Ora.OCRVT.dg
ONLINE ONLINE oracle1
ONLINE ONLINE oracle2
Ora.asm
ONLINE ONLINE oracle1 Started
ONLINE ONLINE oracle2 Started
Ora.gsd
OFFLINE OFFLINE oracle1
OFFLINE OFFLINE oracle2
Ora.net1.network
ONLINE ONLINE oracle1
ONLINE ONLINE oracle2
Ora.ons
ONLINE ONLINE oracle1
ONLINE ONLINE oracle2
Ora.registry.acfs
ONLINE ONLINE oracle1
ONLINE ONLINE oracle2
Cluster Resources
Ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE oracle1
Ora.cvu
1 ONLINE ONLINE oracle2
Ora.oc4j
1 ONLINE ONLINE oracle2
Ora.oracle1.vip
1 ONLINE ONLINE oracle1
Ora.oracle2.vip
1 ONLINE ONLINE oracle2
Ora.scan1.vip
1 ONLINE ONLINE oracle1
Ora.sjjczr.db
1 ONLINE ONLINE oracle1 Open
2 ONLINE ONLINE oracle2 Open
[grid@oracle1 ~] $
In Oracle 10g, CRS Resource includes GSD (Global Serveice Daemon), ONS (Oracle Notification Service), VIP, Database, Instance and Service.
In 11.2, CRSD resources are reclassified: Local Resources and Cluster Resources. OHASD means Cluster Resource.
1. Oracle 11g RAC shutdown and startup related commands
1.1 using crsctl stop has/crsctl stop crs
With the root user, the commands to stop and start the cluster in Oracle11gR2 are as follows:
# crsctl stop has [- f]
# crsctl start has
The only optional parameter for crsctl stop has is-f, and this command can only stop the execution of HAS on the command server. You can't stop on all nodes. So to stop the RAC completely, you need to execute the command on all nodes.
The following two commands: using crs has exactly the same effect as using has:
# crsctl stop crs [- f]
# crsctl start crs
Remember that the first time you installed Oracle 11gR2 RAC + ASM in a production environment, it always felt wrong to check the status with the crs_stat-t command after installation (the number of resources in the online state on node 2 is much less than that on node 1). If you want to restart CRS and ASM, you use the # crsctl stop crs command (without the [- f] parameter), which is not always smooth. Finally restarted the server. When you think about it later, you can actually use crsctl stop has [- f], which is no better than restarting the server.
Start HAS:
[root@rac1bin] #. / crsctl start has
CRS-4123:Oracle High Availability Services has been started.
[root@rac1bin] #
From above, it just starts HAS. In fact, all the resources managed by Oracle Restart will be started later. This can be verified by using the crs_stat command.
[grid@oracle1] $crs_stat-t-v
Name Type R/RA F/FT Target State Host
Ora.DATADG.dg ora....up.type 0/5 0/ ONLINE ONLINE oracle1
Ora.FRADG.dg ora....up.type 0/5 0/ ONLINE ONLINE oracle1
Ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE oracle1
Ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE oracle1
Ora.OCRVT.dg ora....up.type 0/5 0/ ONLINE ONLINE oracle1
Ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE oracle1
Ora.cvu ora.cvu.type 0/5 0/0 ONLINE ONLINE oracle2
Ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE
Ora....network ora....rk.type 0/5 0/ ONLINE ONLINE oracle1
Ora.oc4j ora.oc4j.type 0/1 0/2 ONLINE ONLINE oracle2
Ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE oracle1
Ora....SM1.asm application 0/5 0/0 ONLINE ONLINE oracle1
Ora....E1.lsnr application 0/5 0/0 ONLINE ONLINE oracle1
Ora....le1.gsd application 0/5 0/0 OFFLINE OFFLINE
Ora....le1.ons application 0/3 0/0 ONLINE ONLINE oracle1
Ora....le1.vip ora....t1.type 0/0 0/0 ONLINE ONLINE oracle1
Ora....SM2.asm application 0/5 0/0 ONLINE ONLINE oracle2
Ora....E2.lsnr application 0/5 0/0 ONLINE ONLINE oracle2
Ora....le2.gsd application 0/5 0/0 OFFLINE OFFLINE
Ora....le2.ons application 0/3 0/0 ONLINE ONLINE oracle2
Ora....le2.vip ora....t1.type 0/0 0/0 ONLINE ONLINE oracle2
Ora....ry.acfs ora....fs.type 0/5 0/ ONLINE ONLINE oracle1
Ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE oracle1
Ora.sjjczr.db ora....se.type 0/2 0/1 ONLINE ONLINE oracle1
1.2 use crsctl stop cluster [- all] …
The syntax for this command is:
Crsctl stop cluster [[- all] | [- n [...] [- f]
Crsctl start cluster [[- all] | [- n [...]
This parameter supports more options and can manipulate all nodes at the same time. If no parameter is specified, it is only valid for the current node.
Such as:
[root@rac1] #. / crsctl start cluster-n rac1 rac2
-- stop the current node cluster:
[root@rac1 bin] #. / crsctl stop cluster
2. Stop and start Resource
When the cluster is stopped directly, the relevant Resource is also stopped. But in reality, we are more concerned with starting or shutting down certain resources. Specifically, use the SRVCTL command. This command is not often used and is always forgotten, so you can use the help option-h to view command help:
[grid@rac1] $Srvclt-h
The result displayed by this command is too long to view. You can check the help further:
[grid@rac1] $srvctl start-h
The common commands for the running status of RAC are as follows:
[root@vcdwdb1] # srvctl-h
-bash: srvctl: command not found
[root@vcdwdb1 ~] # su-grid
[grid@vcdwdb1] $srvctl-h
Usage: srvctl [- V]-shows a lot of content, which is selected and pasted as follows
Usage: srvctl start nodeapps [- n] [- g] [- v]
Usage: srvctl stop nodeapps [- n] [- g] [- f] [- r] [- v]
Usage: srvctl status nodeapps
Usage: srvctl start vip {- n |-I} [- v]
Usage: srvctl stop vip {- n |-I} [- f] [- r] [- v]
Usage: srvctl relocate vip-I [- n] [- f] [- v]
Usage: srvctl status vip {- n |-I} [- v]
Usage: srvctl start asm [- n] [- o]
Usage: srvctl stop asm [- n] [- o] [- f]
Usage: srvctl config asm [- a]
Usage: srvctl status asm [- n] [- a] [- v]
Usage: srvctl config listener [- l] [- a]
Usage: srvctl start listener [- l] [- n]
Usage: srvctl stop listener [- l] [- n] [- f]
Usage: srvctl status listener [- l] [- n] [- v]
Usage: srvctl start scan [- I] [- n]
Usage: srvctl stop scan [- I] [- f]
Usage: srvctl relocate scan-I [- n]
Usage: srvctl status scan [- I] [- v]
Usage: srvctl config cvu
Usage: srvctl start cvu [- n]
Usage: srvctl stop cvu [- f]
Usage: srvctl relocate cvu [- n]
Usage: srvctl status cvu [- n]
You can also view the configuration information further, as follows:
[grid@vcdwdb1] $srvctl start-h
The SRVCTL start command starts an Oracle Clusterware-enabled object that is not running.
Usage: srvctl start database-d [- o] [- n]
Usage: srvctl start instance-d {- n [- I] |-I} [- o]
Usage: srvctl start service-d [- s "" [- n |-I]] [- o]
Usage: srvctl start nodeapps [- n] [- g] [- v]
Usage: srvctl start vip {- n |-I} [- v]
Usage: srvctl start asm [- n] [- o]
Usage: srvctl start listener [- l] [- n]
Usage: srvctl start scan [- I] [- n]
Usage: srvctl start scan_listener [- n] [- I]
Usage: srvctl start oc4j [- v]
Usage: srvctl start home-o-s-n
Usage: srvctl start filesystem-d [- n]
Usage: srvctl start diskgroup-g [- n ""]
Usage: srvctl start gns [- l] [- n] [- v]
Usage: srvctl start cvu [- n]
For detailed help on individual commands and objects, use:
Srvctl-h
[grid@vcdwdb1] $srvctl start listener-h
Start the listener.
Usage: srvctl start listener [- l] [- n]
-l listener name
-n node roll call
-h output usage
[grid@vcdwdb1 ~] $
[grid@vcdwdb1] $srvctl status-h
The SRVCTL status command displays the current state of the object.
Usage: srvctl status database-d [- f] [- v]
Usage: srvctl status instance-d {- n |-I} [- f] [- v]
Usage: srvctl status service-d [- s "] [- f] [- v]
Usage: srvctl status nodeapps
Usage: srvctl status vip {- n |-I} [- v]
Usage: srvctl status listener [- l] [- n] [- v]
Usage: srvctl status asm [- n] [- a] [- v]
Usage: srvctl status scan [- I] [- v]
Usage: srvctl status scan_listener [- I] [- v]
Usage: srvctl status srvpool [- g] [- a]
Usage: srvctl status server-n "[- a]
Usage: srvctl status oc4j [- n] [- v]
Usage: srvctl status home-o-s-n
Usage: srvctl status filesystem-d [- v]
Usage: srvctl status diskgroup-g [- n ""] [- a] [- v]
Usage: srvctl status cvu [- n]
Usage: srvctl status gns [- n] [- v]
For detailed help on individual commands and objects, use:
Srvctl-h
[grid@vcdwdb1] $srvctl config-h
The SRVCTL config command displays the object configuration stored in OCR.
Usage: srvctl config database [- d [- a]] [- v]
Usage: srvctl config service-d [- s] [- v]
Usage: srvctl config nodeapps [- a] [- g] [- s]
Usage: srvctl config vip {- n |-I}
Usage: srvctl config network [- k]
Usage: srvctl config asm [- a]
Usage: srvctl config listener [- l] [- a]
Usage: srvctl config scan [- I]
Usage: srvctl config scan_listener [- I]
Usage: srvctl config srvpool [- g]
Usage: srvctl config oc4j
Usage: srvctl config filesystem-d
Usage: srvctl config gns [- a] [- d] [- k] [- m] [- n] [- p] [- s] [- V] [- Q] [- l] [- v]
Usage: srvctl config cvu
For detailed help on individual commands and objects, use:
Srvctl-h
For example:
[grid@vcdwdb1 ~] $srvctl config asm
ASM home directory: / u01/app/11.2.0/grid_home
ASM listener: LISTENER
[grid@vcdwdb1] $srvctl config asm-a
ASM home directory: / u01/app/11.2.0/grid_home
ASM listener: LISTENER
ASM is enabled.
[grid@vcdwdb1 ~] $
[grid@vcdwdb1] $srvctl config listener-a
Name: LISTENER
Network: 1, owner: grid
Home directory:
/ u01/app/11.2.0/grid_home on node vcdwdb2,vcdwdb1
Endpoint: TCP:1521
Summary:
In an Oracle 11g environment, the order in which Oracle is shut down and started is as follows:
Closing order:
1. Close the database, and oracl users execute the srvctl command:
[oracle@rac1 ~] $srvctl stop database-d ORCL-stop instances on all nodes
Or each node logs in to the database and executes SQL > shutdown immediate
2. To stop HAS (High Availability Services), you must use the root user
[root@rac1 oracle] # cd / u01/grid/11.2.0/grid/bin
[root@rac1 bin] #. / crsctl stop has-f
3. To stop the cluster service, you must use the root user:
[root@rac1 oracle] # cd / u01/grid/11.2.0/grid/bin
[root@rac1 bin] #. / crsctl stop cluster-all-stop all node services
Or [root@rac1 bin] #. / crsctl stop cluster-stop the cluster service of this node, and each node executes
You can also control the stopped nodes as follows:
[root@rac1 bin] #. / crsctl stop cluster-n rac1 rac2
If you stop all other nodes at one node without executing the commands one by one, you can also use:
[root@rac1 bin] #. / crsctl stop cluster-all
Boot sequence:
RAC for 11g R2 starts itself by default, of course, if you need to start it manually. Manual startup can be started in the order of cluster, HAS and database. The specific commands are as follows:
1. Start the cluster (cluster)
[root@rac1] #. / crsctl start cluster-all-- all nodes start at the same time
Or only start the specified node's
[root@rac1] #. / crsctl start cluster-n rac1 rac2-- two nodes start at the same time
2. To start HAS (High Availability Services), you must use the root user
[root@rac1 bin] #. / crsctl start has
The above has startup commands need to be executed separately on each node
3. Start the database, and the oracl user executes the srvctl command (assuming the database name is ORCL):
[oracle@rac1 ~] $srvctl start database-d ORCL-stop instances on all nodes
Or each node logs in to the database and executes SQL > startup
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.