ORA-12170 Timeout error occured with sqlnet.log - oracle

I am getting error ORA-12170 while connecting from C# application to Oracle database. I searched and found somewhere that the error description can be found in sqlnet.log file. What I am pasting is the sqlnet.log content. How can I overcome this problem?
Fatal NI connect error 12170.
VERSION INFORMATION:
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
Windows NT TCP/IP NT Protocol Adapter for 32-bit Windows: Version 10.2.0.1.0 - Production
Time: 08-JUN-2016 18:49:09
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:

main err code: 12535
This only tells there is a time-out
secondary err code: 12560
A quick look-up tells us this is "ORA-12560: TNS:protocol adaptor error".
Have you started the Oracle service yet?
To check the Oracle services, you can use command line to run "services.msc", then locate the Oracle services and start them.

Related

What are the best practices for troubleshooting Heterogeneous ODBC connections?

I am trying to establish a heterogeneous ODBC connection from an Oracle 21c XE database to a Progress OpenEdge 11.7 database. I have installed a 32 bit ODBC driver on the Windows 2019 server where the 21c XE DB resides. I have set up an ODBC System DSN, tested it and it works.
I created a initTIMEDATA.ora file in the C:\app\Administrator\product\21c\homes\OraDB21Home1\hs\admin folder.
It contains;
HS_FDS_CONNECT_INFO = TimeData
HS_FDS_TRACE_LEVEL = 4
HS_FDS_TRACE_FILE_NAME = TimeData.trc
Where TimeData matches the ODBC System DSN name.
I modified the listener.ora adding;
(SID_DESC=
(SID_NAME=TimeData)
(ORACLE_HOME=C:\app\Administrator\product\21c\dbhomeXE)
(PROGRAM=C:\app\Administrator\product\21c\dbhomeXE\bin\dg4odbc)
(ENVS = LD_LIBRARY_PATH=C:\Progressx86\OpenEdge\lib:C:\app\Administrator\product\21c\dbhomeXE\bin)
)
I modified my tnsnames.ora file adding;
TIMEDATA=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=10.254.10.41)
(PORT=4621)
)
(CONNECT_DATA=
(SID=TimeData))
(HS=OK))
I created a DBLink like;
CREATE PUBLIC DATABASE LINK time_data_link CONNECT TO "sqluser" IDENTIFIED BY "myPassword" USING 'TIMEDATA';
After restarting everything (DB, Listener...) the listener shows;
Service "TimeData" has 1 instance(s).
Instance "TimeData", status UNKNOWN, has 1 handler(s) for this service...
When I try to run a query;
SELECT * FROM employee_view#time_data_link;
I get;
ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535
ORA-02063: preceding 2 lines from TIME_DATA_LINK
28545. 0000 - "error diagnosed by Net8 when connecting to an agent"
*Cause: An attempt to call an external procedure or to issue SQL
to a non-Oracle system on a Heterogeneous Services database link
failed at connection initialization. The error diagnosed
by Net8 NCR software is reported separately.
*Action: Refer to the Net8 NCRO error message. If this isn't clear,
check connection administrative setup in tnsnames.ora
and listener.ora for the service associated with the
Heterogeneous Services database link being used, or with
'extproc_connection_data' for an external procedure call.
Error at Line: 1 Column: 29
I see no errors in the listener.log, I cannot find TimeData.trc. In poking around the DB trace files I found a trace file related with multiple copies of;
HS connect: nscall returned status ffffffff (-1)
ns main err code: 12569
ns (2) err code: 0
nt main err code: 0
nt (2) err code: 0
nt OS err code: 0
*** 2022-04-03T17:01:07.758909-04:00 (XEPDB1(3))
HS: Unable to establish RPC connection to HS Agent...
HS: ... Agent SID = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.254.10.41)(PORT=4621))(CONNECT_DATA=(SID=TimeData))), NCR error = 65535 Unable to retrieve text of NETWORK/NCR message 65535
I have reached the end of my troubleshooting skills and hope someone else may be able to point me in the right direction.
I had two problems.
The TNSNAMES.ORA file needed to point to the Oracle DB server, running on localhost in my case. Once I changed this, the error changed to
Error;
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application {IM014}
New TNSNAMES.ORA;
TIMEDATA=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=localhost)
(PORT=1521)
)
(CONNECT_DATA=
(SID=TimeData))
(HS=OK))
Once I saw this error it became apparent I needed the 64 bit version of the ODBC driver which I acquired.
After making these changes everything seems to work.

How to resolve (error) ERR unknown command 'service' error in Redis in windows machine?

I installed Redis-cache in my windows machine,after successfully installed i open reddis-cli in that i run service redis_6379 status it's showing following error
(error) ERR unknown command 'service'
How to resolve this error and start the redis server ...?
These are the info about my server
`
Server
redis_version:3.0.504
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:a4f7a6e86f2d60b3
redis_mode:standalone
os:Windows
arch_bits:64
multiplexing_api:WinSock_IOCP
process_id:22004
run_id:7db1c339b5291dc237372c740f8630fd0c665442
tcp_port:6379
uptime_in_seconds:791
uptime_in_days:0
hz:10
lru_clock:2329164
config_file:C:\Program Files\Redis\redis.windows-service.conf
Clients
connected_clients:1
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0
Memory
used_memory:693104
used_memory_human:676.86K
used_memory_rss:655352
used_memory_peak:693104
used_memory_peak_human:676.86K
used_memory_lua:36864
mem_fragmentation_ratio:0.95
mem_allocator:jemalloc-3.6.0
Persistence
loading:0
rdb_changes_since_last_save:0
rdb_bgsave_in_progress:0
rdb_last_save_time:1629718325
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:-1
rdb_current_bgsave_time_sec:-1
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok
Stats
total_connections_received:2
total_commands_processed:2
instantaneous_ops_per_sec:0
total_net_input_bytes:290
total_net_output_bytes:2142
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.00
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:0
evicted_keys:0
keyspace_hits:0
keyspace_misses:0
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:0
migrate_cached_sockets:0
Replication
role:master
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0
CPU
used_cpu_sys:0.28
used_cpu_user:0.36
used_cpu_sys_children:0.00
used_cpu_user_children:0.00
Cluster
cluster_enabled:0
Keyspace
`
The error message is quite clear, there's no Redis command called service.
If you want to check the status of Redis server, you can run INFO command instead. Check thishttps://redis.io/commands) for a list of commands that Redis supports.

How to connect to a Gremlin Websocket in Go?

I'm trying to connect to Gremlin which should be running on port 8182 ([INFO] GremlinServer$1 - Channel started at port 8182)
When I'm connecting to: ws://127.0.0.1:8182 I'm getting the response:
2017/11/03 17:20:04 ERROR: database with the name 'gremlin' gave an error when connecting: websocket: bad handshake.
The Gremlin server responds with:
[WARN] HttpGremlinEndpointHandler - Invalid request - responding with 400 Bad Request and no gremlin script supplied
I'm using Gorilla Websocket in Go to connect:
gremlinGrpcAddress := fmt.Sprintf("ws://%s:%d/", f.config.Host, f.config.Port)
var dialer *websocket.Dialer
clientConn, _, err := dialer.Dial(gremlinGrpcAddress, nil)
if err != nil {
return err
}
f.client = clientConn
UPDATE:
Connecting to echo.websocket.org works, so somehow it is something in the Gremlin server.
The answer lies in the config YAML file.
What is needed is the correct channelizer.
GOOD:
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
Connect to ws://localhost:8182/gremlin instead of ws://localhost:8182. There are several references to it in the Apache TinkerPop documentation and the go-gremlin README.

ORA-21535 error - oracle timeout issue

I am getting the ORA-21535 error in Oracle Alert Log file intermittently. First few hours my application is working fine. After that I'm getting time out issue.
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: 110
nt OS err code: 0
Client Address: XXXXXXXXX
Note: I do not have any other application log other than "alert Log".
You could maybe solve your problem by setting SQLNET.EXPIRE_TIME parameter in the sqlnet.ora of your Oracle server.
With this parameter database will probe the application server every n minutes where n is the setting number.

JDBC and Oracle 11g connection reset on ubuntu

I am having this strange issue connection JDBC to Oracle 11g. It started happening suddenly this Monday without any settings changes that either me or the team were aware of. Reading in Stackoverflow and Oracle forums (see links at the bottom) I've learned that there has been an issue with the generation of random bytes on linux 64bit machines. It led my to try several things, which unfortunately didn't work. Here is a summary of all information I'm aware of.
The weird thing is that I can connect over the terminal using sqlplus, but not using JDBC.
Thank you for any ideas or help,
Amit
My Setup:
OS: Ubuntu 12.04
Java: Both 7 and 6_45 (Issue is the same)
JDBC: Downloaded from the Oracle official site (see further description down)
Connection behind a Cisco VPN
JDBC-MANIFESTS:
odbc7.jar:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 20.12-b01 (Sun Microsystems Inc.)
Implementation-Vendor: Oracle Corporation
Implementation-Title: JDBC
Implementation-Version: 12.1.0.1.0
Repository-Id: JAVAVM_12.1.0.1.0_LINUX.X64_130403
Specification-Vendor: Sun Microsystems Inc.
Specification-Title: JDBC
Specification-Version: 4.0
Main-Class: oracle.jdbc.OracleDriver
sealed: true
Name: oracle/sql/converter/
Sealed: false
Name: oracle/sql/
Sealed: false
Name: oracle/sql/converter_xcharset/
Sealed: false
odbc6.jar:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 20.12-b01 (Sun Microsystems Inc.)
Implementation-Vendor: Oracle Corporation
Implementation-Title: JDBC
Implementation-Version: 12.1.0.1.0
Repository-Id: JAVAVM_12.1.0.1.0_LINUX.X64_130403
Specification-Vendor: Sun Microsystems Inc.
Specification-Title: JDBC
Specification-Version: 4.0
Main-Class: oracle.jdbc.OracleDriver
sealed: true
Name: oracle/sql/converter/
Sealed: false
Name: oracle/sql/
Sealed: false
Name: oracle/sql/converter_xcharset/
Sealed: false
On Friday everything was still working:
I could start my application and have a Java connection to the Oracle DB.
Since Monday I'm having this issue
My old computer (Ubuntu 12.04) as well, I hadn't touched for almost a week started having this issue too, even though I left it in a working state.
Terminal connection using SQLPLUS is working:
amit#mymachine:/usr/lib/oracle$ sqlplus /#DB_HOST_IP:1521/DB_NAME
SQL*Plus: Release 12.1.0.1.0 Production on Tue Apr 22 11:35:58 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Release 11.2.0.3.0 - 64bit Production
SQL>
But connection with JDBC is failing:
DriverManager.getConnection(
"jdbc:oracle:thin:#//DB_HOST_IP:1521/DB_NAME", username,
password);
Hangs for about 20 seconds and throws:
ava.sql.SQLRecoverableException: IO Error: Connection reset
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:682)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:711)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:385)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:30)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:558)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at OracleJDBC.main(OracleJDBC.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at oracle.net.ns.Packet.receive(Packet.java:311)
at oracle.net.ns.DataPacket.receive(DataPacket.java:105)
at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:305)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:249)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:171)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:89)
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:123)
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:79)
at oracle.jdbc.driver.T4CMAREngineStream.unmarshalUB1(T4CMAREngineStream.java:426)
at oracle.jdbc.driver.T4C8TTIdty.receive(T4C8TTIdty.java:688)
at oracle.jdbc.driver.T4C8TTIdty.doRPC(T4C8TTIdty.java:595)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1439)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:486)
... 12 more
From the server's log:
Fatal NI connect error 12170.
VERSION INFORMATION:
TNS for Linux: Version 11.2.0.3.0 - Production
Oracle Bequeath NT Protocol Adapter for Linux: Version
11.2.0.3.0 - Production
TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production
Time: 22-APR-2014 09:57:45
Tracing not turned on.
Tns error struct:
ns main err code: 12535
TNS-12535: TNS:operation timed out
ns secondary err code: 12606
nt main err code: 0
nt secondary err code: 0
nt OS err code: 0
Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=<my.ip.address>)(PORT=42738))
From the Oracle documentation on both server errors:
ORA-12535: TNS:operation timed out
Cause: The requested operation could not be completed within the time out period.
Action: Look at the documentation on the secondary errors for possible remedy. See SQLNET.LOG to find secondary error if not provided explicitly. Turn on tracing to gather more information.
ORA-12606: TNS: Application timeout occurred
Cause: A network session did not reach an application-defined stage within the allowed time interval.
Action: This is an error which does not normally appear at the high level. The action to take is application specific, and is detailed in the higher level error description.
Solutions I've tried:
Adding the following system property -Djava.security.egd=file:///dev/urandom as suggested in the Stackoverflow discussion below.
Set up rng-tools to 'help' the entropy generator of the OS. (see links)
Following code runs without a problem producing random byte arrays (regardless of the parameter -Djava.security.egd:
int a = 10000;
while (a-- > 0){
byte[] array = new byte[2048];
new SecureRandom().nextBytes(array);
System.out.println(a);
}
None of the above seem to have changed the error (time-out).
EDIT: new attemps:
Running my application I could recognize the exact query that causes me the live problem. This is when reading a CLOG column of 1-2kb in size.
SQL> select secure_params from session_token where id=11065073; <- query is stuck.
Restart the client,
increasingly updating this field in this specific row I could still read the field if it was 429 charactes in size, but then when I've increased this to 587 chars it got stuck again.
SQL> select length( secure_params) from session_token where id=11065073;
LENGTH(SECURE_PARAMS)
---------------------
587
SQL> select secure_params from session_token where id=11065073; <- query again stuck.
Attemps number 4 brings me to the thought that there might be an additional issue here, since the application is able to create an initial connection and get some short data from the DB, but only then fails when the results-set gets a bit fat.
END OF EDIT
Links:
Stackoverflow: Oracle JDBC intermittent Connection Issue
Rng entropy generator: http://www.howtoforge.com/helping-the-random-number-generator-to-gain-enough-entropy-with-rng-tools-debian-lenny
ORA-12170 indicates that the TCP connection to the database listener failed.
If this is an error that happens all the time, then check firewalls and network ACLs. Possibly something intermediary has changed?
Alternatively, it could be some other artifact impacting TCP connectivity, such as a IP address clash. I've recently had this problem myself, and have blogged about it at http://distracted-it.blogspot.co.nz/2014/04/ora-12170-tnsconnect-timeout-resolved.html
Hope it helps.

Resources