Showing posts with label transaction. Show all posts
Showing posts with label transaction. Show all posts

Monday, March 26, 2012

Replication down Log Shrinking

Hi,

Is there any relation between replication and the transaction log, we have set up transactional replication between our databases, and I had to clear the log as its size was huge, I also reduced the temp db size. After that, the replication is down, with an error, the subscriptions are invalid, reconfigure the Topology.

Is this related to the shrinking of the logs ?

These two things (shrinking the log, and the expiration of subscription) are not related.|||Ok Sounds logical, but when we have to reduce the size of tempdb, the way we do it is restart the sql server right ? In this case P2P configured has to go down. If yes, then what must be the ideal way of reducing the tempdb size on a system where P2P replication is configured ?|||

. Transaction log and Transactional replication very much related.

Transaction Log Space

For each database that will be published in transactional replication, ensure that the transaction log has enough space allocated. The transaction log of a published database may require more space than the log of an identical, unpublished database. This is because the log records may not be purged until they have been moved to the distribution database.

If the distribution database is unavailable, or if the Log Reader Agent is not running, the transaction log of a publication database continues to grow. The log cannot be truncated past the oldest published transaction that has not been passed into the distribution database (unless replication is turned off completely for that database). It is recommended that you set the transaction log file to autogrow so that the log can accommodate these circumstances.

Ref :

http://msdn2.microsoft.com/en-us/library/aa237475(SQL.80).aspx

http://msdn2.microsoft.com/en-us/library/aa179423(SQL.80).aspx

Madhu

|||

see the first thing i want to mention here is you should never ever trucate the TL of a replicated DB. Each subscription has a lif which is by default (336 hrs ) if i remember correctly, which can be changed in the property of of a publication. If you restart server the replication will not effect. it will re-start from where it left.

Madhu

|||

Why do you need to reduce the size of tempdb?

DO you have any free disk space issues?

I wouldn't suggest to shrink the TEMPDB and keep up the log size with regular transactionlog backups, as you have more information about Trans.log & Trans.replication relation.

Rick305652 wrote:

Ok Sounds logical, but when we have to reduce the size of tempdb, the way we do it is restart the sql server right ? In this case P2P configured has to go down. If yes, then what must be the ideal way of reducing the tempdb size on a system where P2P replication is configured ?

replication conflict when use BEGIN TRANSACTION COMMIT TRANSACTION

Ok let me explain my problem
I update table abc to SERVER A
SERVER A push a replication to SERVER B
and SERVER B push to SERVER A and SERVER C
SERVER A and C are configure to replicate to SERVER B and
SERVER B is configure to replicate to SERVER A and SERVER C
(same tables are replicate)
I have no problem while I not use BEGIN TRANSACTION UPDATE... COMMIT
TRANSACTION
When I use BEGIN TRANSACTION UPDATE... COMMIT TRANSACTION I got a conflict
error
supp info:
2 Queued update conflict. Subscriber wins. Updating Publisher ...
"rl" <rlavoie@.lgs.com> wrote in message
news:%23jnEqEGjFHA.1232@.TK2MSFTNGP15.phx.gbl...
> Ok let me explain my problem
> I update table abc to SERVER A
> SERVER A push a replication to SERVER B
> and SERVER B push to SERVER A and SERVER C
> SERVER A and C are configure to replicate to SERVER B and
> SERVER B is configure to replicate to SERVER A and SERVER C
> (same tables are replicate)
> I have no problem while I not use BEGIN TRANSACTION UPDATE... COMMIT
> TRANSACTION
> When I use BEGIN TRANSACTION UPDATE... COMMIT TRANSACTION I got a conflict
> error
>

Tuesday, March 20, 2012

replication and log shrinking

Since I created a replication (snapshot basic - push) when I'm running the backup log ... with truncate_ only....the size of the transaction log don't lessens. why? (sql2005 without sp)I set to simple the recovery mode and back to full....nothing
the usedPages value is very large...estimatedpages is very slow....
but not shrinking....|||

check of any open transaction . DBCC Opentran

Madhu

|||thnx
I run and and this is the result:

Replicated Transaction Information:
Oldest distributed LSN : (0:0:0)
Oldest non-distributed LSN : (4990:4944:1)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

What can i do with this?|||

From BOL

If neither database_name nor database_id is specified, the default is the current database.

Use DBCC OPENTRAN to determine whether an open transaction exists within the log. When using the BACKUP LOG statement, only the inactive portion of the log can be truncated; an open transaction can cause the log to not truncate completely. In earlier versions of Microsoft? SQL Server?, either all users had to log off or the server had to be shut down and restarted to clear uncommitted transactions from the log. With DBCC OPENTRAN, an open transaction can be identified (by obtaining the system process ID from the sp_who output) and terminated, if necessary.

you need to termintate this open transaction

http://msdn2.microsoft.com/en-us/library/ms182792.aspx

http://www.sql-server-performance.com/dbcc_commands.asp

google it you will fine many

Madhu

|||I stopped the replication (snapshot) and after I could shrink the log....
So this is a bug? ( the db running without any sp)

I tried....I re-set the replication and the symptom is occurred again....
so when I set a replication on this db, I can't shrink the transaction log anymore...

Replication and large transactions

Hello,
Is it true that merge agent is not replicating at all when a transaction is
going on?
In my system I use merge replication and I have set the merge agents on
continuous replication to make sure that all changes are replicated to all
databases as soon as possible. Now I notice that when a large transaction is
going on (about 10 minutes) the merge agent is not replicating at all. So if
concurrently a small transaction took place and was committed, these changes
are replicated after the large transaction was finished.
I guess this behaviour is caused by the merge agent that waits for the large
transaction to finish before it has access to the
msmerge_contents/msmerge_tombstone tables.
Is there any way to prevent this blocking?
Can I set the Isolation Level of the transaction of the merge agent?
thanks in advance,
Marco Broenink
Yes, the way it works is that triggers fire on the tables which are
published to and subscriber to for merge replication.
If you have a large transaction which commits at the end of the transaction,
the triggers will not fire until the commit happens.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Marco Broenink" <MarcoBroenink@.discussions.microsoft.com> wrote in message
news:D0D14388-1660-49DC-9555-DAFD9B8E0C66@.microsoft.com...
> Hello,
> Is it true that merge agent is not replicating at all when a transaction
is
> going on?
> In my system I use merge replication and I have set the merge agents on
> continuous replication to make sure that all changes are replicated to all
> databases as soon as possible. Now I notice that when a large transaction
is
> going on (about 10 minutes) the merge agent is not replicating at all. So
if
> concurrently a small transaction took place and was committed, these
changes
> are replicated after the large transaction was finished.
> I guess this behaviour is caused by the merge agent that waits for the
large
> transaction to finish before it has access to the
> msmerge_contents/msmerge_tombstone tables.
> Is there any way to prevent this blocking?
> Can I set the Isolation Level of the transaction of the merge agent?
> thanks in advance,
> Marco Broenink

Friday, March 9, 2012

Replication -- subscriber job history does not appear on SQL server 2005 Subscriber from S

Hi Everyone,
I have a small issue in looking at the the subscription's job history
(transaction history) on SQL Server 2005 subscriber subscribed to a
SQL Server 2000 publication.
We have the following environments set up and running and all the
Windows and SQL servers service packed to the latest. We are using
transactional replication with all pull subscriptions.
-----
Replication Publisher: SQL server 2000 Standard Edition(on Windows
2003 Server)
both publisher and distributor run on the same machine.
-----
Replication Subscriber: SQL server 2000 Standard Edition(on Windows
2000 Server)
both publisher and distributor run on the same machine.
-----
When I look on the subscriber SQL server 2000, in the subscription's
job history, a message (row) for each transaction (or one row for upto
a group of 100 transactions) is written along with start-up messages
for the job and any error messages.
But when we set up the subscriptions on SQL server 2005 from same
publication, as below
-----
Subscriber: SQL server 2005 Standard Edition(on Windows 2003 Server)
both publisher and distributor run on the same machine.
-----
the replication works fine but the job history is not consistent
between 2000 and 2005 subscribers. When I look on SQL server 2005
subscription's job history, no rows are written for the transactions,
but only messages are logged for job start-ups and any error messages.
Did anyone notice this behaviour?
Is there any way we can configure so all the transaction messages
appear in subscription's job history in SQL Server 2005.
Regards
Raj Chidipudi
On 6 Aug, 14:03, Raj Chidipudi <chidip...@.gmail.com> wrote:
> Hi Everyone,
> I have a small issue in looking at the the subscription's job history
> (transaction history) on SQL Server 2005 subscriber subscribed to a
> SQL Server 2000 publication.
> We have the following environments set up and running and all the
> Windows and SQL servers service packed to the latest. We are using
> transactional replication with all pull subscriptions.
> ----X--
> Replication Publisher: SQL server 2000 Standard Edition(on Windows
> 2003 Server)
> both publisher and distributor run on the same machine.
> ----X--
> Replication Subscriber: SQL server 2000 Standard Edition(on Windows
> 2000 Server)
> both publisher and distributor run on the same machine.
> ----X--
> When I look on the subscriber SQL server 2000, in the subscription's
> job history, a message (row) for each transaction (or one row for upto
> a group of 100 transactions) is written along with start-up messages
> for the job and any error messages.
> But when we set up the subscriptions on SQL server 2005 from same
> publication, as below
> ----X--
> Subscriber: SQL server 2005 Standard Edition(on Windows 2003 Server)
> both publisher and distributor run on the same machine.
> ----X--
> the replication works fine but the job history is not consistent
> between 2000 and 2005 subscribers. When I look on SQL server 2005
> subscription's job history, no rows are written for the transactions,
> but only messages are logged for job start-ups and any error messages.
> Did anyone notice this behaviour?
> Is there any way we can configure so all the transaction messages
> appear in subscription's job history in SQL Server 2005.
> Regards
> Raj Chidipudi
Resolved the issue by editing job used to run the subscription on the
subscriber.
Just suffixed this "-HistoryVerboseLevel [3] -OutputVerboseLevel [2]"
at the end of the command in the only job step.
But i must admit it needed a bit of digging-in few things.
Raj Chidipudi

Wednesday, March 7, 2012

replication - duplicate key.

Hi,

How transaction replication handles this : subscriber side updatable

if there is already a row with same primary key value on
subsciber, will replication give error of duplicate key /
key already exist while inserting at subscriber or what
will happen?

eg.
publisher server S1
database D1
table order
primary key order_no
data:
order_no customer_no item_no...
1 1 1
2 ...
3
4
subscriber server S2
database D2
table order
primary key order_no
data
order_no customer_no item_no...
1 1 1
2 ...
3
4
5

what if someone insert order_no 5 on subscriber and then
same order no came to publisher and replication tried to
replicate order no 5 to subscriber what will happen?

Please reply.
Ram.Primary key constraints error will be displayed if trying to insert duplicate values.|||Originally posted by Satya
Primary key constraints error will be displayed if trying to insert duplicate values.

Satya,

I checked . Replication just ignore the action of insertion if primary key exist on the subscriber. no error!

Ram.

Replication

Hi
I have setup transaction replication, I defined publisher. Now I have new
server
Where I run create script for database and table from publisher server.
First time on my subscriber server's table has rows, I can’t restore from
backup because of time (it took about 8 hrs. to restore).
After setting up replication, my new subscriber got no rows, how tried
tranactional,snapshot replication data is populated on subscriber.
Advice me how to proceed with restoring db on my subscriber m/c.
Thanks
Kalyan
Advice me how to proceed without restoring db on my subscriber m/c.
"Kalyan" wrote:

> Hi
> I have setup transaction replication, I defined publisher. Now I have new
> server
> Where I run create script for database and table from publisher server.
> First time on my subscriber server's table has rows, I can’t restore from
> backup because of time (it took about 8 hrs. to restore).
> After setting up replication, my new subscriber got no rows, how tried
> tranactional,snapshot replication data is populated on subscriber.
>
> Advice me how to proceed with restoring db on my subscriber m/c.
> Thanks
> Kalyan
>

Replication

i know that it's natural that one publication could update three
subscripers the transaction replication do that but i need the inverse
case of that. i have three subscripers and i need any update in each of
them appear in the original database.
can i have a help? thanks for any one helps me.
Hammad,
please take a look at this article:
http://www.replicationanswers.com/Ce...berArticle.asp
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)