Showing posts with label deleting. Show all posts
Showing posts with label deleting. Show all posts

Monday, March 26, 2012

Replication does not work after deleting the LDF file manually.

I have maually deleted the Database.LDF file by stopping the SQL Server. When i start the SQL Server, merge replication which was configured for the database does not work. How do i fix this problem.
Thanks in advance.
Regards,
Venu.Reinitialize the replication. It should pick up a new starting LSN. But why did you ever delete the LDF anyway?

Friday, March 23, 2012

replication conflict at deleting

Hello I have a question.
We have a merge replication between 4 servers and it's working fine but we
had a conflict while deleting a record in a master table wich has the
location and product as a key that says :
"The same row was updated at 'servername1.replication' and deleted at
'servername2.replication'. The resolver chose the update as the winner"
It looks like the same record was updated and deleted in a diferent site,
but first it's imposible because every site touches the products of their
own location, the programs that access the database only inserts, updates or
deletes the records of the location where the user logged belongs. Plus
everytime I delete or update or insert a record in this master table we
insert a transaction record for control.
We had the problem and I can see that the user never updated this master
file because I don't have a transaction for update and they deleted the
record but it never got deleted and the problem is that now I have my master
file with records that are not soppoused to be there anymore.
Is there any other reason why this error comes because as I said they never
updated the record and how can I set replication for the deleted as a winner
in every process.
Thanks in advance
Jennyfer
The conflict resolver will give you enough information to accurately identify
the record that is being updated/deleted.
Before you say it is impossible look at these details and compare them.
If the records match then you need to look at your log files and find out
who is deleting and then who is changing this record.
It sounds like replication has discovered an activity that you were not
aware of.
Jim.
"Jennyfer J Barco" wrote:

> Hello I have a question.
> We have a merge replication between 4 servers and it's working fine but we
> had a conflict while deleting a record in a master table wich has the
> location and product as a key that says :
> "The same row was updated at 'servername1.replication' and deleted at
> 'servername2.replication'. The resolver chose the update as the winner"
> It looks like the same record was updated and deleted in a diferent site,
> but first it's imposible because every site touches the products of their
> own location, the programs that access the database only inserts, updates or
> deletes the records of the location where the user logged belongs. Plus
> everytime I delete or update or insert a record in this master table we
> insert a transaction record for control.
> We had the problem and I can see that the user never updated this master
> file because I don't have a transaction for update and they deleted the
> record but it never got deleted and the problem is that now I have my master
> file with records that are not soppoused to be there anymore.
> Is there any other reason why this error comes because as I said they never
> updated the record and how can I set replication for the deleted as a winner
> in every process.
> Thanks in advance
> Jennyfer
>
>
|||Yes I indentify what is the record being deleted and "update" at the same
time and in my log files I have the transaction for delete but not for
update. But I know that replication discovered some how an activity for this
record.
"Jim Breffni" <JimBreffni@.discussions.microsoft.com> wrote in message
news:4C1F2708-5F98-402C-B4D5-2950FB356CF4@.microsoft.com...
> The conflict resolver will give you enough information to accurately
identify[vbcol=seagreen]
> the record that is being updated/deleted.
> Before you say it is impossible look at these details and compare them.
> If the records match then you need to look at your log files and find out
> who is deleting and then who is changing this record.
> It sounds like replication has discovered an activity that you were not
> aware of.
> Jim.
>
> "Jennyfer J Barco" wrote:
we[vbcol=seagreen]
site,[vbcol=seagreen]
their[vbcol=seagreen]
updates or[vbcol=seagreen]
master[vbcol=seagreen]
never[vbcol=seagreen]
winner[vbcol=seagreen]

Monday, March 12, 2012

Replication and Deleting Rows

Hello,
I have a large table with over 20 million rows.
It is replicated accross a 4 subscribers using Pull subscription. One of the
subscribers is also a Distributor.
We are running some processed to "clean up" the data in this table by
issuing a lot of DELETE commands (using Primary Key as the where clause)
against the large table. The DELETE commands are enclosed in BEGIN TRAN -
COMIT TRAN batches of 20 each.
The deletion works extremely fast on the Publisher.
However, it takes very very long time to apply the very same commands on all
of the subscribers. The subscribers also have the PRIMARY KEY index that is
on the Publisher.
We need to delete a few million rows from the large table using this
technique. However, it makes the Subscribers very slow and unresponsive.
Any suggestions?
Thanks,
ArsenConsider doing this in even smaller batches. If that is not possible, and
transactional consistency is not really of importance, then you could use a
parameter called MaxCmdsInTran for logreader (introduced in SQL Server 2000
SP1 I believe). This breaks huge transactions into smaller chunks of
specified size, while storing the commands in distribution database.
There is another approach, that I would recommend. Consider using 'stored
procedure execution' replication. With this method, you keep a copy of the
archiving stored procedure on all subscribers. When you run this procedure
on the publisher, the distribution agent will call this sp on all
subscribers, instead of sending millions of DELETEs over the network. See
SQL Server Books Online for more information on this.
--
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Arsen V." <arsen@.community.nospam> wrote in message
news:%23hpi4tKoEHA.2612@.TK2MSFTNGP15.phx.gbl...
> Hello,
> I have a large table with over 20 million rows.
> It is replicated accross a 4 subscribers using Pull subscription. One of
the
> subscribers is also a Distributor.
> We are running some processed to "clean up" the data in this table by
> issuing a lot of DELETE commands (using Primary Key as the where clause)
> against the large table. The DELETE commands are enclosed in BEGIN TRAN -
> COMIT TRAN batches of 20 each.
> The deletion works extremely fast on the Publisher.
> However, it takes very very long time to apply the very same commands on
all
> of the subscribers. The subscribers also have the PRIMARY KEY index that
is
> on the Publisher.
> We need to delete a few million rows from the large table using this
> technique. However, it makes the Subscribers very slow and unresponsive.
> Any suggestions?
> Thanks,
> Arsen
>

Replication and Deleting Rows

Hello,
I have a large table with over 20 million rows.
It is replicated accross a 4 subscribers using Pull subscription. One of the
subscribers is also a Distributor.
We are running some processed to "clean up" the data in this table by
issuing a lot of DELETE commands (using Primary Key as the where clause)
against the large table. The DELETE commands are enclosed in BEGIN TRAN -
COMIT TRAN batches of 20 each.
The deletion works extremely fast on the Publisher.
However, it takes very very long time to apply the very same commands on all
of the subscribers. The subscribers also have the PRIMARY KEY index that is
on the Publisher.
We need to delete a few million rows from the large table using this
technique. However, it makes the Subscribers very slow and unresponsive.
Any suggestions?
Thanks,
Arsen
Consider doing this in even smaller batches. If that is not possible, and
transactional consistency is not really of importance, then you could use a
parameter called MaxCmdsInTran for logreader (introduced in SQL Server 2000
SP1 I believe). This breaks huge transactions into smaller chunks of
specified size, while storing the commands in distribution database.
There is another approach, that I would recommend. Consider using 'stored
procedure execution' replication. With this method, you keep a copy of the
archiving stored procedure on all subscribers. When you run this procedure
on the publisher, the distribution agent will call this sp on all
subscribers, instead of sending millions of DELETEs over the network. See
SQL Server Books Online for more information on this.
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Arsen V." <arsen@.community.nospam> wrote in message
news:%23hpi4tKoEHA.2612@.TK2MSFTNGP15.phx.gbl...
> Hello,
> I have a large table with over 20 million rows.
> It is replicated accross a 4 subscribers using Pull subscription. One of
the
> subscribers is also a Distributor.
> We are running some processed to "clean up" the data in this table by
> issuing a lot of DELETE commands (using Primary Key as the where clause)
> against the large table. The DELETE commands are enclosed in BEGIN TRAN -
> COMIT TRAN batches of 20 each.
> The deletion works extremely fast on the Publisher.
> However, it takes very very long time to apply the very same commands on
all
> of the subscribers. The subscribers also have the PRIMARY KEY index that
is
> on the Publisher.
> We need to delete a few million rows from the large table using this
> technique. However, it makes the Subscribers very slow and unresponsive.
> Any suggestions?
> Thanks,
> Arsen
>