This discussion is archived
9 Replies Latest reply: Mar 5, 2013 12:08 AM by Jos van den Oord RSS

How to connect to rac  on oracle 11g r2 and use it

953727 Newbie
Currently Being Moderated
Hi

recently i tried to implement the RAC and the SCAN  NAME is  cluster. now i have one with two node and i make and restored data on it, but there is a problem:
*1) i can see it is working from any client with tnsping as follow but i cant connect it:*

C:\>tnsping cluster

TNS Ping Utility for 64-bit Windows: Version 10.2.0.4.0 - Production on 17-FEB-2
013 08:21:49

Copyright (c) 1997, 2007, Oracle. All rights reserved.

Used parameter files:
D:\oracle\product\10.2.0\client_2\network\admin\sqlnet.ora

Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=cluster.Carane.ir
))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.18.230)(PORT=1521))(ADDRESS=(PROTOCOL=TCP
)(HOST=192.168.18.231)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.18.229)(P
ORT=1521)))
OK (0 msec)

2) if i do not want use "HOSTNAME " or"EZCONNECT" how can connect from client, toad and so on

3) the SQLNET.ORA, LISTENER and TNSNAMES.ORA are as follow:

SQLNET.ORA:
NAMES.DIRECTORY_PATH= (EZCONNECT, TNSNAMES, LDAP, NIS)

NAMES.NIS.META_MAP = testcluster

ADR_BASE = /u01/app/grid


LISTENER :
# listener.ora Network Configuration File: /u01/app/11.2.0/grid/network/admin/listener.ora
# Generated by Oracle configuration tools.

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER = ON

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3 = ON

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2 = ON

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1 = ON

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = cluster.carane.ir)(PORT = 1521))
)
)


LISTENER_SCAN3 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN3))
)
)

LISTENER_SCAN2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN2))
)
)

LISTENER_SCAN1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN1))
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
(SID_NAME = ORCL)
)
)


ADR_BASE_LISTENER = /u01/app/grid



TNSNAMES.ORA:
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.18.228)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
  • 1. Re: How to connect to rac  on oracle 11g r2 and use it
    P.Forstmann Guru
    Currently Being Moderated
    If you have following SCAN listener registered in OCR named "sales1-scan.example.com" in DNS (or in /etc/hosts in sandbox environment):
    [oracle@mynode] srvctl config scan
    SCAN name: sales1-scan, Network: 1/133.22.67.0/255.255.255.0/
    SCAN VIP name: scan1, IP: /sales1-scan.example.com/133.22.67.192
    SCAN VIP name: scan2, IP: /sales1-scan.example.com/133.22.67.193
    SCAN VIP name: scan3, IP: /sales1-scan.example.com/133.22.67.194
    and with Oracle Client 10.2.0.4 in client tnsnames.ora (list the SCAN VIP adresses):
    sales.example.com =(DESCRIPTION=
    (ADDRESS_LIST= (LOAD_BALANCE=on)(FAILOVER=ON)
    (ADDRESS=(PROTOCOL=tcp)(HOST=133.22.67.192)(PORT=1521))
    (ADDRESS=(PROTOCOL=tcp)(HOST=133.22.67.193)(PORT=1521))
    (ADDRESS=(PROTOCOL=tcp)(HOST=133.22.67.194)(PORT=1521)))
    (CONNECT_DATA=(SERVICE_NAME= salesservice.example.com)))
    you can use:
    sqlplus <user>/<password>@sales.example.com
    These examples are from http://www.oracle.com/technetwork/products/clustering/overview/scan-129069.pdf.

    Edited by: P. Forstmann on 17 févr. 2013 10:11
  • 2. Re: How to connect to rac  on oracle 11g r2 and use it
    JohnWatson Guru
    Currently Being Moderated
    Have you perhaps edited your listener.ora file? This entry:
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER))
    )
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = cluster.carane.ir)(PORT = 1521))
    )
    )
    is not correct, on both nodes iit should read
    LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))
    Your connect string should be
    sqlplus scott/tiger@scan-name:1521/orcl
    it should not have an IP address.
    --
    John Watson
    Oracle Certified Master DBA
    http://skillbuilders.com
  • 3. Re: How to connect to rac  on oracle 11g r2 and use it
    user12288492 Newbie
    Currently Being Moderated
    Pls read the following post to get a detailed description of SCAN:



    http://oracleinaction.blogspot.in/2013/01/SCAN.html

    Regards
  • 4. Re: How to connect to rac  on oracle 11g r2 and use it
    953727 Newbie
    Currently Being Moderated
    i used the structure you said but the message of the system is as bellow and the tnsping still works correct:

    C:\>sqlplus system/foolad@cluster:1521/orcl

    SQL*Plus: Release 10.2.0.4.0 - Production on Tue Feb 19 11:30:00 2013

    Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

    ERROR:
    ORA-12545: Connect failed because target host or object does not exist
  • 5. Re: How to connect to rac  on oracle 11g r2 and use it
    JohnWatson Guru
    Currently Being Moderated
    950724 wrote:
    i used the structure you said but the message of the system is as bellow and the tnsping still works correct:

    C:\>sqlplus system/foolad@cluster:1521/orcl

    SQL*Plus: Release 10.2.0.4.0 - Production on Tue Feb 19 11:30:00 2013

    Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

    ERROR:
    ORA-12545: Connect failed because target host or object does not exist
    Remember that you have also broken your node listeners, by editing the listener.ora file.
    --
    John Watson
    Oracle Certified Master DBA
    http://skillbuilders.com
  • 6. Re: How to connect to rac  on oracle 11g r2 and use it
    LANCERIQUE Newbie
    Currently Being Moderated
    Are your clients and server on the same machine/network. If not then check if ports are open. Also do trace route to the Server IP and post your response.

    Regards,
    Nikhil Mehta.
  • 7. Re: How to connect to rac  on oracle 11g r2 and use it
    953727 Newbie
    Currently Being Moderated
    now the listener is :

    LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))          # line added by Agent
    # listener.ora.rac02 Network Configuration File: /u01/app/11.2.0/grid/network/admin/listener.ora
    # Generated by Oracle configuration tools.

    ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3 = ON

    ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2 = ON

    ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1 = ON

    ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_MON = ON

    ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER = ON

    LISTENER_SCAN3 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN3))
    )
    )

    LISTENER_SCAN2 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN2))
    )
    )

    LISTENER_SCAN1 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN1))
    )
    )
  • 8. Re: How to connect to rac  on oracle 11g r2 and use it
    953727 Newbie
    Currently Being Moderated
    C:\>tracert cluster

    Tracing route to cluster.Carane.ir [192.168.18.231]
    over a maximum of 30 hops:

    1 <1 ms <1 ms <1 ms 192.168.18.231

    Trace complete.
  • 9. Re: How to connect to rac  on oracle 11g r2 and use it
    Jos van den Oord Newbie
    Currently Being Moderated
    See for connecting to 11gr2 RAC the http://joordsblog.vandenoord.eu/2010/11/integrate-oracle-10g11gr2-client-or-rac.html

    Cheers,

    Jos van den Oord
    Blog : [Joords Oracle DBA blog|http://joordsblog.vandenoord.eu/]
    Company : [Transfer-solutions.com|http://www.transfer-solutions.com/]

Legend

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