If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > How to find if Replication is enabled or disabled on Sybase ASE?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-16-09, 03:14
d_shanke d_shanke is offline
Registered User
 
Join Date: May 2009
Posts: 8
How to find if Replication is enabled or disabled on Sybase ASE?

What would be the quickest way to find out whether replication is enabled or disabled for database on a Sybase ASE.
Which stored procs if any would help me find the information and what configuration would I have to look at?
Any help is much appreciated.
Reply With Quote
  #2 (permalink)  
Old 06-16-09, 05:42
trvishi trvishi is offline
Registered User
 
Join Date: Sep 2003
Location: Switzerland
Posts: 443
Quote:
Originally Posted by d_shanke
What would be the quickest way to find out whether replication is enabled or disabled for database on a Sybase ASE.
Which stored procs if any would help me find the information and what configuration would I have to look at?
Any help is much appreciated.
You asked a complicated question Depends if you want to just check if its primary or you want to check all patterns in an environment.

If you just want to see the primary, its fairly easy.

1. sp_help_rep_agent --Gives what replication server the repagent is attached to.
and/or
2.
use db
go
dbcc gettrunc
go
-- The secondary trunc state will be 1 if the secondary marker is enabled.

However, even if the both returns output, it doesnt mean replication is working necessarily I know its not that easy.

Have a look at this and download Replication Pattern perl script.

http://www.sypron****/misctools.html
Reply With Quote
  #3 (permalink)  
Old 06-17-09, 06:25
d_shanke d_shanke is offline
Registered User
 
Join Date: May 2009
Posts: 8
Thanks trvishi! Truly speaking I am a novice at the sybase replication concept and do not hold knowledge of what all makes up a complete replication system.
I was plainly told to come up with a function or query which would check that replication database is enabled or disabled. Only after an initial glance at the notes on replication system did I realize the vastness of the topic.
So instead of reading through all the notes I thought maybe there was some quick way to do this. So I had to frame the question in that way

The link that you have provided does not work. Can you please post it again!
Reply With Quote
  #4 (permalink)  
Old 06-17-09, 07:55
Lerac Lerac is offline
Registered User
 
Join Date: Jun 2009
Location: South Africa
Posts: 33
Each of the options mentioned by trvishi would work, but has their own quirks :

- sp_help_rep_agent would still return a line for each database that has a configured RepAgent, even if the secondary truncation pointer is invalid.
- dbcc gettrunc() requires you to run it in the current database.

You can also use the syslogshold table in the master database. This table indicates the oldest active transaction in all the databases. If a secondary truncation pointer is enabled, there is a second "permanent" entry in this table that indicates it :
Code:
 select * from master..syslogshold
 where name = '$replication_truncation_point'
This will indicate something similar to this :
Code:
dbid        reserved    spid        page        xactid         masterxactid   starttime                      name                                                                xloid       
----------- ----------- ----------- ----------- ------         ------------   ---------                      ----                                                                ----------- 
          6           0           0     4622313 0x000000000000 0x000000000000 Jun 17 2009 11:41AM            $replication_truncation_point                                                 0 
          5           0           0       73273 0x000000000000 0x000000000000 Jun 17 2009 11:42AM            $replication_truncation_point                                                 0
Using this also has it's own quirk.. A secondary truncation pointer can be active for a database, even if the Replication agent for it has not been configured with 'sp_config_rep_agent'.
Should this be the case, it's good to know that anyway, as the database will likely run out of transaction log at some point if data in it is being updated. In this case, the truncation point can be removed using :
Code:
use <database>
go
dbcc settrunc ('ltm', 'ignore')
go
If you frequently load production databases into test / development environments like we do, you might want to disable them as a rule anyway as part of your load procedure / script.
Reply With Quote
  #5 (permalink)  
Old 07-02-09, 18:17
trvishi trvishi is offline
Registered User
 
Join Date: Sep 2003
Location: Switzerland
Posts: 443
Quote:
Originally Posted by d_shanke

The link that you have provided does not work. Can you please post it again!
http://www.sypron****/trvishi.reppattern.txt

For some reason, if I post the URL the site doesnt like it.

go to sypron website. Just google it

and then just put a slash after that and type trvishi.reppattern.text

I have to say though. This script is for people who already know a bit of replication. But give it a shot if you would like.

Last edited by trvishi; 07-02-09 at 18:21.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On