Monday, March 19, 2012
Force Invalidate Snapshot???
When we upgraded our ERP to a new version, I am almost certain that I setup Transactional Replication the exact same way....
I did the following to drop an article from a publication:
sp_dropsubscription
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.subscriber = 'SQL-05'
go
sp_droparticle
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.force_invalidate_snapshot = 1 (I HAVE TO DO THIS OR IT WON'T DROP THE ARTICLE & I Don't know why, it didn't used to be this way.....)
go
sp_refreshsubscriptions 'ReportsPUBL'
go
I made my change to the en_csrep_tbl_usr & did the following;
/* Add the Article back */
sp_addarticle
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.source_table = 'en_csrep_tbl_usr'
go
When I start the Snapshot agent it is doing a snapshot of everything & not just the one table!!!!
Anonymous Subscriptions are NOT allowed.
Can you tell me where to look or why it is making me do the @.force_invalidate_snapshot = 1 now?
thanx!
JUDE
Actually the one difference is that the subscriber is doing a PULL now as opposed to the Publisher doing a PUSH as it was setup in the past.
JUDE
"Jude" <judes@.email.uophx.edu> wrote in message news:ec29Ryv7GHA.4288@.TK2MSFTNGP02.phx.gbl...
I am sorry to post about this again, but I can't put my finger on what is wrong.
When we upgraded our ERP to a new version, I am almost certain that I setup Transactional Replication the exact same way....
I did the following to drop an article from a publication:
sp_dropsubscription
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.subscriber = 'SQL-05'
go
sp_droparticle
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.force_invalidate_snapshot = 1 (I HAVE TO DO THIS OR IT WON'T DROP THE ARTICLE & I Don't know why, it didn't used to be this way.....)
go
sp_refreshsubscriptions 'ReportsPUBL'
go
I made my change to the en_csrep_tbl_usr & did the following;
/* Add the Article back */
sp_addarticle
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.source_table = 'en_csrep_tbl_usr'
go
When I start the Snapshot agent it is doing a snapshot of everything & not just the one table!!!!
Anonymous Subscriptions are NOT allowed.
Can you tell me where to look or why it is making me do the @.force_invalidate_snapshot = 1 now?
thanx!
JUDE
|||Does this difference explain the problem?
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Jude" <judes@.email.uophx.edu> wrote in message news:enUr06v7GHA.4708@.TK2MSFTNGP05.phx.gbl...
Actually the one difference is that the subscriber is doing a PULL now as opposed to the Publisher doing a PUSH as it was setup in the past.
JUDE
"Jude" <judes@.email.uophx.edu> wrote in message news:ec29Ryv7GHA.4288@.TK2MSFTNGP02.phx.gbl...
I am sorry to post about this again, but I can't put my finger on what is wrong.
When we upgraded our ERP to a new version, I am almost certain that I setup Transactional Replication the exact same way....
I did the following to drop an article from a publication:
sp_dropsubscription
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.subscriber = 'SQL-05'
go
sp_droparticle
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.force_invalidate_snapshot = 1 (I HAVE TO DO THIS OR IT WON'T DROP THE ARTICLE & I Don't know why, it didn't used to be this way.....)
go
sp_refreshsubscriptions 'ReportsPUBL'
go
I made my change to the en_csrep_tbl_usr & did the following;
/* Add the Article back */
sp_addarticle
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.source_table = 'en_csrep_tbl_usr'
go
When I start the Snapshot agent it is doing a snapshot of everything & not just the one table!!!!
Anonymous Subscriptions are NOT allowed.
Can you tell me where to look or why it is making me do the @.force_invalidate_snapshot = 1 now?
thanx!
JUDE
|||No, should it? Should I change it to a PUSH & I won't have this issue any longer?
JUDE
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message news:u4Lb1ry7GHA.4552@.TK2MSFTNGP05.phx.gbl...
Does this difference explain the problem?
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Jude" <judes@.email.uophx.edu> wrote in message news:enUr06v7GHA.4708@.TK2MSFTNGP05.phx.gbl...
Actually the one difference is that the subscriber is doing a PULL now as opposed to the Publisher doing a PUSH as it was setup in the past.
JUDE
"Jude" <judes@.email.uophx.edu> wrote in message news:ec29Ryv7GHA.4288@.TK2MSFTNGP02.phx.gbl...
I am sorry to post about this again, but I can't put my finger on what is wrong.
When we upgraded our ERP to a new version, I am almost certain that I setup Transactional Replication the exact same way....
I did the following to drop an article from a publication:
sp_dropsubscription
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.subscriber = 'SQL-05'
go
sp_droparticle
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.force_invalidate_snapshot = 1 (I HAVE TO DO THIS OR IT WON'T DROP THE ARTICLE & I Don't know why, it didn't used to be this way.....)
go
sp_refreshsubscriptions 'ReportsPUBL'
go
I made my change to the en_csrep_tbl_usr & did the following;
/* Add the Article back */
sp_addarticle
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.source_table = 'en_csrep_tbl_usr'
go
When I start the Snapshot agent it is doing a snapshot of everything & not just the one table!!!!
Anonymous Subscriptions are NOT allowed.
Can you tell me where to look or why it is making me do the @.force_invalidate_snapshot = 1 now?
thanx!
JUDE
|||It shouldn't matter, but I thought you were implying it did.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Jude" <judes@.email.uophx.edu> wrote in message news:OPbRK4M8GHA.3280@.TK2MSFTNGP02.phx.gbl...
No, should it? Should I change it to a PUSH & I won't have this issue any longer?
JUDE
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message news:u4Lb1ry7GHA.4552@.TK2MSFTNGP05.phx.gbl...
Does this difference explain the problem?
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Jude" <judes@.email.uophx.edu> wrote in message news:enUr06v7GHA.4708@.TK2MSFTNGP05.phx.gbl...
Actually the one difference is that the subscriber is doing a PULL now as opposed to the Publisher doing a PUSH as it was setup in the past.
JUDE
"Jude" <judes@.email.uophx.edu> wrote in message news:ec29Ryv7GHA.4288@.TK2MSFTNGP02.phx.gbl...
I am sorry to post about this again, but I can't put my finger on what is wrong.
When we upgraded our ERP to a new version, I am almost certain that I setup Transactional Replication the exact same way....
I did the following to drop an article from a publication:
sp_dropsubscription
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.subscriber = 'SQL-05'
go
sp_droparticle
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.force_invalidate_snapshot = 1 (I HAVE TO DO THIS OR IT WON'T DROP THE ARTICLE & I Don't know why, it didn't used to be this way.....)
go
sp_refreshsubscriptions 'ReportsPUBL'
go
I made my change to the en_csrep_tbl_usr & did the following;
/* Add the Article back */
sp_addarticle
@.publication = 'ReportsPUBL'
, @.article = 'en_csrep_tbl_usr'
, @.source_table = 'en_csrep_tbl_usr'
go
When I start the Snapshot agent it is doing a snapshot of everything & not just the one table!!!!
Anonymous Subscriptions are NOT allowed.
Can you tell me where to look or why it is making me do the @.force_invalidate_snapshot = 1 now?
thanx!
JUDE
Force invalidate snapshot - how?
Hi,
In SQL 2005 SP1 - In my merge replication RMO C# script, I am getting the error that the merge snapshot is obsolete:
Source: Merge Replication Provider
Number: -2147201021
Message: You must rerun snapshot because current snapshot files are obsolete.
I am new to SMO/RMO and C#. I presume that I need to set the force-invalidate flag somewhere before generating another snapshot. I'm guessing that I can "try/catch" the error and handle it then (am I correct?) My script is running each step synchronously including synchronizing the subscription synchronously - meaning: subscription.SynchronizationAgent.Synchronize();
I presume the error occurs when I synch the subscription and there is an existing, but obsolete, snapshot file.
I would really appreciate it if someone could show me how to set the snapshot force_invalidate flag in RMO (preferably in C#). A fallback might be to delete any existing merge snapshot files, but I presume that would take much more time than setting the switch and calling for another snapshot to be generated. I wish I had some code to look at to show me an example of handling this error. If you can point me to such an example or can help me get around this error, I thank you.
I do have the O'Reilly book - Programming Sql Server 2005, but am not aware of any code examples that pertain to this problem. Let me know if you know of one.
Thanks for any assistance you might be able to provide :-)
Paul
More -
I had assumed a snapshot had been generated and it hasn't. The question of a code example of how to force invalidate a snapshot is still of interest to me though.
|||I found it:
// If the pull subscription and the job exists, mark the subscription
// for reinitialization and start the agent job.
if (subscription.LoadProperties() && subscription.AgentJobId != null)
{
subscription.Reinitialize();
subscription.SynchronizeWithJob();
}
Force invalidate snapshot - how?
Hi,
In SQL 2005 SP1 - In my merge replication RMO C# script, I am getting the error that the merge snapshot is obsolete:
Source: Merge Replication Provider
Number: -2147201021
Message: You must rerun snapshot because current snapshot files are obsolete.
I am new to SMO/RMO and C#. I presume that I need to set the force-invalidate flag somewhere before generating another snapshot. I'm guessing that I can "try/catch" the error and handle it then (am I correct?) My script is running each step synchronously including synchronizing the subscription synchronously - meaning: subscription.SynchronizationAgent.Synchronize();
I presume the error occurs when I synch the subscription and there is an existing, but obsolete, snapshot file.
I would really appreciate it if someone could show me how to set the snapshot force_invalidate flag in RMO (preferably in C#). A fallback might be to delete any existing merge snapshot files, but I presume that would take much more time than setting the switch and calling for another snapshot to be generated. I wish I had some code to look at to show me an example of handling this error. If you can point me to such an example or can help me get around this error, I thank you.
I do have the O'Reilly book - Programming Sql Server 2005, but am not aware of any code examples that pertain to this problem. Let me know if you know of one.
Thanks for any assistance you might be able to provide :-)
Paul
More -
I had assumed a snapshot had been generated and it hasn't. The question of a code example of how to force invalidate a snapshot is still of interest to me though.
|||I found it:
// If the pull subscription and the job exists, mark the subscription
// for reinitialization and start the agent job.
if (subscription.LoadProperties() && subscription.AgentJobId != null)
{
subscription.Reinitialize();
subscription.SynchronizeWithJob();
}