In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "RAC commonly used management commands". In daily operation, I believe many people have doubts about the commonly used management commands in RAC. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "RAC commonly used management commands". Next, please follow the editor to study!
RAC command
1. Node layer
-olsnodes
Olsnodes lists the cluster nodes
Olsnodes
-n node number
-p displays the network interface used for private connections
-I display the VIP of each node
-g print log information
-v print detailed log
2. Cluster layer
-CRSCTL
Check CRS status
Crsctl check crs
Root permission is required to configure whether CRS starts automatically with the system
Crsctl disable crs does not start automatically
Crsctl enable crs automatic start
Start and shut down CRS
Crsctl start crs starts CRS
Crsctl stop crs shuts down CRS
View the location of VOTEDISK
Crsctl query css votedisk
View the CRS module, including the service CRS,CSS,EVM
Crsctl lsmodules css
Crsctl lsmodules crs
Crsctl lsmodules evm
Maintain VOTEDISK
To add VOTEDISK, you need to shut down the database and CRS.
Srvctl stop database-d * *
Root permission
/ home/oracle/product/10.2.0/crs/bin/crsctl stop crs
/ home/oracle/product/10.2.0/crs/bin/crsctl add css votedisk / dev/raw/raw25-force
-ocrdump prints content except OCR in the way of ASCII, and cannot be used for backup and recovery.
Ocrdump [- stdout] [filename] [- keyname name] [- xml]
-stdout: output the content to the screen
-Filename: output the content to a file
-keyname: print only the contents of a key and its subkeys
-xml: print output in .xml format
-ocrcheck
The ocrcheck command is used to check the consistency of OCR content
-ocrconfig
The ocrconfig command is used to maintain OCR disks
Ocrconfig-showbackup view automatic backup
Ocrconfig-backuploc / home/oracle/ocrbak requires root permission
Backing up and restoring OCR
1. Close the cluster database
Srvctl stop database-d ppzhu
2. Close all cluster resources
Crs_stop-all
3. Turn off the cluster software service
/ home/oracle/product/10.2.0/crs/bin/crsctl stop crs requires root permission
4. Export OCR file
/ home/oracle/product/10.2.0/crs/bin/ocrconfig-export / home/oracle/OCR110330.bak requires root permission
5. Start CRS
/ home/oracle/product/10.2.0/crs/bin/crsctl start crs
6. Destroy OCR content
Dd if=/dev/zero f=/dev/raw/raw1 bs=1024 count=102400
7. Check OCR consistency
[oracle@rac1 ~] $ocrcheck
PROT-601: Failed to initialize ocrcheck
8. Use import to restore OCR content
/ home/oracle/product/10.2.0/crs/bin/ocrconfig-import / home/oracle/ocr20110330.bak
9. Check again
[oracle@rac1 ~] $ocrcheck
Status of Oracle Cluster Registry is as follows:
Version: 2
Total space (kbytes): 802956
Used space (kbytes): 5640
Available space (kbytes): 797316
ID: 1379974702
Device/File Name: / dev/raw/raw1
Device/File integrity check succeeded
Device/File not configured
Cluster registry integrity check succeeded
Add an OCR image and change the OCR location
1. Add a mirror image
/ home/oracle/product/10.2.0/crs/bin/ocrconfig-replace ocrmirror / dev/raw/raw11
2. Check
[oracle@rac1 ~] $ocrcheck
Status of Oracle Cluster Registry is as follows:
Version: 2
Total space (kbytes): 802956
Used space (kbytes): 5640
Available space (kbytes): 797316
ID: 1379974702
Device/File Name: / dev/raw/raw1
Device/File integrity check succeeded
Device/File Name: / dev/raw/raw11
Device/File integrity check succeeded
Cluster registry integrity check succeeded
3. Change the OCR location
/ home/oracle/product/10.2.0/crs/bin/ocrconfig-replace ocr / dev/raw/raw12
4. Check to see if the change is complete
[oracle@rac1 ~] $ocrcheck
Status of Oracle Cluster Registry is as follows:
Version: 2
Total space (kbytes): 802956
Used space (kbytes): 5640
Available space (kbytes): 797316
ID: 1379974702
Device/File Name: / dev/raw/raw12
Device/File integrity check succeeded
Device/File Name: / dev/raw/raw11
Device/File integrity check succeeded
Cluster registry integrity check succeeded
5. / etc/oralce/ocr.loc files can also be synchronized automatically
6. Replace the source OCR with an image
Ocrconfig-replace ocr
3. Application layer
-crs_stat
Crs_stat-ls to view the permission definition for each resource
Crs_stat-t to view the status of all current resources
-crs_start
Crs_start: start the resource according to the configuration of CRS PROFILE.
Crs_start-all
-crs_stop
Crs_stop: closing resources
Crs_stop-all
-nosctl
ONS (ORACLE notification service) is used to notify the client and server of changes.
/ home/oracle/product/10.2.0/crs/opmn/conf/ons.config is the configuration information
LOCALPROT is used for local listening, referring to the loopback address of 127.0.0.1
Remoteport is used for remote monitoring, address other than 127.0.0.1
Loglevel: level 1-9, missing is 3, the level used for ONS logging
Logfile: used with loglevel to define the log location of ONS, missing in $ORA_CRS_HOME/opmn/logs/opmn.log
Nodes and useocr: jointly decide which process nodes ONS daemon should communicate with with ONS daemon
Onsctl can stop, start, or call ONS and reload the configuration file
1. Check the status of the process at the OS level to see whether the ONS process is running normally.
Ps-aef | grep ons
2. Confirm the status of ONS service
Onsctl ping
Onsctl start/stop
-srvctl
1. Use the CONFIG option
Srvctl config database views databases registered in OCR
The srvctl config database-d ppzhu view data consists of those nodes
Rac1 ppzhu1 / home/oracle/product/10.2.0/db
Rac2 ppzhu2 / home/oracle/product/10.2.0/db
Srvctl config database-d ppzhu-a displays some detailed information
Srvclt config nodeapps-n rac1-a view the configuration of VIP
Srvctl config listener-n rac1 to check the name of the monitor
Srvctl config service-d cislive-a view the SERVICE in the node
2. ADD some objects
Srvctl add database-d ppzhu-o $ORACLE_HOME adds a new data to OCR
Srvctl add instance-d gaopeng-n rac1-I gaopeng1
3. Enable/disable starts and disables objects
By default, databases, instances, and services are all started automatically with the startup of CRS. You can turn off this feature.
Srvctl enable database-d ppzhu
Last line of srvctl config database-d ppzhu-a
(ENABLE FLAG: DB DISABLED, INST DISABLED ON ppzhu1 ppzhu2)
You can determine whether the execution is normal.
Turn off the automatic startup of an instance
Srvctl disable instance-d ppzhu-I ppzhu1
Turn off the automatic startup of a server on a node
Srvctl disable service-d ppzhu-s dw-I ppzhu1
View
[oracle@rac1] $srvctl config service-d ppzhu-a
Dw PREF: ppzhu1 AVAIL: ppzhu2 TAF: basic
Service dw is disabled on instance (s) ppzhu1.
4. Delete objects using remove
Use the remove command to delete just the definition information of the object in OCR
Delete an instance
Srvctl remove instance-d gaopeng-I gaopeng1
Delete database
Srvctl remove database-d gaopeng
5. Start\ stop object
Start and shut down the entire database
Srvctl start/stop database-d ppzhu
Start and shut down an instance
Srvctl start instance-d ppzhu-I ppzhu1-o mount
Srvctl stop instance-d ppzhu-I ppzhu1-o immediate
Start and shut down SERVICE
Srvctl start/stop service-d ppzhu
Srvctl start/stop service-d ppzhu-s dw-I ppzhu1
View SERVICE status
Srvctl status service-d ppzhu-v
6 、 TRACE SRVCTL
Just set up export SRVM_TRACE=TRUE.
Management of ASM in RAC:
1. Start ASM
$srvctl start asm-n clusnode1
2. Stop ASM
$srvctl stop asm-n clusnode1-o immediate
3. Add ASM information to OCR
$srvctl add asm-n clusnode1-I + ASM1-o / ora/ora10
4. When establishing ASM manually, establish a relationship with the instance so that ASM starts before starting DATABASE and shuts down the database cleanly before shutting down ASM
Srvctl modify instance-d TESTASM-I TESTASM2-s + ASM2
At this point, the study of "RAC commonly used management commands" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.