Re: 10g SQLPLUS connect problem

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Wed, 05 Aug 2009 21:10:14 +0200
Message-ID: <4a79d8fc$0$189$e4fe514c_at_news.xs4all.nl>



Shakespeare schreef:
> joel garry schreef:

>> On Aug 5, 4:35 am, Shakespeare <what..._at_xs4all.nl> wrote:
>>> Rich schreef:
>>>
>>>
>>>
>>>> On Aug 2, 9:17 pm, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
>>>>> "Rich" <richma..._at_earthlink.net> a �crit dans le message de news:
>>>>> a151f7d1-1c4d-427a-95bd-5f6d82c9f..._at_l31g2000vbp.googlegroups.com...
>>>>> |
>>>>> | I am using 10g Express Edition on Windows XP.
>>>>> |
>>>>> | I click on Start -> Oracle Database 10g Express Edition -> Go to
>>>>> | Database Home Page
>>>>> |
>>>>> | I enter my system username and password no problem.
>>>>> |
>>>>> | Then I try to do the same thing in SQLPLUS. I enter the same system
>>>>> | name and password and I get the following error:
>>>>> |
>>>>> | Error:
>>>>> | ORA-12560 TNS:protocol adapter error
>>>>> |
>>>>> | Why does oracle database home page understand my system name and
>>>>> | password and not SQL Plus.
>>>>> ORACLE_SID is not set.
>>>>> Regards
>>>>> Michel
>>>> Thanks for the reply Mike.
>>>> Total Newbie here. What would I need to do in order to set ORACLE_SID.
>>>> Regards
>>> Before starting SQLPLUS, set an environment variable: ORACLE_SID=XE
>>> or connect using username/password_at_xe
>>>
>>> Shakespeare
>>

>> I was under the impression the environment all gets set in the
>> registry for automatic use when you install XE?
>>

>> Rich, do you have more than one Oracle selection under your start-->
>> programs? Are you going to the command line and running sqlplus, or
>> selecting under xe programs? Do you have more than one user login on
>> your computer? Is there other Oracle software on your computer?
>>

>> For me, if I select sqlplus under the xe programs menu it goes right
>> in to sqlplus, and I can then connect to whatever oracle user I want.
>> If I go into the command line and say sqlplus / as sydsba, I'm also
>> right in - no changing directories or anything. If I say set at the
>> command line, there are no Oracle enviroment variables, just a
>> reference to the %oracle_home%\bin in the path. XE did all this
>> automatically on install. I suspect if it is different for you, there
>> is something you are not telling us - perhaps several tries at
>> installing?
>>

>> The suggestions given by Shakespeare and Michel are assuming you are
>> at the command line.
>>

>> If you are conversant with registry editors, you might take a look at
>> see what it says about oracle_home and oracle_sid (I think, it's been
>> a while since I've looked).
>>

>> jg
>> --
>> _at_home.com is bogus.
>> "For a developer a cell phone is a toy, to a DBA it is an instrument
>> of the devil." - Harrison Picot
> 
> Just tested this on my PC. Still had to set ORACLE_HOME and ORACLE_SID....
> 
> But I have multiple ORACLE_HOMe's on my system (one is for oracle 
> client). Got the same errors as the OP.
> 
> Shakespeare

So here's what I did: (sorry it's in Dutch)

SQL*Plus: Release 10.2.0.1.0 - Production on Wo Aug 5 21:02:38 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Voer gebruikersnaam in: system/osait01
ERROR:
ORA-12560: TNS: fout bij protocoladapter.

Voer gebruikersnaam in: system/osait01_at_xe ERROR:
ORA-12154: TNS:kan opgegeven verbindings-ID niet herleiden

Voer gebruikersnaam in:
C:\Documents and Settings\William>set
ORACLE_HOME=C:\oraclexe\app\oracle\product \10.2.0\server

C:\Documents and Settings\William>sqlplus

SQL*Plus: Release 10.2.0.1.0 - Production on Wo Aug 5 21:04:13 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Enter user-name: system/osait01
ERROR:
ORA-12560: TNS:protocol adapter error

Enter user-name: system/osait01_at_xe

Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

SQL> Shakespeare Received on Wed Aug 05 2009 - 14:10:14 CDT

Original text of this message