Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: weird problem with database link and synonym
From the original post it is clear that the alias is defined.
"tnsping DBL" works.
> If the object you're trying to access is in database B while logging
> in to database A, then look at the tnsnames.ora file on the database
> server to see if the alias used in the synonym (DBL) can be resolved,
> i.e. see if the alias is defined in the database server's
> tnsnames.ora. If it isn't, then define it and then try the query
> again.
>
> > "Anonymous Developer" <orakcle_at_yahoo.com> wrote in message
> > news:de75c082.0110010251.3934ea1f_at_posting.google.com...
> > > Here is the problem:
> > >
> > > ------------------------------
> > > $ sqlplus scott/tiger
> > >
> > > SQL> CREATE SYNONYM W_T FOR W_T_at_DBL;
> > > ------------------------------
> > >
> > > Now, I am able to run the follwing query within sqlplus session:
> > >
> > > ------------------------------
> > > SQL> SELECT * FROM w_t ;
> > > ------------------------------
> > >
> > > But the same query from the command line and SQL script file
> > > (as below)
> > > ------------------------------
> > > $ cat > q1.sql
> > > SELECT *
> > > FROM w_t;
> > > <Ctrl-D>
> > > $ sqlplus scott/tiger @q1
> > > ------------------------------
> > >
> > > produces the following well-known error:
> > > ORA-12154: TNS:could not resolve service name
> > >
> > > Besides, "tnsping DBL" succeeds.
> > >
> > > Platform: Oracle 8.1.6 / Linux 2.2.16
> > >
> > > Any idea?
Received on Wed Oct 03 2001 - 10:00:32 CDT
![]() |
![]() |