DB2 database in Oracle SQL developer with SSL option - jdbc

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...

Related

Data Pump export using cloud shell

I am trying to export schema using data pump on Oracle Cloud Autonomous database.
I am using cloud shell to export schema.
When I tried to do the final step:
expdp admin/password#DB_HIGH schemas=SCHEMA_NAME directory=data_pump_dir dumpfile=exp%U.dmp filesize=1G logfile=expot.log
I got
UDE-12154: operation generated ORACLE error 12154 ORA-12154:
TNS:could not resolve the connect identifier specified
Do I need Oracle instant client to do export?
The Oracle client code uses one of three ways to look up connect data:
A flat file named tnsnames.ora
Oracle Names service
LDAP
When the complete ORA-12154 error appears with the text line, your program has found a working Oracle client install. However, the specified Oracle service is not listed in tnsnames.ora, Oracle Names or LDAP.
The first step in the troubleshooting process is to determine which name resolution method is deployed at your site. Most sites use tnsnames.ora, but enough use Oracle Names and LDAP, so it’s best to confirm this information.
If you are not the database administrator, get in touch with the people managing your Oracle systems and find out which method you should be using. They may be able to guide you in fixing the problem in accordance with your site’s standards.
The client code decides which mechanism to use based on the file sqlnet.ora. This file and tnsnames can usually both be found in the Oracle install directory (“ORACLE_HOME”), under network/admin/. This location may be overridden with the environment variable TNS_ADMIN.
If the sqlnet.ora file does not exist or does not specify a resolution method, then Oracle Net uses tnsnames.ora.
Example locations of Oracle networking files include:
Windows
ORANTNET80ADMIN
ORACLEORA81NETWORKADMIN
ORAWIN95NETWORKADMIN
ORAWINNETWORKADMIN
UNIX / Linux
$ORACLE_HOME/network/admin/
/etc/
/var/opt/oracle/
If you fix the naming issues, but you still see the ORA-12154 error, check the Oracle service to confirm that it’s available for connections. A power outage, server failure, or network connectivity issue will make this resource inaccessible. It’s also possible that scheduled maintenance or repairs of an unrelated Oracle issue may take that resource temporarily offline.
Thanks

Able to connect through CMD but not to Oracle SQL developer to Oracle DB

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

How to replicate existing OracleRDB ODBC connection in Oracle's SQL Developer application?

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.

Jetbrains Datagrip cannot connect sql server without specify database

i try to use Datagrip as my primary sql server query tools, bit i meet a problem that i can not move forward.
When i setup the project data source, i have to choose a Database, otherwise it will goto the default tempdb, how i can work like sql server management studio, that i can see all database list.
i have tried both jTds and Microsoft drivers, both not works.
or can i choose multi-database? i do not want to create one data source for one database.
if i connect to mysql, it works like expected.
tks
It is possible to connect without specifying the database. Just leave this field blank. After entering other settings (host, port, user, password), go to Schemas tab in Data Source properties and select all the Databases and schemas you want to work with. Then invoke Synchronize action for this Data Source in Database tool window.
DataGrip 2016.2 EAP claims to have support for showing multiple databases. See https://blog.jetbrains.com/datagrip/ and find for "Database View". Unfortunately, as of the date I'm writing this, it doesn't seem to work at all.
Unfortunately, Andrey's suggestion did not work for me.

Oracle XE 11g (windows 8) I can't connect to the Database (idle instance)

Hi I have problem with idle instance
When I trying:
sqlplus / as sysdba
I get result: Connected to an idle instance.
And when I try startup I get:
ORA-01078: failure in processing system parameters
ORA-01565 error in identifying file 'C:\oraclexe\app\oracle\product\11.2.0\server\dbs/spfileXE.ora
ORA-27041: unable to open file
ORA-04002: unable to open file
O/S-Error: (OS 2) File not found;
My system is Windows 8. Do you any idea how to solve it?
SOLUTION:
I have to startup using command:
startup pfile='<path to file>/init.ora'
and change all paths in init.ora where was
<ORACLE_BASE>
Thx for help
I've got that pain too.
To install Oracle XE you should login as local admin - NOT domain account.
This https://community.oracle.com/thread/2361291 made me happy :)
I just had the same problem.
You just have to start the setup to install the database as administrator.
After this and a reboot everything works fine.
I highly recommend reading the Oracle® Database 2 Day DBA manual, or hire a dba.
You are missing the init{ORACLE_SID}.ora, the parameter file which contains things like database name, controlfile locations. the init{ORACLE_SID}.ora is a text file that is edited with a regular text editor. This file can be converted to a spfile{ORACLE_SID}.ora that can be edited using a database instance. This is also a dynamic parameter file meaning that when you change parameters in an instance, the parameters can also be recorded in the spfile for later reuse.
For now add the db_name and control_files. Make sure that the contol_files parameter points to an existing controlfile[s]. If there are no existing control_file[s], just trash the initXE.ora, spfileXE.ora and start dbca, the Database Configuration Assistant and using that create a new database.

Resources