Solved

stop sql replication

Posted on 2006-06-16
11
763 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
0
Comment
Question by:dano992
  • 5
  • 3
  • 3
11 Comments
 
LVL 28

Expert Comment

by:imran_fast
ID: 16926222
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
 
LVL 7

Expert Comment

by:TRACEYMARY
ID: 16926824
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
 

Author Comment

by:dano992
ID: 16927345
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
 
LVL 7

Expert Comment

by:TRACEYMARY
ID: 16928033
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
 
LVL 28

Expert Comment

by:imran_fast
ID: 16928651
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 7

Expert Comment

by:TRACEYMARY
ID: 16929437
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
 

Author Comment

by:dano992
ID: 16934409
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
 
LVL 7

Expert Comment

by:TRACEYMARY
ID: 16934524
http://www.ureader.com/message/2762551.aspx

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


0
 

Author Comment

by:dano992
ID: 16934685
by the way this happens on all my tables not just prod_candidate
0
 
LVL 7

Accepted Solution

by:
TRACEYMARY earned 500 total points
ID: 16934916
Hmm......thats strange ha.......
then i stop everything and do the entire snapshot again and get the sch files re snapped.
0
 
LVL 28

Expert Comment

by:imran_fast
ID: 16940033
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SLQ View not updating 10 47
c# code 19 59
sql query Help 12 29
Count duplicate cells in a coulmn only once sql statement 3 6
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now