Skip to Content

Replication between SAP Sybase ASE and SAP Sybase IQ: Quick setup Cheat Sheet

You should have valid license for SAP Sybase ASE, SAP Replication Server and SAP Sybase IQ. 

Before setting up replication, add ASE , Replication Server and Sybase IQ enteries in interfaces file

ON Sybase ASE:

[sybase@rhvm sample_resource_files]$ isql -Usa -P -Spds155

1> use pubs2\\

2> go\\

1> create table testlab (c1 int primary key, c2 int, c3 char(10))\\

2> go\\

1> use master\\

2> go\\

1> sp_addserver prs155,RPCServer,prs155\\

2> go\\

Adding server 'prs155', physical name 'prs155'\\

Server added.\\

(return status = 0)\\

1> sp_addserver prs155,sds,prs155\\

2> go\\

Adding server 'prs155', physical name 'prs155'\\

Server added.\\

(return status = 0)\\

1> connect to prs155\\

2> go\\

Entered passthru mode to server 'prs155'.\\

--On Replication Server create connection to IQ database

1> 1> create connection to iq151.iqdemo\\

2> using profile rs_ase_to_iq;standard\\

3> set username to dbmaint\\

4> set password to dbmaint\\

5> go\\

Connection to 'iq151.iqdemo' is created.\\

On IQ:

1>create table testlab (c1 int primary key, c2 int, c3 char(10))

2>go\\

1> grant all on testlab to public\\

2> go\\

1> grant connect to dbmaint identified by dbmaint\\

2> go\\

1> grant DBA to dbmaint\\

2> go\\

1> grant membership in group rs_systabgroup to dbmaint\\

2> go\\

1> grant connect to sa identified by sysadmin\\

2> go\\

1> grant DBA to sa\\

2> go\\

1> grant membership in group rs_systabgroup to sa\\

2> go\\

1> grant group to DBA\\

2> grant membership in group DBA to dbmaint\\

3> grant membership in group DBA to sa\\

4> go\\

On Replication Server:

1> admin who\\

2> go\\

Spid Name       State                Info\\

---- ---------- -------------------- ----------------------------------------\\

   40 DSI EXEC   Awaiting Command     103(1) iq151.iqdemo\\

   39 DSI        Awaiting Message     103 iq151.iqdemo\\

   38 SQM        Awaiting Message     103:0 iq151.iqdemo\\

   21 DSI EXEC   Awaiting Command     101(1) pds155.prs155_RSSD\\

    9 DSI        Awaiting Message     101 pds155.prs155_RSSD\\

   19 DIST       Awaiting Wakeup      101 pds155.prs155_RSSD\\

   20 SQT        Awaiting Wakeup      101:1  DIST pds155.prs155_RSSD\\

   18 SQM        Awaiting Message     101:1 pds155.prs155_RSSD\\

   17 SQM        Awaiting Message     101:0 pds155.prs155_RSSD\\

   22 REP AGENT  Awaiting Command     pds155.prs155_RSSD\\

   23 NRM        Awaiting Message     pds155.prs155_RSSD\\

   35 DSI EXEC   Awaiting Command     102(1) pds155.pubs2\\

   29 DSI        Awaiting Message     102 pds155.pubs2\\

   31 DIST       Awaiting Wakeup      102 pds155.pubs2\\

   32 SQT        Awaiting Wakeup      102:1  DIST pds155.pubs2\\

   30 SQM        Awaiting Message     102:1 pds155.pubs2\\

   28 SQM        Awaiting Message     102:0 pds155.pubs2\\

   33 REP AGENT  Awaiting Command     pds155.pubs2\\

   34 NRM        Awaiting Message     pds155.pubs2\\

   10 dSUB       Sleeping\\

    6 dCM        Awaiting Message\\

    7 dAIO       Awaiting Message\\

   12 dREC       Sleeping             dREC\\

   37 USER       Active               sa\\

    5 dALARM     Awaiting Wakeup\\

   13 dSYSAM     Sleeping\\

1> alter connection to iq151.iqdemo\\

2> set dsi_compile_enable to 'on'\\

3> go\\

Config parameter 'dsi_compile_enable' is modified.\\

1> alter connection to iqdemo154.iqdemo set dsi_compile_enable to 'on'\\

2> go\\

Config parameter 'dsi_compile_enable' is modified. This change will not take\\

effect until the connection/route is restarted. A connection/route can be\\

restarted with the suspend and resume commands.\\

1> alter connection to iqdemo154.iqdemo set dsi_compile_max_cmds to '1000'\\

2> go\\

Config parameter 'dsi_compile_max_cmds' is modified.\\

1> alter connection to iqdemo154.iqdemo set dsi_bulk_threshold to '10'\\

2> go\\

Config parameter 'dsi_bulk_threshold' is modified.\\

1> alter connection to iqdemo154.iqdemo set dsi_command_convert to 'i2di,u2di'\\

2> go\\

Config parameter 'dsi_command_convert' is modified. This change will not take\\

effect until the connection/route is restarted. A connection/route can be\\

restarted with the suspend and resume commands.\\

1> suspend connection to iq151.iqdemo\\

2> go\\

Connection to 'iq151.iqdemo' is suspended.\\

1> resume connection to iq151.iqdemo\\

2> go\\

Connection to 'iq151.iqdemo' is resumed.\\

1> disconnect\\

2> go\\

Exited passthru mode from server 'prs155'.\\

On ASE

1> use pubs2\\

2> go\\

1> insert into testlab values(1,1,'testrow1')\\

2> insert into testlab values(2,2,'testrow2')\\

3> insert into testlab values(3,3,'testrow3')\\

4> go\\

(1 row affected)\\

(1 row affected)\\

(1 row affected)\\

1> sp_setreptable testlab, true\\

2> go\\

The replication status for 'testlab' is set to true, owner_off.\\

(return status = 0)\\

1> connect to prs155\\

2> go\\

Entered passthru mode to server 'prs155'.\\

1> create replication definition testlabrep\\

2> with primary at pds155.pubs2\\

3> with primary table named 'testlab'\\

4> with replicate table named 'testlab'\\

5> (c1 int, c2 int, c3 char(10))\\

6> primary key(c1)\\

7> go\\

Replication definition 'testlabrep' is created.\\

1> create subscription testlabsub for testlabrep\\

2> with replicate at iq151.iqdemo\\

3> go\\

Subscription 'testlabsub' is in the process of being created.\\

On IQ

1> select * from testlab\\

2> go\\

c1          c2          c3\\

----------- ----------- ----------\\

1           1          testrow1

2           2          testrow2

3           3          testrow3

(3 rows affected)

On ase

1> disconnect

2> go

Exited passthru mode from server 'prs155'.

1> insert into testlab values(4,4,'testrow4')

2> insert into testlab values(5,5,'testrow5')

3> insert into testlab values(6,6,'testrow6')

4> go

(1 row affected)

(1 row affected)

(1 row affected)

On IQ

1> select * from testlab

2> go

c1          c2          c3

----------- -----------

----------

           1           1 testrow1

           2           2 testrow2

           3           3 testrow3

           4           4 testrow4

           5           5 testrow5

           6           6 testrow6

(6 rows affected)

Tags: