trouble logging on to Sql*Plus via command and can't log on to Designer (need connect string)

I just successfully installed Oracle Developer but having trouble logging on to Sql Plus from command line, also can't connect via any of the Developer Tools, I keep getting TNS: Connect timeout occurred. This also happens for Sql Plus for Windows.
Oracle forms connect error
However, I can connect via Sql Plus command window when it's run from "Start --> All Programs", but not when I first run the Command window:
Sql Plus connect plus error
Gadsden ConsultingIT SpecialistAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gerwin Jansen, EE MVETopic Advisor Commented:
You should check your PATH settings, Your first sql plus is 11.2.0.1.0 where as the second one is 10.1.0.4.2. The first one has a configured tnsnames (in network\admin) and the second one does not,
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
slightwv (䄆 Netminder) Commented:
I agree with Gerwin's post.  Looks like you have multiple Oracle products installed.

I wanted to comment on the original question about timeouts.

99% of the time these are due to a firewall issue.  Since you specified a service name (database) in teh sql developer window, it is trying a network connection.  You would need to look a the tnsnames.ora file it is using to see what/where the ORCL instance is that it is looking for.
0
Gadsden ConsultingIT SpecialistAuthor Commented:
Ok, that makes sense, but . . . I don't quite get it, wouldn't the TNS listener be listening for anything ? I thought this was kind of a universal resource . . .
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

slightwv (䄆 Netminder) Commented:
>>wouldn't the TNS listener be listening for anything ? I thought this was kind of a universal resource . . .

It listens for whatever you tell it to or whatever has registered with it.

When you go to make a connection you it looks for the listener wherever you tell it to look.  May be you aren't looking for the listener when you think you are looking.
0
Gadsden ConsultingIT SpecialistAuthor Commented:
slightwv,

>>It listens for whatever you tell it to or whatever has registered with it.
-- ok, that kind of makes sense, but it doesn't compute with me . . . Mainly because I'm only going to have ONE tnsnames file on my machine, right ?

Here's my orig path (see notes on lines 5 and 8)
E:\app\DevSuiteHome_1\jdk\jre\bin\classic;
E:\app\DevSuiteHome_1\jdk\jre\bin;
E:\app\DevSuiteHome_1\jdk\jre\bin\client;
E:\app\DevSuiteHome_1\jlib;
E:\app\DevSuiteHome_1\bin;   <-- Sql plus 10.1 found here, but no tnsnames, so dead end, end of PATH search
E:\app\DevSuiteHome_1\jre\1.4.2\bin\client;
E:\app\DevSuiteHome_1\jre\1.4.2\bin;
E:\app\Stephen\product\11.2.0\dbhome_1\bin;  <-- tnsnames found here, also Sql Plus 11.2

%SystemRoot%\system32;
%SystemRoot%;
%SystemRoot%\System32\Wbem;
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;

C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;
C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;
C:\Program Files (x86)\Common Files\ThinPrint\;

C:\Program Files\Java\jdk1.7.0_60\bin

Open in new window

To fix my sql plus from command window issue, I moved E:\app\Stephen\product\11.2.0\dbhome_1\bin;   to the front of my PATH, and now Sql Plus always comes from there and I can connect.

But . . . I still can't connect from the Oracle Developer tools, here:
Oracle forms can't connect
Nor can I connect to the d.b. from Sql Plus for Windows, which is in E:\app\DevSuiteHome_1\BIN\sqlplusw.exe, even though the Listener is now first in PATH

How do I fix this ?
0
slightwv (䄆 Netminder) Commented:
>>Mainly because I'm only going to have ONE tnsnames file on my machine, right ?

You can have as many tnsnames.ora files as you want.  Same for listener.ora files if you have more than one listener from more than one ORACLE_HOME.

>>But . . . I still can't connect from the Oracle Developer tools, here:

SQL Developer sort of has it's own environment.  You should be able to set up a direct connection but I never use that tool so I cannot say how.

If sql developer is being run form the DevSuiteHome path, it still may need a tnsnames.ora file there.  Copy the one from the 11g install under:
E:\app\DevSuiteHome_1\network\admin

>> even though the Listener is now first in PATH

listener doesn't matter.  It can run from any ORACLE_HOME.  Everything just has to point to the correct place.
0
Gadsden ConsultingIT SpecialistAuthor Commented:
slightwv,
>>You can have as many tnsnames.ora files as you want.
-- but I only want ONE ! isn't that normal ? it would be goofy to have multiple tnsnames, imo.

-- Note that for SQL Developer the path is "E:\Program Files (x86)\sqldeveloper\sqldeveloper.exe", BUT this works fine, I connected to the d.b. without jumping through hoops.

Here's the Oracle developer tools' tnsnames in E:\app\DevSuiteHome_1\NETWORK\ADMIN
EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = Stephen-PC.home)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = PLSExtProc)
    )
  )

Open in new window

Here's the tnsnames from the 11g d.b.

LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))


ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

Open in new window


I'll play around with this, thanks.
0
slightwv (䄆 Netminder) Commented:
>>-- but I only want ONE ! isn't that normal ? it would be goofy to have multiple tnsnames, imo.

Not abnormal at all.  You typically have one per Oracle product install.  If you ONLY want one, there is a TNS_ADMIN environment variable you need to set that will tell ALL Oracle products where to locate the tnsnames file:
http://docs.oracle.com/cd/E11882_01/win.112/e10845/ap_net.htm#NTQRF515

Personally, I never use TNS_ADMIN and have been using Oracle for over 20 years.
0
Gadsden ConsultingIT SpecialistAuthor Commented:
Ok, I mostly got it going.

- I copied the 11g tnsnames to Oracle Developer location, and I got Oracle Forms to connect to one of my databases, yea !

- I couldn't connect to Oracle forms as "sys as sysdba" ("invalid username / password",
- I did connect as "hr", so not sure why I couldn't connect as "sys as sysdba" (I connect from sql plus and Sql Developer)
0
slightwv (䄆 Netminder) Commented:
Not an Oracle Forms guy but the space messes up a LOT of Oracle products.

I'm sure if you Google around, you'll see how to connect 'as sysdba' with Forms.

My question is: Why would you want to?

Connecting as SYS is something you typically NEVER do unless you are performing some major database actions.  I don't see Forms as needing to do this.
0
Gadsden ConsultingIT SpecialistAuthor Commented:
>>My question is: Why would you want to connect as "sys"
-- I'm just trying to set up my environment, so that is my test connection.

So I got my question answered, but I'm sure I'll be back, thanks !
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.