3
respostas

Erro de conexão

Já li todas as dúvidas postadas com este assunto e não consegui resolver o meu problema.

Já vou responder as perguntas padrão que o suporte faz: Durante a instalação algum erro foi retornado? NÃO Os serviços Oracle foram criados corretamente? SIM

Na versão 21 do Oracle, os arquivos de conexão estão em um diretório um pouco diferente, dentro da pastasample. Por este motivo, o SQL Developer não está localizando uma entrada TNS. Já retirei desta pasta e coloquei na padrão! Pasta dos arquivos TNS

O developer identifica os arquivos. TNSNAMESInsira aqui a descrição dessa imagem para ajudar na acessibilidadeInsira aqui a descrição dessa imagem para ajudar na acessibilidade

Serviço sendo executado normalmente

3 respostas

tnsnames.ora já tentei apagar o que vem de padrão, que é a parte inicial e deixar só a parte que está no final, que colocaram como solução no forum, mas continua o erro ( só muda o código final do CONNECTION_ID).

# This file contains the syntax information for 
# the entries to be put in any tnsnames.ora file
# The entries in this file are need based. 
# There are no defaults for entries in this file
# that Sqlnet/Net3 use that need to be overridden 
#
# Typically you could have two tnsnames.ora files
# in the system, one that is set for the entire system
# and is called the system tnsnames.ora file, and a
# second file that is used by each user locally so that
# he can override the definitions dictated by the system
# tnsnames.ora file.

# The entries in tnsnames.ora are an alternative to using
# the names server with the onames adapter.
# They are a collection of aliases for the addresses that 
# the listener(s) is(are) listening for a database or 
# several databases.

# The following is the general syntax for any entry in 
# a tnsnames.ora file. There could be several such entries 
# tailored to the user's needs.

<alias>= [ (DESCRIPTION_LIST =  # Optional depending on whether u have 
                # one or more descriptions
                # If there is just one description, unnecessary ]
      (DESCRIPTION=
        [ (SDU=2048) ]    # Optional, defaults to 2048
                # Can take values between 512 and 32K
        [ (ADDRESS_LIST=    # Optional depending on whether u have
                # one or more addresses
                # If there is just one address, unnecessary ]
          (ADDRESS=
        [ (COMMUNITY=<community_name>) ] 
        (PROTOCOL=tcp)
        (HOST=<hostname>)
        (PORT=<portnumber (1521 is a standard port used)>)
          )
          [ (ADDRESS=
          (PROTOCOL=ipc)
          (KEY=<ipckey (PNPKEY is a standard key used)>)    
        )
          ]
          [ (ADDRESS=
          [ (COMMUNITY=<community_name>) ]
          (PROTOCOL=decnet)
          (NODE=<nodename>)
          (OBJECT=<objectname>)
        )
          ]
              ... # More addresses
        [ ) ] # Optional depending on whether ADDRESS_LIST is used or not 
        [ (CONNECT_DATA=
        (SID=<oracle_sid>)
        [ (GLOBAL_NAME=<global_database_name>) ]
          )
        ]
        [ (SOURCE_ROUTE=yes) ]  
      )
      (DESCRIPTION=     
        [ (SDU=2048) ]    # Optional, defaults to 2048
                # Can take values between 512 and 32K
        [ (ADDRESS_LIST= ]    # Optional depending on whether u have more
                # than one address or not
                # If there is just one address, unnecessary
          (ADDRESS
        [ (COMMUNITY=<community_name>) ]
        (PROTOCOL=tcp)
        (HOST=<hostname>)
        (PORT=<portnumber (1521 is a standard port used)>)
          )
          [ (ADDRESS=
          (PROTOCOL=ipc)
          (KEY=<ipckey (PNPKEY is a standard key used)>)
             )
          ]
          ...         # More addresses
        [ ) ]         # Optional depending on whether ADDRESS_LIST  
                # is being used
        [ (CONNECT_DATA=
        (SID=<oracle_sid>)
        [ (GLOBAL_NAME=<global_database_name>) ]
          )
        ]
        [ (SOURCE_ROUTE=yes) ]
      )
      [ (CONNECT_DATA=
          (SID=<oracle_sid>)
          [ (GLOBAL_NAME=<global_database_name>) ]
        )
      ]
      ...   # More descriptions 
    [ ) ]    # Optional depending on whether DESCRIPTION_LIST is used or not
XE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 177.12.41.60(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE) ) )

LISTENER_XE = (ADDRESS = (PROTOCOL = TCP)(HOST = 177.12.41.60)(PORT = 1521))

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

listener.ora já tentei apagar o que vem de padrão, que é a parte inicial e deixar só a parte que está no final, que colocaram como solução no forum, mas continua o erro ( só muda o código final do CONNECTION_ID). Usei HOST como localhost, quanto o meu ip, ambos com o mesmo erro.

# copyright (c) 1997 by the Oracle Corporation
# 
# NAME
#   listener.ora
# FUNCTION
#   Network Listener startup parameter file example
# NOTES
#   This file contains all the parameters for listener.ora,
#   and could be used to configure the listener by uncommenting
#   and changing values.  Multiple listeners can be configured
#   in one listener.ora, so listener.ora parameters take the form
#   of SID_LIST_<lsnr>, where <lsnr> is the name of the listener
#   this parameter refers to.  All parameters and values are
#   case-insensitive.

# <lsnr>
#   This parameter specifies both the name of the listener, and
#   it listening address(es). Other parameters for this listener
#   us this name in place of <lsnr>.  When not specified,
#   the name for <lsnr> defaults to "LISTENER", with the default
#   address value as shown below.
#
# LISTENER =
#  (ADDRESS_LIST=
#    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
#    (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))    

# SID_LIST_<lsnr>
#   List of services the listener knows about and can connect 
#   clients to.  There is no default.  See the Net8 Administrator's
#   Guide for more information.
#
# SID_LIST_LISTENER=
#   (SID_LIST=
#    (SID_DESC=
#            #BEQUEATH CONFIG
#          (GLOBAL_DBNAME=salesdb.mycompany)
#          (SID_NAME=sid1)            
#          (ORACLE_HOME=/private/app/oracle/product/8.0.3)
#            #PRESPAWN CONFIG
#         (PRESPAWN_MAX=20)
#      (PRESPAWN_LIST=
#           (PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))
#         )
#        )
#       )

# PASSWORDS_<lsnr>
#   Specifies a password to authenticate stopping the listener.
#   Both encrypted and plain-text values can be set.  Encrypted passwords
#   can be set and stored using lsnrctl.  
#     LSNRCTL> change_password
#       Will prompt for old and new passwords, and use encryption both
#       to match the old password and to set the new one.
#     LSNRCTL> set password
#    Will prompt for the new password, for authentication with 
#       the listener. The password must be set before running the next
#       command.
#     LSNRCTL> save_config
#       Will save the changed password to listener.ora. These last two
#       steps are not necessary if SAVE_CONFIG_ON_STOP_<lsnr> is ON.
#       See below.
#
# Default: NONE
#
# PASSWORDS_LISTENER = 20A22647832FB454      # "foobar"

# SAVE_CONFIG_ON_STOP_<lsnr>
#   Tells the listener to save configuration changes to listener.ora when
#   it shuts down.  Changed parameter values will be written to the file,
#   while preserving formatting and comments.
# Default: OFF
# Values: ON/OFF
#
# SAVE_CONFIG_ON_STOP_LISTENER = ON

# USE_PLUG_AND_PLAY_<lsnr>
#   Tells the listener to contact an Onames server and register itself
#   and its services with Onames.
# Values: ON/OFF
# Default: OFF
#
# USE_PLUG_AND_PLAY_LISTENER = ON

# LOG_FILE_<lsnr>
#   Sets the name of the listener's log file.  The .log extension
#   is added automatically.
# Default=<lsnr>
#
# LOG_FILE_LISTENER = lsnr

# LOG_DIRECTORY_<lsnr>
#   Sets the directory for the listener's log file.
# Default: <oracle_home>/network/log
#
# LOG_DIRECTORY_LISTENER = /private/app/oracle/product/8.0.3/network/log

# TRACE_LEVEL_<lsnr>
#   Specifies desired tracing level.
# Default: OFF
# Values: OFF/USER/ADMIN/SUPPORT/0-16
#
# TRACE_LEVEL_LISTENER = SUPPORT

# TRACE_FILE_<lsnr>
#   Sets the name of the listener's trace file. The .trc extension
#   is added automatically.
# Default: <lsnr>
#
# TRACE_FILE_LISTENER = lsnr

# TRACE_DIRECTORY_<lsnr>
#   Sets the directory for the listener's trace file.
# Default: <oracle_home>/network/trace
#
# TRACE_DIRECTORY_LISTENER=/private/app/oracle/product/8.0.3/network/trace
# CONNECT_TIMEOUT_<lsnr>
#   Sets the number of seconds that the listener waits to get a 
#   valid database query after it has been started.
# Default: 10
#
# CONNECT_TIMEOUT_LISTENER=10

DEFAULT_SERVICE_LISTENER = XE

SID_LIST_LISTENER =
 (SID_LIST =
  (SID_DESC =
    (SID_NAME = CLRxtProc)            
    (ORACLE_HOME = C:\app\lucas\product\21c\dbhomeXE)
    (PROGRAM = extproc)
    (ENVS = "EXTPROC_DLLS=ONLY:C:\app\lucas\product\21c\dbhomeXE\bin\oraclr.dll")
   )
 )

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

Olá, Lucas, tudo bem?

Você poderia fornecer mais detalhes do seu ambiente? Assim, poderei entender melhor o que pode estar acontecendo.

  • Você tentou informar em nome do Host a palavra LOCALHOST ao invés do IP?
  • Você poderia reiniciar todos os serviços Oracle?

Aguardo o seu retorno!

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software