Cannot Connect with TOAD but Can with Other Tools/Apps - oracle

I am able to connect to an Oracle database using several tools, but am unable to connect using Toad for Oracle 8.5.3 (though before a login/logout to Windows I was able to).
I am not using TNSNAMES.ORA to connect. I have two Oracle homes:
C:\Oracle\product\10.2.0\client_1
(OraClient10g_home1) and
C:\Oracle\product\10.2.0\client_2
(ODACHome2)
where client 2 was installed after client 1.
I have tried Toad with each home, but I get "ORA-12154: TNS:could not resolve the connect identifier specified" when I supply the database name, user name, and password. I can connect using SQL*Plus using this same information, and I can connect via ADO.NET (ODP.NET). tnsping (client 2) to the server works, but tnsping (client 1) does not.
My PATH environment variable contains, in order:
C:\oracle\product\10.2.0\client_2\bin;C:\oracle\product\10.2.0\client_1\bin
and changing the order of PATH seems to have no effect. When I added the line
NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES)
to sqlnet.ora of client 2, Toad still could not connect, but the error message appeared much more quickly.

I found the answer rather quickly after I posted, but I don't know if this is the best solution. I copied the ldap.ora file from client 1 to client 2. ldap.ora had lines like the following, which I have munged for security reasons:
DIRECTORY_SERVERS= (XXXXX:389:636,YYYYY:389:636)
DEFAULT_ADMIN_CONTEXT = ""
DIRECTORY_SERVER_TYPE = OID

Related

Does Oracle SQL Developer Work With sqlnet.ora?

Is there a way to configure Oracle SQL Developer to respect the TNS look up order in sqlnet.ora ?
We have all information correctly configured in TNS_ADMIN folder:
ldap.ora
sqlnet.ora
tnsnames.ora
Our sqlnet.ora config TNS Look up order as:
...
NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES)
...
We want the client to check LDAP first , then local tnsnames.ora as a backup in case lost LDAP connection.
But looks like Oracle SQL Developer can not use sqlnet.ora.
You either have to select TNS or LDAP explicitly.
I google around , but no one seems bother with this.
Please let me know if it is even possible with Oracle SQL Developer, if so , how ?
For SQLNet.ORA to come into play, setup a THICK connection.
Once you have your HOME established, check 'Use OCI/Thick Driver' below that.
You'll be prompted to restart sqldev.
Then make your connection.
To confirm your connection is 'thick', run this in SQL worksheet with F5:
show connection
What comes back should show :OCI in the connection URL. If you see 'thin', you haven't successfully setup the THICK driver.
Otherwise by default SQL Developer uses JDBC to connect, and SQLNet.ora never comes into play. It can still look for and find a TNSNames.ora file though.
Run this in a worksheet to see what's what with TNS
For people who also have trouble with this.
Someone told me a simple solution.

Export Database connection to Oracle Developer

I have a database Connection established in odbcad and Microsoft Access (aswell as working in Excel) via ODBC and want to also get it working in Oracle SQL developer.
It is a Windows SQL Server as far as i know and I have tried several Settings, of which None works. I have also installed Driver for ODBC. I would like to Import Settings into SQL developer as applied in MS Access, is there any possibility?
No, SQL Developer is a Java application and uses a JDBC driver.
But if you look at the odbc properties for your connection, those should largely translate to what you need to define a basic connection.
Oracle:
Server name or IP address of the DB, port # for the listener, and the name of the SID or Service, plus a valid username and password is all you need to connect to Oracle.
What error do you get when you try to connect?
Show us what you're trying.
Update:
You're trying to connect to SQL Server but you're getting"
Native SSPI library not loaded
You're trying to use OS Authentication for your connection. For this to work with the jTDS driver, you need to copy a DLL file named ntlmauth.dll (which is for NT authentication) under the jtds-x.x.x-dist\x86\SSO\ or jtds-x.x.x-dist\x64\SSO\, to any directories in the PATH environment.
Please update your question such that's it's clear you're connecting to SQL Server and share the error message so others can find it.
I imagine this question is a duplicate of many previous iterations of the same challenge.

Communication between two databases (Oracle, VirtualBox)

Currently I am trying to understand how can two databases communicate to each other (for instance: get data from one to another).
Detailed description
I have two Oracle databases, one on Windows and latter on Oracle VirtualBox. On Windows DB I have one user (PAI) with single table called TESTME. On VirtualBox, only user (PAI_VB) was created. Now, I want to display the content of the TESTME table from SQL Developer from VB.
I have done
I want to display table TESTME using LINK statement:
CREATE DATABASE LINK LINK_TO_PAI
CONNECT TO PAI IDENTIFIED BY PAI
USING 'DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=myIP)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=XE))';
Note: data from 'DESCRIPTION' section were taken from tnsname.ora file on Windows.
Having that, via following query I will manage to display table:
SELECT * FROM PAI.TESTME#LINK_TO_PAI;
Unfortunately, it does not work.
Error from console
ORA-12154: TNS:could not resolve the connect identifier specified
12154. 00000 - "TNS:could not resolve the connect identifier specified"
*Cause: A connection to a database or other service was requested using
a connect identifier, and the connect identifier specified could not
be resolved into a connect descriptor using one of the naming methods
configured. For example, if the type of connect identifier used was a
net service name then the net service name could not be found in a
naming method repository, or the repository could not be
located or reached.
*Action:
- If you are using local naming (TNSNAMES.ORA file):
- Make sure that "TNSNAMES" is listed as one of the values of the
NAMES.DIRECTORY_PATH parameter in the Oracle Net profile
Questions
Could you please propose solution to my problem (I know that in *Action section there is a hint but still I cannot solve it).
Maybe, you could introduce me another way to make communication between two databases possible.
EDIT
I managed to connect from my VB machine to one on Win10 via SQLDeveloper and SQLPlus. Unfortunately, using Oracle LINK I can not access data from database.
SOLVED !!
I managed to solve my issue. The problem laid in LINK. Since following part:
'DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=myIP)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=XE))'
was inside tnsnames.ora file i should define my link as follows:
CREATE DATABASE LINK LINK_TO_PAI
CONNECT TO PAI IDENTIFIED BY PAI
USING 'xe';
After that minor change, I was able to freely us LINK in my example. Cheers :)
Here's what you need to have for a working database link:
Network connectivity between the two hosts.
Oracle Listener process running on the host you want to connect to.
Correct TNS entry while creating the link.
Correct username and password to connect to the remote database.
The TNS-12154 error you're getting means the database running on the virtual host can't get to XE's listener using the description you gave it.
Make sure you're using the correct IP address when trying to connect to your Windows host from your virtual machine.
Run tnsping from your virtual environment to see if it can get to the Windows host listener.
tnsping 'DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=your_windows_host_ip_from_step_1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=XE))'
or just tnsping XE if you have the TNS entry stored as XE in tnsnames.ora file on your virtual machine.
See also: Oracle documentation — Testing Connections.
Once you get OK response from tnsping try connecting to XE with sqlplus (sqlplus PAI/PAI#XE) or via SQL Developer running on the virtual host. If you can connect that way your database link should also work with the same TNS entry.
This is a tricky part of oracle because there are a number of diverent ways to make a connection.
I suggest that you begin to make sure that you have a tnsnames.ora file both on windows and in your virtualbox environment. What os are you running in VirtualBox by the way?
In both tnsnames.ora files both databases should be named. Easiest to make them identical.
Then connect with sql*plus from windows to your database in VirtualBox and from VirtualBox to your database on Windows.
Just to make sure your network and tns config are OK.
If this works recreate your db-link with the servce alias from tnsnames after using. This should work.

ora 12560 tns protocol adapter error- while connecting to oracle

I have oracle 9i already installed in my machine. I am trying to connect to the oracle but while connection i am getting "ora 12560 tns protocol adapter error" type of error. i have tried it with the default pass scott/tiger , system/manager..
When i tried to connect to the oracle using default credentials i am getting the above error.
is it the problem with the username and password ? if so how can i get the username and password which is already set ?
IME, ORA-12560 means the Oracle Universal Installer messed up your listener configuration.
Assuming you have an Oracle 9i Server installed on your computer, here's a list of things to check.
does "lsnrctl status" show your database instance?
does "tnsping my_service_name" work?
do tnsnames.ora and listener.ora contain entries for your database? Are the hostname / port etc. correct?
If the configuration is wrong, your best bet is to start netca, remove your existing listener configuration and re-configure it.
One question, though: Why do you want to run Oracle 9i? Do you have to support some kind of legacy application / database? (Oracle 11gR2 is so much nicer than 9i)
Start -> Run -> services.msc
Select the oracle service name and right click on it then select start.

I can access my oracle database by command line, but cannot by navicat, ORA-12514 error

I use the command prompt to connect my Oracle database. All functions work, but when I try to use my Navicat to connect to the database, it shows the following error message:
ORA-12514:TNS:listener does not currently know of service requested in
connect descriptor.
My general settings for Navicat are:
host type:basic
ip address:127.0.0.1(also try my ip, but still have same problem)
port:1521
service name:orcl
By "all functions work", I assume you mean you are able to connect to the database and query.
Can you show us the connect that you use.
If you are using sqlplus in this fashion,
sqlplus userid/password#database1
it means your current client is pointing to the correct tnsnames.ora. May be navicat does not point to the correct tnsnames.ora file? The error indicates that you want to connect to, say database1, and Oracle is not able to map "database1" to the correct server, host and port number.
Have you gone through the connectiond details here?
http://www.navicat.com/en/products/navicat_oracle/oracle_detail_win.html
What is your operating system version and oracle version?

Resources