Ora 12170 tns connect timeout occurred что делать
Пользователи не могут подключиться к базе. Обычно при этом они получают ошибки: ORA-12547: TNS:lost contact или ORA-12637: Packet receive failed.
В sqlnet.log на сервере сообщения об ошибке ORA-12170: TNS:Connect timeout. Еще для версий 10g и выше, в alert.log могут быть сообщения WARNING: inbound connection timed out (ORA-3136).
VERSION INFORMATION:
TNS for 64-bit Windows: Version 10.2.0.4.0 — Production
Oracle Bequeath NT Protocol Adapter for 64-bit Windows: Version 10.2.0.4.0 — Production
Windows NT TCP/IP NT Protocol Adapter for 64-bit Windows: Version 10.2.0.4.0 — Production
Time: 13-FEB-2013 13:47:12
Tracing not turned on.
Tns error struct:
ns main err code: 12535
TNS-12535: TNS:operation timed out
ns secondary err code: 12560
nt main err code: 505
TNS-00505: Operation timed out
nt secondary err code: 60
nt OS err code: 0
Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=10.77.116.47)(PORT=2971))
***********************************************************************
Для разных ОС, параметр ‘nt secondary err code‘ может быть разным
For the Solaris system: nt secondary err code: 145:
ETIMEDOUT 145 /* Connection timed out */
For the Linux operating system: nt secondary err code: 110
ETIMEDOUT 110 Connection timed out
For the HP-UX system: nt secondary err code: 238:
ETIMEDOUT 238 /* Connection timed out */
For AIX: nt secondary err code: 78:
ETIMEDOUT 78 /* Connection timed out */
For Windows based platforms: nt secondary err code: 60 (which translates to Winsock Error: 10060)
Выдержка из документации
ORA-12170: TNS:Connect timeout occurred
Cause: The server shut down because connection establishment or communication with a client failed to complete within the allotted time interval. This may be a result of network or system delays; or this may indicate that a malicious client is trying to cause a Denial of Service attack on the server.
Action: If the error occurred because of a slow network or system, reconfigure one or all of the parameters SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT in sqlnet.ora to larger values. If a malicious client is suspected, use the address in sqlnet.log to identify the source and restrict access. Note that logged addresses may not be reliable as they can be forged (e.g. in TCP/IP).
Смысл этой ошибки в том что соединение не может быть установлено в течение отведенного интервала времени. А вот причин по которым это происходит может быть великое множество.
Как видно, основная рекомендация — увеличить параметры SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT и SQLNET.RECV_TIMEOUT. Можно попробовать сделать это, но это может не помочь. Поэтому лучше попробовать разобраться в корне проблемы.
Несколько основных причин ошибки и способы их решения
1) Серверные ресурсы перегружены.
Проверить насколько загружен сервер (процессор, диски, сеть). Выявить причину утечки ресурсов и устранить её. Большая загрузка сети может косвенно указывать на DoS. Если вы обнаружили высокую нагрузку сервера, но она оказалась полезной — то это указывает на нехватку мощности сервера и пора задуматься об его обновлении или замене.
©Bobrovsky Dmitry
2) Проблемы сети.
©Bobrovsky Dmitry
Если есть возможность проверить сетевой канал от клиента до сервера с помощью специализированых аппаратных или программных средств. Если нет, то можно запуститесь ping на некоторое время и посмотреть, какое время отклика и нет ли потерь пакетов.
3) База данных и Listener не функционируют.
Проверить что сама база данных и Listener запущены и работают нормально, что к ним можно подключиться локально или с других компьютеров сети.
Dmitry Bobrovsky
4) Проблемы из-за антивируса или firewall.
Dmitry Bobrovsky
Отключить или даже полностью деинсталировать антивирус или firewall.
5) Проблемы с DNS.
Либо прописать соответствующие записи в файл host либо во всех конфигурационных файлах oracle net использовать вместо имен — ip-адреса.
Запись fatal ni connect error 12170 ns main err code 12535 впервые появилась Dmitry Bobrovsky Blog
ORA_EXCEL
API Oracle PL/SQL to Excel XSLX Самый мощный PL/SQL Excel API в мире.
- RU
- EN
- DE
- ES
- JP
- Домой
- Цены
- Примеры
- _Hello world
- _Запрос на экспорт листа
- _Семейство шрифтов, цвет и размер
- _Пользовательский формат ячейки
- _Горизонтальное и вертикальное выравнивание
- _Жирный, курсив и подчеркивание
- _Границы со стилями и цветами
- _Объединять и выравнивать ячейки
- _Перенос текста
- _Ширина столбца и высота строки
- _Несколько листов
- _Несколько документов
- _Экспорт из выбора
- _Добавить 1.048.576 строк на лист
- _Сохранить лист в файл XLSX
- _Сохранить лист в BLOB
- _Установить размер листовой бумаги
- _Отступ слева и справа от текста
- _Неограниченное количество листов на документ
- _Установить цвет фона ячейки
- _Установить ширину столбца
- _Установить высоту строки
- _Задать поля листа
- _Задать заголовок листа и текст нижнего колонтитула
- _Установить комментарий к ячейке
- _Фильтровать ячейки
- _Повернуть текст
- _Скрыть столбцы и строки
- _Установить формулы столбца
- _Установить портрет или альбомную ориентацию
- _Установить ячейку как гиперссылку
- _Группировать столбцы
- _Сохранить BLOB в файл
- _Стоп-кадр по вертикали
- _Стоп-кадр по горизонтали
- _Стиль ячейки
- _Установить автора документа
- _Установить систему дат
- _Читать документ xlsx
- _Установить активную ячейку
- _Список — проверка данных
- _Целое число — проверка данных
- _Десятичное число — проверка данных
- _Дата — проверка данных
- _Время — проверка данных
- _Длина текста — проверка данных
- add_sheet
- add_row
- query_to_sheet
- set_row_height
- set_cell_value
- set_cell_font
- set_default_font
- set_cell_bold
- set_cell_italic
- set_cell_underline
- set_cell_color
- set_cell_bg_color
- set_cell_align_left
- set_cell_align_right
- set_cell_align_center
- set_cell_vert_align_top
- set_cell_vert_align_middle
- set_cell_vert_align_bottom
- set_column_width
- set_cell_border_top
- set_cell_border_bottom
- set_cell_border_left
- set_cell_border_right
- set_cell_border
- set_cell_wrap_text
- merge_cells
- merge_rows
- set_cell_format
- set_cell_formula
- set_cell_rotate_text
- set_sheet_margins
- set_sheet_landscape
- set_sheet_paper_size
- set_sheet_header_text
- set_sheet_footer_text
- set_cell_hyperlink
- set_cell_indent_left
- set_cell_indent_right
- set_cell_comment
- hide_column
- hide_row
- set_cells_filter
- save_to_file
- save_to_blob
- set_1904_date_system
- set_1900_date_system
- set_document_author
- add_style
- set_cell_style
- freeze_panes_horizontal
- freeze_panes_vertical
- blob_to_file
- group_columns
- set_cell_validation_list
- set_cell_validation_integer
- set_cell_validation_decimal
- set_cell_validation_date
- set_cell_validation_time
- set_cell_validation_text_len
Код ошибки базы данных Oracle ORA-12170 Описание
База данных: 10g Выпуск 1
Код ошибки: ORA-12170
Описание: TNS:истекло время ожидания соединения
Причина: Сервер отключился, поскольку установление соединения или связь с клиентом не удалось завершить в течение выделенного интервала времени. Это может быть результатом сетевых или системных задержек; или это может указывать на то, что злонамеренный клиент пытается вызвать атаку типа «отказ в обслуживании» на сервере.
Действие: Если ошибка произошла из-за медленной сети или системы, перенастройте один или все параметры SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT в sqlnet.ora для больших значений. Если подозревается злонамеренный клиент, используйте адрес в sqlnet.log, чтобы определить источник и ограничить доступ. Обратите внимание, что зарегистрированные адреса могут быть ненадежными, так как они могут быть подделаны (например, в TCP / IP).База данных: 10g Выпуск 1
Код ошибки: ORA-12170
Описание: TNS:Connect timeout occurred
Причина: The server shut down because connection establishment or communication with a client failed to complete within the allotted time interval. This may be a result of network or system delays; or this may indicate that a malicious client is trying to cause a Denial of Service attack on the server.
Действие: If the error occurred because of a slow network or system, reconfigure one or all of the parameters SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT in sqlnet.ora to larger values. If a malicious client is suspected, use the address in sqlnet.log to identify the source and restrict access. Note that logged addresses may not be reliable as they can be forged (e.g. in TCP/IP).База данных: 10g Выпуск 2
Код ошибки: ORA-12170
Описание: TNS:истекло время ожидания соединения
Причина: Сервер отключился, поскольку установление соединения или связь с клиентом не удалось завершить в течение выделенного интервала времени. Это может быть результатом сетевых или системных задержек; или это может указывать на то, что злонамеренный клиент пытается вызвать атаку типа «отказ в обслуживании» на сервере.
Действие: Если ошибка произошла из-за медленной сети или системы, перенастройте один или все параметры SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT в sqlnet.ora для больших значений. Если подозревается злонамеренный клиент, используйте адрес в sqlnet.log, чтобы определить источник и ограничить доступ. Обратите внимание, что зарегистрированные адреса могут быть ненадежными, так как они могут быть подделаны (например, в TCP / IP).База данных: 11g Выпуск 1
Код ошибки: ORA-12170
Описание: TNS:истекло время ожидания соединения
Причина: Сервер отключился, поскольку установление соединения или связь с клиентом не удалось завершить в течение выделенного интервала времени. Это может быть результатом сетевых или системных задержек; или это может указывать на то, что злонамеренный клиент пытается вызвать атаку типа «отказ в обслуживании» на сервере.
Действие: Если ошибка произошла из-за медленной сети или системы, перенастройте один или все параметры SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT в sqlnet.ora для больших значений. Если подозревается злонамеренный клиент, используйте адрес в sqlnet.log, чтобы определить источник и ограничить доступ. Обратите внимание, что зарегистрированные адреса могут быть ненадежными, так как они могут быть подделаны (например, в TCP / IP).База данных: 11g Выпуск 2
Код ошибки: ORA-12170
Описание: TNS:истекло время ожидания соединения
Причина: Сервер отключился, поскольку установление соединения или связь с клиентом не удалось завершить в течение выделенного интервала времени. Это может быть результатом сетевых или системных задержек; или это может указывать на то, что злонамеренный клиент пытается вызвать атаку типа «отказ в обслуживании» на сервере.
Действие: Если ошибка произошла из-за медленной сети или системы, перенастройте один или все параметры SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT в sqlnet.ora для больших значений. Если подозревается злонамеренный клиент, используйте адрес в sqlnet.log, чтобы определить источник и ограничить доступ. Обратите внимание, что зарегистрированные адреса могут быть ненадежными, так как они могут быть подделаны (например, в TCP / IP).База данных: 12c Выпуск 1
Код ошибки: ORA-12170
Описание: TNS:истекло время ожидания соединения
Причина: Сервер отключился, поскольку установление соединения или связь с клиентом не удалось завершить в течение выделенного интервала времени. Это может быть результатом сетевых или системных задержек; или это может указывать на то, что злонамеренный клиент пытается вызвать атаку типа «отказ в обслуживании» на сервере.
Действие: Если ошибка произошла из-за медленной сети или системы, перенастройте один или все параметры SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT в sqlnet.ora для больших значений. Если подозревается злонамеренный клиент, используйте адрес в sqlnet.log, чтобы определить источник и ограничить доступ. Обратите внимание, что зарегистрированные адреса могут быть ненадежными, так как они могут быть подделаны (например, в TCP / IP).База данных: 12c Выпуск 2
Код ошибки: ORA-12170
Описание: TNS:истекло время ожидания соединения
Причина: Сервер отключился, поскольку установление соединения или связь с клиентом не удалось завершить в течение выделенного интервала времени. Это может быть результатом сетевых или системных задержек; или это может указывать на то, что злонамеренный клиент пытается вызвать атаку типа «отказ в обслуживании» на сервере.
Действие: Если ошибка произошла из-за медленной сети или системы, перенастройте один или все параметры SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT в sqlnet.ora для больших значений. Если подозревается злонамеренный клиент, используйте адрес в sqlnet.log, чтобы определить источник и ограничить доступ. Обратите внимание, что зарегистрированные адреса могут быть ненадежными, так как они могут быть подделаны (например, в TCP / IP).База данных: 18c Выпуск 1
Код ошибки: ORA-12170
Описание: TNS:истекло время ожидания соединения
Причина: Сервер отключился, поскольку установление соединения или связь с клиентом не удалось завершить в течение выделенного интервала времени. Это может быть результатом сетевых или системных задержек; или это может указывать на то, что злонамеренный клиент пытается вызвать атаку типа «отказ в обслуживании» на сервере.
Действие: Если ошибка произошла из-за медленной сети или системы, перенастройте один или все параметры SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT в sqlnet.ora для больших значений. Если подозревается злонамеренный клиент, используйте адрес в sqlnet.log, чтобы определить источник и ограничить доступ. Обратите внимание, что зарегистрированные адреса могут быть ненадежными, так как они могут быть подделаны (например, в TCP / IP).База данных: 19c Выпуск 1
Код ошибки: ORA-12170
Описание: TNS:истекло время ожидания соединения
Причина: Сервер отключился, поскольку установление соединения или связь с клиентом не удалось завершить в течение выделенного интервала времени. Это может быть результатом сетевых или системных задержек; или это может указывать на то, что злонамеренный клиент пытается вызвать атаку типа «отказ в обслуживании» на сервере.
Действие: Если ошибка произошла из-за медленной сети или системы, перенастройте один или все параметры SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT в sqlnet.ora для больших значений. Если подозревается злонамеренный клиент, используйте адрес в sqlnet.log, чтобы определить источник и ограничить доступ. Обратите внимание, что зарегистрированные адреса могут быть ненадежными, так как они могут быть подделаны (например, в TCP / IP).
Библиотека кодов ошибок базы данных Oracle
- _10gR1 Коды ошибок
- _10gR2 Коды ошибок
- _11gR1 Коды ошибок
- _11gR2 Коды ошибок
- _12cR1 Коды ошибок
- _12cR2 Коды ошибок
- _18cR1 Коды ошибок
- _19cR1 Коды ошибок
Ora 12170 tns connect timeout occurred что делать

Error ORA-12170: “TNS: Connect Timeout Occurred”
There are several possible causes for error ORA-12170. They include: problems with the firewall, when the database is down, when the listener is down, if the sqlnet.ora parm is invalid, among other possible causes.
To fix the error, the user should consider all possible causes and their corresponding solutions on how to get rid of the error. The solution to error ORA-12170 will emerge through process of elimination.
Check to make sure there is no firewall in place between the client and server. If there is, disable the firewall and try again
If the error occurred because there was a delay in the system or network, turn on tracing to determine exactly where clients are timing out.
It may be the case that the Oracle service is running on an IP address while the host is configured to another IP address. To determine the IP address of the Oracle service, issue an lsnrctl status command. Check the address that is reported. To determine the IP address of the host, issue an ipconfig or ifconfig. This is dependent on your operation system; use ipconfig for Windows OS and ifconfig for Linux. To avoid seeing error ORA-12170, use a static IP address rather than a DHCP for assigning an IP address of the host.
In one case, the server may have shut down because the connection establishment or communication with a client did not complete in an allotted time interval. This is probably due to delays within the system or the network, or it may possibly be a client that is trying to maliciously attack by causing a Denial of Service attack on the server.
If the error is occurring because of a slow network or system, you may fix the error by reconfiguring the following parameters in sqlnet.ora to larger values:
SQLNET.INBOUND_CONNECT_TIMEOUT, SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT
If the error is occurring due to a malicious attack via a Denial of Service attack, you may use the sqlnet.log to identify the source of attack and restrict the attacker’s access. However, users should be aware that logged addresses might not be entirely reliable. To find your sqlnet.ora file, go to your $ORACLE_HOME/network/admin directory. If the timeout occurs before the IP address can be retrieved by the database server, enable listener tracing to determine the client who made the request.
If you continue to experience problems, contact your business objects administrator or database administrator with the error message information.
ORA-12170: TNS:Connect timeout occurred
I was trying to connect to the database here in my laptop using Oracle Toad but I kept on having this error:
ORA-12170: TNS:Connect timeout occurred
What are the possible reasons why I kept on having this error? I accessed the same database yesterday and was able to accessed it.
55.2k 30 30 gold badges 205 205 silver badges 201 201 bronze badges
asked May 31, 2014 at 12:35
Pseudonymous Pseudonymous
635 1 1 gold badge 5 5 silver badges 13 13 bronze badgesHas your laptop been given a new IP address by DHCP, perhaps? What IP is the listener/connection using at the moment?
May 31, 2014 at 12:39
@AlexPoole hi, is it because yesterday i was connecting to a WIFI connection different from the WIFI connection i’m using now?
May 31, 2014 at 12:43
Probably, they usually use DHCP; is your DB connection going to localhost (127.0.0.1), or a real IP? If it’s real you’ll need to change it your current IP, not the one you had yesterday. You need to check what address your listener is using too though. It might have the same real (old) IP, or could be using you PC name, which might be working. Run lsnrctl status to see what it is doing now.
May 31, 2014 at 12:59
@AlexPoole Im connecting to a real IP(192.168.1.6) and in the lsnrctl status command i had these: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))) does it mean i need to change the listener in listener.ora?
May 31, 2014 at 13:08
The address in the connection needs to match the listener address; so yes, change the connection to 127.0.0.1.
May 31, 2014 at 13:54
9 Answers 9
[Gathering the answers in the comments]
The problem is that the Oracle service is running on a IP address, and the host is configured with another IP address.
To see the IP address of the Oracle service, issue an lsnrctl status command and check the address reported (in this case is 127.0.0.1, the localhost):
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))To see the host IP address, issue the ipconfig (under windows) or ifconfig (under linux) command.
Howewer, in my installation, the Oracle service does not work if set on localhost address, I must set the real host IP address (for example 192.168.10.X).
To avoid this problem in the future, do not use DHCP for assigning an IP address of the host, but use a static one.
answered Oct 30, 2014 at 9:26
4,549 3 3 gold badges 37 37 silver badges 44 44 bronze badges» lsnrctl status » did great for me. I found some other host. then, routed that host to 127.0.0.1, Issue solved. Thanks !
May 22, 2015 at 4:14
It is because of conflicting SID. For example, in your Oracle12cBase\app\product\12.1.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora file, connection description for ORCL is this:
ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )And, you are trying to connect using the connection string using same SID but different IP, username/password, like this:
To resolve this, make changes in the tnsnames.ora file:
ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.130.52)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )2,673 3 3 gold badges 25 25 silver badges 33 33 bronze badges
answered Feb 8, 2017 at 8:45
Ashish Jain Ashish Jain
457 1 1 gold badge 6 6 silver badges 20 20 bronze badgesCheck the FIREWALL, to allow the connection at the server from your client. By allowing Domain network or create rule.
answered Nov 10, 2016 at 5:20
11 1 1 bronze badgeThe oracle installer doesn’t seem to add the firewall rule (or warn you that you need to do it manually), sick of oracle its just one error after another.
Nov 23, 2016 at 10:36
Issue because connection establishment or communication with a client failed to complete within the allotted time interval. This may be a result of network or system delays.
answered May 23, 2017 at 9:23
Vishal Tathe Vishal Tathe
180 1 1 silver badge 8 8 bronze badgesTROUBLESHOOTING STEPS (Doc ID 730066.1)
Connection Timeout errors ORA-3135 and ORA-3136 A connection timeout error can be issued when an attempt to connect to the database does not complete its connection and authentication phases within the time period allowed by the following: SQLNET.INBOUND_CONNECT_TIMEOUT and/or INBOUND_CONNECT_TIMEOUT_ server-side parameters.
Starting with Oracle 10.2, the default for these parameters is 60 seconds where in previous releases it was 0, meaning no timeout.
On a timeout, the client program will receive the ORA-3135 (or possibly TNS-3135) error:
ORA-3135 connection lost contact
and the database will log the ORA-3136 error in its alert.log:
. Sat May 10 02:21:38 2008 WARNING: inbound connection timed out (ORA-3136) .
When a database session is in the authentication phase, it will issue a sequence of SQL statements. The authentication is not complete until all these are parsed, executed, fetched completely. Some of the SQL statements in this list e.g. on 10.2 are:
select value$ from props$ where name = 'GLOBAL_DB_NAME' select privilege#,level from sysauth$ connect by grantee#=prior privilege# and privilege#>0 start with grantee#=:1 and privilege#>0 select SYS_CONTEXT('USERENV', 'SERVER_HOST'), SYS_CONTEXT('USERENV', 'DB_UNIQUE_NAME'), SYS_CONTEXT('USERENV', 'INSTANCE_NAME'), SYS_CONTEXT('USERENV', 'SERVICE_NAME'), INSTANCE_NUMBER, STARTUP_TIME, SYS_CONTEXT('USERENV', 'DB_DOMAIN') from v$instance where INSTANCE_NAME=SYS_CONTEXT('USERENV', 'INSTANCE_NAME') select privilege# from sysauth$ where (grantee#=:1 or grantee#=1) and privilege#>0 ALTER SESSION SET NLS_LANGUAGE= 'AMERICAN' NLS_TERRITORY= 'AMERICA' NLS_CURRENCY= '$' NLS_ISO_CURRENCY= 'AMERICA' NLS_NUMERIC_CHARACTERS= '.,' NLS_CALENDAR= 'GREGORIAN' NLS_DATE_FORMAT= 'DD-MON-RR' NLS_DATE_LANGUAGE= 'AMERICAN' NLS_SORT= 'BINARY' TIME_ZONE= '+02:00' NLS_COMP= 'BINARY' NLS_DUAL_CURRENCY= '$' NLS_TIME_FORMAT= 'HH.MI.SSXFF AM' NLS_TIMESTAMP_FORMAT= 'DD-MON-RR HH.MI.SSXFF AM' NLS_TIME_TZ_FORMAT= 'HH.MI.SSXFF AM TZR' NLS_TIMESTAMP_TZ_FORMAT= 'DD-MON-RR HH.MI.SSXFF AM TZR'NOTE: The list of SQL above is not complete and does not represent the ordering of the authentication SQL . Differences may also exist from release to release.
The above SQL statements need to be Parsed, Executed and Fetched as happens for all SQL inside an Oracle Database. It follows that any problem encountered during these phases which appears as a hang or severe slow performance may result in a timeout.
Symptoms of such hangs will be seen by the authenticating session as waits for: • cursor: pin S wait on X • latch: row cache objects • row cache lock Other types of wait events are possible; this list may not be complete.
The issue here is that the authenticating session is blocked waiting to get a shared resource which is held by another session inside the database. That blocker session is itself occupied in a long-running activity (or its own hang) which prevents it from releasing the shared resource needed by the authenticating session in a timely fashion. This results in the timeout being eventually reported to the authenticating session.
- Troubleshooting of Authentication hangs
In such situations, we need to find out the blocker process holding the shared resource needed by the authenticating session in order to see what is happening to it.
Typical diagnostics used in such cases are the following:
- Three consecutive systemstate dumps at level 266 during the time that one or more authenticating sessions are blocked. It is likely that the blocking session will have caused timeouts to more than one connection attempt. Hence, systemstate dumps can be useful even when the time needed to generate them exceeds the period of a single timeout e.g. 60 sec:
$ sqlplus -prelim '/ as sysdba' oradebug setmypid oradebug unlimit oradebug dump systemstate 266 . wait 90 seconds oradebug dump systemstate 266 . wait 90 seconds oradebug dump systemstate 266 quit- ASH reports covering e.g. 10-15 minutes of a time period during which several timeout errors were seen.
- If possible, Two consecutive queries on V$LATCHHOLDER view for the case where the shared resource being waited for is a latch. select * from v$latchholder; The systemstate dumps should help in identifying the blocker session. Level 266 will show us in what code it is executing which may help in locating any existing bug as the root cause.
Examples of issues which can result in Authentication hangs
- Unpublished Bug 6879763 shared pool simulator bug fixed by patch for unpublished Bug 6966286 see Note 563149.1
- Unpublished Bug 7039896 workaround parameter _enable_shared_pool_durations=false see Note 7039896.8
- Other approaches to avoid the problem
In some cases, it may be possible to avoid problems with Authentication SQL by pinning such statements in the Shared Pool soon after the instance is started and they are freshly loaded. You can use the following artcile to advise on this: Document 726780.1 How to Pin a Cursor in the Shared Pool using DBMS_SHARED_POOL.KEEP
Pinning will prevent them from being flushed out due to inactivity and aging and will therefore prevent them for needing to be reloaded in the future i.e. needing to be reparsed and becoming susceptible to Authentication hang issues.