Sunday, February 25, 2018

Clusterware Exclusive Mode to restore OCR

9:58 AM Posted by Dilli Raj Maharjan , No comments

We execute crsctl start crs command as OS user root to start Oracle High Availability Service on the local server. We can invoke crsctl command in exclusive mode to perform exclusive cluster maintenance task as restoring OCR and VDs, troubleshooting root.sh and so on. While starting cluster in exclusive mode we need to stop cluster stack from all other nodes in the cluster. Starting Cluster in exclusive mode do not requires VD and network.

Following is the syntax.
crsctl start crs [-excl [-nocrs] [-cssonly]] | [-wait | -waithas | -nowait] | [-noautostart]

-excl Starts clusterware in exclusive mode
-nocrs Starts Clusterware with out CRS
-cssonly Starts CSS only

-wait Wait until the crs started completely and display all progress and status
-waithas Wait until startup is completed and display OHASD progress and status
-nowait Not to wait for OHASD to start

-noautostart Start only OHASD.

I am unable to start crs in my two node rac (rac01, rac02).  While digging more I came to know that OCR file is missing.


Trying to start crs normally from rac01.
./crsctl start crs



Few minutes later, I check the status of the crs 
./crsctl stat res -t



Checking the crs with crsctl check crs command and notice that CRS is not up, css is online and evmd is also not working.
./crsctl check crs



Checking the status of ocrfile but no luck.
./ocrcheck



Use adrci to find the diagnostic location and crs logs.
adrci
show homes



Checking alert file.
cd /u01/app/oracle/diag/crs/rac01/crs
tail -f alert.log



On accessing trace file it is noticed that OCR file is marked as unavailable.
cat /u01/app/oracle/diag/crs/rac01/crs/trace/crsd.trc 



Trying to stop crs on rac01 on which we have started crs previously.
./crsctl stop crs



Since stopping crs failed, -f option is used to stop crs forcefully.
 ./crsctl stop crs -f



Stopping crs on rac02 so that crs stack is not started on any node of the cluster.
./crsctl stop crs -f



Start Cluster stack on exclusive mode without crs -nocrs option.
./crsctl start crs -excl -nocrs



List the details of ocr backup files.
 ./ocrcheck -showbackup



Accessing the location of OCR file we noticed that backup file is already created on the location.
asmcmd
ls
cd DATA
cd rac-cluster
cd OCRBACKUP
ls



Restore OCR file with the command below and stop the crs that has been started on exclusive mode.
./ocrconfig -restore  +FRA:/rac-cluster/OCRBACKUP/backup00.ocr.257.968870687
./crsctl stop crs



Start CRS normally.
 ./crsctl start crs



Verify CRS file on ASM storage.
cd +DATA/rac-cluster/OCRFILE
ls



Verify crs status on the node.
./crsctl stat res -t


Now the OCR file is restored successfully.  We can start crs on another node too.

Additional OCR file integrity verification commands:
#ocrcheck
$ocrcheck -config
$ocrcheck -local -config
$cluvfy comp ocr -n all -verbose
$cluvfy comp ocr -n rac01 -verbose
$cluvfy comp ocr -n rac02 -verbose















Tuesday, February 6, 2018

Install Oracle 12c R2 RAC database

8:03 AM Posted by Dilli Raj Maharjan No comments

Once Oracle Grid Infrastructure 12c R2 installation completes successfully. 
Extract the Oracle Database source at appropriate location. Change directory to the source and execute 
./runInstaller


Below is the landing page once you execute the runInstaller.


Uncheck option I wish to receive security updates via My Oracle Support. Click on Next > to continue.

Warning message will be pop up Click on Yes to continue. 


Select Create and configure a database and Click on Next > to continue.


Select Server class and Click on Next > to continue.


Select Oracle Real Application Cluster database installation. Click on Next > to continue.


Select Admin managed and Click on Next > to continue.


Make sure that rac01 and rac02 are selected and Click on Next > to continue.


Select Advanced Install option. Click on Next > to continue.


Select Enterprise Edition (7.5GB) Click on Next > to continue.


Browse and choose appropriate Oracle base and Software location. Click on Next > to continue.


Choose required database template. Click on Next > to continue.


Specify database identifiers and choose either database need to create as container database. If yes then provide pluggable database name. Click on Next > to continue.


Enabling Automatic Memory Management may result error if physical memory is greater than 4GB. Following error message will be displayed in that case.





Make sure you do not enable Automatic memory management. Click on Character sets tab to change character sets.

Choose required character set. Click on Sample schemas tab if you need sample schemas.


Select Install sample schemas in the database option if we need sample schemas to be installed on database.  Click on Next > to continue.


Select appropriate Database Storage Options.  Click on Next > to continue.


If we have EM cloud control already installed on our environment then we can specify the details of EM cloud control. Otherwise make sure this option is not selected.  Click on Next > to continue.


If we need to enable recovery options then select this option and specify the storage location for recovery.  Click on Next > to continue.


Select required disk group name to install Oracle database.  Click on Next > to continue.



Enter password for administrative accounts.  Click on Next > to continue.


Provide appropriate OS groups.  Click on Next > to continue.


Prerequisite Checks in progress.

Prerequisite failed due to insufficient total swap space. In my case swap space is not sufficient. I have option to increase swap space or Ignore it. Click on Ignore All to ignore.

Once prerequisite failed has been ignored, click on Next > to continue.

 
Warning message will be pop up. Click on Yes to continue.


Summary screen will be displayed. Click on Install to begin installation.


Installation on progress. #####


Installation on progress. ##########


Execute Configuration Scripts window will be pop up. Execute script on rac01 and rac02.




Once script execution completes Click on OK to continue.



Once installation completes Click on Close to close the window.