locked
Replication sync RRS feed

  • Question

  • Please provide query to see status of replication if i have publication name.

    Thank u


    MnSap

    Sunday, June 7, 2020 7:15 PM

All replies

  • Hi MnSap,

    You can try to execute sp_replmonitorhelppublication at the Distributor on the distribution database. This returns monitoring information for all publications using this Distributor. To limit the result set to a single Publisher, publication, or published database, specify @publisher, @publication, or @publisher_db, respectively. Please refer to Programmatically Monitor Replication.

    This is a similar thread, hope it could help you.

    Best regards,
    Cathy 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com



    Monday, June 8, 2020 2:05 AM
  • Hi MnSap,

    Any update? Did the reply could help you?

    Best regards,
    Cathy 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Wednesday, June 10, 2020 7:47 AM
  • Try this:

    
    use distribution
    go
    select distinct case 
    when runstatus  = 1 then 'Start.'

    when runstatus  = 2 then 'Succeed.'

    when runstatus  = 3 then 'In progress.'

    when runstatus  = 4  then 'Idle.'

    when runstatus  = 5 then 'Retry.'

    when runstatus  = 6  then 'Fail.'
    end
    from MSdistribution_history  
    join (
    select  agent_id, max(time) time 
    From MSdistribution_history
    join  MSdistribution_agents on 
    MSdistribution_agents.id=
    MSdistribution_history.agent_id
    where publication='XXX' 
    group by agent_id
    )  as X on  X.agent_id=MSdistribution_history.agent_id
    and x.time=MSdistribution_history.time

     



    Wednesday, June 10, 2020 2:40 PM
    Answerer
  • Not working

    MnSap

    Friday, June 12, 2020 4:35 PM
  • Thanks Cathy.

    Can we have a query which can run anywhere and either pub, sub or distr?

    and search key should be publication or subscription name.


    MnSap

    Friday, June 12, 2020 4:37 PM
  • Hi MnSap,

    >> Can we have a query which can run anywhere and either pub, sub or distr?

    As I known, you can’t. 

    Best regards,
    Cathy 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Monday, June 15, 2020 7:25 AM
  • This works fine for me.

    What do you get when you run your query?

    Did you run it in the distribution database? Did you replace 'publicationName' with your publication name?

    There was an error in the query - I did fix it.
    Monday, June 15, 2020 8:10 PM
    Answerer