This discussion is archived
6 Replies Latest reply: Jan 9, 2013 3:28 AM by GarryB RSS

Two RAC services of the same name in a GI cluster

GarryB Newbie
Currently Being Moderated
Grid Version : 11.2.0.3

Platform : RHEL 5.4

In our 11.2.0.3 GI cluster , we have DBs of version 11.2.0.3 and 11.2.0.2 running.

Only today I've realized that you can create two services of the same name in a cluster.

ORCL      db is of version 11.2.0.3
NATSUP db is of version 11.2.0.2

I managed to create a service named DNP_TST_02 on both DBs.

--- After env variables for 11.2.0.3 db Home

--- Creating DNP_TST_02 service in 11.2.0.3 DB


srvctl add service -d ORCL -s DNP_TST_02 -r ORCL1 -a ORCL2

srvctl start service -d ORCL -s DNP_TST_02

srvctl status service -d ORCL -s DNP_TST_02

-- Tested connectivity using

sqlplus tst_for_drop/hello_123@syptex-scan.ap.renduit.com:1628/DNP_TST_02.hk.standardchartered.com


--- Creating DNP_TST_02 service in 11.2.0.2 DB

srvctl add service -d NATSUP -s DNP_TST_02 -r NATSUP1 -a NATSUP2

srvctl status service -d NATSUP -s DNP_TST_02

srvctl start service -d NATSUP -s DNP_TST_02

srvctl status service -d NATSUP -s DNP_TST_02


-- Tested connectivity

sqlplus tst_for_drop/tester@syptex-scan.ap.renduit.com:1628/DNP_TST_02.hk.standardchartered.com

---
But, wouldn't a service of the same name confuse the listener ?

If the user you are trying to connect exist in both DBs, should the listener/CRS will be more confused. Right ?

If the users exist in both DBs and have the same password, then it will be worse . Right ?

So, should be CRS be allowing two service of the same name in two DBs in one GI cluster ?
  • 1. Re: Two RAC services of the same name in a GI cluster
    Victor Armbrust Oracle ACE
    Currently Being Moderated
    You're just updating the service.

    Have you look Server Control Utility documentation?

    http://docs.oracle.com/cd/E11882_01/rac.112/e16795/srvctladmin.htm#i1008562


    Syntax and Options
    Use the srvctl add service command to create a service, using the first of the following syntax models, or to update an existing service, using the second syntax model:
    srvctl add service -d db_unique_name -s service_name {-r "preferred_list"
       [-a "available_list"] [-P {BASIC | NONE | PRECONNECT}] | -g server_pool
       [-c {UNIFORM | SINGLETON]} [-k network_number]
       [-l [PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY]
       [-y {AUTOMATIC | MANUAL}] [-q {TRUE | FALSE}] [-x {TRUE | FALSE}]
       [-j {SHORT | LONG}][-B {NONE | SERVICE_TIME | THROUGHPUT}]
       [-e {NONE | SESSION | SELECT}] [-m {NONE | BASIC}] [-z failover_retries]
       [-w failover_delay]
    
    srvctl add service -d db_unique_name -s service_name
       -u {-r preferred_list | -a available_list} [-f]
    Victor
  • 2. Re: Two RAC services of the same name in a GI cluster
    JohnWatson Guru
    Currently Being Moderated
    Hello, Garry - you can get exactly the same effect in a single instance environment. I've run this in two separate databases that happen to be on the same machine:
    SQL>  alter system set service_names=dup scope=memory;
    
    System altered.
    
    SQL> alter system register
      2  ;
    
    System altered.
    
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    oracle@domU-12-31-39-0E-D5-A2:[/home/oracle]
    $ lsnrctl status
    
    LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 08-JAN-2013 07:18:53
    
    Copyright (c) 1991, 2011, Oracle.  All rights reserved.
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
    Start Date                07-JAN-2013 09:24:30
    Uptime                    0 days 21 hr. 54 min. 23 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /u01/app/oracle/product/11.2.0/db_2/network/admin/listener.ora
    Listener Log File         /u01/app/oracle/diag/tnslsnr/domU-12-31-39-0E-D5-A2/listener/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=domU-12-31-39-0E-D5-A2.compute-1.internal)(PORT=1521)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=domU-12-31-39-0E-D5-A2.compute-1.internal)(PORT=8080))(Presentation=HTTP)(Session=RAW))
    Services Summary...
    Service "DUP" has 2 instance(s).
      Instance "class", status READY, has 1 handler(s) for this service...
      Instance "orcl", status READY, has 1 handler(s) for this service...
    And yes, you get connected randonly through the usual connect time load balancing:
    $ sqlplus scott/tiger@domU-12-31-39-0E-D5-A2:1521/DUP
    
    SQL*Plus: Release 11.2.0.3.0 Production on Tue Jan 8 07:28:50 2013
    
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> select name from v$database;
    
    NAME
    ---------
    ORCL
    
    SQL> !sqlplus scott/tiger@domU-12-31-39-0E-D5-A2:1521/DUP
    
    SQL*Plus: Release 11.2.0.3.0 Production on Tue Jan 8 07:29:09 2013
    
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> select name from v$database;
    
    NAME
    ---------
    CLASS
    I can see how it would be unavoidable in a single instance environment, but clusterware really shouldn't permit it. I think it is almost a bug, service names should be unique within a cluster.
  • 3. Re: Two RAC services of the same name in a GI cluster
    GarryB Newbie
    Currently Being Moderated
    You're just updating the service.

    No. I am not updating. I am creating a new service in a different DB.
    As you can see , the second one is actually on a different DB called NATSUP
  • 4. Re: Two RAC services of the same name in a GI cluster
    Sebastian Solbach (DBA Community) Guru
    Currently Being Moderated
    Hi Garry,

    yes this will confuse the listener, if both databases are using the same ones (REMOTE_LISTENER entries).
    So this is not a good idea ;) Since you never know on which database the client will end up.

    For you information: A similar issue was the main reason for a security alert, because without COST restriction, even a database/service with the same name on another host could simply register with REMOTE_LISTENER on another listener....

    Regards
    Sebastian
  • 5. Re: Two RAC services of the same name in a GI cluster
    GarryB Newbie
    Currently Being Moderated
    yes this will confuse the listener, if both databases are using the same ones (REMOTE_LISTENER entries).

    Yes. Since they both are 11.2 DBs , I am using the SCAN based entry for REMOTE_LISTENER for both the databases. I have no other choice for an 11.2 DB in and 11.2 cluster . Right ?
  • 6. Re: Two RAC services of the same name in a GI cluster
    Sebastian Solbach (DBA Community) Guru
    Currently Being Moderated
    Hi,

    yes, you only have one SCAN listener.
    However you could create other listeners (on other ports), and using the "old" pre 11gR2 method (of including all these listeners in the REMOTE_LISTENER parameter).

    This would still leave you with having the same service name (but using a different port and different listeners).

    But I personally would vote for changing the service name.

    Regards
    Sebastian

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points