Oracle RAC Operation of the RAC DB with backup OCR and Votting

** Myself
Check the Status of the RAC DB
There are several ways to check the status of the RAC. The srvctl utility shows the current configuration and status of the RAC database.
srvctl config database -d ONLINE
mkondb1 ONLINE1 /oracle/product/db_1
mkondb2 ONLINE2 /oracle/product/db_1
srvctl status database -d ONLINE
Instance ONLINE1 is running on node mkondb1
Instance ONLINE2 is running on node mkondb2
-------------------------------------------------------------------------------------------------

Start/Stop All Instances with SRVCTL (All node)
Start/stop all the instances and their enabled services. I have included this step just for fun as a way to bring down all instances!
Start database
               srvctl start nodeapps -n mkondb1
               srvctl start nodeapps -n mkondb2
               srvctl start asm -n mkondb1
               srvctl start asm -n mkondb2
               srvctl start database -d ONLINE
 
Stop database
               
               srvctl stop database -d ONLINE
               srvctl stop asm -n mkondb1
               srvctl stop asm -n mkondb2
               srvctl stop nodeapps -n mkondb1
               srvctl stop nodeapps -n mkondb2
 
 
 

Start/Stop machine and database with SRVCTL (All node)
Start/stop all the instances and their enabled services. I have included this step just for fun as a way to bring down all instances!
Start machine of Rac database
 
               # Rac db is automatic start when machine is started up
 
 
Shutdown machine of Rac database   
               srvctl stop database -d ONLINE
               crs_ctl stop crs


-------------------------------------------------------------------------------------------------
Starting the Oracle RAC 10g Environment (1 node)
The first step is to start the node applications (Virtual IP, GSD, TNS Listener, and ONS). When the node applications are successfully started, then bring up the ASM instance. Finally, bring up the Oracle instance (and related services) and the Enterprise Manager Database console.
Start Node ONLINE1:
               srvctl start nodeapps -n mkondb1
               srvctl start asm -n mkondb1
               srvctl start instance -d ONLINE -i ONLINE1
 

Stopping the Oracle RAC 10g Environment (1 node)
The first step is to stop the Oracle instance. When the instance (and related services) is down, then bring down the ASM instance. Finally, shut down the node applications (Virtual IP, GSD, TNS Listener, and ONS).
Stop Node ONLINE1:
               srvctl stop instance -d ONLINE -i ONLINE1
               srvctl stop asm -n mkondb1
               srvctl stop nodeapps -n mkondb1
 

-------------------------------------------------------------------------------------------------
Starting listener Oracle RAC 10g Environment (1 node)
If listener down or not start automatic.
Start Node ONLINE1:
 
               lsnrctl start

Stopping listener the Oracle RAC 10g Environment (1 node)
If want to stop listener.
Stop Node ONLINE1:
 
               lsnrctl stop
 


-------------------------------------------------------------------------------------------------

Starting ASM Instance Oracle RAC 10g Environment (1 node)
If ASM instance down or not start automatic.
Start Node ONLINE1:
 
               srvctl start asm -n mkondb1
 

Stopping ASM Instance the Oracle RAC 10g Environment (1 node)
If want to stop ASM instance.
Stop Node ONLINE1:
               srvctl stop asm -n mkondb1
 

-------------------------------------------------------------------------------------------------

Start/Stop Database control Oracle RAC 10g
GUI browser for control database
http://atsdb01.aerothai.local:1158/em
emctl start dbconsole
emctl stop dbconsole
-------------------------------------------------------------------------------------------------
Test Connection Load balance and Fail over with not config TAF
In Session 1
sqlplus system/oracle@ONLINE
 
COLUMN instance_name    FORMAT a13
COLUMN host_name        FORMAT a9
COLUMN failover_method  FORMAT a15
COLUMN failed_over      FORMAT a11
 
SELECT
    instance_name
  , host_name
  , NULL AS failover_type
  , NULL AS failover_method
  , NULL AS failed_over
FROM v$instance
UNION
SELECT
    NULL
  , NULL
  , failover_type
  , failover_method
  , failed_over
FROM v$session
WHERE username = 'SYSTEM';

Another Session
srvctl stop instance -d ONLINE -i ONLINE1 -o abort

Go back Session 1 Again and rerun sql and see instance_name
SELECT
    instance_name
  , host_name
  , NULL AS failover_type
  , NULL AS failover_method
  , NULL AS failed_over
FROM v$instance
UNION
SELECT
    NULL
  , NULL
  , failover_type
  , failover_method
  , failed_over
FROM v$session
WHERE username = 'SYSTEM';
 
 

Backup/Restore OCR
Doc ID: Note:279793.1
Subject: How to Restore a Lost Voting Disk in 10g
### OCR is backed up automatically by Oracle Clusterware every 4 hours (on the OCR Master node) to ORA_CRS_HOME/cdata/crs
ocrconfig –showbackup
ocrconfig –replace
ocrconfig -replace ocr destination_file or disk
ocrconfig -replace ocrmirror destination_file or disk

Doc ID: Note:268937.1
Subject: Repairing or Restoring an Inconsistent OCR in RAC

Backup/Restore Votedisk
Backup only one voting disk by dd in case of
- after oracle crs installation
- after node add or del
- can be done online
Check voting disk
crsctl query css votedisk
Backup
dd if=/dev/rdisk/disk33 of=/oracle/product/db_1/voteback1_4k.dd bs=4k
- or -
dd if=/dev/rdisk/disk33 of=/oracle/product/db_1/voteback1.dd
Restore by dd
 

0 comments:

Loading