Action type Execute SQL Query on Oracle(c) Database Server fails with Connection refused

Document ID : KB000121727
Last Modified Date : 29/11/2018
Show Technical Document Details
Issue:
We are trying to connect to CA-RA database via Action type "Execute SQL Query on Oracle(c) Database Server" and it fails with:
Failed to get connection for: jdbc:oracle:thin:@//<ScanServername>:1521/<OracleServiceName>
IO Error: The Network Adapter could not establish the connection
Connection refused (Connection refused)
error code: 0
Environment:
CA Release Automation 6.6
Oracle 12.1.0.2.0
Oracle SCAN is being used
Cause:
It was determined to be an issue with the firewall using "deep packet inspection" and changing the contents of the redirect packet as it was sent from the SCAN listener to the client. 

The problem/cause is documented with more details here: 
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=466797500313008&parent=EXTERNAL_SEARCH&sourceId=PROBLEM&id=1398979.1&_afrWindowMode=0&_adf.ctrl-state=831zynml8_4
​​​​​​
Resolution:
Quoting the Solution from the link above:
"CISCO firewalls have a configuration option to "inspect sqlnet" or "deep packet inspection". This setting can impact certain data transfer across the network and result in failed or mis-formed packets.

Check if this option is enabled, and if necessary disable the "inspect sqlnet" option at the firewall level.

There also is a known bug with Cisco which causes this "deep packet inspection" to occur despite the setting.  Please check with that vendor for more information."

 
Additional Information:
While troubleshooting we wrote a java class that connects to the database using the exact same JDBC connection and using the same exact jdbc driver used by the agent. This failed. If the cause above is suspected then you can try the same from your scan and db host to see if they work. If working from the scan and/or db host then chances are very likely that you're experiencing the problem described in the link provided in the cause section above.