ORA-12570: Network Session: Unexpected packet read error, Azure Windows VM Oracle Machine

SKR 1 Reputation point
2020-09-01T07:58:46.53+00:00

Dear Friends,

I am getting Oracle Connection error in Client machine very often.

"ORA-12570: Network Session: Unexpected packet read error"

I am working in Windows 2012R2 Azure VM with Oracle 12.2.0.1,
Connection Provider : Oracle.ManagedDataAccess.Client 19.8

Is this problem of Oracle Settings or VM settings..?

https://learn.microsoft.com/en-us/azure/load-balancer/load-balancer-tcp-idle-timeout

What Azure saying in the above Document..? whether i have to any another setting in VM

Please help me to solve this issue.

Thanking you.

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,598 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. suvasara-MSFT 10,056 Reputation points
    2020-09-01T20:37:40.963+00:00

    Hello,

    I am not much familiar with Oracle DB but from the networking view I can sense that this might be due to exceeding idle timeout limit.
    This means that if you have a period of inactivity on your tcp or http sessions for more than the timeout value, there is no guarantee to have the connection maintained between the client and your service. When the connection is closed, your client application will get an error message like “The underlying connection was closed.

    Note: IdleTimeoutInMinutes is optional. If not set, the default timeout is 4 minutes. Its value can now be set between 4 and 30 minutes.

    Configure TCP timeout for your Instance-Level Public IP to 15 minutes.

     Set-AzurePublicIP –PublicIPName webip –VM MyVM -IdleTimeoutInMinutes 15
    

    Set Idle Timeout when creating an Azure endpoint on a Virtual Machine

    Get-AzureVM -ServiceName "mySvc" -Name "MyVM1" | Add-AzureEndpoint -Name "HttpIn" -Protocol "tcp" -PublicPort 80 -LocalPort 8080 -IdleTimeoutInMinutes 15| Update-AzureVM
    

    Do click on "Accept Answer" and "Upvote" on the post that helps you, this can be beneficial to other community members.


  2. SKR 1 Reputation point
    2020-09-02T02:10:21.587+00:00

    Hello Suvasara,

    Thanks for your reply
    can you help me to fill the commands

    Set-AzurePublicIP –PublicIPName webip –VM MyVM -IdleTimeoutInMinutes 15

    Get-AzureVM -ServiceName "mySvc" -Name "MyVM1" | Add-AzureEndpoint -Name "HttpIn" -Protocol "tcp" -PublicPort 80 -LocalPort 8080 -IdleTimeoutInMinutes 15| Update-AzureVM

    Where and where i have to enter my ipaddress and name

    $publicIP = Get-AzPublicIpAddress -Name MyPublicIP -ResourceGroupName MyResourceGroup
    $publicIP.IdleTimeoutInMinutes = "15"
    Set-AzPublicIpAddress -PublicIpAddress $publicIP

    I tried in powershell, but giving error

    $publicIP = Get-AzPublicIpAddress -Name xx.xxx.xx.xxx -ResourceGroupName SOURCENAME

    Get-AzPublicIpAddress: The Resource 'Microsoft.Network/publicIPAddresses/xx.xxx.x.xxxx' under resource group 'SOURCENAME' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
    StatusCode: 404

    Please

    Thanks


  3. Andreas Heizmann 1 Reputation point
    2020-09-08T12:10:10.387+00:00

    Hello,

    I had the same problem. Instead of modifying the TCP idle timeout of your virtual machine, you can also force the oracle client to check existing connections.
    In your application configuration file (or sqlnet.ora file) set SQLNET.EXPIRE_TIME to specify a the time interval, in minutes, to send a probe to verify that client/server connections are active. If you set the value to 1, the client will check each minute and Azure will never close it. If your application relies on connection pooling (enabled by default), this is the way to go.

    Oracle docs: https://docs.oracle.com/cd/B19306_01/network.102/b14213/sqlnet.htm
    App configuration example:
    <oracle.manageddataaccess.client>
    <version number="*">
    <settings>
    <setting name="SQLNET.EXPIRE_TIME" value="1"/>
    </settings>
    </version>
    </oracle.manageddataaccess.client>

    I hope this will save someones time in the future.

    Best regards

    Andreas

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.