Oracle sql developer ошибка 17002

I encountered same problem with ORACLE 11G express on Windows.
After a long time waiting I got the same error message.

My solution is to make sure the hostname in tnsnames.ora (usually it’s not «localhost») and the default hostname in sql developer(usually it’s «localhost») same. You can either do this by changing it in the tnsnames.ora, or filling up the same in the sql developer.

Oh, of course you need to reboot all the oracle services (just to be safe).

Hope it helps.


I came across the similar problem again on another machine, but this time above solution doesn’t work.
After some trying, I found restarting all the oracle related services can fix the problem. Originally when the installation is done, connection can be made. Somehow after several reboot of computer, there is problem.
I change all the oracle services with start time as auto. And once I could not connect, I restart them all over again (the core service should be restarted at last order), and works fine.

Some article says it might be due to the MTS problem. Microsoft’s problem. Maybe!

In this post we’re going to talk about Oracle SQL developer “SQL Error 17002 Sqlstate 08006” error on Windows. We’ll talk about the error code and how to fix it fast.

Why Does SQL Error 17002 Sqlstate 08006 Shows Up?

Most of the times it shows up because there is incorrect Misconfiguration or listener isn’t running. Before you’re able to connect with Oracle database, SQL developer must be configured correctly and listener has to be running. The listener handles databases connection, by default the SQL settings does not need listener for connecting to database and so it has to be configured.

SQL Error 17002 Sqlstate 08006

SQL Error 17002 Sqlstate 08006

Another possible reason for this SQL error could be database sessions have been terminated by the network firewall or interrupted by another reason. In this case you have to make sure firewall isn’t stopping idle connections.

Connectivity problems between oracle integration and connectivity agent can be the cause of this error also, or when the connectivity agent is disabled. You have to make sure connectivity agent is running. You can check the status under your Dashboards and Agents in oracle integration.

How To Fix SQL Error 17002 Sqlstate 08006

The fixes to this SQL error code is mostly about fixing or configuring the listener. We’ll also share other fixes that will help.

Fix No.1: Ensure listener is running

This can be checked from Windows Service Manager or using Command Prompt. Follow these steps to check the status;

Checking listener status using Windows Service Manager:

  1. Press Windows + R to open Run Dialogue.
  2. Type msc in the dialogue box.
  3. In the list of services, TNS listener is listed, make sure it’s running, the status is shown beside each service. If it’s not running you just need to right-click and click Start.

Checking with command prompt:

Open command prompt, you can do that by typing cmd in windows search, right-click on it and select ‘Run As Administrator’.

  1. When the command prompt opens, you type this command: C:>lsnrctl status
  2. If it’s not running, error will be mentioned multiple times, and you need to start it.
  3. To start the listener service, you need to type this command: C:>lsnrctl start

lsnrctl status

lsnrctl status

Fix No.2: Making sure the listener has the right configurations

  1. Open Oracle SQL Developer.
  2. Right click on database name and select properties.
  3. A window will open and you need to take note of the Hostname and port values under the ‘details’ tab.
  4. The default port is 1521, but sometimes it can be 1522, it has to be changed.
  5. Now back to checking hostname, you should type C:>hostname.
  6. The hostname will immediately appear below this command and if you’re receiving the SQL error code 17002, in most cases it will be different from the hostname that appeared when you right-click on the database name in the previous step. Remember that I told you to take note of the Hostname, this difference occurs when the computer name is changed. In this situation, the hostname has to be corrected in the connection Window, and the port value also should be changed to 1521 if that’s not the value.
  7. The next step now is to open tnsnames.ora file and check to confirm that the hostname and port is correct. The full path is; %ORACLE_HOME%/network/admin/tnsnames.ora. if not you need to change the values appropriately.
  8. Open the Windows Service Manager and Restart OracleserviceXE by right clicking and then click restart.
  9. Now you should test the connection to see if things are ok. When you’re sure all values are correct, that’s the Port, Hostname, username and password, you should click the test button. If connection show successful it means the problem has been rectified.
  10. After that you can now click connect and can now browse and query your database.

This fix can be lengthy or seem complex to most users but that’s the way to go about it.

Fix No.3: Restart Oracle TNS listener

As we’ve mentioned in the first fix, you should check whether listener is running or not, so in this case even if it’s running you should restart it. You should follow the same procedure in the first fix. Restarting the listener has work for some, you should give it a try.

Conclusion

So far these are some of the best fixes to SQL Error 17002 Sqlstate 08006, the problem most of the time has to do with listener and you need to ensure that it’s pointing to the correct port and server. Once you can figure this out, you’ll definitely get rid of the problem. Do let us know in the comments if these fixes have solved the SQL error for you, if you also have more ideas to share please drop your comments below for our readers.

I have an Oracle database 12c standard edition release 12.2.0.1.0 running on a Linux instance of AWS ec2. When I try to connect to it remotely from my machine (macOS) using SQL Developer I get an IO Error: The Network Adapter could not establish the connection Vendor Code 17002 error.

  • connecting using sqlplus from my machine:
sqlplus cd2/ @ec2-publicIp.myCloud.compute.amazonaws.com:1522/orcl

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Aug 3 15:30:56 2020
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

ERROR:
ORA-12541: TNS:no listener
  • On the ec2 instance, Security Groups, a TCP 1522 port is open for my machine’s public IP
  • telnet to the instance, port 1522 seems to indicate that the port is open:
telnet ec2-pubIp.compute.amazonaws.com 1522
Trying pubIp...
telnet: connect to address pubIp: Connection refused
telnet: Unable to connect to remote host
  • Port 1522 is used consistently across all the configurations
  • I verified that the ec2 hostname (hostnamecommand) matches the service name output from lsnrctl status. The output shows localhost instead of ip-localIp.myCloud.compute.internal.
$ hostname
ip-localIp.myCloud.compute.internal
$ lsnrctl status
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 03-AUG-2020 15:20:44

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ip-localIp.myCloud.compute.internal)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                03-AUG-2020 13:30:22
Uptime                    0 days 1 hr. 50 min. 22 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/centos/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/centos/diag/tnslsnr/ip-localIp/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1522)))
Services Summary...
Service "orcl.myCloud.compute.internal" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB.myCloud.compute.internal" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully

  • The hostname and port also matches the default listener configured in listener.ora:
cat /u01/app/centos/product/12.2.0/dbhome_1/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/centos/product/12.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ip-localIp.myCloud.compute.internal)(PORT = 1522))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
    )
  )
  • Oracle parameters are as shown, again both host and port match:
SQL> show parameter listener_networks

NAME                     TYPE    VALUE
------------------------------------ ----------- ------------------------------
listener_networks            string

SQL> show parameter local_listener

NAME                     TYPE    VALUE
------------------------------------ ----------- ------------------------------
local_listener               string  (ADDRESS=(PROTOCOL=TCP)(HOST =
                          ip-localIp.myCloud
                         .compute.internal)(PORT = 1522
                         ))

SQL> show parameter remote_listener

NAME                     TYPE    VALUE
------------------------------------ ----------- ------------------------------
remote_listener              string
  • I can connect from the ec2 instance: sqlplus / as sysdba
  • I can connect from the ec2 instance as a schema/user cd2:
sqlplus cd2/ @orcl

SQL*Plus: Release 12.2.0.1.0 Production on Mon Aug 3 18:04:13 2020

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

Enter password: 
Last Successful login time: Mon Aug 03 2020 18:03:52 +00:00

Connected to:
Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production

SP2-0310: unable to open file "orcl.sql"
SQL> select 1 from dual;

     1
----------
     1

SQL> 

  • SQL Developer connection matches both the port and ec2’s public domain name:
    enter image description here
  • This database server is our dev instance so no license was installed
  • Updated listener.ora by setting the HOST value to 0.0.0.0, restarted with lsnrctl but the result was the same:
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1522))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
    )
  )

  • /etc/hosts content:
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 ip-localIp.myCloud.compute.internal
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
  • I also tested it with all inbound traffic and all ports opened for the ec2 instance

Я пытаюсь подключиться к базе данных с помощью SQLDeveloper, и я получаю следующую ошибку:

An Error was Encountered performing The requested operation:

IO Error: Conection reset

Vendor code 17002.

Не могли бы вы помочь мне?

4b9b3361

Ответ 1

Ниже перечислены шаги, которые могут исправить ошибку:

  • Нажмите Windows + R
  • Введите services.msc и нажмите Enter
  • Найти все службы
  • Начиная с ora запустите эти службы и подождите!!
  • Когда инициализируется служба вашего сервера (в моем случае это было orcl)
  • Теперь запустите mysql или что вы используете и запустите coding.P

Ответ 2

Я столкнулся с той же проблемой с ORACLE 11G express в Windows.
После долгого ожидания я получил то же сообщение об ошибке.

Мое решение заключается в убедиться, что имя хоста в tnsnames.ora(обычно это не «localhost» ) и имя хоста по умолчанию в sql-разработчике (обычно это «localhost» ) одинаково. Вы можете либо сделать это, изменив его в tnsnames.ora, либо заполнив то же самое в разработчике sql.

О, конечно, вам нужно перезагрузить все службы оракула (просто чтобы быть в безопасности).

Надеюсь, что это поможет.


Я снова столкнулся с подобной проблемой на другой машине, но на этот раз выше решение не работает.
После некоторых попыток я обнаружил, что перезапуск всех связанных с oracle сервисов может решить проблему. Первоначально, когда установка завершена, соединение может быть выполнено. Как-то после нескольких перезагрузок компьютера возникает проблема.
Я меняю все службы оракула с временем начала, как авто. И как только я не смог подключиться, я перезапускаю их снова и снова (основная служба должна быть перезапущена в последнем порядке) и работает нормально.

В какой-то статье говорится, что это может быть связано с проблемой MTS. Проблема с Microsoft. Может быть!

Ответ 3

У меня была та же проблема. Я начал использовать свой слуховой аппарат Oracle TNS, затем он работает нормально снова.

См. LISTENER: TNS-12545… Нет такого файла или каталога.

Ответ 4

В вашем случае «Код 17002 поставщика» является эквивалентом ошибки ORA-12541: скорее всего, ваш слушатель выключен или имеет неправильный порт или имя службы. Из документов:

ORA-12541: TNS no listener

Причина. Слушатель исходного репозитория не запущен.

Действие: Запустите прослушиватель на компьютере, на котором находится исходный репозиторий.

If you search for the Oracle error “Io Exception: The Network Adapter could not establish the connection” (ORA-17002) you will find plenty of discussion on the web. It usually comes down to what the message says, that it is a network issue. But the error can also be caused by e.g. incompatible jar files. In my case, however, I was trying to access a 11g R2 instance from SQL Developer and during initial setup everything had worked. And local access, also with SQL Developer, worked absolutely fine.

Solution: Replace “simple” DB hostname with the fully qualified one. I am not sure why this changed the behavior. I can think of either a DNS setup issue (although my search list included the domain) or some kind of reverse lookup logic that is being applied. Anyway, I wanted to share this finding and also record it for my own future use.

Возможно, вам также будет интересно:

  • Oracle home key ошибка
  • Oracle exception код ошибки
  • Oracle cloud ошибка при обработке операции
  • Oracle 01033 ошибка что значит
  • Ora 29400 ошибка данных картриджа

  • Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии