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

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.

Please check if below can be worked around.
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.
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
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.
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

SQL Server Managed Backup to Azure

I'm trying to backup SQL Server (Local) to Azure Blob Storage. I have created the SAS Credential
CREATE CREDENTIAL [https://xxxxxxxxx.blob.core.windows.net/yyyyyyyy]
WITH IDENTITY = 'Shared Access Signature',
SECRET = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
In SQL Server, while trying to enable the Backup for server using this command
USE msdb;
GO
EXEC msdb.managed_backup.sp_backup_config_basic
#enable_backup =1,
#database_name = 'TempDB',
#container_url = 'https://xxxxxxxxx.blob.core.windows.net/yyyyyyyy',
#retention_days = 30
GO
I get this error:
Msg 45207, Level 17, State 17, Procedure managed_backup.sp_add_task_command, Line 102 [Batch Start Line 19]
The operation failed because of an internal error. The argument must not be empty string.
Parameter name: sasToken Please retry later.
at Microsoft.WindowsAzure.Storage.Core.Util.CommonUtility.AssertNotNullOrEmpty(String paramName, String value)
at Microsoft.WindowsAzure.Storage.Auth.StorageCredentials..ctor(String sasToken)
at Microsoft.SqlServer.SmartAdmin.SmartBackupAgent.FileService.VerifyContainerURL(String containerURL, SqlConnection conn)
at Microsoft.SqlServer.SmartAdmin.SmartBackupAgent.SmartBackup.ConfigureDbOrInstance(SmartBackupConfigParameters config, LogBaseService jobLogger, SqlConnection conn)
If we change the #enable_backup to "0", the query executes correctly.
I have tried re-creating the SAS key, it doesn't work.
PS: I'm currently using SQL Server 2017.
Try with these steps
1) Create a SQL Server credential using a shared access signature.
To create a SQL Server credential, follow these steps:
Connect to SQL Server Management Studio.
Open a new query window and connect to the SQL Server instance of the
database engine in your on-premises environment.
In the new query window, execute the following script .
USE master CREATE CREDENTIAL
"https://.blob.core.windows.net/"
//this name must match the container path, start with https and must
not contain a forward slash at the end WITH IDENTITY='SHARED ACCESS
SIGNATURE' //this is a mandatory string and should not be changed
, SECRET = 'sharedaccesssignature' //this is the shared access
signature key GO
Example:
USE master
CREATE CREDENTIAL [https://msfttutorial.blob.core.windows.net/containername]
WITH IDENTITY='SHARED ACCESS SIGNATURE'
, SECRET = 'sharedaccesssignature'
GO
To see all available credentials, you can run the following statement
in a query window connected to your instance:
SELECT * from sys.credentials
2) Create backup .Modify the URL appropriately for your storage account name and the container and then execute this script.
//To permit log backups, before the full database backup, modify the database to use the full recovery model.
USE master;
ALTER DATABASE AdventureWorks2016
SET RECOVERY FULL;
BACKUP DATABASE AdventureWorks2016
TO URL = 'https://<mystorageaccountname>.blob.core.windows.net/<mystorageaccountcontainername>/AdventureWorks2016_onprem.bak
3) Open Object Explorer and connect to Azure storage using your storage account and account key. Expand Container verify that the backup appears in this container.
For more details refer these links link1 and link2
If anyone has experienced the similar issue with SQL Server, an update may solve your problem.
Symptoms
Assume that you disable "Allow Blob Public Access" on a storage account. In this situation, when you enable a managed or automated backup in Microsoft SQL Server 2016 or 2017, you receive the following error message:
"SQL Server Managed Backup to Microsoft Azure cannot configure the database 'DatabaseName' because a container URL was either not provided or invalid. It is also possible that your SAS credential is invalid."
Resolution
This problem is fixed in the following cumulative update for SQL
Server:
Cumulative Update 23 for SQL Server 2017
Cumulative Update 16 for SQL Server 2016 SP2
https://support.microsoft.com/en-us/topic/kb4589360-fix-error-when-you-enable-managed-or-automated-backup-in-sql-server-2016-and-2017-if-allow-blob-public-access-is-disabled-on-a-storage-account-d2315f8d-6a38-5d6c-6f02-3ab14c4b34cf

The underlying provider failed on Open. Remote Debbuging with Azure to VS2019

I am remotely debugging my application with azure and VS2019 and it works fine until I have to connect to the database.
Then I get the following error. "The underlying provider failed on Open."
On the other hand, if I debug locally everything works correctly.
Do you have to activate any permission in Azure or in the project config so that the database can be accessed remotely?
Right after the connection string I have put the following.
_context.Database.Connection.Open ();
So it returns the following error to me:
"Unable to connect to any of the specified MySQL hosts".
All this locally does not happen to me. Only when trying to debug remotely.
According to your description, we can ensure that the remote debug function of vs2019 is normal. An error is reported in this _context.Database.Connection.Open (); code. Obviously, the program cannot connect to the mysql database server.
Troubleshooting:
First make sure that your mysql database server can be accessed using tools (such as Mysql Workbench).
Using tools to ensure that the database is accessible is to ensure that the firewall of your database server is open (mysql in azure or other server).
Check the connectionstring of mysql in the released program. According to your error message, it is likely that the connection string is used incorrectly.

Informatica Domain Configuration database connection during Powercenter installation

I am trying to install Informatica Server.
During domain configuration repository database information I get database connectivity error.
Error: Test Connection Failed. Correct the database connection information and test the connection again.
But when I connect using same details through Oracle SQL Developer to this database, it works fine.
I am using service name and port number field from the TNS File, still getting this error.
I think you can check tomcat log, catalina.out logs. This will help on finding out real issue.
Go to command prompt and type ping localhost and see if its responding anything. May be you can use IP and check host file.

SQL Server 2016 linked Oracle Server - Suddenly stopped working

After rebooting my Windows Server 2016 Standard (SQL Server 2016) my SSIS process that runs this query:
select * from openquery(HRMPROD, 'SELECT QUERY HERE' )
started failing with this error:
I get the same error if I try to run the query in SSMS. I have the same linked server set up on my test instance and the query is successful when I run it there. I have compared the linked server create script on both instances and it is the same.
Any idea where I should look for what is causing the connection issue on the one server but not the other?
Thank you.
Saying the answer is on the Oracle side is just like pointing fingers across the way. Let's just fix the issue here.
There is a connection string that is used from SSIS, (which you also used in SSMS) The connection string contains three main components to connect and would result in the 12154 error if any of them were incorrect:
Host
Instance name (different than Instance on Sql Server, think database name)
port
The port most likely hasn't change, neither has the database name, but the host...No, hasn't changed, but the DNS server used to connect most likely has! I would ping the host and see what returns from the SSIS and your SSMS host that you're using. I would expect it to fail. Find out what IP address the host is using and ping that - see if it returns. I'm guessing that's the change that needs to be updated or your Network folks need to fix a DNS configuration/server issue.
Hope this helps!
Kellyn
Since you are getting a response from the TNS Listener, the problem lies on the Oracle side. See Architecture of Oracle Network Services for an overview of how the Oracle networking handles things. Keep in mind that based on the error message you've reached the TNS Listener, so you only need to check things between TNS and the Oracle database... In other words, your networking and SQL Server settings are fine or you wouldn't be able to get this error message.
I would agree with above that the issue might have to do with the network. I have come across that a few times, where we can set everything up, but a firewall is blocking communication between the two servers.
Open up powershell on the new server and run a tracert to the target to see the hops and identify if is connecting across the network.
If it is, then run a test-netconnect on the specific port, to see if the port is open from the firewalls.
Cheers!

Grails Data Source URL for Oracle Database that uses TNS

I'm writing a Groovy/Grails application that will be connecting to an Oracle database that uses TNS names for resolving the actual host. The problem I'm running into is trying to figure out the connection string (called the url in the DataSource.groovy file). I've tried Googling examples, but all the examples I've found so far include the host name, something that I want to avoid since I've been told that this database uses TNS names so that the host can change and the various apps that connect to it won't need to be updated with the new host name.
If someone can provide an example or link that would help me create a connection string using the following details that would be much appreciated.
TNS name: TEST
Username: User
Password: Password
You have to have the host name and the port of the machine that has the listener at least. The actual DB host will be in the TNS file and can be changed without having to change the url string.
jdbc:oracle:thin:User/Password#//myhost:1521/TEST

Resources