Connecting to sqlplus via command line
704200Jun 2 2009 — edited Jun 2 2009Hi,
I am fairly new to Oracle and can't manage to connect to my database via sql*plus. I have Oracle XE (10) edition installed here and it seems to be working fine as I can connection via the web interface and run SQL queries on it. However when it comes to sql*plus, I am not able to access it. I have tried the following:
sqlplus \nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jun 2 10:29:28 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
sqlplus my_user_name/my_password
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jun 2 10:31:08 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
Enter user-name:
sqlplus my_user_name/my_password@XE
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jun 2 10:30:19 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12541: TNS:no listener
Enter user-name:
I am using the same password than what I use to connect as SYSTEM via the web interface (and it's the same for all my user anyway). Anyone has any idea what I'm missing?
Here is my tnsnames.ora:
cat /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File:
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = anthony-desktop)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
And my listerner.ora
cat /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/listener.ora
# listener.ora Network Configuration File:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = anthony-desktop)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
Thanks a lot!
Anthony