Minimize
Blogger List

Johannes Ahrends
Toad and Oracle

Ben Boise
Toad SC Discussions

Kevin Dalton
Benchmark Factory

Steven Feuerstein
PL/SQL Obsession

Devin Gallagher
Toad SC discussions

Stuart Hodgins
JProbe Discussions

  Henrik "Mauritz" Johnson
Toad Tips & Tricks on the "other" Toads
  Mark Kurtz
Toad SC discussions
  Michael Lumbard
Toad SC discussions
Daniel Norwood
Toad for Data Analysts,
Toad Extension for Visual Studio
Debbie Peabody
Toad for Data Analysts
Gary Piper
Toad Reports Manager
John Pocknell
Toad for Oracle, JProbe
Kuljit Sangha
Toad SC discussions
Bert Scalzo Indicates Oracle ACE status
Toad for Oracle, Data Modeling, Benchmarking
Jeff Smith
Toad product family
Richard To
SQL Optimization
Jim Wankowski
DB2 - LUW and z/OS
John Weathington
  Toad Data Modeler Opens in a new window
Data Modeling
 
  Real Automated Code Testing for Oracle
Quest Code Tester blog
 
Minimize
Blog Tags
toad for oracle (122)
oracle (62)
plsql (46)
sql optimization (37)
toad for data analysts (28)
code tester (19)
toad for ibm db2 (13)
automation (11)
batch optimizer (10)
virtualization (10)
schema browser (9)
toad for sql server (9)
data grid (8)
sql (8)
sql editor (8)
toad data modeler (8)
benchmark factory (7)
excel (7)
query builder (7)
report manager (7)
toad extension (7)
visual studio (7)
11g (6)
configuration (6)
freeware (6)
health check (6)
vmware (6)
connect (5)
dba module (5)
er diagrammer (5)
F4 (5)
linux (5)
refactoring (5)
spotlight (5)
unicode (5)
compare (4)
debugger (4)
export (4)
formatter (4)
make code (4)
rman (4)
strip code (4)
benchmark (3)
bfscript (3)
bulk collect (3)
code templates (3)
code xpert (3)
database browser (3)
db2 (3)
notebook (3)
oem (3)
RAC (3)
session browser (3)
speed (3)
sql optimizer (3)
toad for mysql (3)
tpc-c (3)
9.7 (2)
alert log (2)
app designer (2)
awr (2)
code insight (2)
code snippets (2)
collection (2)
compare and sync (2)
compliance (2)
data generator (2)
data warehouse (2)
database explorer (2)
database monitor (2)
explain (2)
forall (2)
ftp (2)
group execute (2)
handbook (2)
installation (2)
job scheduler (2)
multi-task (2)
nested table (2)
os command (2)
profiler (2)
recovery (2)
release history (2)
save as (2)
schema compare (2)
sql recall (2)
stats pack (2)
subversion (2)
team coding (2)
trace file browser (2)
while loop (2)
10g (1)
64 bit (1)
7zip (1)
action (1)
addm (1)
alter (1)
ansi join (1)
array (1)
ccleaner (1)
code coverage (1)
code road map (1)
CRON (1)
cursor for loop (1)
data browser (1)
data subset (1)
database probe (1)
dbms_flashback (1)
dbms_profiler (1)
ddl (1)
feuerstein (1)
filezilla (1)
flash drive (1)
flow control (1)
for loop (1)
group policy manager (1)
hints (1)
import (1)
index (1)
inheritance (1)
invoker rights (1)
ipad (1)
java (1)
latency (1)
log switch (1)
logical model (1)
ltrim (1)
master-detail browser (1)
monitor (1)
multi-select (1)
naming standards (1)
network (1)
object explorer (1)
OEBS (1)
package (1)
parser (1)
partitioning (1)
performance (1)
pragma (1)
project manager (1)
RAT (1)
revo (1)
REXEC (1)
schema report (1)
script manager (1)
search (1)
set operator (1)
sga (1)
slow (1)
sonarsource (1)
source control (1)
space projection (1)
sql monitor (1)
sql navigator (1)
sql script (1)
sql tracker (1)
sql*plus (1)
standards (1)
statistics (1)
stored procedure (1)
string parser (1)
sub-model (1)
sub-type (1)
synch (1)
synchback (1)
TELNET (1)
toad (1)
trace (1)
unit test (1)
unix (1)
usb (1)
utility (1)
v10 (1)
v9.5 (1)
version control (1)
waits (1)
workload replay (1)
workspace (1)
xml (1)
 
WELCOME, GUEST
 
 

Blogs
Toad and Database Commentaries

Toad World blogs are a mix of insightful how-tos from Quest experts as well as their commentary on experiences with new database technologies.  Have some views of your own to share?  Post your comments!  Note:  Comments are restricted to registered Toad World users.

Do you have a topic that you'd like discussed?  We'd love to hear from you.  Send us your idea for a blog topic.


Dec 21

Written by: Bert
Monday, December 21, 2009 12:07 PM  RssIcon

One of the most common TOAD questions or problem areas is with connecting to remote and/or local databases. The process and requirements are actually quite simple – yet this remains a high frequency question that seems to cause remarkable confusion. And not just for new Oracle or new TOAD users, as sometimes even old pros can forget and ask. They just often do a Homer Simpson “Doh” once they hear the answer

Now there are literally dozens of scenarios that you might encounter, I am not going to show them all. Instead I’ll show you a common yet easy one to understand and troubleshoot. Then you simply need to apply your new “detective skills” to solve the other scenarios you might run into. Just remember, TOAD has two million+ users – and if we had a real connection problem we’d have heard about it and fixed it. Almost every time you get an unable to connect to database error message – it’s a local PC or possibly even a database server listener configuration problem. I’m not simply trying to pass the buck here. I’m just telling you that it’s the rare exception and not the rule – connection errors are most likely on your end, so investigate before just saying TOAD’s broken.

The most common scenario we run into is that people say “I can connect with Oracle SQL*Plus on my PC and TOAD gives an Oracle error – so TOAD does not work for me or my very special conditions. So here’s a screen snapshot of SQL*Plus working on my Windows XP PC.

OK – so SQL*Plus works on my PC. Now look at this screen snapshot – same PC yet TOAD won’t connect.

So let’s see what I did to get this wonderful Oracle error ORA-12154 (just one of the three to four error messages you’re likely to see while your SQL*Net environment or configuration is not right). Look at the first three solid arrows – I gave the correct user ID and password, plus the correct Oracle SID or instance ID. So why did I get this database connection error? Look at the crossed, fatter errors near the bottom right hand corner – these are you clues.

I have instructed TOAD to use the Oracle 11g client on my PC, and the red “X” next to the “TNSNames Editor” button indicates that there is no TNSNames.ora file. OK – but then why did SQL*Plus work? Look again back at the first screen snapshot. It appears that I have run SQL*Plus from Oracle 10g somehow? If I then do a right hand mouse on “MY Computer” on my desktop and choose properties, the Windows “System Properties” window will pop-up. Now if I next choose the “Advanced” tab and then press the “Environment Variables” button, the window in the next screen snapshot comes up. I finally double click the “PATH” so I can review and possibly edit my PATH environment variable – because here’s where the problem lies. Look at the screen a moment before reading on.

OK – my environment has the Oracle 10g home first in my PATH order. So when I run SQL*Plus it starts the binary from Oracle 10g and by default looks for the TNSNames.ora file under the same home – so it works because there is a TNSNames.ora file there. We know that for sure because as this next and final screen snapshot from TOAD shows, when I use the Oracle 10G home the red “X” turns to a green -> and the “TNSNames Editor” button indicates that there is a valid TNSNames.ora file. This attempt to connect using TOAD works – and works just fine.

So the key lesson or conclusion to take away from this blog is as follows: TOAD can connect to Oracle databases and it works 99.99% of the time. If you have a problem and get some Oracle connection error message, odds are that you have one of the following problems: a bad SQL*net install, are pointing to the wrong Oracle Home, have a Windows PATH environment ordering problem, or some other user setup and configuration problem related to your Windows and/or Oracle home.

So please apply this type of investigative process and thinking anytime that you cannot connect to your database with TOAD. TOAD could never have achieved such huge adoption and success if it could not connect to peoples’ databases. Thus the problem is most likely some minor little thing specific to your PC. Because in the last ten years I can count on one hand the real database connection problems that people have run into. It’s that rare.

4 comment(s) so far...


Re: TOAD Database Connections Problems

Bert, I like to move my TNSNAMES.ORA and SQLNET.ORA files to a folder outside of any Oracle Home - say, C:\Oracle\admin\network. Then instead of rearranging the PATH, I create a new Environment variable, TNS_ADMIN pointing to that folder. From then on, I never have to worry about where my TNSNAMES.ORA file is, no matter what Oracle software I install.

By JCFlack on   Tuesday, December 22, 2009 7:40 AM

Re: TOAD Database Connections Problems

That's a great solution - but not everyone has access to a shared network drive (I know hard to believe - but still happens). But you've proven my point - if you understand how "Oracle connectivity" works, then you'll have zero issues with TOAD - and smarties like you will find excellent solutions that liberate you from ever having to worry about it again. So if people take your lead and learn about the moving parts - they too can avoid headaches like above. It will be a happy day in TOAD land when we never again hear "but it works in SQL*PLus, so TOAD has a problem..." :)

By bscalzo on   Tuesday, December 22, 2009 7:59 AM

Re: TOAD Database Connections Problems

What network drive? "network" is just the name of the folder. "C:/Oracle/Admin/network" is on a local drive. Now, not everyone has administrative authority on their own workstation, so not everyone can create a new environment variable. Your solution of switching the Oracle Home to the one that contains your TNSNAMES.ORA file works for almost everyone. I've found that with TOAD 10, I have problems if I use the Oracle Home for an older client like 9iR2. A 10gR2 or 11g client works fine.

By JCFlack on   Wednesday, December 23, 2009 10:13 AM

Re: TOAD Database Connections Problems

Aha - misunderstood - that's a nice solution. Or you can skip tnsnames.ora files altogether by using the direct connect option.

By bscalzo on   Wednesday, December 23, 2009 10:16 AM
Search Blog Entries