drno-reg
@drno-reg
см не кратко

Почему ошибка ORA-12514: TNS:listener does not currently know of service requested in connect descriptor?

Здравствуйте.

На 3-х виртуальных машинах в локальной сети
192.168.0.21
192.168.0.22
192.168.0.23
проинсталлированы 3 экземпляра Oracle

ниже
1.
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = d:\databases\Oracle\product\12.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:d:\databases\Oracle\product\12.2.0\dbhome_1\bin\oraclr12.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.21)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
	)


2.
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = D:\Databases\Oracle\product\12.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:\Databases\Oracle\product\12.2.0\dbhome_1\bin\oraclr12.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 2001))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC2001))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.22)(PORT = 2001))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC2001))
    )
	)


3.
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = D:\DataBases\Oracle\product\12.2.0\dbhome_1)
      (PROGRAM = extproc)
    )
    (SID_DESC = 
      (GLOBAL_DBNAME = DBORACLE.SERVER02)
      (ORACLE_HOME = D:\DataBases\Oracle\product\12.2.0\dbhome_1)
      (SID_NAME = DBORACLE)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 3001))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.23)(PORT = 3001))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )	
  )


DBORACLE_NETWORK =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.23)(PORT = 3001))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = dboracle)
    )
  )


1 и 2 работает инстансы,
3-й при подключении клиента возвращает ошибку

An error was encountered performing the requested operation:
Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
Vendor code 12514


Как решить проблему с 3-м эксземпляром?
  • Вопрос задан
  • 51167 просмотров
Решения вопроса 2
Smithson
@Smithson
20+ лет админю
Вот тут пишут, что надо исправить SERVICE_NAME в tnsnames.ora
Ответ написан
drno-reg
@drno-reg Автор вопроса
см не кратко
В общем в одной подсети инстансы oracle с одинаковыми service name и портами жить могут.

в listener.ora добавляем информацию о новом подключении по IP и меняем порт

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 2001))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC2001))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.22)(PORT = 2001))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC2001))
    )	
  )


В tnsnames.ora заносим информацию о новых экземплярах

SERVER01_DBORACLE_LOCAL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.22)(PORT = 2001))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = dboracle)
    )
  )  
  
SERVER01_DBORACLE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 2001))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = dboracle)
    )
  )    
ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC2001))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

LISTENER_DBORACLE =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 2001))


После перезапускаем службы листенера и самой БД.

Проверяем командой
lsnrctl status
LSNRCTL for 64-bit Windows: Version 12.2.0.1.0 - Production on 13-APR-2017 16:27:57

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=2001)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 64-bit Windows: Version 12.2.0.1.0 - Production
Start Date                13-APR-2017 15:28:54
Uptime                    0 days 0 hr. 59 min. 2 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   D:\DataBases\Oracle\product\12.2.0\dbhome_1\network\admin\listener.ora
Listener Log File         D:\DataBases\Oracle\diag\tnslsnr\SERVER01\listener\alert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=2001)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC2001ipc)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.22)(PORT=2001)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC2001ipc)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=SERVER01)(PORT=5500))(Security=(my_wallet_directory=D:\DATABASES\ORACLE\admin\dboracle\xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
  Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "dboracle" has 1 instance(s).
  Instance "dboracle", status READY, has 1 handler(s) for this service...
Service "dboracleXDB" has 1 instance(s).
  Instance "dboracle", status READY, has 1 handler(s) for this service...

The command completed successfully

обязательно должна быть информация о
Service "dboracle" has 1 instance(s).
  Instance "dboracle", status READY, has 1 handler(s) for this service...
Service "dboracleXDB" has 1 instance(s).
  Instance "dboracle", status READY, has 1 handler(s) for this service...


lsnrctl reload – переинициализировать листенер иногда помагает, когда инстанс не инициализовался листенером
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы