Views

Showing posts with label RAC. Show all posts
Showing posts with label RAC. Show all posts

Saturday, December 9, 2017

RAC - Convert an Admin Managed RAC Database to Policy Managed for 11gR2 database

Convert an Admin Managed RAC Database to Policy Managed for 11gR2 database

Check the current pool status

[oracle@o1 dbs]$ srvctl config database -d RAC
Database unique name: RAC
Database name: RAC
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/RAC/spfileRAC.ora
Domain: localdomain
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: RAC
Database instances: RAC1,RAC2
Disk Groups: DATA
Mount point paths:
Services:
Type: RAC
Database is administrator managed

Check the status of server pool.

[oracle@o1 dbs]$ srvctl status srvpool -a
Server pool name: Free
Active servers count: 0
Active server names:
Server pool name: Generic
Active servers count: 2
Active server names: o1,o2
NAME=o1 STATE=ONLINE
NAME=o2 STATE=ONLINE

Stop database -

[oracle@o1 dbs]$ srvctl stop database -d RAC

Create a server pool for the policy managed database.

[oracle@o1 dbs]$ srvctl add srvpool -g SrvPool1 -l 1 -u 2

-l refers to Minimum size of the server pool
-u refers to Maximum suze if the server pool

Modify the admin database to the new server pool

[oracle@o1 dbs]$ srvctl modify database -d RAC -g SrvPool1

Verify the status of the server pool

[oracle@o1 dbs]$ srvctl status srvpool -a
Server pool name: Free
Active servers count: 0
Active server names:
Server pool name: Generic
Active servers count: 0
Active server names:
Server pool name: SrvPool1
Active servers count: 2
Active server names: o1,o2
NAME=o1 STATE=ONLINE
NAME=o2 STATE=ONLINE

Verify the status of the database to confirm the conversion to a policy managed database

[oracle@o1 dbs]$ srvctl config database -d RAC
Database unique name: RAC
Database name: RAC
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/RAC/spfileRAC.ora
Domain: localdomain
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: SrvPool1
Database instances:
Disk Groups: DATA
Mount point paths:
Services:
Type: RAC

Database is policy managed

Tuesday, December 5, 2017

RAC - Create spfile from pfile for RAC instances

Create spfile from pfile for RAC instances

The pfile is present at /u01/app/oracle/product/11.2.0/dbhome_1/dbs/initRAC.ora.
We will first start RAC with this pfile and create new spfile in ASM and restart RAC with new spfile.
Steps performed as under:

Stop the cluster.

[oracle@o1 dbs]$ srvctl stop database -d RAC
[oracle@o1 dbs]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       o1                                          
               ONLINE  ONLINE       o2                                          
ora.LISTENER.lsnr
               ONLINE  ONLINE       o1                                           
               ONLINE  ONLINE       o2                                          
ora.asm
               ONLINE  ONLINE       o1                       Started            
               ONLINE  ONLINE       o2                       Started             
ora.gsd
               OFFLINE OFFLINE      o1                                          
               OFFLINE OFFLINE      o2                                          
ora.net1.network
               ONLINE  ONLINE       o1                                           
               ONLINE  ONLINE       o2                                          
ora.ons
               ONLINE  ONLINE       o1                                          
               ONLINE  ONLINE       o2                                           
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       o1                                          
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       o1                                          
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       o1                                          
ora.cvu
      1        ONLINE  ONLINE       o1                                          
ora.o1.vip
      1        ONLINE  ONLINE       o1                                           
ora.o2.vip
      1        ONLINE  ONLINE       o2                                          
ora.oc4j
      1        ONLINE  ONLINE       o1                                          
ora.rac.db
      1        OFFLINE OFFLINE                               Instance Shutdown  
      2        OFFLINE OFFLINE                               Instance Shutdown  
ora.scan1.vip
      1        ONLINE  ONLINE       o1                                          
ora.scan2.vip
      1        ONLINE  ONLINE       o1                                          
ora.scan3.vip
      1        ONLINE  ONLINE       o1  

Mount one db instance.

[oracle@o1 dbs]$ . oraenv
ORACLE_SID = [+ASM1] ? RAC1

SQL> startup mount pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initRAC.ora';

SQL> select INSTANCE_NAME,HOST_NAME,STATUS from v$instance;

INSTANCE_NAME   HOST_NAME       STATUS     
--------------  -------------------- ------------
RAC1            o1.localdomain       MOUNTED


Create spfile from pfile.


SQL> create spfile='+DATA/RAC/spfileRAC.ora' from pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initRAC.ora';

SQL> exit


Check in ASM if new spfile has been created.

[oracle@o1 dbs]$ . oraenv
ORACLE_SID = [RAC1] ? +ASM1

[oracle@o1 dbs]$ asmcmd
ASMCMD> cd DATA
ASMCMD> cd RAC
ASMCMD> ls -l
Type  Redund  Striped  Time Sys  Name
                            Y    CONTROLFILE/
                            Y    DATAFILE/
                            Y    ONLINELOG/
                            Y    PARAMETERFILE/
                            Y    TEMPFILE/
                            N    spfileRAC.ora => +DATA/RAC/PARAMETERFILE/spfile.268.961984543
ASMCMD> exit

Restart the cluster.

[oracle@o1 dbs]$ srvctl stop database -d RAC

[oracle@o1 dbs]$ srvctl start database -d RAC

Check for new parameter file.
    
[oracle@o1 dbs]$ . oraenv
ORACLE_SID = [+ASM1] ? RAC1

SQL> show parameter spfile

NAME         TYPE VALUE
------------ ----------- ------------------------------

spfile            string  +DATA/rac/spfilerac.ora

Thursday, September 14, 2017

RAC - Voting Disk

Voting Disk

Voting disk is a shared file used by clusterware for various functions. Primary purpose of voting disk is node membership. It contains information about all the nodes in the cluster. Clusterware uses voting disk to decide whether a node is part of the cluster. Every node writes 2 types of heartbeats in voting disk. 1. Disk heartbeat 2. Network heartbeat. If the node is able to communicate with node master it will put disk heartbeat. If the node is able to communicate with other nodes of the cluster, it will put network heartbeat. If CSSD is able to see both the heartbeat of a node in voting disk, it means the node is healthy. If any of the heartbeat is missing, there is some error. If disk heartbeat is missing, cssd updates kill block of node. Kill block of node is checked every second. Till 11gr1, voting disk was placed on raw device. From 11gr2, its mandatory to put voting disk on ASM storage.  It creates one more issue. If a node is coming up, it needs to read voting disk, but asm cant be up until node is up. So how will it read the voting disk. There is a solution to this issue. Once asm is up, cluster puts voting disk information at a fixed location and the location is put in asm disk header. So even if asm is not up, cluster can read voting disk. Till 11gr1, voting disk had to be backed up separately. From 11gr2, voting disk as it resides in asm, is backed up automatically with disk backup. We should always keep odd number of voting disk. There is a reason for it. At any point of time any node in cluster should be able to access more than half number of total voting disks. [Number of voting disk - failure tolerated, 1 –> 0, 2   –> 0, 3 –> 1, 4 –> 1, 5 –> 2, 6 –> 2, 2n-1 –> n, 2n -> n] As for 2n-1 and 2n number of voting disks, failure is n, then it’s better to keep 2n-1 voting disk instead of keeping one redundant voting disk. So, we always keep odd number of voting disks. We can keep maximum of 15 voting disk, minimum of 3. Oracle recommends not more than 5. The size of voting disk is usually 280mb. The number of voting disk will be decided on the asm disk redundancy we are using.  We can query voting disk by (crsctl query css votedisk)

[oracle@testing ~]$ crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   53e5e46930f14f0ebfdc49abfed65701 (/dev/raw/raw11) [OCRVD]
 2. ONLINE   2dd1ebe0dc1f4feabf3545c3f589d407 (/dev/raw/raw12) [OCRVD]
 3. ONLINE   74814e9a48d14fc1bfc48ec5afc75b90 (/dev/raw/raw13) [OCRVD]


Located 3 voting disk(s).