Sybase Replication: T-SQL Query to check content of exception log
Sybase Replication rs_helpexception, RSSD, Sybase ReplicationIn Replication system, whenever any transaction is applied on primary database, it gets replicated to its downstream database and this way it makes DR database in sync with Primary. Sometimes when replication finds any issue with the transaction, it throws an exception in replication server log and replication thread goes down. This exception gets logged into exception log by running sysadmin log_ first_tran first and then running below given query.
This SQL query can be used to check the content of exception log and it just provides exact transaction that has failed and does not contain any garbage value, while traditional rs_helpexception output generates garbage value along with transaction details.
First login to replication server and run below command to log the transaction into exception log.
1> syadmin log_first_tran, ASE,DB
2> go
Now login to RSSD database and run below command.
select b.textval from rs_exceptscmd a,rs_systext b where a.cmd_id=b.parentid
and a.cmd_type='L' and sys_trans_id= (select max(sys_trans_id)
from rs_exceptscmd)
Sample Output of above query:
delete from empl_tb where id=340123
delete from empl_tb where id=340393
delete from empl_tb where id=340487
Sample Output of traditional rs_helpexception:
textval:
——————————————————————————————-
A0100distribute :origin_time='Jun 13 10:20:24:416PM',:origin_user='',
:mode=1
begin transaction 'logexec' for 'eurian'/''
begin transaction
A0100distribute :origin_user='',:mode=1
exec "TT"."so_req_rep_all_allcon" @"p01"=80000709,@"p02"='MIL'
execute tt_act_rep_all_allcon @p01 = 80000709, @p02 = 'MIL'
A0100distribute :origin_time='Jun 13 10:20:416PM',:origin_user='',
:mode=1
delete from empl_tb where id=340123
A0100distribute :origin_user='',:mode=1
exec "TT"."so_req_rep_all_allcon" @"p01"=80000709,@"p02"='MIL'
execute tt_act_rep_all_allcon @p01 = 80000709, @p02 = 'MIL'
A0100distribute :origin_user='',:mode=1
exec "TT"."so_req_rep_all_allcon" @"p01"=80000709,@"p02"='MIL'
execute tt_act_rep_all_allcon @p01 = 80000709, @p02 = 'MIL'
A0100distribute :origin_time='Jun 13 10:20:416PM',:origin_user='',
:mode=1
delete from empl_tb where id=340393
A0100distribute :origin_user='',:mode=1
exec "TT"."so_req_rep_all_allcon" @"p01"=80000709,@"p02"='MIL'
execute tt_act_rep_all_allcon @p01 = 80000709, @p02 = 'MIL'
A0100distribute :origin_time='Jun 13 10:20:416PM',:origin_user='',
:mode=1
delete from empl_tb where id=340487
A0100distribute :origin_user='',:mode=1
commit transaction
execute rs_update_lastcommit @origin = 107,@origin_qid =0x00000001004620
d300019296000effffffff000000008910009bd7cd0001000000000001,
@ secondary_qid =0x000000000000000000000000000000000000000000000000000
000000000000000000000, @origin_time = 'Jun 13 10:20:227PM'
commit transaction
(return status = 0)
How useful was this post?
Click on a star to rate it!
Average rating 5 / 5. Vote count: 3
No votes so far! Be the first to rate this post.