################################################################
# Oracle Clusterware Commands release 11.1
################################################################
Command Description:
crs_getperm    Lists the permissions associated with a resource.
crs_profile       Creates, validates, deletes, and updates an Oracle Clusterware application profile
crs_register     Registers configuration information for an application with the OCR.
crs_relocate 
  Relocates an application profile to another node.
crs_setperm    Sets permissions associated with a resource.
crs_stat           Lists the status of an application profile.
crs_start          Starts applications that have been registered.
crs_stop           Stops an Oracle Clusterware application.
crs_unregister  Removes the configuration information for an application profile from the OCR.



################################################################
#  S T A R T - S T O P - S T A T U S   O R A C L E  C L U S T E R
################################################################
--To stop or start oracle clusterware on a node in a managed fashion:
-- as root account
/etc/init.d/init.crs [stop|start]
--or
[root@node1 root]# crsctl stop crs

--To disable the oracle cluster so it doesn't attempt to start after a reboot, or
--to ensure that it will be started automatically on boot:
/etc/init.d/init.crs [disable|enable]
--or
[root@node1 root] # crsctl enable crs


--As the oracle user on docrac1, check the status of the Oracle Clusterware
/crs/bin/crs_stat -t

--Verify that Oracle Clusterware is running on the node
[root@node1 root] #crsctl check crs

--Check the status of an individual Oracle Clusterware daemon using the following
--syntax, where daemon is crsd, cssd, or evmd:
[root@node1 root] # crsctl check daemon

-- Check the existence and the location of Voting Disk
[root@node1 root] # crsctl query  css votedisk

##Cluster Verification Utility (CVU) to verify the OCR integrity. Run the
--following command, where the -n all argument retrieves a list of all the cluster
--nodes that are configured as part of your cluster:
[root]# cluvfy comp ocr -n all [-verbose]

##You use the CVU comp nodeapp command to verify the existence of node
--applications, namely the virtual IP (VIP), Oracle Notification Services (ONS), and
--Global Service Daemon (GSD), on all the nodes.
[root]# cluvfy comp nodeapp [ -n node_list] [-verbose]

##To check the settings for the interconnect:
--1. In a command window, log in to the operating system as the root user.
--2. To verify the accessibility of the cluster nodes, specified by node_list, from the
--local node or from any other cluster node, specified by srcnode, use the
--component verification command nodereach as follows:
[root]# cluvfy comp nodereach -n node_list [ -srcnode node ] [-verbose]

##To verify the connectivity among the nodes through specific network interfaces,
[root]# cluvfy comp nodecon -n node_list -i interface_list [-verbose]
[root]# cluvfy comp nodecon -n docrac1, docrac2, docrac3 -i eth0 -verbose


###Oracle Clusterware Diagnostics Collection Script
--The diagnostics provide additional information so that Oracle Support Services
--can resolve problems. It displays the status of the Cluster Synchronization
--Services (CSS), Event Manager (EVM), and the Cluster Ready Services (CRS) daemons

[root@node1 root] # CRS_home/bin/diagcollection.pl --collect

################################################################
#  DEBUGGING OF ORACLE CLUSTERWARE COMPONENTS
################################################################
--1. In a command window, log in to the operating system as the root user.
--2. Use the following command to obtain the module names for a component, where
--component_name is crs, evm, css or the name of the component for which you
--want to enable debugging:
# crsctl lsmodules component_name

--For example, viewing the modules of the css component might return the following results:
# crsctl lsmodules css
The following are the CSS modules ::
CSSD
COMMCRS
COMMNS

--3. Use CRSCTL as follows, where component_name is the name of the Oracle
--Clusterware component for which you want to enable debugging, module is the
--name of module, and debugging_level is a number from 1 to 5:
# crsctl debug log component module:debugging_level

For example, to enable the lowest level of tracing for the CSSD module of the css
component, you would use the following command:
# crsctl debug log css CSSD:1

--4. After you have obtained the needed trace information, disable debugging by
--setting the debugging_level to 0 for the module, as shown in the following
example.
# crsctl debug log css CSSD:0

################################################################
# OLSNODES and OIFCFG utility
################################################################
--The OLSNODES command provides the list of nodes and other information
--for all nodes participating in the cluster

olsnodes [-n] [-i] [-l] [-v] [-g] [-p]

-g Logs cluster verification information with more details.
-i Lists all nodes participating in the cluster and includes the Virtual Internet
Protocol (VIP) address assigned to each node.
-l Displays the local node name.
-n Lists al nodes participating in the cluster and includes the assigned node
numbers.
-p Lists all nodes participating in the cluster and includes the private interconnect
assigned to each node.
-v Logs cluster verification information in verbose mode.

-----------------------------------------------------------------------------------
--Before you invoke OIFCFG, ensure that you have started Oracle Clusterware on at
--least the local node and preferably on all nodes if you intend to include the -global
--option on the command.

OIFCFG


################################################################
# SRVCTL Utility for OCR management
################################################################
--Using srvctl the standard tool for stopping and starting services.  The most used commands are
srvctl [stop|start] database -d DBNAME
srvctl [stop|start] instance -d DBNAME -i SID
srcvtl [stop|start] nodeapps -n HOSTNAME

--example
./srvctl status asm -n docrac1
ASM instance +ASM1 is running on node docrac1.
  
--Stop all the node applications running in a Oracle Clusterware: ASM instance, RAC instances
--node_name is the name of the node:
$ CRS_home/crs/bin/srvctl stop nodeapps -n node_name  

--Stop Oracle Clusterware using
[root]# CRS_home/bin/crsctl stop crs

################################################################
#                   V O T I N G  -  D I S K S
################################################################

################################
#Backup / Restore VOTING Disk
################################

dd if=voting_disk_name of=backup_file_name

--Backup Example Using RAW Devices
dd if=/dev/sdd1 of=/tmp/voting.dmp

--Restore Example Using RAW Devices
dd if=backup_file_name of=voting_disk_name

-- P.S.
--When you use the dd command for making backups of the voting disk, the backup can
--be performed while the Cluster Ready Services (CRS) process is active; you do not
--need to stop the crsd.bin process before taking a backup of the voting disk.

################################################################

################################
# Adding/Removing Voting Disk using: crsctl
################################

--Adding Voting Disks
crsctl add css votedisk path


-Removing Voting Disks
crsctl delete css votedisk path

--P.S.
--You can dynamically add and remove voting disks after installing Oracle RAC.
--If your cluster is down, then you can use the -force option to
--modify the voting disk configuration when using either of these
--commands without interacting with active Oracle Clusterware
--daemons. However, you may corrupt your cluster configuration if
--you use the -force option while a cluster node is active.


################################################################
#                 O R A C L E  C L U S T E R  R E G I S T R Y
################################################################

--Oracle RAC environments do not support
--more than two OCRs, a primary OCR and a secondary OCR.

####################################
#Viewing Available OCR and Backups
####################################

--Show the availability of Primary and Secondary OCR files
ocrcheck

--Show the availability of backup copies
ocrconfig -showbackup


################################
#Backup / Restore OCR File
################################

--------------
##Backup OCR
--------------
--Oracle Clusterware automatically creates OCR backups every 4 hours.
--The default location for generating backups on Red Hat Linux
--systems is CRS_home/cdata/cluster_name

--Export the dump file of OCR
[root]# ocrconfig -export backup_file_name


--Check the status of the OCR:
ocrcheck

--P.S.
--If this command does not display the message 'Device/File integrity check succeeded'
-- for at least one copy of the OCR, then both the primary OCR and the
-- OCR mirror have failed. You must restore the OCR from a backup.

-------------------------------------------
##Restore OCR using automated Backup file
-------------------------------------------
--1. list the available backup files
[root]# ocrconfig -showbackup

--2. Review the contents of the backup using ocrdump command, where
--file_name is the name of the OCR backup file:
[root]# ocrdump -backupfile file_name

--3. As the root user, stop Oracle Clusterware on all the nodes in your Oracle RAC cluster
--Repeat this command on each node in your Oracle RAC cluster!
[root]# crsctl stop crs


--4. As the root user, restore the OCR by applying an OCR backup file that you
--identified in Step 1
[root]# ocrconfig -restore file_name

--5. Restart Oracle Clusterware on all the nodes in your cluster by
--restarting each node, or by running the following command:
[root]# crsctl start crs

--6. Use the Cluster Verification Utility (CVU) to verify the OCR integrity. Run the
--following command, where the -n all argument retrieves a list of all the cluster
--nodes that are configured as part of your cluster:
[root]# cluvfy comp ocr -n all [-verbose]

-------------------------------------------
##Restore OCR using Export file
-------------------------------------------
--1. As the root user, stop Oracle Clusterware on all the nodes in your Oracle RAC cluster
--Repeat this command on each node in your Oracle RAC cluster!
[root]# crsctl stop crs

--2. As the root user, restore the OCR data by importing the contents of the OCR export file
[root]# ocrconfig -import file_name

--3. Restart Oracle Clusterware on all the nodes in your cluster by
--restarting each node, or by running the following command:
[root]# crsctl start crs

--4. se the Cluster Verification Utility (CVU) to verify the OCR integrity. Run the
--following command, where the -n all argument retrieves a list of all the cluster
--nodes that are configured as part of your cluster:
[root]# cluvfy comp ocr -n all [-verbose]


################################################
# To add a primary or secondary OCR location
################################################

--1. Use the following command to verify that Oracle Clusterware is running on the
--node on which the you are going to perform the replace operation:
crsctl check crs

--2. Run the following command as root using either destination_file or disk to
--designate the target location of the primary OCR:
ocrconfig -replace ocr destination_file
ocrconfig -replace ocr disk

--3. Run the following command as root using either destination_file or disk to
--designate the target location of the secondary OCR:
ocrconfig -replace ocrmirror destination_file
ocrconfig -replace ocrmirror disk

--4. If any node that is part of your current Oracle RAC cluster is shut down, then run
--the following command on the stopped node to let that node rejoin the cluster
--after the node is restarted:
ocrconfig -repair ocr [device_name]

########################
# Removing an OCR
########################

--To remove an OCR location, at least one OCR must be online. You can remove an OCR
--location to reduce OCR-related overhead or to stop mirroring your OCR because you
--moved the OCR to a redundant storage system, such as a redundant array of
--independent disks (RAID).
--To remove an OCR location from your Oracle RAC cluster:

--1. Use the OCRCHECK utility to ensure that at least one OCR other than the OCR
--that you are removing is online.
ocrcheck

--2. Run the following command on any node in the cluster to remove one copy of the OCR:
ocrconfig -replace ocr

 

 

   
 
  Site Map