• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 782
  • Last Modified:

stop sql replication

hou do i stop transactional replication after the publisher crashed  and no longer availabe
i need to be able to write to the subscriber
but it seems that i cannot because of replication
there has to be a way  help
0
dano992
Asked:
dano992
  • 5
  • 3
  • 3
1 Solution
 
imran_fastCommented:
Write to subscirber ?

don't know what you mean  when the publisher is crashed no longer replication is available. but is the publisher and the distributor the same. In that case start working on subscriber no need to worry about.

In case you are unable to make any schema changes at subscriber  (case for two way transactional replication) go to sysobjects table and make replinfo column for that table to be 0.

Note you cannot make any changes to system tables like that you have to make allow update option to be 1 for more details look for sp_configure.
0
 
TRACEYMARYCommented:
Had the same problem......go to the replication, publisher
...and right click on properties you should see a page come up with subscriptions, articles etc ..go to the subscriptions...make a note of where your subscribing to which database and server...and delete them.
then go to the log reader and stop that, and stop all the agents.........think these are in the replication monitor......

If your doing snapshot..................then go to replication publisher again and readd the subscriptions there is a screen one of the options is yes to recreate the schemas something like that and just say yes and it will redo your snapshot again.....

Re start the log reader, restart the agents ...
0
 
dano992Author Commented:
yes the publisher and the distributer are the same server and thats the server that crashed and no longer available
the subscription is a different server and thats the one i need to be able to write to
when i try to open a table and do a return all rous and try to modify a record
it wont let me do it receive some error about the replication column on the table
so im assuming that the database is in a read only state or am i mistaken?
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
TRACEYMARYCommented:
yes do all that i said.....we have same set up sql1 and sql2.
so just go to the replication and delete the subscriptions stop everythng reader, and the distribution....if can't find in sql em go to the dts jobs and stop them all.....

then go back to sql replication right click on publisher....it brings up the screen with lots of tabs click on subscription delete it...then ....read add and start the snapshot you will know its working cause it will whizz through the tables.........whilst it running you can start the log reader and the subscriptions....its ok it will not start replicaiton until snapshot has run........................also the snapshot locks all tables so make sure no one on it.

just read read .......your thread...how many servers you got.......1 or 2..........if 1 is that up...and you get the errors ..........just stop everything...(all agents and all log reader, snapshots.....
the onlyway i found out to get it working was to delete the subscirptions...

you will know it has stopped go to sp_who2 your not see a thread in there......

i not got the server at home so im trying to rememeber the right buttons for you to click.
0
 
imran_fastCommented:
hi TRACEYMARY,
The author said "the Publisher server that crashed and no longer available"

Hi dano992 ,
No it cannot be read Only i think the error what you are getting is related to rowguid column in the replicated table so at the subscriber go to the table you are trying to modify and see if rowguid column exists there if it exists drop it

Alter Table TableName drop column rowguid
go

if this dosen't solve your problem then please post the exact error message what you are getting.
0
 
TRACEYMARYCommented:
that true if only one column then you can alter table if dropping table all together your have to delete the subscriptions....and re do snapshot ...
0
 
dano992Author Commented:
HEERE IS THE ERROR IM RECEIVING
cannot insert the value NULL into column msrepl_tran_version
table prod_candidate column does not allow nulls
insert fails
 from what i can gather there is a replication column in everry table
and when i try to insert a row or something on the table it fails because
the data in replication row flows down from the publisher
0
 
TRACEYMARYCommented:
http://www.ureader.com/message/2762551.aspx

does the prod_candidate have a unique key........add ROWID make it indentity yes.


0
 
dano992Author Commented:
by the way this happens on all my tables not just prod_candidate
0
 
TRACEYMARYCommented:
Hmm......thats strange ha.......
then i stop everything and do the entire snapshot again and get the sch files re snapped.
0
 
imran_fastCommented:
Hi Dano992,
You configured Merge replication.

Thats why in all of your tables you are having this column. Note if you are using replication for failover then you should configrue transactional replication.

Simple solution is to drop this column from all your tables, if not assign default value newid() to all this columns


and this is how you can get rid of the column

/*
Press control + <T>
Run the below script
Take thhe result and run it again on the subscirber database
*/
set nocount on
select 'alter table '+table_name + ' drop column msrepl_tran_version' + char(13) +'go' from information_schema.columns where column_name ='msrepl_tran_version'
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now