PDA

View Full Version : Connecting to database Using SqlPlus


th83
09-27-2003, 07:26 AM
People i am having problem conecting to datbases in oracle 8i using SqlpPlus

i use the command

lsnrctl status

there was no listener running

so i us the command

lsnrctl start

then i again test the listener status and it listed all my database

(c) Copyright 1998 Oracle Corporation. All rights reserved.

Connecting to (DESCRIPTION=(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS))(ADDRE
SS=(PROTOCOL=IPC)(KEY=ORCL)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 8.1.5.0.0 - Produc
tion
Start Date 27-SEP-03 13:22:45
Uptime 0 days 0 hr. 15 min. 24 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File E:\Oracle\Ora81\network\admin\listener.ora
Listener Log File E:\Oracle\Ora81\network\log\listener.log
Services Summary...
GLOBALDB has 1 service handler(s)
TESTDB has 1 service handler(s)
ORCL has 1 service handler(s)


Now when i try to connect to the GlobalDB

D:\>sqlplus username/pass@GlobalDB

It gives me error

ERROR:
ORA-12154: TNS:could not resolve service name

i want to connect to particular database (e.g TestDB or GlobalDB) not to my default database

rdfreel
10-26-2003, 11:01 PM
Hi th83

You need to have your service (SID) in your client tnsnames.ora file. Do you have an entry for your GlobalDB?
You must have an entry for each database you are trying to connect to in your tnsnames.ora file.

This file is located at:
$ORACLE_HOME\network\admin
Make sure you have the sytax correct, i.e. the host where the database lives, the port, the SID, etc. Make sure it is also in the correct format, with all parens having closing parens, etc.

An example tnsnames.ora file comes with the install.
Also, the server side must have a tnsnames.ora file also that can resolve your user process' connection string.

Good luck