Link to home
Start Free TrialLog in
Avatar of William Peck
William PeckFlag for United States of America

asked on

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.
User generated image
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:
User generated image
ASKER CERTIFIED SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

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.
Avatar of William Peck

ASKER

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 . . .
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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:
User generated image
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 ?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
>>-- 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.
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)
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.
>>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 !