Re: A stupid SQL*Plus question

From: Karsten Farrell <kfarrell_at_belgariad.com>
Date: Fri, 11 Apr 2003 15:32:16 GMT
Message-ID: <MPG.19007fd5e6f0e003989730_at_news.la.sbcglobal.net>


Xalison.holloway_at_oracle.comX said...
> You'll need to create an entry in the tnsnames.ora file for the remote server. You can do
> this using the Net Configuration Assistant.
>
> Alison
>
> wl wrote:
> > Hi all,
> > I apologize for this simple question.
> >
> > I have a need to access an Oracle database on another server using my PC. I
> > installed SQL*Plus for Windows, but was unable to logon to the database. I
> > have no idea what to enter in the "hostname string".
> >
> > With the following example information, can someone tell me what the
> > "hostname string" should be:
> >
> > server address: dbserver.company.com
> > port: 1521
> > database: mydb
> > user: userid1
> > password: password1
> >
> > Thanks
> >
> >
>
Or ... if you're the "edit" kind of person, edit your tnsnames.ora file and include the following entry (modified for your environment):

mydb =
  (DESCRIPTION =
    (ADDRESS_LIST =

      (ADDRESS =
        (PROTOCOL = TCP)(HOST = dbserver.company.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = mydb)
    )
  )

Then in the dialog box when you start sqlplus, put the userid, password, and mydb (or whatever you call it in your tnsnames.ora).

One thing, though - make sure your host name is dbserver.company.com. Go to the server, and if it's Unix, type the command, hostname. Whatever appears in the reply is what you put as the HOST parameter in your tnsnames.ora. And even if you use the Net Config Assist as suggested, be sure to check your sqlnet.ora file, which often by default has a DEFAULT_DOMAIN entry that is wrong (in my environment, at least).

-- 
/Karsten
DBA > retired > DBA
Received on Fri Apr 11 2003 - 17:32:16 CEST

Original text of this message