I've got a JDBC-URL like such to connect to an Oracle 12c database:
jdbc:oracle:thin:#ldap://oraldap:389/thisdb,cn=OracleContext,dc=world
As can be seen, connection happens through LDAP.
Now I want to connect to same database via "Oracle Provider for OLE DB". Question is, what should I enter as data source here? Tried "ldap://oraldap:389/thisdb,cn=OracleContext,dc=world" - but this naturally didn't work. As far as I understand, I could enter a TNS-string like (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)))- but I didn't gather how to represent the ldap-part.
What's the way to do this?
Ok, solved - I needed to have the tns-configuration files from Oracle. So namely it is the files ldap.ora, sqlnet.ora and tnsnames.ora which I put into a specific folder plus creating the environment variable TNS_ADMIN. For connecting through OLE_DB I enter the database name as data source - and it works!
Related
Need help to connect DB2 on cloud with Oracle SQL developer.
I have configured SQL developer with third party JDBC to other DBs, but not work in DB2 with SSL option.
There have no option to set "sslConnection=true" in connection dialog. I have tried db2 type 2/4 jdbc drivers, that's same result.
Oracle-SQL-Developer successfully lets me connect to Db2-on-cloud with SSL.
My version of Oracle-SQL-Developer is old 17.02 and yes that version seems to lack a GUI way to add connection attributes for Db2 connections . I will update this answer for version 19.02 later.
A workaround is:
append the required property to the database name field.
Example: BLUDB:sslConnection=true; . Depending on version, the GUI
may misbehave , in which case do not try a connect or test at this
time, but instead try SAVE and then close Oracle-SQL-Developer - to
cause it to update its connections.xml file.
The connection information is stored in file connections.xml
which you can edit when Oracle-SQL-Developer is closed. The location
of that file may depend on which operating-system you are using. For
Linux it is in the .sqldeveloper tree off the home directory of the user running SQL-Devleoper
. First take a backup of that file before
you change it. Search for your newly created connection name. Look
through the settings to find the customUrl for your Db2-on-cloud
connection. You can edit it to look something like below:
<StringRefAddr addrType="customUrl">
<Contents>
jdbc:db2://dashdb-txn-sbox-***********.services.*****.bluemix.net:50001/BLUDB:sslConnection=true;
</Contents>
If you made changes, save the file, take another backup of the changed file (in case it gets overwritten next time), and restart SQL-Developer. Your connection should appear in the Connections pane, and the connect should succeed if you entered all other credentials and connection-parameters correctly. Works for me...
List item
What is the best way to get rid of tnsnames.ora file on each client
pc ?
Can we use Oracle "transparent gateway" - which uses ODBC drivers to
eliminate "tnsname.ora" file alto gather --to facilitate "oracle to
oracle" connections?
We know one can use Oracle "transparent gateway" to connect to
heterogeneous databases connection e.g., DB2, SQL Server. But can
we use it for Oracle to Oracle?
Any suggestions as to how to get rid of tnsnames.ora?
You can do that when you provide a name server which resolves the TNS alias for you.
With current Oracle you can use:
local naming naming method (which requires an tnsnames.ora file)
directory naming naming method (e.g. with an LDAP Server)
easy connect naming method
CDS external naming method
Network Information Service (NIS) external naming method
Check Oracle documentation Configuring Naming Methods, resp. NAMES.DIRECTORY_PATH to get more information.
Thank you very much for your quick response. My problem is that we have more than 20 Oracle databases and every time when someone gets a new PC or new database is created - that TNSNAmes file needs to be updated, We still have a plenty of legacy client server (two-tier - fat client applications. Your suggestion that we can use Oracle internet directory (OID) in conjunction with Microsft LDAP. Correct? Can we use Microsoft LDAP only without OID? this way we can we get rid of client based Tnsname? correct?
So I got connected to Oracle 11g in cmd as follows
However, when I type the same username and password in Oracle SQL Developer, it does not work. And I have uname and pwd, what goes in the connection name?
This what I got, when i entered a connection name and My uname and PWD
Oracle SQL Developer
Just give any string in your connection name, that is used for identify different connection in sql developer.
Like,
Connection name : Connection_1
username : system
password : yourpass
If you want to create another connection to another database or another schema then you have to give another name and by login you can directly access that particular schema.
Hope it will help.
I think the issue might be that SQL Developer uses a different tnsnames.ora file. The file can be set under:
Tools>Preferences>Database>Advanced
Choose the correct tnsnames directory there.
Depending on your developer version, you might also want to set the Oracle Client folder.
After that in your connection dialog choose TNS instead of BASIC. And pick the tnsalias name from the list from the file.
Let me know if that works.
I also faced the same issue and after trying series of steps came to this conclusion.
1)Make sure to follow the blog to install the DB and check the validation steps too :
https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/12c/r1/Windows_DB_Install_OBE/Installing_Oracle_Db12c_Windows.html
This blog makes sure that you are able to connect to SQL via CMD.
2) If you still face issue while connecting to SQL developer for the same configuration,check : Advanced system settings-->Environment variables-->system variables--> PATH
Make sure you have entry for the DB here.
Environment variable for DB
3) If above step is a success,check the tnsnames.ora and listener.ora files present in the location : dbhome_1\network\admin
These files should have a valid entry for the localhost and SID/service name.
Thanks,
Sandeep
I am new to Oracle database in general, but I'm attempting to get Oracle's SQL Developer running on a workstation that has pre-configured System DSNs created for an OracleRDB database. I've confirmed the ODBC connections are working because I can use MS Access to connect and link to the tables. The "test" options within ODBC also succeed. Now I am trying to get a similar connection created using SQL Developer so I can see the column types and write queries in a more useful editor.
Here's what I have available when examining the ODBC connection properties:
Now I'm trying to create a duplicate connection in SQL Developer, but I'm at a loss for why things don't work. I first tried using the default SQL Developer installation, but couldn't get things working. Then I discovered there's an OracleRDB extension available, so I installed that, but I keep getting this error when attempting to use similar values:
As I stated, these ODBC connections were pre-configured on the workstation I'm using, so I don't know anything more than what is provided by the Oracle ODBC driver window.
Is there something obvious I'm not seeing or doing to replicate this connection in SQL Developer? Or perhaps something else I can do to debug this to learn more?
UPDATE
On the advice of one answer I'm trying to make the connection with JDBC, but having a hard time understanding what I'm doing wrong. Here's another screenshot with the connection parameters I have available, but with the server and database names changed:
With these values (the port came from my tnsnames.ora file), if I try to make a JDBC connection I keep getting the following error from SQL Developer:
One final attempt I did was to use the proper values in the Oracle RDB tab, and when I use them and click 'test' the Testing Connection dialog just spins and never seems to return:
So I apologize for the long post here, but I'm struggling because there's just something I am really not understanding about how this all works. I appreciate everyone who took the time to read this question.
Oracle SQL Developer is a Java Application. You'll need to get the JDBC Driver for RDB.
Once you have that, in the SQL Developer preferences, find the Third Party JDBC section, and then use that to add an entry and point to the JAR for what you just installed.
Step by step instructions here.
Working connection string for RDB Thin Driver:
RDB_DB_CONN_STR = "jdbc:rdbThin://node.myplace.com:1707/";
where node.myplace.com is the name of the OpenVMS node hosting the RDB Thin Driver, 1707 is the port number assigned to the RDB Thin Driver.
I am getting
no ocijdbc11 in java.library.path
when trying to connect to the oracle database and I am not sure why and how to correct the issue . I am using: Oracle SQL Developer and Oracle Client 11G. I need help on correcting this issue. I have edited the sqlnet.ora file to add the below details:
NAMES.DIRECTORY_PATH= (LDAP,TNSNAMES,EZCONNECT)
SQLNET.EXPIRE_TIME=2
SQLNET.INBOUND_CONNECT_TIMEOUT=45
However, I am still getting the error message. Apparently there is an LDAP.ORA file as well, but I don't know where it is and how to edit that file. It looks like I need to add below information
DEFAULT_ADMIN_CONTEXT="###########"
DIRECTORY_SERVERS = (###########)
DIRECTORY_SERVER_TYPE = OID
Also, my TNSNames.ora file is blank, I am not sure why it is blank. Maybe I need to install Oracle Client 11g or 12c again. Thanks
I figured this out. I was connecting the wrong database instance. There are two similar databases: ###10### AND ###01###1. I needed to connect to ###10### not ###01###1 for the data that I need. The database instances are very similar and I connected to the wrong one.