Link to home
Start Free TrialLog in
Avatar of Panadroid
Panadroid

asked on

Configuring one listener for two databases?

I have two databases in my server and I want to use one listener for both of them. I have done some configurations and so far it's more or less working but something must be wrong because if I do a tnsping for one of the databases in the admin folder  it works:

----------------------------------------------------------------------------------------------------------------------
C:\app\Cris\product\11.2.0\dbhome_1\NETWORK\ADMIN>tnsping testorcl

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 22-JUN-2
015 14:17:50

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

Parameterdateien benutzt:
C:\app\Cris\product\11.2.0\dbhome_2\network\admin\sqlnet.ora


Adapter TNSNAMES zur Auflösung des Alias benutzt
Verbindungsversuch mit (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP
)(HOST = CRIS-WS)(PORT = 1521))) (CONNECT_DATA = (SID_NAME = OUC) (SERVICE_NAME =
 ORCL.168.1.205)))
OK (0 ms)
----------------------------------------------------------------------------------------------------------------------

Buuuuuuuuut if I do a tnsping for the same database outside this folder [C:\app\Cris\product\11.2.0\dbhome_1\NETWORK\ADMIN] it does not work. Example:

----------------------------------------------------------------------------------------------------------------------
C:\>tnsping testorcl

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 22-JUN-2
015 14:15:25

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

Parameterdateien benutzt:
C:\app\Cris\product\11.2.0\dbhome_2\network\admin\sqlnet.ora

Adapter HOSTNAME zur Auflösung des Alias benutzt
Verbindungsversuch mit (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROT
OCOL=TCP)(HOST=202.202.236.10)(PORT=1521)))
TNS-12541: TNS: Kein Listener
----------------------------------------------------------------------------------------------------------------------

When I do tnsping for the second database it works no matter in which folder I'm in.
Does anybody have any idea what could be wrong, please help me!
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

My guess is your environment variables are pointing to a different ORACLE_HOME.

So you are calling two different tnsping's which is using two different tnsnames.ora files.
Avatar of Panadroid

ASKER

Yes

This is the tnsnames.ora for the first database
C:\app\Cris\product\11.2.0\dbhome_1\NETWORK\ADMIN>
TESTORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = CRIS-WS)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID_NAME = OUC)
      (SERVICE_NAME = ORCL.168.1.205)
    )
  )

This is my tnsnames.ora for the second database:

C:\app\Cris\product\11.2.0\dbhome_2\NETWORK\ADMIN>
ORCLWE8 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = CRIS-WS)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID_NAME = OWE8)  
      (SERVICE_NAME = ORCLWE8)      
    )
  )


And the listener.ora:
C:\app\Cris\product\11.2.0\dbhome_1\NETWORK\ADMIN>
# listener.ora Network Configuration File: c:\app\Cris\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS =
          (PROTOCOL = TCP)
          (HOST = CRIS-WS)
          (PORT = 1521)
        )
      )
    )
  )


SID_LIST_LISTENER =
     (SID_LIST =
        (SID_DESC =
          (GLOBAL_DBNAME = orcl.168.1.205)
          (ORACLE_HOME = c:\app\Cris\product\11.2.0\dbhome_1)
          (SID_NAME = OUC)
        )
         
        (SID_DESC =
          (GLOBAL_DBNAME = orclwe8)
          (ORACLE_HOME = c:\app\Cris\product\11.2.0\dbhome_1)
          (SID_NAME = OWE8)
        )
     )
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial