Connection to Oracle Autonomous Database using sqlplus without wallet - oracle

I'm trying to connect to Oracle Autonomous Database using EZ CONNECT string: user/password#host:port/service_name
I have configured the access from the IP addresses I need to connect and set mTLS as not required:
As a result, I can successfully connect to the database when I use the wallet downloaded from the console.
But if I try to connect to the DB using EZ CONNECT string, I get the following error:
sqlplus -l user/password#tcp://adb.us-sanjose-1.oraclecloud.com:1521/service_name_high.adb.oraclecloud.com
SQL*Plus: Release 19.0.0.0.0 - Production on Wed May 25 00:19:38 2022
Version 19.8.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
ERROR:
ORA-12547: TNS:lost contact
SP2-0751: Unable to connect to Oracle. Exiting SQL*Plus
Is it possible to connect to Autonomous Database using EZ CONNECT string? If yes, then what am I doing wrong?
Update 1:
I also tried to use a full connect string
sqlplus -l user/pass#'(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=adb.us-sanjose-1.oraclecloud.com))(connect_data=(service_name=xxxxxxx_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)(ssl_server_cert_dn="CN=adb.us-sanjose-1.oraclecloud.com, OU=Oracle ADB SANJOSE, O=Oracle Corporation, L=Redwood City, ST=California, C=US")))'
but then the connection fails with the following error ORA-28759: failure to open file.
I suspect that it's some security settings, but I can clearly see that my IP is enabled and since with the same security settings I can connect with mutual TLS and wallet, I don't understand where the problem might be.

You can configure Autonomous to allow connection without a WALLET:
https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/support-tls-mtls-authentication.html
(Which looks like you done that)
However you still need TCPS and not TCP:
https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/connect-jdbc-thin-tls.html - and you need to pass the security part, which cannot be passed today in the short format (see connecting without a wallet).
PS: Autonomous Dedicated (ADB-D) allows connecting with pure TCP.

Related

How to connect oracle Cloud Instance using Oracle Cloud Shell?

I am using following Command to connect oracle cloud instance 19c using Oracle Cloud Shell
sqlplus username/password#db
It shows following error
SQL*Plus: Release 19.0.0.0.0 - Production on *******
Version 19.5.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Depending on the type of Database you have in OCI, you can connect from Cloud Shell to that database via a Service Gateway.
https://docs.cloud.oracle.com/en-us/iaas/Content/Network/Tasks/servicegateway.htm
Both Cloud Shell and Cloud Infrastructure Databases (such as Autonomous Transaction Processing database) can be accessed via a Service Gateway without using the public internet.
https://www.oracle.com/cloud/networking/service-gateway.html
The Cloud Shell isn't connected to your VCNs - it will need to access your database through internet. For this to happen, you'll need to open your database's listener port to the internet, and this is a "VERY BAD IDEA" generally speaking.
Best is to create a VM instance in the same VCN and connect to the DB from the VM.
If you want to eliminate all the intermediate layers for your test, even the local VCN network, then you can connect directly to the DB node using ssh and emit your select from there.
Here's a quick how-to guide on how to connect your on-prem SQL Dev tool to Oracle Cloud Database. https://www.youtube.com/watch?v=3bJ3JlpGlPo&list=PLdtXkK5KBY56jDbMevAMIbZGVAGUz9aYQ&index=14 You can create a bastion session, use ssh port forwarding to connect your local DB tools to cloud database instance using DB listener port for sqlnet.

Oracle 11g SqlDeveloper connects to remote database but SqlPlus cannot

As the title suggests, I am trying to connect to a remote database via VPN. When I connect using SQL Developer, the connection is fine. However when I try to connect using SQLPlus I get the below error
ERROR:
ORA-12638: Credential retrieval failed
Enter user-name:
I am using the exact same credentials for both (cannot copy the details here as they are a clients and confidential).
Any thoughts as to why SQL Developer acts differently to SQLPlus?
Thanks in advance
K.

informatica powercenter sql server connection issue

Background: I am really new. Informatica Developer for PowerCenter Express Version: 9.6.1 HotFix 2
I am trying to connect to a sql server 2012 database. I created this connection
, basically just changed the server, database in connection string of meatadata access and data access. I have tested I can use the user name password to access the sql server in sql server management studio. And when I click test it reports successful.
But when I create a mapping and a physical object (read) based on that connection, when I try data view on that object, it reports this error:
[LDTMCMN_0029] message [com.informatica.sdk.dtm.ExecutionException: [LDTM_0072] RR_4036 Error connecting to database [
Microsoft SQL Server Native Client 11.0: Login timeout expired
SQL State: HYT00 Native Error: 0
Microsoft SQL Server Native Client 11.0: A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
SQL State: 08001 Native Error: 87
Microsoft SQL Server Native Client 11.0: SQL Server Network Interfaces: Connection string is not valid [87].
SQL State: 08001 Native Error: 87
State: 1 Severity: 16
SQL Server Message: SQL Server Network Interfaces: Connection string is not valid [87].
Database driver error...
Function Name : Connect
Database Error: Failed to connect to database using user [bcsgetl] and connection string [192.168.100.88:1433].].]
One thing to note, when I created that physical object, I used that connection and I was able to select a table, which proves the connection is successful.
As from the error message "Connection string is not valid".
For a Native SQL Server connection work without provide it
Your can try a connection with the ODBC protocol, but instead as for the PowerCenter, where it need to be created a ODBC 64 bit connection on the Windows Server 2012, for the developer and PowerCenter Express, instead I found that it need still an ODBC but from the local machine.
Follow this steps:
-Launch the ODBC Administrator using the odbcad32.exe file located in the
C:\Windows\SysWOW64 directory.
-Create a new ODBC SQL data source under user and make sure do not use space in the name.
-Restart the Developer Client.
-Create in the Developer Client a ODBC connection with your parameters.
Please make sure to use as "Connection String" the same you used for the ODBC source on your local machine.
So if you called it "SQL_Local" that is your Connection String

Why can't I connect via jdbc using SQLcl

I can connect to a remote database using SQLDeveloper.
I am trying to connect to the same database using sqlcl from the command line, but I am getting an error.
Here is the command that I am running:
/bin/sql username/pass#delphix-vdb-n-1.va2.b2c.nike.com:1521/vdbsl14
I have also tried:
/bin/sql username/pass#//delphix.......etc.
Here is the error I am receiving:
SQLcl: Release 4.2.0.16.131.1023 RC on Wed Jun 15 11:36:33 2016
Copyright (c) 1982, 2016, Oracle. All rights reserved.
USER = username
URL = jdbc:oracle:thin:#delphix-vdb-n-1.va2.b2c.nike.com:1521/vdbsl14
Error Message = Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
Username? (RETRYING) ('username/*********#delphix-vdb-n-1.va2.b2c.nike.com:1521/vdbsl14'?)
Also in SQLDeveloper, I just enter the following under "custom jdbc url" and it connects without any issue, so I was hoping I could connect via the command line using the same URL but so far, it is not working:
jdbc:oracle:thin:#delphix-vdb-n-1.va2.b2c.nike.com:1521:vdbsl4
It looks like your SID and service name are not the same. In SQL Developer you seem to be using the SID - at least in the custom JDBC URL you showed - as denoted by the colon in :vdbsl4.
Your SQLcl URL is using the service name, as denoted by the slash in /vdbsl14. Using the SID instead (i.e. changing the / to :) in that URL should work since it's using JDBC:
sqlcl username/pass#delphix-vdb-n-1.va2.b2c.nike.com:1521:vdbsl14
Alternatively (and preferably, in my opinion) find out what your service name actually is. If you have sufficient privileges on the database you can do show parameters service_names from SQL Devleoper, or if you have access to the server as DBA you can do lsnrctl services, or even look at the tnsnames.ora in case there is a TNS alias defined that shows the service name. (listener.ora isn't likely to help, but could give hints or if you're lucky show a default service name).
You can use that service name in a JDBC URL, as /service_name.
You can also use a TNS alias from SQLcl (or SQL*Plus). You may already have a tnsnames.ora available; if not you might be able to copy it from your server, or create your own. That can refer to the SID or the service name.
You can even pass a full TNS description to SQL*Plus (not sure about SQLcl) but that's a bit unpleasant. If you don't have/want a tnsnames.ora you can use 'easy connect' syntax, which is the same as you're using for SQLcl - but that has to be the service name, it doesn't allow SIDs.

sqlplus connection to 11g DB

Oracle 11g2 64-bit Database installed on windows server 2008.
Oracle 6i Form Developer installed on windows server 2003.
There is DB connection problem from client PC.
I add my DB SID(orcl2008) in tnsnames.ora file on client machine.
When Open cmd and
C:\>tnsping80 orcl2008
TNS Ping Utility for 32-bit Windows:
<c> Copyright 1997 Oracle Corporation.
Attempting to connect<ADDRESS=<PROTOCOL=TCP><HOST=192.168.15.100><Port=1521>>OK<0 msec>
But when connect DB using sqlplus then cmd disappear.
C:\>sqlplus scott/123#orcl2008
As press enter then CMD screen disappear immediately.
And when I try to connect Form 6i with using:
U:scott
P:123
H:orcl2008
this form also disappear.
Kindly help me, connect 11g2 Database instance with sqlplus and Form 6i.
Pinging always confirms whther the service is running or not. It does not mean that it allows remote connections. Check your configuration to allow remote connections, then try out again.

Resources