Re: Problem with Synonym
Posted in 1999
Topics: High Availability & Replication, Error Codes & Troubleshooting, Platform-Specific Issues
Ravi Krishna 1 Sep 99, 19:21:
> Environment : Informix 7.30.UC8
> Hardware : IBM RS6000 H70 AIX 4.3.2
>
> We have 2 servers, production server (Pserver) and Report Server
>
> (RServer). Data is replicated from Pserver to RServer thru HDR. In
> other
>
> words Pserver is the Primary server and Rserver the secondary.
>
> All report programs are directed to Rserver. However some of the
> reports require an insert on some tables. Since Rserver is a read only
> database, we wanted to create a synonym for those tables where data is
> inserted, to points to the same table on the Pserver. In the report
> program SQL will refer to the synonym instead of real table name. This
> way data will be inserted on the Psever even though the report program
> is running on the Rserver.
>
> create synonym syntablename FOR dbname@Pserver:tableName ;>
> Here comes the problem:
>
> CASE1: This SQL works:-
> insert on dbname@Pserver:tableName values (...)
>
> CASE2: This SQL does not work:-
> insert on syntablename values (...)
> We get error 271, ISAM error 101.
>
> Aren't both doing the same thing. Why does the first one work and
> second one fail.
>
> We are not comfortable with hardcoded remote server table names (as in
>
>
> case1) in report programs.
>
> Can anyone give a solution.
>
> TIA.
>
> Ravi.
> --
> Posted via Talkway - http://www.talkway.com
> Exchange ideas on practically anything (tm).
>
Hi.
You never can do a write to a secondary server except if you
change the status to standard, in this case the replication will be
ended and lost the funcionality. The replication means that you
have somethink like a snapshot.
I don't know your development tool but if this tool suport
parameters try to send paramerts to the program ( like
dbname@Pserver) and prepare the statments that do a write to de
database (insert, deletes, updates).
Take care.
---------------------------------------
Isidre PONS ROCA
BASE - Gesti' d'Ingressos Locals
(Diputacio de Tarragona)
Servei de Sistemes de Informacio
Av President Lluis Companys 12-C
43005 - Tarragona
SPAIN
Tel # +34 977 236731
Fax # +34 977 227302
http://www.altanet.org
ipons@dtgna.altanet.org
---------------------------------------
> Hi.
>
> You never can do a write to a secondary server except if you
> change the status to standard, in this case the replication will be
> ended and lost the funcionality. The replication means that you
> have somethink like a snapshot.
I am not making an attempt to write anything to the secondary server.
The insert statement mentioned is actually on a synonym which in turn
points to the table on the primary server. It works when written as
insert into databaseName@serverName:tableNamebut not insert into synonymName. Strange, since both are doing the same
job.
Ravi.