Guenadi N Jilevski's Oracle BLOG

Oracle RAC, DG, EBS, DR and HA DBA BLOG

Oracle 11g R2 (11.2.0.2) RAC One Node management

Oracle 11g R2 11.2.0.2 RAC One Node management

In Oracle 11gR2 11.2.0.2 RAC One Node database creation and management is simplified. The traditional srvctl utility used to manage RAC databases now can natively manage RAC One Node databases as well. Another enhancement in 11.2.0.2 is the ability to easy create RAC One Node database using dbca utility as specified here. To recount, prior to Oracle 11gR2 11.2.0.2 patch 9004119 had to be applied to provide the utilities for Oracle RAC One Node management as described here. Starting with Oracle 11gR2 11.2.0.2 srvctl utility adds features to relocate RAC One Node database to another server or to convert between Oracle RAC database and Oracle RAC One Node database.

In this article we will look at managing RAC One Node databases using the srvctl utility for relocation to another server and for conversion between Oracle RAC and Oracle RAC One Node database.

Let’s set Transparent Application Failover (TAF) service

Create an entry in tnsnames.ora as follows.

 

 


RONETAF =

  (DESCRIPTION =

    (ENABLE = BROKEN)

    (LOAD_BALANCE = OFF)

    (FAILOVER = ON)

    (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan)(PORT = 1521))

      (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = RONE)

      (FAILOVER_MODE =

        (TYPE = SELECT)

        (METHOD = BASIC)

        (BACKUP = RONE)

      )

    )

  )

 

 

 

 

 

 

Relocate a RAC One Node database instance to another server from the list of candidate servers.

In this example we will use RONE RAC One Node database running on raclinux2 node and with candidate servers defined as raclinux1 and raclinux2, that is, the RONE can be relocated between raclinux1 and raclinux2.

 

 


[oracle@raclinux2 admin]$ srvctl status database -d rone

Instance RONE_1 is running on node raclinux2

Online relocation: INACTIVE

[oracle@raclinux2 admin]$ srvctl config database -d rone

Database unique name: RONE

Database name: RONE

Oracle home: /u01/app/oracle/product/11.2.0/db_20

Oracle user: oracle

Spfile: +DATA/RONE/spfileRONE.ora

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: RONE

Database instances:

Disk Groups: DATA

Mount point paths:

Services: RACONE

Type: RACOneNode

Online relocation timeout: 30

Instance name prefix: RONE

Candidate servers: raclinux2,raclinux1

Database is administrator managed

[oracle@raclinux2 admin]$

 

 

 

 

 

Connect to the database using the TAF tnsnames.ora entry and run a query in one terminal session and relocate the instance to another candidate server while query is running in another terminal session

 

10pt;"> 

10pt;">[oracle@raclinux2 admin]$ sqlplus system/sys1@ronetaf

SQL*Plus: Release 11.2.0.2.0 Production on Tue Oct 5 14:21:50 2010

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

SQL> select * from gv$instance;

   INST_ID INSTANCE_NUMBER INSTANCE_NAME

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

HOST_NAME

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

VERSION           STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_WAIT

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

LOGINS     SHU DATABASE_STATUS   INSTANCE_ROLE      ACTIVE_ST BLO

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

         1               1 RONE_1

raclinux2.gj.com

11.2.0.2.0        05-OCT-10 OPEN         YES          1 STOPPED

ALLOWED    NO  ACTIVE            PRIMARY_INSTANCE   NORMAL    NO

SQL>

SQL> @/u03/testtaf.sql

 SID   SERIAL# FAILOVER_TYPE FAILOVER_METHOD FAILED_OVER

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

  37         7 SELECT        BASIC           NO

INSTANCE_NAME

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

RONE_1

  COUNT(*)

----------

    628628

 SID   SERIAL# FAILOVER_TYPE FAILOVER_METHOD FAILED_OVER

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

  53         3 SELECT        BASIC           YES

INSTANCE_NAME

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

RONE_2

  COUNT(*)

----------

    628628

SQL>

 

 

 

Once the query is started relocate the instance to node raclinux1 in another terminal session.


[oracle@raclinux1 ~]$ srvctl status database -d RONE

Instance RONE_1 is running on node raclinux2

Online relocation: INACTIVE

[oracle@raclinux1 ~]$ srvctl relocate database -d RONE -n raclinux1

[oracle@raclinux1 ~]$ srvctl status database -d RONE

Instance RONE_2 is running on node raclinux1

Online relocation: INACTIVE

[oracle@raclinux1 ~]$

 

 

 

 

 

 

 

 

 

Monitor the failover in the first terminal session where the SQL is executing. RONE get relocated to node raclinux1 and the active instance is RONE_2. The TAF works and the session fails over to RONE_2.

Converting RAC One Node database to RAC database

Here we will use the srvctl utility to convert RAC One Node database to RAC database (srvctl convert database –c RAC). Initially RONE is configured as RAC One Node database with active instance running onraclinux1.

 


[oracle@raclinux1 db_20]$ srvctl config database -d RONE

Database unique name: RONE

Database name: RONE

Oracle home: /u01/app/oracle/product/11.2.0/db_20

Oracle user: oracle

Spfile: +DATA/RONE/spfileRONE.ora

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: RONE

Database instances:

Disk Groups: DATA

Mount point paths:

Services: RACONE

Type: RACOneNode

Online relocation timeout: 30

Instance name prefix: RONE

Candidate servers: raclinux1

Database is administrator managed

[oracle@raclinux1 db_20]$

 

 

 

 

Use srvctl to convert the database to RAC and create and start second instance as shown below.

 


[oracle@raclinux1 db_20]$ srvctl convert database -d RONE -c RAC

[oracle@raclinux1 db_20]$ srvctl status database -d RONE

Instance RONE_1 is running on node raclinux1

[oracle@raclinux1 db_20]$ srvctl config database -d RONE

Database unique name: RONE

Database name: RONE

Oracle home: /u01/app/oracle/product/11.2.0/db_20

Oracle user: oracle

Spfile: +DATA/RONE/spfileRONE.ora

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: RONE

Database instances: RONE_1

Disk Groups: DATA

Mount point paths:

Services: RACONE

Type: RAC

Database is administrator managed

[oracle@raclinux1 db_20]$

[oracle@raclinux1 db_20]$ srvctl add instance -d RONE -i RONE_2 -n raclinux2

[oracle@raclinux1 db_20]$ srvctl config database -d RONE

Database unique name: RONE

Database name: RONE

Oracle home: /u01/app/oracle/product/11.2.0/db_20

Oracle user: oracle

Spfile: +DATA/RONE/spfileRONE.ora

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: RONE

Database instances: RONE_1,RONE_2

Disk Groups: DATA

Mount point paths:

Services: RACONE

Type: RAC

Database is administrator managed

[oracle@raclinux1 db_20]$

[oracle@raclinux1 db_20]$ srvctl start instance -d RONE -i RONE_2

[oracle@raclinux1 db_20]$ srvctl status database -d RONE

Instance RONE_1 is running on node raclinux1

Instance RONE_2 is running on node raclinux2

[oracle@raclinux1 db_20]$

[oracle@raclinux1 db_20]$ sqlplus system/sys1@rone

SQL*Plus: Release 11.2.0.2.0 Production on Wed Oct 6 14:44:57 2010

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

SQL> select * from gv$instance;

   INST_ID INSTANCE_NUMBER INSTANCE_NAME

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

HOST_NAME

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

VERSION           STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_WAIT

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

LOGINS     SHU DATABASE_STATUS   INSTANCE_ROLE      ACTIVE_ST BLO

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

         1               1 RONE_1

raclinux1.gj.com

11.2.0.2.0        06-OCT-10 OPEN         YES          1 STOPPED

ALLOWED    NO  ACTIVE            PRIMARY_INSTANCE   NORMAL    NO

   INST_ID INSTANCE_NUMBER INSTANCE_NAME

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

HOST_NAME

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

VERSION           STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_WAIT

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

LOGINS     SHU DATABASE_STATUS   INSTANCE_ROLE      ACTIVE_ST BLO

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

         2               2 RONE_2

raclinux2.gj.com

11.2.0.2.0        06-OCT-10 OPEN         YES          2 STOPPED

ALLOWED    NO  ACTIVE            PRIMARY_INSTANCE   NORMAL    NO

SQL>

 

 

 

 

Converting RAC database to RAC One Node database

In order to convert a RAC database to RAC One Node database we need to

  1. Remove the second instance
  2. Use srvct to conver to RAC One Node database (srvctl convert database –c RACONENODE)

 

 


[oracle@raclinux1 db_20]$ srvctl stop instance -d RONE -i RONE_2

[oracle@raclinux1 db_20]$ srvctl status database -d RONE

Instance RONE_1 is running on node raclinux1

Instance RONE_2 is not running on node raclinux2

[oracle@raclinux1 db_20]$

[oracle@raclinux1 db_20]$ srvctl stop instance -d RONE -i RONE_2

[oracle@raclinux1 db_20]$ srvctl status database -d RONE

Instance RONE_1 is running on node raclinux1

Instance RONE_2 is not running on node raclinux2

[oracle@raclinux1 db_20]$ srvctl remove instance -d RONE -i RONE_2

Remove instance from the database RONE? (y/[n]) y

[oracle@raclinux1 db_20]$ srvctl status database -d RONE

Instance RONE_1 is running on node raclinux1

[oracle@raclinux1 db_20]$

[oracle@raclinux1 db_20]$ srvctl config database -d RONE

Database unique name: RONE

Database name: RONE

Oracle home: /u01/app/oracle/product/11.2.0/db_20

Oracle user: oracle

Spfile: +DATA/RONE/spfileRONE.ora

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: RONE

Database instances: RONE_1

Disk Groups: DATA

Mount point paths:

Services: RACONE

Type: RAC

Database is administrator managed

[oracle@raclinux1 db_20]$

[oracle@raclinux1 db_20]$ srvctl convert database -d RONE -c RACONENODE

PRKO-2159 : Option '-i' should be specified to convert an administrator-managed RAC database to its equivalent RAC One Node database configuration

[oracle@raclinux1 db_20]$ srvctl convert database -d RONE -c RACONENODE -i RONE_1

[oracle@raclinux1 db_20]$ srvctl config database -d RONE

Database unique name: RONE

Database name: RONE

Oracle home: /u01/app/oracle/product/11.2.0/db_20

Oracle user: oracle

Spfile: +DATA/RONE/spfileRONE.ora

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: RONE

Database instances:

Disk Groups: DATA

Mount point paths:

Services: RACONE

Type: RACOneNode

Online relocation timeout: 30

Instance name prefix: RONE

Candidate servers: raclinux1

Database is administrator managed

[oracle@raclinux1 db_20]$

[oracle@raclinux1 db_20]$ srvctl status database -d RONE

Instance RONE_1 is running on node raclinux1

Online relocation: INACTIVE

[oracle@raclinux1 db_20]$

[oracle@raclinux1 db_20]$ sqlplus system/sys1@rone

SQL*Plus: Release 11.2.0.2.0 Production on Wed Oct 6 15:13:24 2010

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

SQL> select * from gv$instance;

   INST_ID INSTANCE_NUMBER INSTANCE_NAME

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

HOST_NAME

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

VERSION           STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_WAIT

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

LOGINS     SHU DATABASE_STATUS   INSTANCE_ROLE      ACTIVE_ST BLO

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

         1               1 RONE_1

raclinux1.gj.com

11.2.0.2.0        06-OCT-10 OPEN         YES          1 STOPPED

ALLOWED    NO  ACTIVE            PRIMARY_INSTANCE   NORMAL    NO

SQL>  

 

 

 

 

 

Summary

Staring with Oracle 11gR2 version 11.2.0.2 srvctl utility is used entirely to manage RAC ONE Node database activities such as relocation and conversion to and from RAC database to name a few.

October 7, 2010 - Posted by | oracle

4 Comments »

  1. […] Oracle 11g R2 11.2.0.2 RAC One Node management In Oracle 11gR2 11.2.0.2 RAC One Node database creation and management is simplified. The traditional srvctl utility used to manage RAC databases now can natively manage RAC One Node databases as well. Another enhancement in 11.2.0.2 is the ability to easy create RAC One Node database using dbca utility as specified here. To recount, prior to Oracle 11gR2 11.2.0.2 patch 9004119 had to be applied to p … Read More […]

    Pingback by Oracle 11g R2 (11.2.0.2) RAC One Node management (via Guenadi N Jilevski’s Oracle BLOG) « Levi Pereira's | December 9, 2010 | Reply

  2. […] Oracle 11g R2 11.2.0.2 RAC One Node management […]

    Pingback by ORCLearning of the week « Oracle DB 10g & 11g Tops | December 19, 2010 | Reply

  3. […] For information about Oracle RAC One Node installation and management click here. […]

    Pingback by Build Active-Passive HA configuration for single instance database with Oracle GI 11.2.0.3 « Guenadi N Jilevski's Oracle BLOG | January 9, 2012 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: