We help IT Professionals succeed at work.

stop sql replication

dano992
dano992 asked
on
818 Views
Last Modified: 2008-01-09
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
Comment
Watch Question

Top Expert 2006

Commented:
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.
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 ...

Author

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?
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.
Top Expert 2006

Commented:
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.
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 ...

Author

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
http://www.ureader.com/message/2762551.aspx

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


Author

Commented:
by the way this happens on all my tables not just prod_candidate
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Top Expert 2006

Commented:
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'

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.