ORA-12545: Network Transport: Unable to resolve connect hostname

Viewed 2046

Getting following exception two week once in PROD, when calling azure function from core api 3.1.

Below issue occurred when establishing the connection with oracle DB using ADO.Net. especially when executes the conn.open().

            OracleConnection conn = new OracleConnection(connStr);
            conn.Open();
            OracleCommand cmd = new OracleCommand(strSQLQuery, conn)
            {
                CommandType = CommandType.Text
            };
            OracleDataReader odr = cmd.ExecuteReader();

Once restarted the app service from azure portal, it would be resolved.

Error - ora-12545 network transport unable to resolve connect hostname.

1 Answers

Please check if below can be worked around.

  1. If you are using the tnsname.ora,Please make sure its configured correctly. Check tnsname.ora file for prod and check for servername,See if the prod listener exists in listener.ora file, it must be missing.So try to add the listener for prod environment similar to dev ,if present.
  2. If the Connection string had DNS name, try replacing it with IP address. Try to use user service name as they have different names for product and dev separately which can be useful even if SID is same (in some cases).Always Ensure that the host field of the local_listener is properly set to a name which can be resolved by the Oracle client.

Or

  1. Try to update host files to contain the requird server and host port. Go to \etc\hosts . Insert server name and server IP in here and save.
  2. Also check the .net version , it may be incompatible sometimes, maybe that’s why , after restarting ,its setting itself and the problem is resolved in azure app service.or Some times issue maybe due to firewall being restricting in azure portal.

You can raise a support request from overview page from troubleshoot blade ,if the issue still remains.

Reference: oracle - Stack Overflow

Related