Detailed descriptions of crsctl, ocrcheck, ocrdump, and ocrconfig commands at the RAC cluster Layer

Source: Internet
Author: User
Tags cdata


The crsctl, ocrcheck, ocrdump, and ocrconfig commands on the RAC cluster layer are detailed. The cluster layer is a core cluster composed of Clusterware, which maintains the shared devices in the cluster, and provides a complete cluster Status view for the Application cluster. The application cluster is adjusted based on this view. There are four commands for this layer: crsctl, ocrcheck, ocrdump, and ocrconfig. The last three are for OCR disks. The CrsctlCrsctl command can be used to check the CRS process stack, the status of each crs process, manage Votedisk, and track the CRS process. Www.2cto.com [root @ rac1 bin] #. /crsctl 3.1.1 check the crs status [root @ rac1 bin] #. /crsctl check crs Cluster Synchronization Services appears healthy Cluster Ready Services appears healthy Event Manager appears healthy-check a single status [root @ rac1 bin] #. /crsctl check cssd CSS appears healthy [root @ rac1 bin] #. /crsctl check crsd CRS appears healthy [root @ rac1 bin] #. /crsctl check evmd EVM appears healthy www.2cto.com 3. 1.2 configure the crs stack to enable the CRS process stack. By default, the crs process stack is started with the operating system. Sometimes you need to disable this feature for maintenance purposes. You can use the root user to execute the following command. [Root @ rac1 bin] #. /crsctl disable crs [root @ rac1 bin] #. the/crsctl enable crs Command actually modifies the content in the file/etc/oracle/scls_scr/raw/root/crsstart. 3.1.3 start. When stopping the crs stack in Oracle 10.1, you must restart Clusterware by restarting the system. However, starting from Oracle 10.2, you can run commands to start and stop CRS. -Start CRS: [root @ rac1 bin] #. /crsctl start crs Attempting to start CRS stack The CRS stack will be started shortly-Disable CRS: [root @ rac1 bin] #. /crsctl stop crs Stopping resources. successfully stopped CRS resources Stopping CSSD. shutting down CSS daemon. shutdown request successfully issued. 3.1.4 view the location of the votedisk [root @ rac1 bin] #. /crsctl query css votedisk 3.1.5 view and modify crs parameters-view parameters: Use get [root @ rac1 bin] #./ Crsctl get css misscount 60-Modify parameter: Use set, but use this function with caution [root @ rac1 bin] #. /crsctl set css miscount 60 3.1.6 tracks the crs module and provides auxiliary functions. CRS consists of three services: CRS, CSS, and EVM. Each Service is composed of a series of modules, crsctl allows each module to be tracked and recorded in logs. [Root @ rac1 bin] #. /crsctl lsmodules css [root @ rac1 bin] #. /crsctl lsmodules evm-tracking CSSD module, which must be executed by the root user: [root @ rac1 bin] #. /crsctl debug log css "CSSD: 1" Configuration parameter trace is now set to 1. set CRSD Debug Module: CSSD Level: 1-view the trace log [root @ rac1 cssd] # pwd/u01/app/oracle/product/crs/log/rac1/cssd [root @ rac1 cssd] # more ocssd. log... 3.1.7 when maintaining votedisk to install Clusterware graphically, if you select the External Redundancy policy When configuring Votedisk, you can only enter one Votedisk. However, even if External Redundancy is used as the Redundancy policy, multiple vodedisks can be added, but they must be added using the crsctl command. After multiple votedisks are added, these votedisks are mutually mirrored, it can prevent spof of Votedisk. It should be noted that Votedisk uses a "majority of available algorithms". If there are multiple votedisks, more than half of the votedisks must be used at the same time for Clusterware to work properly. For example, if four votedisks are configured and one Votedisk is broken, the cluster can work normally. If two votedisks are broken, more than half of them cannot be met. The cluster will be down immediately and all nodes will be restarted immediately, therefore, if you add a Votedisk, try not to add only one disk, but to add two disks. This is different from OCR. Only one OCR configuration is required. It is dangerous to add or delete a Votedisk. You must stop the database, ASM, CRS Stack, and-force. 1) view the current configuration [root @ rac1 bin] #. /crsctl query css votedisk 2) Stop CRS on all nodes: [root @ rac1 bin] #. /crsctl stop crs 3) add Votedisk [root @ rac1 bin] #. /crsctl add css votedisk/dev/raw/rac1-force Note: even after CRS is disabled, you must use the-force parameter to add and delete Votedisk, the-force parameter is only used when the CRS is disabled. Otherwise, the following message is displayed: Cluter is not a ready state for online disk addition. 4) confirm the added information: [root @ rac1 bin] #. /crsctl query css votedisk 5) Start CRS [root @ rac1 bin] #. /crs Ctl start crs 3.2 ocr command series Oracle Clusterware puts the configuration information of the entire cluster on shared storage, which is OCR Disk. in the entire cluster, only one Node can perform read and write operations on the OCR Disk. This Node is called the Master Node and all nodes will keep an OCR copy in the memory, at the same time, an OCR Process reads content from this memory. When the OCR content changes, the OCR Process of the Master Node is responsible for synchronizing the OCR Process to other nodes. Because OCR content is so important, Oracle backs up it every four hours, and retains the last three backups, And the last backup of the previous day and previous week. This backup is completed by the Master Node CRSD process. The default backup location is under the $ CRS_HOME \ crs \ cdata \ <cluster_name> directory. After each backup, the backup file name is automatically changed to reflect the backup time sequence. The last backup is called backup00.ocr. In addition to local backup files, DBA should keep one copy of the backup files on other storage devices to prevent accidental storage failures. 3.2.1 ocrdump this command can print OCR content in ASCII format, but this command cannot be used for OCR backup and recovery. That is to say, the generated files can only be used for reading but not for restoration. Command Format: ocrdump [-stdout] [filename] [-keyname name] [-xml] parameter description:-stdout: print the content and output it to the Filename: output content to the file-keyname: print only a key and its Child content-xml: print the output sample in xml format: Use the system.css key content. output to the screen in xml format [root @ rac1 bin] #. /ocrdump-stdout-keyname system.css-xml | more ...... This command generates a log file in the $ CRS_HOME \ log \ <node_name> \ client Directory during execution. The file name is ocrdump _ <pid>. log. If a problem occurs during command execution, you can view the cause of the problem from this log. 3.2.2 The ocrcheckOcrcheck command is used to check the consistency of OCR content. The ocrcheck_pid.log file is generated in the $ CRS_HOME \ log \ nodename \ client Directory during command execution. This command does not require parameters. [Root @ rac1 bin] #./ocrcheck 3.2.3 ocrconfig this command is used to maintain the OCR disk. During clusterware installation, if you select External Redundancy mode, you can enter only one OCR disk location. However, Oracle allows you to configure two OCR disks to mirror each other to prevent single point of failure of the OCR disk. The OCR disk is different from the Votedisk disk. The OCR disk can have only one Primary OCR and one Mirror OCR. [Root @ rac1 bin] #. /ocrconfig-help-view self-help backup [root @ rac1 bin] #. /ocrconfig-showbackup by default, OCR is automatically backed up in the $ CRS_HOME \ CRS \ CDATA \ cluster_name directory, you can use the ocrconfig-backuploc <directory_name> command to modify to the new directory 3.2.4 for export. Import to back up and restore Oracle. We recommend that you adjust the cluster, such as adding or deleting nodes, you should back up the OCR file by using export. If replace or restore is performed, we recommend that you use the cluvfy comp ocr-n all command to perform a comprehensive check. This command is in the installation software of clusterware. 1) First, disable CRS [root @ rac1 bin] #. /crsctl stop crs 2) use the root user to export the OCR content [root @ rac1 bin] #. /ocrconfig-export/u01/ocr. exp 3) Restart CRS [root @ rac1 bin] #. /crsctl start crs 4) Check the CRS status [root @ rac1 bin] #. /crsctl check crs CSS appears healthy CRS appears healthy EVM appears healthy 5) destroys OCR content [root @ rac1 bin] # dd if =/dev/zero f =/dev/raw/rac1 bs = 1024 count = 102400 102400 + 0 records in 102400 + 0 records out 6) check OCR 1 [Root @ rac1 bin] #. /ocrcheck PROT-601: Failed to initialize ocrcheck 7) use the cluvfy tool to check consistency [root @ rac1 cluvfy] #. /runcluvfy. sh comp ocr-n all Verifying OCR integrity Unable to retrieve nodelist from Oracle clusterware. verification cannot proceed. 8) use Import to restore OCR content [root @ rac1 bin] #. /ocrconfig-import/u01/ocr. exp 9) Check OCR again [root @ rac1 bin] #. /ocrcheck 10) use the cluvfy tool to check [root @ rac1 cluvfy] #. /runcluvf Y. sh comp ocr-n all www.2cto.com 3.2.5 move ocr file location example: Move OCR from/dev/raw/rac1 to/dev/raw/raw3. 1) check whether there is an OCR backup [root @ rac1 bin] #. /ocrconfig-showbackup if there is no backup, you can immediately execute an export as a backup: [root @ rac1 bin] #. /ocrconfig-export/u01/ocrbackup-s online 2) view the current OCR configuration [root @ rac1 bin] #. /ocrcheck 3) Add a Mirror OCR [root @ rac1 bin] #. /ocrconfig-replace ocrmirror/dev/raw/raw4 4) confirm the addition is successful [root @ rac1 bin] #. /ocrcheck 5) change the primary OCR position [root @ rac1 bin] #. /ocrconfig-replace ocr/dev/raw/raw3 confirm the modification is successful: [root @ rac1 bin] #. /ocrcheck 6) use the ocrconfig command to modify the/etc/oracle/ocr on all RAC nodes. the content of the loc file is also automatically synchronized. If the file is not automatically synchronized, You can manually change it to the following content. [Root @ rac1 bin] # more/etc/oracle/ocr. loc ocrconfig_loc =/dev/raw/rac1 ocr1_config_loc =/dev/raw/raw3 local_only = FALSE

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.