tags:

views:

167

answers:

1

When i try to run this

#sqlplus system@orcl

it gives me this error

SQL*Plus: Release 10.1.0.3.0 - Production on Tue Apr 20 02:24:41 2010

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

Enter password: 
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

the oracle server is working , I can connect through SQLDeveloper

My .profile looks like this

export PATH=/opt/local/bin:/opt/local/sbin:$PATH    
# Setting PATH for Python 3.1
# The orginal version is saved in .profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.1/bin:${PATH}"
DYLD_LIBRARY_PATH=/Users/lesce/instantclient
export TNS_ADMIN=/Users/lesce/instantclient
export ORACLE_SID="orcl"
export DYLD_LIBRARY_PATH
export PATH=$PATH:/Users/lesce/instantclient

tnsnames.ora

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

listener.ora

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /Users/oracle/oracle/product/10.2.0/db_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = orcl)
      (ORACLE_HOME = /Users/oracle/oracle/product/10.2.0/db_1)
    )
  )
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )

My SqlDeveloper configuration

username : sys
role : sysdba
connection type : basic
hostname : localhost
port : 1521
sid : orcl
A: 

Delete extraneous space in tnsnames.ora before ORCL (shown as underscores for clarity):

___ORCL =

should be

ORCL =

SQLDeveloper does not use tnsnames.ora in "basic" mode, so it is not affected.

Juraj
If it does not help, regenerate the configuration with Net Configuration Assistant.
Juraj
It's not the extraneous space , that was just how I pasted it .I've given up and installed ubuntu in a virtual machine , thanks for the answer .
lesce