ORA-12514: TNS:listener não tem conhecimento sobre o serviço

DBA Geral (instalação, configuração do banco, scripts do Sql*Plus, shell scripts, batch scripts, etc...)
Responder
gab26
Rank: Programador Júnior
Rank: Programador Júnior
Mensagens: 16
Registrado em: Qua, 04 Jan 2017 11:01 am

Boa tarde galera, estou com um problema acredito que seja de configuração do oracle, não entendo muito bem, estou tentando, é seguinte estou com um DUMP do banco da minha empresa, vou fazer uma aplicação web java, minha intenção era instalar o banco e depois subir o DUMP, mas quando termina a instalação tento fazer a conexão mas me vem essa mensagem:
ORA-12514: TNS:listener não tem conhecimento sobre o serviço solicitado atualmente no descritor de conexão
, pelo o que pesquisei seria problema no arquivo tnsnames, segue ele abaixo como esta:

Selecionar tudo

# tnsnames.ora Network Configuration File: C:\app\gabriel\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

MEGA =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.21)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = MEGA)
    )
  )

ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-L7F0R37)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = ORCL)
    )
  )


se alguém puder me ajudar agredeço muito. obrigado.
Avatar do usuário
dr_gori
Moderador
Moderador
Mensagens: 5024
Registrado em: Seg, 03 Mai 2004 3:08 pm
Localização: Portland, OR USA
Contato:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

Qual deles que está dando problema?
Eu vi que o ORACLR_CONNECTION_DATA está sem SERVICE_NAME.

Veja se esses links podem ajudar você:
http://dba-oracle.com/t_ora_12514_tns_l ... uested.htm

Selecionar tudo

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor 

Expert Oracle Database Tips by Burleson Consulting

August 27, 2015


Question:  I am attempting to enter SQL*Plus and I am getting this error:

oracle> sqlplus system/manager@mysid

ERROR
ORA-12514: TNS: Listener does not currently know of service requested in connect descriptor

How do I prevent this form of the ORA-12514 error?  Also, I often get a TNS-12514 along with the ORA-12514.  Are these the same error?   If not, how do I avoid the TNS-12514?

Answer:  First, the ORA error is a permutation of the ORA-12514: TNS listener cannot resolve service name error as shown below.  This form of the ORA-12541 error commonly happens when the database or the listener processes are in the middle of a startup, or when the database (mysid in your case) has not been registered with the listener. 

root> oerr ora 12514

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

Cause:

The listener received a request to establish a connection to a database or other service.

The connect descriptor received by the listener specified a service name for a service (usually a database service) that either has not yet dynamically registered with the listener or has not been statically configured for the listener.

This may be a temporary condition such as after the listener has started, but before the database instance has registered with the listener.

Action:

    Wait a moment and try to connect a second time.

    Check which services are currently known by the listener by executing: lsnrctl services

    Check that the SERVICE_NAME parameter in the connect descriptor of the net service name used specifies a service known by the listener.

    If an easy connect naming connect identifier was used, check that the service name specified is a service known by the listener.

    Check for an event in the listener.log file.  

To register the database with the listener

You have two options to register your database with the listener:

    Simply add a service name to your tnsnames.ora file.

    If you have the multiple listeners and have specified the database name in your pfile/spfile with local_listener=mysid then you can dynamically register the database with the listener.

The TNS-12514 is very similar to the ORA-12514 for a reason.  Sometimes Oracle does not get far enough along in the process for an Oracle error, so a similar network error will appear.  Resolving one should take care of the other.

Read on for specific information on dealing with the TNS-12514 on Windows.

ORA-12514: TNS listener cannot resolve service name error

Question:  I have an issue causing a ORA-12514: TNS: listener could not resolve SERVICE_NAME error:

SQL> shutdown immediate

Database closed.
Database dismounted.
ORACLE instance shut down.
 
SQL> startup mount

ORACLE instance started.
ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect descriptor

I'm using Oracle 10g on Windows 2000.

What's cause of this error and how to resolve it?

Answer by Edward Stoever:  

I avoid using a listener connection when I startup or shutdown, as a matter of practice. I realize that cannot always be done. Are you physically on the machine? Can you ssh or telnet in and run sqlplus on the box? Then connect like so:

export ORACLE_SID=mydb  ###Unix/Linux
sqlplus sys as sysdba
[no password needed - just hit return ]
SQL> startup mount
...

Do not connect with the @mydb to avoid the listener.

Also, Windows systems are subject to a variety of other issues from screen savers that hog the CPU to the Catch-22 of either anti-virus protection or a virus interfering with connections.  These conditions and a few others can cause TNS-12514 to appear.

Also note the similarities in numbering and content for ORA-12154, which deals with TNS inability to resolve the service name.
http://www.dba-oracle.com/t_tnsnames_dn ... server.htm

Selecionar tudo

 Add a service name to tnsnames.ora file

Oracle Database Tips by Burleson Consulting

When the Oracle DBA creates their tnsnames.ora file to define remote databases they often specify the host name of the foreign server that contains the remote Oracle database. 

For example, a entry in the tnsnames.ora file for a remote database might look like this.  In the example, we have added the service name "berlin" to our tnsnames.ora file:
berlin =
   (DESCRIPTION =
     (ADDRESS_LIST =
         (ADDRESS =
           (COMMUNITY = TCP)
           (PROTOCOL = TCP)
          (HOST = hun)
           (PORT = 1521)
          )
      )
     (CONNECT_DATA = (SID = kraus))
    )

Here we see a TNS service name of berlin, which defines a connection to a remote server named hun that contains an Oracle database named kraus. When a remote connection request is made from the UNIX server, the /etc/host file is accessed to get the IP address for the hum server. 

From the listing below, we see that the hum server is located at 192.133.13.12.  In sum, the /etc/host file is used to isolate the IP address from the tnsnames.ora file.  If the IP address should ever change, the UNIX systems administrator only needs to change the IP address in one place.
root> cat /etc/hosts

192.133.13.22  hum    hum.com
192.144.13.22  dopey  dopey.com
gab26
Rank: Programador Júnior
Rank: Programador Júnior
Mensagens: 16
Registrado em: Qua, 04 Jan 2017 11:01 am

dr_gori boa tarde, obrigado pela resposta, em todos acontece isso, desinstalei todo o oracle e instalei de novo, uma coisa estranha pelo menos pra mim que não entendo, quando eu tento conectar pelo PL/SQL DEVELOPER, ele me da o erro em qualquer instancia, agora quando conecto pelo pelo SQL/PLUS, ele não me da erro, outra coisa esse erro já ocorre quando eu estou criando o banco no "Assistente de Configuração de banco de dados", ele me da o erro do LISTENER, quando tento configurar a rede pelo "Assistente de configuração de rede", ele não aceita o login e senha que o SQL/PLUS aceita. Não faço ideia do que seja.

obrigado.
gab26
Rank: Programador Júnior
Rank: Programador Júnior
Mensagens: 16
Registrado em: Qua, 04 Jan 2017 11:01 am

só atualizando ai pessoal, continuei pesquisando e achei a solução pelo menos para o meu caso, quando dei esse comando:

Selecionar tudo

SHOW PARAMETER LOCAL LISTENER
o valor da string era vazia, depois disso dei esse comando:

Selecionar tudo

alter system set LOCAL_LISTENER='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.21)(PORT=1521))'scope=both;
Alterando o sistema, e agora esta conectando normalmente.

Obrigado pela atenção ai galera
Responder
  • Informação
  • Quem está online

    Usuários navegando neste fórum: Nenhum usuário registrado e 7 visitantes