Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Wait for Mirror treshold

By Wilfred van Dijk,

This procedure is very handy if you want to control the load on a mirrored database. For example rebuilding indexes on the principal database generates a lot of load on the mirrored database (especially with a snapshot).

In order to control the load on a mirrored server, create this procedure (on the principal) and insert a call to this procedure between each "heavy" (statement on the principal).

For example, I rebuild my indexes by a cursor loop and just before I fetch the next index, I call this procedure. This procedure takes the mirror tresholds from SQL. NOTE: By using this procedure, you still might get messages in your errorlog about mirror tresholds. This procedure only slows down your statements (in order to give the mirrored database more breath).

In order to prevent an infinite execution of this statement, @MaxWaitSeconds determines the number of seconds before this procedure aborts (a returncode is set).
@Checkdelay is the delaytime before the tresholds are checked again.

Total article views: 448 | Views in the last 30 days: 1
 
Related Articles
FORUM

Database Mirroring

Database Mirroring - Index on Principal

FORUM

Mirrored Database

Mirrored Database

FORUM

database mirroring

database mirroring

FORUM

Database Mirroring

Database Mirroring

FORUM

Database mirroring

Database mirroring

Tags
administration    
database mirroring    
t-sql    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones