Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Replicate from ASE to MSSQL and vice-versa

7 posts in Replication Agent Last posting was on 2003-07-28 21:39:18.0Z
Jose Morales Posted on 2003-07-14 16:01:50.0Z
From: "Jose Morales" <jmorales@cibernetica.net>
Subject: Replicate from ASE to MSSQL and vice-versa
Date: Mon, 14 Jul 2003 11:01:50 -0500
Lines: 79
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <e0vkrFiSDHA.298@forums-2-dub>
Newsgroups: sybase.public.rep-agent
NNTP-Posting-Host: dsl-207.50.140-pool-51.cwpanama.net 207.50.140.51
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub sybase.public.rep-agent:586
Article PK: 841510

Hi,

I am trying to configure a bidirectional replication between ASE and MSSQL.
I think that in some document I already read it can be possible. I installed
Replication Server Options in order to configure this. I created a DC Server
to replicat from ASE to MSSQL and an instance of rep agent for MSSQL in
order to replicate from MSSQL to ASE. Right now I am able to replicate from
Sybase to MSSQL, and that part is working fine. The problem is the rep agent
which is not up. I think it can be configuration.

When I set up rep agent instance, the most trascendental parameters was

rs_source_ds
About this parameter the manual state the following
"Identify a data server name and a database name representing the primary
database connection for the RS".

So in this configuration a setup the name of the DC server.

All the other parameters have a right value and I am able to run the command
test_connection successfully.

The problem arise when I try to get up the Rep Agent.

About the primary database connection the Installation Guide manual states:
"Log in to the primary Replication Server with a user ID that has sa
permission , create the connection and define the Replicatino Server
Maintenance User ID for the database connection to the primary database
using the create connection command, the command would look like this:

create connection to ra_sales_instance.sales_db
set error class rs_sqlserver_error_class
set function string class rq_sqlserver_function_class
set username maint_user
set password maint_pwd
with log transfer on, dsi_suspended"


Ok I make some changes to what manual states. I create the connection in
this way:

create connection to DC_MSQL.pubs
set error class to rs_sqlserver_error_class
set function string class to rs_msss_function_class
set username to pubs_maint
set password to pubs_maint_ps
with log_transer on


where DC_MSQL is my DC Server not my rep agent instance. If I run
test_connection from rep agent instance, all is ok. But when I tried to
start up reg agent instance in replicate mode it sends me the following
error to the log:

I. 2003/07/14 10:26:00.54. com.sybase.ra.lti.LTI Successfully connected to
the Rep Server.
E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection SQL execution
failed.
E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection SQL ERROR --
E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection Message:
Replication Agent connection for 'DC_MSQL.pubs' is not allowed because the
stable queue for this source is not active.


And the service stay running in admin mode not in replicate mode. Besides,
The rep agent thread always is down and never get up.

Whit this experience I am doubting about if this bidirectional replication
is possible. Because I already configured both components (DC for MSSQL and
Rep Agent for MSSQL) but in separates servers in a uni-directional way, and
it worked fine. But in this special case when the replication have to be
bidirectional, I want to know if this is possible and if it possible what I
can do in order to get it?

TIA,

Jose Morales


Greg Carter Posted on 2003-07-15 04:07:42.0Z
Message-ID: <3F137E0E.40500@sybase.com>
Date: Mon, 14 Jul 2003 22:07:42 -0600
From: Greg Carter <gcarter@sybase.com>
Reply-To: gcarter@workmail.com
Organization: Sybase, Inc.
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Jose Morales <jmorales@cibernetica.net>
Subject: Re: Replicate from ASE to MSSQL and vice-versa
References: <e0vkrFiSDHA.298@forums-2-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Newsgroups: sybase.public.rep-agent
NNTP-Posting-Host: vpn-dub-105.sybase.com 10.22.120.105
Lines: 96
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub sybase.public.rep-agent:589
Article PK: 862249

José,

Bi-directional is possible.

Was there any complaint from RepServer when you executed the following
command:

create connection to DC_MSQL.pubs
set error class to rs_sqlserver_error_class
set function string class to rs_msss_function_class
set username to pubs_maint
set password to pubs_maint_ps
with log_transer on

When logged into RepServer, what does "admin who" show you?


--
Thanks,
G.Carter
Sybase Replication Server Engineering
mailto:greg.carter@workmail.com

Jose Morales wrote:

>Hi,
>
>I am trying to configure a bidirectional replication between ASE and MSSQL.
>I think that in some document I already read it can be possible. I installed
>Replication Server Options in order to configure this. I created a DC Server
>to replicat from ASE to MSSQL and an instance of rep agent for MSSQL in
>order to replicate from MSSQL to ASE. Right now I am able to replicate from
>Sybase to MSSQL, and that part is working fine. The problem is the rep agent
>which is not up. I think it can be configuration.
>
>When I set up rep agent instance, the most trascendental parameters was
>
>rs_source_ds
>About this parameter the manual state the following
>"Identify a data server name and a database name representing the primary
>database connection for the RS".
>
>So in this configuration a setup the name of the DC server.
>
>All the other parameters have a right value and I am able to run the command
>test_connection successfully.
>
>The problem arise when I try to get up the Rep Agent.
>
>About the primary database connection the Installation Guide manual states:
>"Log in to the primary Replication Server with a user ID that has sa
>permission , create the connection and define the Replicatino Server
>Maintenance User ID for the database connection to the primary database
>using the create connection command, the command would look like this:
>
>create connection to ra_sales_instance.sales_db
>set error class rs_sqlserver_error_class
>set function string class rq_sqlserver_function_class
>set username maint_user
>set password maint_pwd
>with log transfer on, dsi_suspended"
>
>
>Ok I make some changes to what manual states. I create the connection in
>this way:
>
>create connection to DC_MSQL.pubs
> set error class to rs_sqlserver_error_class
> set function string class to rs_msss_function_class
> set username to pubs_maint
> set password to pubs_maint_ps
> with log_transer on
>
>
>where DC_MSQL is my DC Server not my rep agent instance. If I run
>test_connection from rep agent instance, all is ok. But when I tried to
>start up reg agent instance in replicate mode it sends me the following
>error to the log:
>
>I. 2003/07/14 10:26:00.54. com.sybase.ra.lti.LTI Successfully connected to
>the Rep Server.
>E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection SQL execution
>failed.
>E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection SQL ERROR --
>E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection Message:
>Replication Agent connection for 'DC_MSQL.pubs' is not allowed because the
>stable queue for this source is not active.
>
>
>And the service stay running in admin mode not in replicate mode. Besides,
>The rep agent thread always is down and never get up.
>
>Whit this experience I am doubting about if this bidirectional replication
>is possible. Because I already configured both components (DC for MSSQL and
>Rep Agent for MSSQL) but in separates servers in a uni-directional way, and
>it worked fine. But in this special case when the replication have to be
>bidirectional, I want to know if this is possible and if it possible what I
>can do in order to get it?
>
>TIA,
>
>Jose Morales
>
>
>
>


Jose Morales Posted on 2003-07-15 13:48:18.0Z
From: "Jose Morales" <jmorales@cibernetica.net>
References: <e0vkrFiSDHA.298@forums-2-dub> <3F137E0E.40500@sybase.com>
Subject: Re: Replicate from ASE to MSSQL and vice-versa
Date: Tue, 15 Jul 2003 08:48:18 -0500
Lines: 154
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <O8sSvftSDHA.298@forums-2-dub>
Newsgroups: sybase.public.rep-agent
NNTP-Posting-Host: dsl-207.50.140-pool-51.cwpanama.net 207.50.140.51
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub sybase.public.rep-agent:590
Article PK: 841512

There is not compliant about create connection command, where DC_MSQL is a
direct connect server. If I run admin who_is_down, it shows me the rep agent
down and a message in the errorlog that states this:

E. 2003/07/14 15:36:39.79.
com.sybase.ra.conn.drivers.MSSqlServerMerantJDBCInfo Connection type
MSMERJDBC requires that a user name be configured.
E. 2003/07/14 15:36:39.82. com.sybase.ra.la.mssql.RAMLogAdmin Internal
logic error. Reason: Cannot create Main RAConnectionMgr()
E. 2003/07/14 15:36:39.82. com.sybase.ra.la.mssql.RAMLogAdmin SQL
connection or execution failed: Connection type MSMERJDBC requires that a
user name be configured.

I modify my configuration and I create one connection for DC_MSQL.pub with
log_transfer off and another one for repagent_mssql.pubs (this is a rep
agent instance) with log_transfer on. But still the rep agent is down and
the message above is in the errorlog showing something is wrong. If I run
test_connection from repagent is shows me all is ok even I can put it in
replicate mode. I was able to create a replication def and a subscription,
even I run the command to mark the table for replicate. But the rep agent
still shows down from Rep Server and when I insert a record into the table
it does not get replicated because rep agent is down.

Regards,

Jose

"Greg Carter" <gcarter@sybase.com> escribió en el mensaje
news:3F137E0E.40500@sybase.com...

> José,
>
> Bi-directional is possible.
>
> Was there any complaint from RepServer when you executed the following
> command:
>
> create connection to DC_MSQL.pubs
> set error class to rs_sqlserver_error_class
> set function string class to rs_msss_function_class
> set username to pubs_maint
> set password to pubs_maint_ps
> with log_transer on
>
> When logged into RepServer, what does "admin who" show you?
>
>
> --
> Thanks,
> G.Carter
> Sybase Replication Server Engineering
> mailto:greg.carter@workmail.com
>
>
>
> Jose Morales wrote:
>
> >Hi,
> >
> >I am trying to configure a bidirectional replication between ASE and
MSSQL.
> >I think that in some document I already read it can be possible. I
installed
> >Replication Server Options in order to configure this. I created a DC
Server
> >to replicat from ASE to MSSQL and an instance of rep agent for MSSQL in
> >order to replicate from MSSQL to ASE. Right now I am able to replicate
from
> >Sybase to MSSQL, and that part is working fine. The problem is the rep
agent
> >which is not up. I think it can be configuration.
> >
> >When I set up rep agent instance, the most trascendental parameters was
> >
> >rs_source_ds
> >About this parameter the manual state the following
> >"Identify a data server name and a database name representing the primary
> >database connection for the RS".
> >
> >So in this configuration a setup the name of the DC server.
> >
> >All the other parameters have a right value and I am able to run the
command
> >test_connection successfully.
> >
> >The problem arise when I try to get up the Rep Agent.
> >
> >About the primary database connection the Installation Guide manual
states:
> >"Log in to the primary Replication Server with a user ID that has sa
> >permission , create the connection and define the Replicatino Server
> >Maintenance User ID for the database connection to the primary database
> >using the create connection command, the command would look like this:
> >
> >create connection to ra_sales_instance.sales_db
> >set error class rs_sqlserver_error_class
> >set function string class rq_sqlserver_function_class
> >set username maint_user
> >set password maint_pwd
> >with log transfer on, dsi_suspended"
> >
> >
> >Ok I make some changes to what manual states. I create the connection in
> >this way:
> >
> >create connection to DC_MSQL.pubs
> > set error class to rs_sqlserver_error_class
> > set function string class to rs_msss_function_class
> > set username to pubs_maint
> > set password to pubs_maint_ps
> > with log_transer on
> >
> >
> >where DC_MSQL is my DC Server not my rep agent instance. If I run
> >test_connection from rep agent instance, all is ok. But when I tried to
> >start up reg agent instance in replicate mode it sends me the following
> >error to the log:
> >
> >I. 2003/07/14 10:26:00.54. com.sybase.ra.lti.LTI Successfully connected
to
> >the Rep Server.
> >E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection SQL execution
> >failed.
> >E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection SQL ERROR --
> >E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection Message:
> >Replication Agent connection for 'DC_MSQL.pubs' is not allowed because
the
> >stable queue for this source is not active.
> >
> >
> >And the service stay running in admin mode not in replicate mode.
Besides,
> >The rep agent thread always is down and never get up.
> >
> >Whit this experience I am doubting about if this bidirectional
replication
> >is possible. Because I already configured both components (DC for MSSQL
and
> >Rep Agent for MSSQL) but in separates servers in a uni-directional way,
and
> >it worked fine. But in this special case when the replication have to be
> >bidirectional, I want to know if this is possible and if it possible what
I
> >can do in order to get it?
> >
> >TIA,
> >
> >Jose Morales
> >
> >
> >
> >
>


Greg Carter Posted on 2003-07-15 17:18:50.0Z
Message-ID: <3F14377A.4060502@sybase.com>
Date: Tue, 15 Jul 2003 11:18:50 -0600
From: Greg Carter <gcarter@sybase.com>
Reply-To: gcarter@workmail.com
Organization: Sybase, Inc.
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Jose Morales <jmorales@cibernetica.net>
Subject: Re: Replicate from ASE to MSSQL and vice-versa
References: <e0vkrFiSDHA.298@forums-2-dub> <3F137E0E.40500@sybase.com> <O8sSvftSDHA.298@forums-2-dub>
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.rep-agent
NNTP-Posting-Host: gcarter-pc.sybase.com 157.133.214.230
Lines: 379
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub sybase.public.rep-agent:592
Article PK: 862250

José,

First, let me mention that there is no reason to create two connections when dealing with a non-ASE data server that is both primary and replicate. One connection will do just fine. The only reason I can think of why someone might want two, is just because they like looking at it that way. But then my question would be, why don't they create two connections for their bi-directional replication requirements to ASE?

That aside, and for the sake of discussion, let's assume you have two connections - let's call them DC_MSQL.pub for the outbound connection and repagent_mssql.pubs for the inbound connection.

Creating the outbound connection, DC_MSQL.pub: "DC_MSQL" must be defined in your interfaces file and must point to the data server handling activity against the database referred to here as "pub". Whether or not the replicate data server actually needs the "pub" qualifier or not, RepServer needs it. So if the replicate data server is of a type that does not support multiple databases, "pub" is not used to make the connection and you may make up whatever you like for the database name. Since this is strictly outbound, you will want the "with log transfer off" option of the RepServer "create connection" command. You will also want to make sure that you use the correct values for options "error class" and "function string class" so that the DSI knows how to properly handle any errors from the replicate data server as it is applying transactions, and so that the DSI uses the proper functions and function strings for mapping commands appropriately for the replicate data server. You will also want to supply values for the "username" and "password" options of that command that are valid  in the replicate data base we are referring to as DC_MSQL.pub. RepServer must be able to use this username and password to log into the replicate database and apply replicated transactions. This is the "maintenance user". Since this is strictly outbound, the only relationship between this connection and the RepAgent is that the maintenance user defined here should be the same as the maintenance user defined on the inbound connection, repagent_mssql.pubs. This will allow the RepAgent to know which transactions by default it should *not* forward to RepServer and thereby prevent a kind of "circular" replication in which the same transaction bounces back and forth between primary and replicate. Note: If you had used one connection as both inbound and outbound, you would not have to manually enforce this requirement.
create connection to DC_MSQL.pub
set error class to rs_sqlserver_error_class
set function string class to rs_msss_function_class
set username to maint_user
set password to maint_user_pwd
with log transfer off


Creating the inbound connection, repagent_mssql.pub: Here, since this is strictly inbound, you will want to select the "with log transfer on, dsi_suspended" options of the RepServer "create connection" command. Since this is strictly outbound, your choice of values for options "error class" and "function string class" really don't matter, so long as the values you choose have been properly defined to RepServer. Inbound activity never makes use of this information. Finally, since this inbound connection is supposed to correspond to the previous outbound connection, you should use the same values for the maintenance user here as you did before. So for RepServer we have:
create connection to repagent_mssql.pub
set error class to dummy_error_class
set function string class to dummy_function_class
set username to  maint_user
set password to maint_user_pwd
with log transfer on, dsi_suspended

But now we have some RepAgent work to do since RepAgent will be using this connection. First, RepAgent needs to be given username and password with which to log into RepServer. For RepAgent/MSSS, you use the rs_username and rs_password configurations to set this. Note that in RepServer, this user must have been created and granted "connect source" permission in order to be used by a RepAgent. This is *not* the maintenance user. Second, since this is strictly inbound, while the database name does not have to be in the interfaces file, RepAgent does need to know both the data server name and the database name so that it can tell RepServer whose log it is transferring. You provide RepAgent these names using its rs_source_ds and rs_source_db configurations. These values in RepAgent's configuration must match the "dataserver.database" names given to the connection you want RepAgent to use - in this case, repagent_mssql.pub. And they do not have to match RepAgent's pds_datasource_name and pds_database_name configurations. They can if you like but they don't have to. What is important is that RepAgent's rs_source_ds and rs_source_db settings match the "dataserver.database" named used to create the connection in RepServer that RepAgent will use. Finally, you do not have to tell RepAgent anything about the maintenance user. When RepAgent logs into RepServer, it will identify itself as a RepAgent, specify the dataserver and database whose log it is transferring, and ask for the maintenance user name for that dataserver and database. RepServer will respond by giving it the username value provided in this inbound connection.

Do it with a single connection: Personally, I would recommend to keep it simple and use a single connection in RepServer for both inbound and outbound. This will also conserve some resources in RepServer. To do this, choose those elements of the two "create connections" that are used to support the inbound side of the inbound connection and the outbound side of the outbound connection. So we would have
create connection to DC_MSQL.pub
set error class to rs_sqlserver_error_class
set function string class to rs_msss_function_class
set username to  maint_user
set password to maint_user_pwd
with log transfer on

Then in RepAgent, set rs_source_ds and rs_source_db to "DC_MSQL" and "pub" respectively, and away you go.

Note: I believe that the test_connection in RepAgent only checks to see if the username and password it has been supplied using configurations rs_username and rs_password are valid for logging in to RepServer. It does not check if the setting of rs_source_ds and rs_source_db will identify the correct connection it should be using. This explains why test_connection works but the RepAgent can not send LTL.


-- Thanks, G.Carter Sybase Replication Server Engineering mailto:greg.carter@workmail.com



Jose Morales wrote:

There is not compliant about create connection command, where DC_MSQL is a direct connect server. If I run admin who_is_down, it shows me the rep agent down and a message in the errorlog that states this: E. 2003/07/14 15:36:39.79. com.sybase.ra.conn.drivers.MSSqlServerMerantJDBCInfo Connection type MSMERJDBC requires that a user name be configured. E. 2003/07/14 15:36:39.82. com.sybase.ra.la.mssql.RAMLogAdmin Internal logic error. Reason: Cannot create Main RAConnectionMgr() E. 2003/07/14 15:36:39.82. com.sybase.ra.la.mssql.RAMLogAdmin SQL connection or execution failed: Connection type MSMERJDBC requires that a user name be configured. I modify my configuration and I create one connection for DC_MSQL.pub with log_transfer off and another one for repagent_mssql.pubs (this is a rep agent instance) with log_transfer on. But still the rep agent is down and the message above is in the errorlog showing something is wrong. If I run test_connection from repagent is shows me all is ok even I can put it in replicate mode. I was able to create a replication def and a subscription, even I run the command to mark the table for replicate. But the rep agent still shows down from Rep Server and when I insert a record into the table it does not get replicated because rep agent is down. Regards, Jose "Greg Carter" <gcarter@sybase.com> escribió en el mensaje news:3F137E0E.40500@sybase.com...
José, Bi-directional is possible. Was there any complaint from RepServer when you executed the following command: create connection to DC_MSQL.pubs set error class to rs_sqlserver_error_class set function string class to rs_msss_function_class set username to pubs_maint set password to pubs_maint_ps with log_transer on When logged into RepServer, what does "admin who" show you? -- Thanks, G.Carter Sybase Replication Server Engineering mailto:greg.carter@workmail.com Jose Morales wrote:
Hi, I am trying to configure a bidirectional replication between ASE and
MSSQL.
I think that in some document I already read it can be possible. I
installed
Replication Server Options in order to configure this. I created a DC
Server
to replicat from ASE to MSSQL and an instance of rep agent for MSSQL in order to replicate from MSSQL to ASE. Right now I am able to replicate
from
Sybase to MSSQL, and that part is working fine. The problem is the rep
agent
which is not up. I think it can be configuration. When I set up rep agent instance, the most trascendental parameters was rs_source_ds About this parameter the manual state the following "Identify a data server name and a database name representing the primary database connection for the RS". So in this configuration a setup the name of the DC server. All the other parameters have a right value and I am able to run the
command
test_connection successfully. The problem arise when I try to get up the Rep Agent. About the primary database connection the Installation Guide manual
states:
"Log in to the primary Replication Server with a user ID that has sa permission , create the connection and define the Replicatino Server Maintenance User ID for the database connection to the primary database using the create connection command, the command would look like this: create connection to ra_sales_instance.sales_db set error class rs_sqlserver_error_class set function string class rq_sqlserver_function_class set username maint_user set password maint_pwd with log transfer on, dsi_suspended" Ok I make some changes to what manual states. I create the connection in this way: create connection to DC_MSQL.pubs set error class to rs_sqlserver_error_class set function string class to rs_msss_function_class set username to pubs_maint set password to pubs_maint_ps with log_transer on where DC_MSQL is my DC Server not my rep agent instance. If I run test_connection from rep agent instance, all is ok. But when I tried to start up reg agent instance in replicate mode it sends me the following error to the log: I. 2003/07/14 10:26:00.54. com.sybase.ra.lti.LTI Successfully connected
to
the Rep Server. E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection SQL execution failed. E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection SQL ERROR -- E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection Message: Replication Agent connection for 'DC_MSQL.pubs' is not allowed because
the
stable queue for this source is not active. And the service stay running in admin mode not in replicate mode.
Besides,
The rep agent thread always is down and never get up. Whit this experience I am doubting about if this bidirectional
replication
is possible. Because I already configured both components (DC for MSSQL
and
Rep Agent for MSSQL) but in separates servers in a uni-directional way,
and
it worked fine. But in this special case when the replication have to be bidirectional, I want to know if this is possible and if it possible what
I
can do in order to get it? TIA, Jose Morales


Jose Morales Posted on 2003-07-22 05:45:00.0Z
From: "Jose Morales" <jmorales@cibernetica.net>
References: <e0vkrFiSDHA.298@forums-2-dub> <3F137E0E.40500@sybase.com> <O8sSvftSDHA.298@forums-2-dub> <3F14377A.4060502@sybase.com>
Subject: Re: Replicate from ASE to MSSQL and vice-versa
Date: Tue, 22 Jul 2003 00:45:00 -0500
Lines: 778
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_001D_01C34FEA.7D1B7980"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <u44EhSBUDHA.346@forums-2-dub>
Newsgroups: sybase.public.rep-agent
NNTP-Posting-Host: dsl-207.50.140-pool-51.cwpanama.net 207.50.140.51
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub sybase.public.rep-agent:600
Article PK: 841513

Thanks Greg,
 
I tried with one connection and it was successfull. It something tricky, but it works. My only complaint is about create replication definitions on the MSSQL site. Because when I tried to create it from RSM it sends me the following message:
 
Unable to find the command: 'sp_setreptable_on' in file:'HDS_NULL_COMMAND'
 
Message from server: Message:512, State 1, Severityu 16 -- 'Subquery returned more than 1 value. This is illegal when the subquery follows =, !=, <, <=, >, >=, or when the subquery is used as an expression.
 
Is we put this message appart, all is working fine, because I created the replication definition with RCL. But I think that there would be a way to solve this message.
 
Regards,
 
Jose Morales
 
"Greg Carter" <gcarter@sybase.com> escribió en el mensaje news:3F14377A.4060502@sybase.com...
José,

First, let me mention that there is no reason to create two connections when dealing with a non-ASE data server that is both primary and replicate. One connection will do just fine. The only reason I can think of why someone might want two, is just because they like looking at it that way. But then my question would be, why don't they create two connections for their bi-directional replication requirements to ASE?

That aside, and for the sake of discussion, let's assume you have two connections - let's call them DC_MSQL.pub for the outbound connection and repagent_mssql.pubs for the inbound connection.

Creating the outbound connection, DC_MSQL.pub: "DC_MSQL" must be defined in your interfaces file and must point to the data server handling activity against the database referred to here as "pub". Whether or not the replicate data server actually needs the "pub" qualifier or not, RepServer needs it. So if the replicate data server is of a type that does not support multiple databases, "pub" is not used to make the connection and you may make up whatever you like for the database name. Since this is strictly outbound, you will want the "with log transfer off" option of the RepServer "create connection" command. You will also want to make sure that you use the correct values for options "error class" and "function string class" so that the DSI knows how to properly handle any errors from the replicate data server as it is applying transactions, and so that the DSI uses the proper functions and function strings for mapping commands appropriately for the replicate data server. You will also want to supply values for the "username" and "password" options of that command that are valid  in the replicate data base we are referring to as DC_MSQL.pub. RepServer must be able to use this username and password to log into the replicate database and apply replicated transactions. This is the "maintenance user". Since this is strictly outbound, the only relationship between this connection and the RepAgent is that the maintenance user defined here should be the same as the maintenance user defined on the inbound connection, repagent_mssql.pubs. This will allow the RepAgent to know which transactions by default it should *not* forward to RepServer and thereby prevent a kind of "circular" replication in which the same transaction bounces back and forth between primary and replicate. Note: If you had used one connection as both inbound and outbound, you would not have to manually enforce this requirement.
create connection to DC_MSQL.pub
set error class to rs_sqlserver_error_class
set function string class to rs_msss_function_class
set username to maint_user
set password to maint_user_pwd
with log transfer off


Creating the inbound connection, repagent_mssql.pub: Here, since this is strictly inbound, you will want to select the "with log transfer on, dsi_suspended" options of the RepServer "create connection" command. Since this is strictly outbound, your choice of values for options "error class" and "function string class" really don't matter, so long as the values you choose have been properly defined to RepServer. Inbound activity never makes use of this information. Finally, since this inbound connection is supposed to correspond to the previous outbound connection, you should use the same values for the maintenance user here as you did before. So for RepServer we have:
create connection to repagent_mssql.pub
set error class to dummy_error_class
set function string class to dummy_function_class
set username to  maint_user
set password to maint_user_pwd
with log transfer on, dsi_suspended

But now we have some RepAgent work to do since RepAgent will be using this connection. First, RepAgent needs to be given username and password with which to log into RepServer. For RepAgent/MSSS, you use the rs_username and rs_password configurations to set this. Note that in RepServer, this user must have been created and granted "connect source" permission in order to be used by a RepAgent. This is *not* the maintenance user. Second, since this is strictly inbound, while the database name does not have to be in the interfaces file, RepAgent does need to know both the data server name and the database name so that it can tell RepServer whose log it is transferring. You provide RepAgent these names using its rs_source_ds and rs_source_db configurations. These values in RepAgent's configuration must match the "dataserver.database" names given to the connection you want RepAgent to use - in this case, repagent_mssql.pub. And they do not have to match RepAgent's pds_datasource_name and pds_database_name configurations. They can if you like but they don't have to. What is important is that RepAgent's rs_source_ds and rs_source_db settings match the "dataserver.database" named used to create the connection in RepServer that RepAgent will use. Finally, you do not have to tell RepAgent anything about the maintenance user. When RepAgent logs into RepServer, it will identify itself as a RepAgent, specify the dataserver and database whose log it is transferring, and ask for the maintenance user name for that dataserver and database. RepServer will respond by giving it the username value provided in this inbound connection.

Do it with a single connection: Personally, I would recommend to keep it simple and use a single connection in RepServer for both inbound and outbound. This will also conserve some resources in RepServer. To do this, choose those elements of the two "create connections" that are used to support the inbound side of the inbound connection and the outbound side of the outbound connection. So we would have
create connection to DC_MSQL.pub
set error class to rs_sqlserver_error_class
set function string class to rs_msss_function_class
set username to  maint_user
set password to maint_user_pwd
with log transfer on

Then in RepAgent, set rs_source_ds and rs_source_db to "DC_MSQL" and "pub" respectively, and away you go.

Note: I believe that the test_connection in RepAgent only checks to see if the username and password it has been supplied using configurations rs_username and rs_password are valid for logging in to RepServer. It does not check if the setting of rs_source_ds and rs_source_db will identify the correct connection it should be using. This explains why test_connection works but the RepAgent can not send LTL.


-- Thanks, G.Carter Sybase Replication Server Engineering mailto:greg.carter@workmail.com



Jose Morales wrote:
There is not compliant about create connection command, where DC_MSQL is a direct connect server. If I run admin who_is_down, it shows me the rep agent down and a message in the errorlog that states this: E. 2003/07/14 15:36:39.79. com.sybase.ra.conn.drivers.MSSqlServerMerantJDBCInfo Connection type MSMERJDBC requires that a user name be configured. E. 2003/07/14 15:36:39.82. com.sybase.ra.la.mssql.RAMLogAdmin Internal logic error. Reason: Cannot create Main RAConnectionMgr() E. 2003/07/14 15:36:39.82. com.sybase.ra.la.mssql.RAMLogAdmin SQL connection or execution failed: Connection type MSMERJDBC requires that a user name be configured. I modify my configuration and I create one connection for DC_MSQL.pub with log_transfer off and another one for repagent_mssql.pubs (this is a rep agent instance) with log_transfer on. But still the rep agent is down and the message above is in the errorlog showing something is wrong. If I run test_connection from repagent is shows me all is ok even I can put it in replicate mode. I was able to create a replication def and a subscription, even I run the command to mark the table for replicate. But the rep agent still shows down from Rep Server and when I insert a record into the table it does not get replicated because rep agent is down. Regards, Jose "Greg Carter" <gcarter@sybase.com> escribió en el mensaje news:3F137E0E.40500@sybase.com...
José, Bi-directional is possible. Was there any complaint from RepServer when you executed the following command: create connection to DC_MSQL.pubs set error class to rs_sqlserver_error_class set function string class to rs_msss_function_class set username to pubs_maint set password to pubs_maint_ps with log_transer on When logged into RepServer, what does "admin who" show you? -- Thanks, G.Carter Sybase Replication Server Engineering mailto:greg.carter@workmail.com Jose Morales wrote:
Hi, I am trying to configure a bidirectional replication between ASE and
MSSQL.
I think that in some document I already read it can be possible. I
installed
Replication Server Options in order to configure this. I created a DC
Server
to replicat from ASE to MSSQL and an instance of rep agent for MSSQL in order to replicate from MSSQL to ASE. Right now I am able to replicate
from
Sybase to MSSQL, and that part is working fine. The problem is the rep
agent
which is not up. I think it can be configuration. When I set up rep agent instance, the most trascendental parameters was rs_source_ds About this parameter the manual state the following "Identify a data server name and a database name representing the primary database connection for the RS". So in this configuration a setup the name of the DC server. All the other parameters have a right value and I am able to run the
command
test_connection successfully. The problem arise when I try to get up the Rep Agent. About the primary database connection the Installation Guide manual
states:
"Log in to the primary Replication Server with a user ID that has sa permission , create the connection and define the Replicatino Server Maintenance User ID for the database connection to the primary database using the create connection command, the command would look like this: create connection to ra_sales_instance.sales_db set error class rs_sqlserver_error_class set function string class rq_sqlserver_function_class set username maint_user set password maint_pwd with log transfer on, dsi_suspended" Ok I make some changes to what manual states. I create the connection in this way: create connection to DC_MSQL.pubs set error class to rs_sqlserver_error_class set function string class to rs_msss_function_class set username to pubs_maint set password to pubs_maint_ps with log_transer on where DC_MSQL is my DC Server not my rep agent instance. If I run test_connection from rep agent instance, all is ok. But when I tried to start up reg agent instance in replicate mode it sends me the following error to the log: I. 2003/07/14 10:26:00.54. com.sybase.ra.lti.LTI Successfully connected
to
the Rep Server. E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection SQL execution failed. E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection SQL ERROR -- E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection Message: Replication Agent connection for 'DC_MSQL.pubs' is not allowed because
the
stable queue for this source is not active. And the service stay running in admin mode not in replicate mode.
Besides,
The rep agent thread always is down and never get up. Whit this experience I am doubting about if this bidirectional
replication
is possible. Because I already configured both components (DC for MSSQL
and
Rep Agent for MSSQL) but in separates servers in a uni-directional way,
and
it worked fine. But in this special case when the replication have to be bidirectional, I want to know if this is possible and if it possible what
I
can do in order to get it? TIA, Jose Morales


Greg Carter Posted on 2003-07-25 22:08:36.0Z
Message-ID: <3F21A986.9020807@sybase.com>
From: Greg Carter <gcarter@sybase.com>
Reply-To: gcarter@workmail.com
Organization: Sybase, Inc.
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: sybase.public.rep-agent
To: Jose Morales <jmorales@cibernetica.net>
Subject: Re: Replicate from ASE to MSSQL and vice-versa
References: <e0vkrFiSDHA.298@forums-2-dub> <3F137E0E.40500@sybase.com> <O8sSvftSDHA.298@forums-2-dub> <3F14377A.4060502@sybase.com> <u44EhSBUDHA.346@forums-2-dub>
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vpn-dub-187.sybase.com
X-Original-NNTP-Posting-Host: vpn-dub-187.sybase.com
Date: 25 Jul 2003 15:08:36 -0700
X-Trace: forums-1-dub 1059170916 10.22.120.187 (25 Jul 2003 15:08:36 -0700)
X-Original-Trace: 25 Jul 2003 15:08:36 -0700, vpn-dub-187.sybase.com
Lines: 483
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.rep-agent:605
Article PK: 862264

José,

You have to explicitly identify each server and
make sure that the vendor type is correct in RSM. You have to add a MS SQL Server,
or an Oracle Server, etc. Additionally, you have to set up the Rep Agent in RSM
(again identifying the vendor for the source database) and setup a data
server for the source database. So for a bi-directional MS SQL Server to
ASE you would need.

ASE
Replication Server
MS SQL Server data server - accessed through a DirectConnect
Rep Agent for MS SQL Server
RSM Server

The heterogeneous replication guide details the steps to setup an RSM
environment. You can locate this guide on the web at http://sybooks.sybase.com/onlinebooks/group-rs/rsg1250e/rshetrep/@Generic__BookView

-- Thanks, G.Carter Sybase Replication Server Engineering mailto:greg.carter@workmail.com


Jose Morales wrote:

Thanks Greg,
 
I tried with one connection and it was successfull. It something tricky, but it works. My only complaint is about create replication definitions on the MSSQL site. Because when I tried to create it from RSM it sends me the following message:
 
Unable to find the command: 'sp_setreptable_on' in file:'HDS_NULL_COMMAND'
 
Message from server: Message:512, State 1, Severityu 16 -- 'Subquery returned more than 1 value. This is illegal when the subquery follows =, !=, <, <=, >, >=, or when the subquery is used as an expression.
 
Is we put this message appart, all is working fine, because I created the replication definition with RCL. But I think that there would be a way to solve this message.
 
Regards,
 
Jose Morales
 
"Greg Carter" <gcarter@sybase.com> escribió en el mensaje news:3F14377A.4060502@sybase.com...
José,

First, let me mention that there is no reason to create two connections when dealing with a non-ASE data server that is both primary and replicate. One connection will do just fine. The only reason I can think of why someone might want two, is just because they like looking at it that way. But then my question would be, why don't they create two connections for their bi-directional replication requirements to ASE?

That aside, and for the sake of discussion, let's assume you have two connections - let's call them DC_MSQL.pub for the outbound connection and repagent_mssql.pubs for the inbound connection.

Creating the outbound connection, DC_MSQL.pub: "DC_MSQL" must be defined in your interfaces file and must point to the data server handling activity against the database referred to here as "pub". Whether or not the replicate data server actually needs the "pub" qualifier or not, RepServer needs it. So if the replicate data server is of a type that does not support multiple databases, "pub" is not used to make the connection and you may make up whatever you like for the database name. Since this is strictly outbound, you will want the "with log transfer off" option of the RepServer "create connection" command. You will also want to make sure that you use the correct values for options "error class" and "function string class" so that the DSI knows how to properly handle any errors from the replicate data server as it is applying transactions, and so that the DSI uses the proper functions and function strings for mapping commands appropriately for the replicate data server. You will also want to supply values for the "username" and "password" options of that command that are valid  in the replicate data base we are referring to as DC_MSQL.pub. RepServer must be able to use this username and password to log into the replicate database and apply replicated transactions. This is the "maintenance user". Since this is strictly outbound, the only relationship between this connection and the RepAgent is that the maintenance user defined here should be the same as the maintenance user defined on the inbound connection, repagent_mssql.pubs. This will allow the RepAgent to know which transactions by default it should *not* forward to RepServer and thereby prevent a kind of "circular" replication in which the same transaction bounces back and forth between primary and replicate. Note: If you had used one connection as both inbound and outbound, you would not have to manually enforce this requirement.
create connection to DC_MSQL.pub
set error class to rs_sqlserver_error_class
set function string class to rs_msss_function_class
set username to maint_user
set password to maint_user_pwd
with log transfer off


Creating the inbound connection, repagent_mssql.pub: Here, since this is strictly inbound, you will want to select the "with log transfer on, dsi_suspended" options of the RepServer "create connection" command. Since this is strictly outbound, your choice of values for options "error class" and "function string class" really don't matter, so long as the values you choose have been properly defined to RepServer. Inbound activity never makes use of this information. Finally, since this inbound connection is supposed to correspond to the previous outbound connection, you should use the same values for the maintenance user here as you did before. So for RepServer we have:
create connection to repagent_mssql.pub
set error class to dummy_error_class
set function string class to dummy_function_class
set username to  maint_user
set password to maint_user_pwd
with log transfer on, dsi_suspended

But now we have some RepAgent work to do since RepAgent will be using this connection. First, RepAgent needs to be given username and password with which to log into RepServer. For RepAgent/MSSS, you use the rs_username and rs_password configurations to set this. Note that in RepServer, this user must have been created and granted "connect source" permission in order to be used by a RepAgent. This is *not* the maintenance user. Second, since this is strictly inbound, while the database name does not have to be in the interfaces file, RepAgent does need to know both the data server name and the database name so that it can tell RepServer whose log it is transferring. You provide RepAgent these names using its rs_source_ds and rs_source_db configurations. These values in RepAgent's configuration must match the "dataserver.database" names given to the connection you want RepAgent to use - in this case, repagent_mssql.pub. And they do not have to match RepAgent's pds_datasource_name and pds_database_name configurations. They can if you like but they don't have to. What is important is that RepAgent's rs_source_ds and rs_source_db settings match the "dataserver.database" named used to create the connection in RepServer that RepAgent will use. Finally, you do not have to tell RepAgent anything about the maintenance user. When RepAgent logs into RepServer, it will identify itself as a RepAgent, specify the dataserver and database whose log it is transferring, and ask for the maintenance user name for that dataserver and database. RepServer will respond by giving it the username value provided in this inbound connection.

Do it with a single connection: Personally, I would recommend to keep it simple and use a single connection in RepServer for both inbound and outbound. This will also conserve some resources in RepServer. To do this, choose those elements of the two "create connections" that are used to support the inbound side of the inbound connection and the outbound side of the outbound connection. So we would have
create connection to DC_MSQL.pub
set error class to rs_sqlserver_error_class
set function string class to rs_msss_function_class
set username to  maint_user
set password to maint_user_pwd
with log transfer on

Then in RepAgent, set rs_source_ds and rs_source_db to "DC_MSQL" and "pub" respectively, and away you go.

Note: I believe that the test_connection in RepAgent only checks to see if the username and password it has been supplied using configurations rs_username and rs_password are valid for logging in to RepServer. It does not check if the setting of rs_source_ds and rs_source_db will identify the correct connection it should be using. This explains why test_connection works but the RepAgent can not send LTL.


-- Thanks, G.Carter Sybase Replication Server Engineering mailto:greg.carter@workmail.com



Jose Morales wrote:
There is not compliant about create connection command, where DC_MSQL is a direct connect server. If I run admin who_is_down, it shows me the rep agent down and a message in the errorlog that states this: E. 2003/07/14 15:36:39.79. com.sybase.ra.conn.drivers.MSSqlServerMerantJDBCInfo Connection type MSMERJDBC requires that a user name be configured. E. 2003/07/14 15:36:39.82. com.sybase.ra.la.mssql.RAMLogAdmin Internal logic error. Reason: Cannot create Main RAConnectionMgr() E. 2003/07/14 15:36:39.82. com.sybase.ra.la.mssql.RAMLogAdmin SQL connection or execution failed: Connection type MSMERJDBC requires that a user name be configured. I modify my configuration and I create one connection for DC_MSQL.pub with log_transfer off and another one for repagent_mssql.pubs (this is a rep agent instance) with log_transfer on. But still the rep agent is down and the message above is in the errorlog showing something is wrong. If I run test_connection from repagent is shows me all is ok even I can put it in replicate mode. I was able to create a replication def and a subscription, even I run the command to mark the table for replicate. But the rep agent still shows down from Rep Server and when I insert a record into the table it does not get replicated because rep agent is down. Regards, Jose "Greg Carter" <gcarter@sybase.com> escribió en el mensaje news:3F137E0E.40500@sybase.com...
José, Bi-directional is possible. Was there any complaint from RepServer when you executed the following command: create connection to DC_MSQL.pubs set error class to rs_sqlserver_error_class set function string class to rs_msss_function_class set username to pubs_maint set password to pubs_maint_ps with log_transer on When logged into RepServer, what does "admin who" show you? -- Thanks, G.Carter Sybase Replication Server Engineering mailto:greg.carter@workmail.com Jose Morales wrote:
Hi, I am trying to configure a bidirectional replication between ASE and
MSSQL.
I think that in some document I already read it can be possible. I
installed
Replication Server Options in order to configure this. I created a DC
Server
to replicat from ASE to MSSQL and an instance of rep agent for MSSQL in order to replicate from MSSQL to ASE. Right now I am able to replicate
from
Sybase to MSSQL, and that part is working fine. The problem is the rep
agent
which is not up. I think it can be configuration. When I set up rep agent instance, the most trascendental parameters was rs_source_ds About this parameter the manual state the following "Identify a data server name and a database name representing the primary database connection for the RS". So in this configuration a setup the name of the DC server. All the other parameters have a right value and I am able to run the
command
test_connection successfully. The problem arise when I try to get up the Rep Agent. About the primary database connection the Installation Guide manual
states:
"Log in to the primary Replication Server with a user ID that has sa permission , create the connection and define the Replicatino Server Maintenance User ID for the database connection to the primary database using the create connection command, the command would look like this: create connection to ra_sales_instance.sales_db set error class rs_sqlserver_error_class set function string class rq_sqlserver_function_class set username maint_user set password maint_pwd with log transfer on, dsi_suspended" Ok I make some changes to what manual states. I create the connection in this way: create connection to DC_MSQL.pubs set error class to rs_sqlserver_error_class set function string class to rs_msss_function_class set username to pubs_maint set password to pubs_maint_ps with log_transer on where DC_MSQL is my DC Server not my rep agent instance. If I run test_connection from rep agent instance, all is ok. But when I tried to start up reg agent instance in replicate mode it sends me the following error to the log: I. 2003/07/14 10:26:00.54. com.sybase.ra.lti.LTI Successfully connected
to
the Rep Server. E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection SQL execution failed. E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection SQL ERROR -- E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection Message: Replication Agent connection for 'DC_MSQL.pubs' is not allowed because
the
stable queue for this source is not active. And the service stay running in admin mode not in replicate mode.
Besides,
The rep agent thread always is down and never get up. Whit this experience I am doubting about if this bidirectional
replication
is possible. Because I already configured both components (DC for MSSQL
and
Rep Agent for MSSQL) but in separates servers in a uni-directional way,
and
it worked fine. But in this special case when the replication have to be bidirectional, I want to know if this is possible and if it possible what
I
can do in order to get it? TIA, Jose Morales



Jose Morales Posted on 2003-07-28 21:39:18.0Z
From: "Jose Morales" <jmorales@cibernetica.net>
Newsgroups: sybase.public.rep-agent
References: <e0vkrFiSDHA.298@forums-2-dub> <3F137E0E.40500@sybase.com> <O8sSvftSDHA.298@forums-2-dub> <3F14377A.4060502@sybase.com> <u44EhSBUDHA.346@forums-2-dub> <3F21A986.9020807@sybase.com>
Subject: Re: Replicate from ASE to MSSQL and vice-versa
Lines: 907
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_003A_01C35527.3D8381E0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 207.50.140.51
X-Original-NNTP-Posting-Host: 207.50.140.51
Message-ID: <3f259806@forums-1-dub>
Date: 28 Jul 2003 14:39:18 -0700
X-Trace: forums-1-dub 1059428358 207.50.140.51 (28 Jul 2003 14:39:18 -0700)
X-Original-Trace: 28 Jul 2003 14:39:18 -0700, 207.50.140.51
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.rep-agent:606
Article PK: 841516

Hi Greg,
 
I set up all the needed products to replicate in bidirectional way. But doing some tests I found that when I insert a record in ASE if I executed a select * from replicate table (in MS server) I can catch the maintenance user's insert spawning a lock in such a way that I have to kill the process of the maintenance user, and when I do this the insert never arrive to the replicate table. Is this a normal behaviour or I have to set up some parameters in DC/RS in order to avoid this kind of lock?
 
Regards,
 
Jose Morales
----- Original Message
"Greg Carter" <gcarter@sybase.com> escribió en el mensaje news:3F21A986.9020807@sybase.com...
José,

You have to explicitly identify each server and
make sure that the vendor type is correct in RSM. You have to add a MS SQL Server,
or an Oracle Server, etc. Additionally, you have to set up the Rep Agent in RSM
(again identifying the vendor for the source database) and setup a data
server for the source database. So for a bi-directional MS SQL Server to
ASE you would need.

ASE
Replication Server
MS SQL Server data server - accessed through a DirectConnect
Rep Agent for MS SQL Server
RSM Server

The heterogeneous replication guide details the steps to setup an RSM
environment. You can locate this guide on the web at http://sybooks.sybase.com/onlinebooks/group-rs/rsg1250e/rshetrep/@Generic__BookView

-- Thanks, G.Carter Sybase Replication Server Engineering mailto:greg.carter@workmail.com


Jose Morales wrote:
Thanks Greg,
 
I tried with one connection and it was successfull. It something tricky, but it works. My only complaint is about create replication definitions on the MSSQL site. Because when I tried to create it from RSM it sends me the following message:
 
Unable to find the command: 'sp_setreptable_on' in file:'HDS_NULL_COMMAND'
 
Message from server: Message:512, State 1, Severityu 16 -- 'Subquery returned more than 1 value. This is illegal when the subquery follows =, !=, <, <=, >, >=, or when the subquery is used as an expression.
 
Is we put this message appart, all is working fine, because I created the replication definition with RCL. But I think that there would be a way to solve this message.
 
Regards,
 
Jose Morales
 
"Greg Carter" <gcarter@sybase.com> escribió en el mensaje news:3F14377A.4060502@sybase.com...
José,

First, let me mention that there is no reason to create two connections when dealing with a non-ASE data server that is both primary and replicate. One connection will do just fine. The only reason I can think of why someone might want two, is just because they like looking at it that way. But then my question would be, why don't they create two connections for their bi-directional replication requirements to ASE?

That aside, and for the sake of discussion, let's assume you have two connections - let's call them DC_MSQL.pub for the outbound connection and repagent_mssql.pubs for the inbound connection.

Creating the outbound connection, DC_MSQL.pub: "DC_MSQL" must be defined in your interfaces file and must point to the data server handling activity against the database referred to here as "pub". Whether or not the replicate data server actually needs the "pub" qualifier or not, RepServer needs it. So if the replicate data server is of a type that does not support multiple databases, "pub" is not used to make the connection and you may make up whatever you like for the database name. Since this is strictly outbound, you will want the "with log transfer off" option of the RepServer "create connection" command. You will also want to make sure that you use the correct values for options "error class" and "function string class" so that the DSI knows how to properly handle any errors from the replicate data server as it is applying transactions, and so that the DSI uses the proper functions and function strings for mapping commands appropriately for the replicate data server. You will also want to supply values for the "username" and "password" options of that command that are valid  in the replicate data base we are referring to as DC_MSQL.pub. RepServer must be able to use this username and password to log into the replicate database and apply replicated transactions. This is the "maintenance user". Since this is strictly outbound, the only relationship between this connection and the RepAgent is that the maintenance user defined here should be the same as the maintenance user defined on the inbound connection, repagent_mssql.pubs. This will allow the RepAgent to know which transactions by default it should *not* forward to RepServer and thereby prevent a kind of "circular" replication in which the same transaction bounces back and forth between primary and replicate. Note: If you had used one connection as both inbound and outbound, you would not have to manually enforce this requirement.
create connection to DC_MSQL.pub
set error class to rs_sqlserver_error_class
set function string class to rs_msss_function_class
set username to maint_user
set password to maint_user_pwd
with log transfer off


Creating the inbound connection, repagent_mssql.pub: Here, since this is strictly inbound, you will want to select the "with log transfer on, dsi_suspended" options of the RepServer "create connection" command. Since this is strictly outbound, your choice of values for options "error class" and "function string class" really don't matter, so long as the values you choose have been properly defined to RepServer. Inbound activity never makes use of this information. Finally, since this inbound connection is supposed to correspond to the previous outbound connection, you should use the same values for the maintenance user here as you did before. So for RepServer we have:
create connection to repagent_mssql.pub
set error class to dummy_error_class
set function string class to dummy_function_class
set username to  maint_user
set password to maint_user_pwd
with log transfer on, dsi_suspended

But now we have some RepAgent work to do since RepAgent will be using this connection. First, RepAgent needs to be given username and password with which to log into RepServer. For RepAgent/MSSS, you use the rs_username and rs_password configurations to set this. Note that in RepServer, this user must have been created and granted "connect source" permission in order to be used by a RepAgent. This is *not* the maintenance user. Second, since this is strictly inbound, while the database name does not have to be in the interfaces file, RepAgent does need to know both the data server name and the database name so that it can tell RepServer whose log it is transferring. You provide RepAgent these names using its rs_source_ds and rs_source_db configurations. These values in RepAgent's configuration must match the "dataserver.database" names given to the connection you want RepAgent to use - in this case, repagent_mssql.pub. And they do not have to match RepAgent's pds_datasource_name and pds_database_name configurations. They can if you like but they don't have to. What is important is that RepAgent's rs_source_ds and rs_source_db settings match the "dataserver.database" named used to create the connection in RepServer that RepAgent will use. Finally, you do not have to tell RepAgent anything about the maintenance user. When RepAgent logs into RepServer, it will identify itself as a RepAgent, specify the dataserver and database whose log it is transferring, and ask for the maintenance user name for that dataserver and database. RepServer will respond by giving it the username value provided in this inbound connection.

Do it with a single connection: Personally, I would recommend to keep it simple and use a single connection in RepServer for both inbound and outbound. This will also conserve some resources in RepServer. To do this, choose those elements of the two "create connections" that are used to support the inbound side of the inbound connection and the outbound side of the outbound connection. So we would have
create connection to DC_MSQL.pub
set error class to rs_sqlserver_error_class
set function string class to rs_msss_function_class
set username to  maint_user
set password to maint_user_pwd
with log transfer on

Then in RepAgent, set rs_source_ds and rs_source_db to "DC_MSQL" and "pub" respectively, and away you go.

Note: I believe that the test_connection in RepAgent only checks to see if the username and password it has been supplied using configurations rs_username and rs_password are valid for logging in to RepServer. It does not check if the setting of rs_source_ds and rs_source_db will identify the correct connection it should be using. This explains why test_connection works but the RepAgent can not send LTL.


-- Thanks, G.Carter Sybase Replication Server Engineering mailto:greg.carter@workmail.com



Jose Morales wrote:
There is not compliant about create connection command, where DC_MSQL is a direct connect server. If I run admin who_is_down, it shows me the rep agent down and a message in the errorlog that states this: E. 2003/07/14 15:36:39.79. com.sybase.ra.conn.drivers.MSSqlServerMerantJDBCInfo Connection type MSMERJDBC requires that a user name be configured. E. 2003/07/14 15:36:39.82. com.sybase.ra.la.mssql.RAMLogAdmin Internal logic error. Reason: Cannot create Main RAConnectionMgr() E. 2003/07/14 15:36:39.82. com.sybase.ra.la.mssql.RAMLogAdmin SQL connection or execution failed: Connection type MSMERJDBC requires that a user name be configured. I modify my configuration and I create one connection for DC_MSQL.pub with log_transfer off and another one for repagent_mssql.pubs (this is a rep agent instance) with log_transfer on. But still the rep agent is down and the message above is in the errorlog showing something is wrong. If I run test_connection from repagent is shows me all is ok even I can put it in replicate mode. I was able to create a replication def and a subscription, even I run the command to mark the table for replicate. But the rep agent still shows down from Rep Server and when I insert a record into the table it does not get replicated because rep agent is down. Regards, Jose "Greg Carter" <gcarter@sybase.com> escribió en el mensaje news:3F137E0E.40500@sybase.com...
José, Bi-directional is possible. Was there any complaint from RepServer when you executed the following command: create connection to DC_MSQL.pubs set error class to rs_sqlserver_error_class set function string class to rs_msss_function_class set username to pubs_maint set password to pubs_maint_ps with log_transer on When logged into RepServer, what does "admin who" show you? -- Thanks, G.Carter Sybase Replication Server Engineering mailto:greg.carter@workmail.com Jose Morales wrote:
Hi, I am trying to configure a bidirectional replication between ASE and
MSSQL.
I think that in some document I already read it can be possible. I
installed
Replication Server Options in order to configure this. I created a DC
Server
to replicat from ASE to MSSQL and an instance of rep agent for MSSQL in order to replicate from MSSQL to ASE. Right now I am able to replicate
from
Sybase to MSSQL, and that part is working fine. The problem is the rep
agent
which is not up. I think it can be configuration. When I set up rep agent instance, the most trascendental parameters was rs_source_ds About this parameter the manual state the following "Identify a data server name and a database name representing the primary database connection for the RS". So in this configuration a setup the name of the DC server. All the other parameters have a right value and I am able to run the
command
test_connection successfully. The problem arise when I try to get up the Rep Agent. About the primary database connection the Installation Guide manual
states:
"Log in to the primary Replication Server with a user ID that has sa permission , create the connection and define the Replicatino Server Maintenance User ID for the database connection to the primary database using the create connection command, the command would look like this: create connection to ra_sales_instance.sales_db set error class rs_sqlserver_error_class set function string class rq_sqlserver_function_class set username maint_user set password maint_pwd with log transfer on, dsi_suspended" Ok I make some changes to what manual states. I create the connection in this way: create connection to DC_MSQL.pubs set error class to rs_sqlserver_error_class set function string class to rs_msss_function_class set username to pubs_maint set password to pubs_maint_ps with log_transer on where DC_MSQL is my DC Server not my rep agent instance. If I run test_connection from rep agent instance, all is ok. But when I tried to start up reg agent instance in replicate mode it sends me the following error to the log: I. 2003/07/14 10:26:00.54. com.sybase.ra.lti.LTI Successfully connected
to
the Rep Server. E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection SQL execution failed. E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection SQL ERROR -- E. 2003/07/14 10:26:00.57. com.sybase.ra.conn.RAConnection Message: Replication Agent connection for 'DC_MSQL.pubs' is not allowed because
the
stable queue for this source is not active. And the service stay running in admin mode not in replicate mode.
Besides,
The rep agent thread always is down and never get up. Whit this experience I am doubting about if this bidirectional
replication
is possible. Because I already configured both components (DC for MSSQL
and
Rep Agent for MSSQL) but in separates servers in a uni-directional way,
and
it worked fine. But in this special case when the replication have to be bidirectional, I want to know if this is possible and if it possible what
I
can do in order to get it? TIA, Jose Morales