Sie sind auf Seite 1von 94

Step-by-Step Guide to Log Shipping for SAP Customers

using Microsoft SQL Server 2000


By Ramesh Meyyappan
Microsoft Corporation
Published: February 2002
Abstract
This guide !"#s you through the Log Shipping $i%!rd& hich en!b"es setting up ! st!ndby d!t!b!se on
second!ry server' (t is intended for )!t!b!se Administr!tors& SAP *!sis Consu"t!nts'

This is a preliminary document and may be changed substantially
prior to final commercial release of the software described herein
The information contained in this document represents the current
!iew of Microsoft Corporation on the issues discussed as of the date
of publication Because Microsoft must respond to changing mar"et
conditions# it should not be interpreted to be a commitment on the
part of Microsoft# and Microsoft cannot guarantee the accuracy of
any information presented after the date of publication
This white paper is for informational purposes only M$CR%&%FT
M'()& *% +'RR'*T$)&# ),PR)&& %R $MP-$).# $* T/$&
.%C0M)*T
Complying with all applicable copyright laws is the responsibility of
the user +ithout limiting the rights under copyright# no part of this
document may be reproduced# stored in or introduced into a
retrie!al system# or transmitted in any form or by any means
1electronic# mechanical# photocopying# recording# or otherwise2# or
for any purpose# without the e3press written permission of Microsoft
Corporation
Microsoft may ha!e patents# patent applications# trademar"s#
copyrights# or other intellectual property rights co!ering sub4ect
matter in this document )3cept as e3pressly pro!ided in any written
license agreement from Microsoft# the furnishing of this document
does not gi!e you any license to these patents# trademar"s#
copyrights# or other intellectual property
5 2006 Microsoft Corporation 'll rights reser!ed Microsoft#
%utloo"# PowerPoint# +indows# and +indows *T are either
registered trademar"s or trademar"s of Microsoft Corporation in the
0nited &tates and7or other countries
%ther product and company names mentioned herein may be the
trademar"s of their respecti!e owners
M8icrosoft Corporation 9 %ne Microsoft +ay 9 Redmond# +'
:;0<2=>?:: 9 0&'
Contents
Contents........................................................................................................................................ 3
Introduction................................................................................................................................... 5
Log Shipping Architecture........................................................................................................... 6
Prim!ry server''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''+
Second!ry server'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''+
Monitoring server'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''+
Log Shipping ith SAP'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''',
Centr!" (nst!nce !nd )!t!b!se is running on different servers''''''''''''''''''''''''''''''''''''''''''''''''''''''''''',
Centr!" (nst!nce !nd )!t!b!se is running on the s!me server''''''''''''''''''''''''''''''''''''''''''''''''''''''''''',
Requirements................................................................................................................................ 8
Gener!" re-uirement'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''.
Centr!" (nst!nce !nd )!t!b!se is running on different servers'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''.
Centr!" (nst!nce !nd )!t!b!se is running on the s!me server'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''/
Preparation for setting up Log Shipping..................................................................................!
Configuring service !ccounts for SQL Server'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''00
)irectory for storing tr!ns!ction "og fi"es in Prim!ry Server''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''02
1etor# Sh!re for the !bove directory in Prim!ry Server''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''02
)irectory for storing tr!ns!ction "og fi"es in Second!ry Server'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''02
1etor# Sh!re for the !bove directory in Second!ry Server'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''02
3egister the Prim!ry& Second!ry !nd Monitor Server in 4nterprise M!n!ger'''''''''''''''''''''''''''''''''''05
Chec# for SQL Server 4nterprise 4dition'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0,
*!c#up the production d!t!b!se'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0/
3estore the production d!t!b!se on the second!ry st!ndby d!t!b!se server''''''''''''''''''''''''''''''''''20
Setting up Log Shipping............................................................................................................. "#
St!rt )!t!b!se M!inten!nce P"!n on prim!ry production d!t!b!se server'''''''''''''''''''''''''''''''''''''''25
Se"ect )!t!b!ses''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''26
7pd!te )!t! 8ptimi%!tion (nform!tion''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''2+
)!t!b!se (ntegrity Chec#''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''2,
Specify the d!t!b!se *!c#up P"!n'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''2.
Specify Tr!ns!ction Log *!c#up )is# )irectory'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''2/
Specify the Tr!ns!ction Log Sh!re'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''20
Specify the Log Shipping )estin!tion'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''20
Log Shipping Schedu"e'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''22
Log Shipping Thresho"ds'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''2+
Log Shipping Monitor server'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''2,
3eports !nd history'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''2.
S!ving the m!inten!nce p"!n''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''50
$nderstanding the Log Shipping process................................................................................ #
SQL Server Agent 9obs cre!ted by Log Shipping $i%!rd''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''50
3e!d-8n"y second!ry st!ndby d!t!b!se''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''52
%onitoring the Log Shipping Processes..................................................................................#3
Log Shipping Monitor''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''52
:i"es th!t !re b!c#ed up !nd copied'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''55
%odif&ing the Log Shipping P'an.............................................................................................. #6
8n the prim!ry production d!t!b!se server''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''5+
8n the second!ry st!ndby d!t!b!se server'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''66
Modify the Log Shipping tr!ns!ction "og b!c#up schedu"e'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''6.
P'anned promotion of secondar& to primar&............................................................................6!
Adding bac( the o'd primar& production database ser)er after maintenance......................*#
$np'anned promotion of secondar& to primar&.......................................................................88
Adding an operator for notification........................................................................................... 8+
Re'ated Lin(s............................................................................................................................... +#
Introduction
Log Shipping is designed as an inexpensive high-availability solution that can be used to
protect a database against the failure of the primary production database server. You can
also use Log Shipping in addition to failover clustering to protect against site-level
disasters as well as local server failure. Log Shipping enables you to maintain a copy of
the production database on one or more secondary servers and to easily promote one of
the secondary standby database servers to become the new primary production database
server.
Log Shipping uses SQL Server backup and restore capabilities to provide database
redundancy between the production database on a primary server and a standby database
on one or more secondary servers. Log Shipping requires an administrator to detect a
failure and initiate a role change. role change promotes a secondary standby database
server to a primary production database server by recovering the production database on
the secondary standby database server. !he role change process is not automatic and
takes at least several minutes to complete. "t can take significantly longer with large
databases. fter a role change# S$ $rofile parameters should be modified on the %entral
"nstance and pplication Servers so they can connect to the standby database. &nlike
with failover clustering# virtual server names and "$ addresses are not incorporated into
Log Shipping.
'ardware upgrades can be performed with minimal downtime without loss of data by
promoting the secondary standby database server to primary production database server
during the hardware upgrade
(n disaster scenario# where the primary production database server fails. !here is a
possibility of data loss# this depends how often the transaction logs are backed up and
copied to the secondary standby database server# more often means less data loss.
Log Shipping is a less expensive high availability solution compared to )ailover
%lustering# but unlike failover clustering# Log Shipping requires manual process to
promote a secondary standby database server to primary production database server. *ith
Log Shipping# proximity is not a limitation+ you can place a secondary standby database
server in a geographically remote location to protect against a catastrophic disaster.
Secondary standby database servers do not need to be identical to the primary production
database server# although differences in the amount of memory# the number and speed of
the processors# and the robustness of the storage system can affect SQL Server
performance after a role change.
Log Shipping Architecture
SQL Server ,--- .nterprise .dition has built-in support for Log Shipping+ the
architecture consists of a primary server# one or more secondary servers# and a
monitoring server. !hese servers perform the following roles/
Primary server
!he primary server is a server running SQL Server ,--- and containing the production
database. You create and use a full database backup of this database to initiali0e a
standby database on each secondary server. SQL Server gent 1obs make periodic
transaction log backups of the production database to capture changes made to the
production database.
Secondary server
Secondary servers are servers running SQL Server ,--- and containing an unrecovered
copy of the production database from the primary server. SQL Server gent 1obs
periodically copy transaction log backups from the primary production database server
and restore these transaction log backups# without recovery# on each of the secondary
servers. !he restoration process updates the standby database on each secondary server
with new transactions from the primary production database server. standby database
can be recovered# and the secondary server can replace the primary production database
server if the primary production database server fails or must be taken offline for planned
maintenance.
2ore than one secondary server is useful to hold the production database at various
point-in-times on these standby databases. )or example secondary server
3S.45.46789 can be configured to have a load delay of -min. while secondary server
3S.45.467,9 can be configured to have a load delay of :hrs. "n the above scenario#
when a table is deleted in primary server# the secondary server 3S.45.467,9 will still
hold the table until :hrs past table deletion
!here can also be a secondary server 1ust for the purpose of data protection+ all secondary
standby database servers need not be configured to take over primary role on a primary
server failure.
Monitoring server
monitoring server is a server running SQL Server ,--- that monitors the status of the
Log Shipping 1obs on the primary production database server and on each secondary
standby database server. !o enable you to detect a failure to the primary server or to any
secondary servers# use a server other than the primary server or a secondary server as the
monitoring server.
"n case a third server is not available for setting up monitoring server# it is recommended
to use secondary server as the monitoring server
Log Shipping with SAP
Log Shipping built-in support is only available with SQL Server ,--- .nterprise .dition.
Since S$ %ustomers are usually using SQL Server ,--- .nterprise .dition in the S$
System Landscape this is not an issue. *hen a S$ customer chooses a secondary server
which is not part of the S$ System Landscape# then they have to acquire an additional
SQL Server ,--- .nterprise .dition for this purpose.
.xample/
8. %ustomer uses the development database server as the secondary server for
the production database+ in this case there is no need to acquire a SQL Server
,--- .nterprise .dition.
,. %ustomer uses the database server not part of S$ System Landscape as the
secondary server for the production database+ in this case there is a need to
acquire a SQL Server ,--- .nterprise .dition.
Centra' Instance and ,atabase is running on different ser)ers
"n this case# when the primary server or the production database fails# the standby
database is promoted as production database. "t is necessary to update the S$ $rofile to
ad1ust the database server parameter to point to the new primary production database
server. !his will not require a new License 7ey as the %entral "nstance server has not
moved.
Centra' Instance and ,atabase is running on the same ser)er
"n this case# when the server fails# the standby database is promoted as production
database. !he %entral "nstance can be installed on the same server or on a different
server# the S$ $rofile parameter need to be ad1usted to point to the new primary
production database server. !his will require a new License 7ey as the %entral "nstance
server has moved to a different server.
*hen only the production database fails but the %entral "nstance is still available# the
standby database is promoted as production database. "t is necessary to update the S$
$rofile to ad1ust the database server parameter to point to the new primary production
database server. !his will not require a new License 7ey as the %entral "nstance server
has not moved.
Requirements
-enera' requirement
!he secondary server hosting the standby database should have SQL Server ,---
.nterprise .dition installed.
Scheduled transaction log backup should be stopped irrespective whether it is scheduled
from SQL Server .nterprise 2anager or ;68: or from other :
rd
party backup tools. (nce
the Log Shipping is set up# SQL Server will create a new 1ob and perform transaction log
backup. "t is recommended to perform file level backup of the transaction log backup
files using *indows 6ackup or :
rd
party backup tools.
!here is no need to alter full database backup or differential backup schedules# but it is
recommended to schedule Log Shipping transaction log backup to avoid the overlap with
full database backup or differential backup schedules.
.nough disk space on the secondary server to hold the standby database. !he standby
database will be identical in si0e to the production database# including the number of
files. 6ut the disk structure need not be the same as primary server# but should be able to
hold all the files.
$rocessor capacity on the secondary server should be able to keep with the transaction
log application without lag. "n primary production database server# the processor is
utili0ed for Selects and "nserts<&pdate<;eletes. "n secondary server only
"nserts<&pdate<;eletes are performed# so the processor requirement is not that high# but
in case this standby database is promoted as production database# then it should have
enough resources to handle the load.
.xtra disk space on the primary server is needed to keep the transaction log backup on
disk. "t is recommended to keep this transaction log until they are archived into tapes#
usually 8 week to = weeks of transaction logs.
.xtra disk space on the secondary server is needed to keep the transaction log copied
from the primary server on disk. "t is recommended to keep this transaction log until they
are applied to the standby database# usually 8-, days of transaction logs.
pply latest SQL Server Service $acks on the primary production database server and the
secondary standby database servers.
Centra' Instance and ,atabase is running on different ser)ers
!he secondary server hosting the standby database should have identical SQL Server
setting like the primary production database server. !o achieve this# we recommend a
;atabase "nstance only installation of S$ on this secondary server with the same S"; as
the production S";. !hen delete the newly created database on this secondary standby
database server before starting the Log Shipping setup.
"t is also possible to manually prepare the secondary standby database server without
performing a database only installation of S$+ in this case you have to configure the
secondary standby database server to have same settings like the primary production
database server. Like using SQL Server installing setting of binary sort order with >?-
code page# setting tempdb si0e# changing SQL Server configuration parameter# mapping
domain accounts sidadm and S$ServiceS"; in SQL Server etc. ;omain accounts
sidadm and S$ServiceS"; should have administrative privilege in this secondary
standby database server.
"n case you choose an already existing database server in the S$ System Landscape as a
secondary server for hosting the standby database# like development server# there is little
preparation needed. !here is no need to perform a dummy ;atabase "nstance only
installation of S$# instead make sure the domain accounts sidadm and S$ServiceS";
have administrative privilege in this secondary standby database server# map domain
accounts sidadm and S$ServiceS"; in SQL Server# expand tempdb to accommodate
primary production database server tempdb requirement.
"f you are using a separate instance other than an existing SQL Server "nstance# you have
to prepare the SQL Server "nstance either manually or by performing a ;atabase "nstance
only installation of S$.
Centra' Instance and ,atabase is running on the same ser)er
!he secondary server hosting the standby database should have identical SQL Server
setting like the primary production database server. !o achieve this# we recommend a
%entral and ;atabase "nstance installation of S$ on this secondary server with the same
S"; as the production S";. !hen delete the newly created database on this secondary
standby database server before starting the Log Shipping setup.
lthough using an already existing database server in the S$ System Landscape is
possible# we recommend using another server for your %entral "nstance. "n case you want
to do this# test and document the procedure clearly as you need different S$ System
@umber.

Preparation for setting up Log Shipping
!his session walks you through the steps required to setup Log Shipping. !he screenshots
are taken from a S$ system with the following settings
$rimary Server name/ S$SQL
Secondary Server name/ S$SQL6
S$S";/ 4.;
*indows ;omain/ S$SQL4.;
Configuring ser)ice accounts for S.L Ser)er
Arant Local dministrative privilege for the production S"; accounts#
;(2"@BS$S"; and ;(2"@BS$ServiceS";# in the secondary servers and monitor
server.
%onfigure 2icrosoft SQL Server and SQL Server gent to use ;(2"@BS$S"; user
account. !his should be performed both on the primary production database server and
secondary standby database server.
"n case your secondary standby database server is same as development database server#
use ;(2"@BS$S"; for the ;evelopment S"; to start 2icrosoft SQL Server and SQL
Server gent service.
"n case there is a separate monitor server# also configure 2icrosoft SQL Server and SQL
Server gent service to use the ;(2"@BS$S"; and ;(2"@BS$ServiceS";
accounts.
%onfigure the 2icrosoft SQL Server and SQL Server gent service to start
automatically. !herefore open the service properties dialog box and change the service
user account in the Log on tab. !he next pictures show examples for changing the service
user accounts of C2SSQLS.45.4D and CSQLS.45.4A.@!D service to the user
account CS$SQL4.;BredadmD.
,irector& for storing transaction 'og fi'es in Primar& Ser)er
%reate a directory in the primary production database server to store the transaction log
files. "t is recommended to create this directory on a separate drive that is independent of
pagefile# tempdb# data and transaction log file location. )ree space available in this drive
should be able to accommodate few weeks of transaction log depending on the tape
archive settings. @ame the directory as $rimary!Logs.
/et0or( Share for the abo)e director& in Primar& Ser)er
%reate a @etwork share for the above directory on the primary production database
server. !his is the @etwork share where the secondary standby database server will copy
the transaction log backup files periodically.
,irector& for storing transaction 'og fi'es in Secondar& Ser)er
%reate a directory in the secondary standby database server to store the transaction log
files. )ree space available in this drive should be able to accommodate few days of
transaction log backup files. @ame the directory as Secondary!Logs.
/et0or( Share for the abo)e director& in Secondar& Ser)er
%reate a @etwork share for the above directory on the secondary standby database server.
!his is the @etwork share where the other secondary servers will copy the transaction
logs once this secondary standby database is promoted as primary production database.
Register the Primar&1 Secondar& and %onitor Ser)er in 2nterprise %anager
Start SQL Server .nterprise 2anager and register $rimary# Secondary and 2onitor
Server.
"f there is a ElocalF server registered# delete the registration by right clicking on the ElocalF
and choosing 3;elete SQL Server 4egistration9
4ight click on the 3SQL Server Aroup9 and choose 3@ew SQL Server 4egistration9.
)ollow the wi0ard# choose the $rimary# Secondary and 2onitor Server and accept all
defaults. ;o not choose ElocalF# choose the local server by name.
Chec( for S.L Ser)er 2nterprise 2dition
4ight click on each server in the SQL Server .nterprise 2anager and choose $roperties#
look in Aeneral tab under $roduct if it is SQL Server .nterprise .dition.
3ac(up the production database
2ake sure the transaction log backup is not scheduled from SQL Server .nterprise
2anager or ;68: or :
rd
party backup tools.
6ackup the production database on a tape or disk.
Restore the production database on the secondar& standb& database ser)er
2ake sure the SQL Server and database settings are correct as discussed in the
4equirement section.
%reate necessary directories in the secondary standby database server# it is recommended
to name these directories as standby so it is easy to administer.
2ake sure to choose 3Leave database nonoperational but able to restore additional
transaction logs9 option.
(nce the restore is complete# the database will show EloadingF as status.
Setting up Log Shipping
Start ,atabase %aintenance P'an on primar& production database ser)er
4ight click @ew 2aintenance $lan from ;atabase 2aintenance $lan under 2anagement
on the primary production database server.
Se'ect ,atabases
%heck 3Ship the transaction logs to other SQL Servers Elog shippingF box and also check
the S"; database in the C!hese databasesG database grid.
$pdate ,ata 4ptimi5ation Information
;o not choose any check boxes in the 3&pdate ;ata (ptimi0ation "nformation9 screen.
,atabase Integrit& Chec(
;o not choose any check boxes in the 3;atabase "ntegrity %heck9 screen.

Specif& the database 3ac(up P'an
&ncheck all the checkbox in the 3Specify the database 6ackup $lan9 screen. "f you need a
backup schedule for full database backup# define a different maintenance plan and don9t
use this.
Specif& 6ransaction Log 3ac(up ,is( ,irector&
%hoose 3&se this directory9 and select the $rimary!Logs directory. lso check 34emove
files older than9 box and mention the period after which SQL Server can delete the old
transaction log files. 2ake sure you archive these transaction log backup files to tape
before they are deleted.
Specif& the 6ransaction Log Share
%hoose the network share for the $rimary!Logs directory.
Specif& the Log Shipping ,estination
%hoose add and define the secondary standby database server details.
%hoose the secondary standby database server name in the 3Server @ame9. "f the
secondary server does not appear# it means it is not registered in the SQL Server
.nterprise 2anager.
!hen choose the Secondary!Logs directory located in the secondary standby database
server as the 3!ransaction Log ;estination ;irectory9.
"n the 3destination ;atabase9 choose 3&se existing database E@o initiali0ationF9 and
choose the S"; database. "nstead# it is also possible to choose 3%reate and initiali0e new
database9# but this will create the database on a location that does not accommodate S$
database directory structure. Since you restored the database already# it is enough that
you select 3&se existing database E@o initiali0ationF9 and choose the S"; database.
%hoose 3@o recovery mode9 or 3Standby mode9. "n either mode you cannot start S$
until the database is promoted to primary. *ith 3@o recovery mode9 you have no read
access to the database and with 3Standby mode9 you have read access to the database.
"rrespective whether there is read access or not you cannot start S$ until the database is
promoted to primary.
*ith 3@o recovery mode9# the promotion to primary might take few extra minutes# but
does not allow read access to the database. dditional transaction log applications will be
quick as there is no need to save and apply incomplete transactions for every transaction
log restore.
*ith 3Standby mode9# the promotion to primary is quick# but the database offers read
access. 6ut additional transaction log applications might be slow Eas there is a need to
save and apply incomplete transactions for every transaction log restore# these incomplete
transactions can be gigabytes in si0e and can make the transaction log much slowerF# in
some cases this can even create a lag in application that the secondary standby database
server is never able to catch-up.
%heck the 3!erminate users in database9 option.
%heck the 3llow database to assume primary role9# this is required where this secondary
standby database server might be promoted as primary production database server. "f you
have more than one secondary# you might choose not to check this box on some
secondary standby database server which is hosted for data protection and not for
promotion.
%hoose the @etwork share for the Secondary!Logs in the 3!ransaction Log 6ackup
;irectory9.
"f you want to set up additional secondary standby database servers# choose add and
define them.
*hen you click next in the 3Specify the Log Shipping ;estination9 screen# you will get
the below message# choose 3Yes9 and continue. !he message mentions that the secondary
database that you restored is in 3Loading9 state and not 34ead-(nly9 state H this is okay#
as the Log Shipping wi0ard will change the mode if necessary.
Log Shipping Schedu'e
6ackup schedule/ 'ow often the transaction log is backed up on the primary production
database server. !he transaction that have been committed but not backed up and copied
to the secondary standby database server is lost on a disaster scenario. ;epending on the
requirement# this can be set to ? or 8? minute or 8 hour. ;o not set this value to less than
, minute.
Copy Frequency: 'ow often the transaction log backup files are copied to the secondary
standby database server. You can execute the copy process for transaction log copying
more often then executing the transaction log backup on the production database server.
)or example if the transaction log backup runs once the hour# the copy process will try to
copy once the hour too and miss the file as it is in use. "t is better to copy few minutes
later or copy more frequently than the transaction log backup.
Load Frequency: 'ow often the transaction log backups are applied to the secondary
standby database. Since the transaction log backup files are copied at %opy )requency#
this can be set to the same value as 6ackup schedule as there is no effect on data loss.
.ven though you have to give the same value for %opy<Load )requency# you can
customi0e individually when you edit the Log Shipping maintenance plan later.
Load Delay/ 'ow much delay has to be introduced in applying the transaction log
backup. "f the delay is : hours# then a table that is deleted in primary production database
server will be available in the secondary standby database for : more hours. &sually the
Load ;elay is set to - minutes.
File Retention Period/ pplied transaction log files will be deleted from the secondary
standby database server. !his setting decides when will these files deleted. !he usual )ile
4etention $eriod is 8 or , days.
"f you change the transaction log backup process to back up more frequently# there will
be more files that need to be copied+ this is not an issue as they are managed
automatically. )or example if you back up transaction log every hour# you get ,=
transaction log backup files in a day# instead if you back up log every ? minutes# you
have ,>> transaction log backup files in a day.
Log Shipping 6hresho'ds
Backup alert threshold/ You can set a threshold for transaction log backup on primary
production database server. *hen the transaction log backup lags behind this threshold
you can have notification# like email. &sually this is set to : times higher than the backup
schedule in the previous screen.
Out of sync alert threshold/ You can set a threshold for transaction log restore on
secondary standby databases. *hen the transaction log is not restored by this threshold
you can have notification. &sually this is set to : times higher than the backup schedule
in the previous screen.
Log Shipping %onitor ser)er
%hoose the Log Shipping 2onitor server. "t is preferable to have a separate monitoring
server# but if this is not possible you can choose either primary or secondary server as
monitor server. *e recommend a separate :
rd
server as monitoring sever or to use
secondary server.
Reports and histor&
"n the next two screens you can choose to have reports and history saved. "f you choose#
use a different directory than the $rimary!Logs directory# like a report directory so these
file need not be archived along with the transaction log backup files. lso make sure you
choose to delete older reports after certain number of weeks.
Sa)ing the maintenance p'an
"n the next two screens# give a name for this Log Shipping maintenance plan and click
finish.
$nderstanding the Log Shipping process
S.L Ser)er Agent 7obs created b& Log Shipping 8i5ard
!here will be I 1obs created by Log Shipping *i0ard.
8. !ransaction log backup 1ob on primary/ !his 1ob is created on the primary
production database server to backup transaction log H you can look at the 1obs
under SQL Server gent 1obs on the primary server.
,. %opying 1ob/ !his 1ob is created on the secondary standby database server to copy
the transaction log backup files from primary production database server share to
secondary standby database server transaction log directory.
:. !ransaction log restore 1ob/ !his 1ob is created on the secondary standby database
server to restore the transaction log backup files into the secondary standby
database.
=. 6ackup lert 1ob/ !his 1ob is created in the monitor server to generate alert when
transaction log backup does not complete within the threshold. You can set up an
operator to be notified if this 1ob fails.
?. 4estore lert 1ob/ !his 1ob is created in the monitor server to generate alert when
transaction log restore does not complete within the threshold. You can set up an
operator to be notified if this 1ob fails
I. !ransaction log backup 1ob on secondary/ !his 1ob is created on the secondary
standby database server to backup transaction log on the secondary standby
database. !his 1ob is disabled+ it will be automatically enabled when this
secondary standby database is promoted to primary production database.
Read94n'& secondar& standb& database
(nce the Log Shipping is set up the secondary standby database will be marked 4ead-
(nly. !he status will change to normal when this secondary standby database is
promoted to production database.
%onitoring the Log Shipping Processes
Log Shipping %onitor
Log Shipping 2onitor will be located on the monitor server. 'ere you can have a look at
the status of the Log Shipping. You double click on the Log Shipping entry to see
detailed information on the activities# like when was the last transaction log backup# copy
and transaction log restore. 'ere you can also change the alert schedule.
!o have more detailed information on 1ob status# you can also have a look at the
individual 1obs and their history.
"f there is a failure# it will be flagged in this screen.

:i'es that are bac(ed up and copied
$er schedule the transaction log is backed up on the primary production database server
into the $rimary!Logs directory.
$er schedule the above files are copied from the $rimary!Logs directory into
Secondary!logs directory.
%odif&ing the Log Shipping P'an
4n the primar& production database ser)er
!he Log Shipping plan is maintained on the primary production database server. You can
modify the plan to change/
8. Transaction log backup schedule/ ;o not change the directory when the
transaction log backups are kept without changing the network share as this will
break the copy process.
! "dd ne# secondary
:. $odify e%isting secondary to change# directory and network share. !o change
from 3Standby9 to 3@o 4ecovery9 mode. !o modify the copy and load frequency.
lso to change (ut of Sync !hreshold and Load !ime ;elay.
4n the secondar& standb& database ser)er
Log Shipping $lan is also maintained on the secondary standby database server where
the schedule for the transaction log backup is defined for the secondary standby database#
which will take effect once this database is promoted to primary production database.
%odif& the Log Shipping transaction 'og bac(up schedu'e
!o avoid full backup overlapping the Log Shipping9s transaction log backup schedule#
modify the Log Shipping transaction log backup schedule by editing the Log Shipping
maintenance plan.
P'anned promotion of secondar& to primar&
"n case of planned promotion of secondary standby database server to primary production
database server there is no loss of committed data. !his requires ? to 8- minutes of
downtime before the secondary is promoted to primary and operational again.
!he following Steps are needed.
8. Stop S$.
,. 2ake sure the S"; database is not in use by looking at the SQL Server .nterprise
2anager# 2anagement# %urrent ctivity# $rocess "nfo H here there should be no
connection using the S"; database# if yes# clear up the connection.
:. .xecute the following statement using SQL Server Query naly0er on the
primary production database server H execute the above command under the
3msdb9 database and not under the S"; or master database. !his statement will
back up the transaction log on the primary production database server to include
all changes and will change the primary production database status to ELoadingF.
!he statement will also disable the transaction log backup 1ob in the primary
production database server and remove the primary production database server
from the Log Shipping process.
.J.% spKchangeKprimaryKrole
LdbKname M NS";N#
LbackupKlog M 8#
Lterminate M -#
LfinalKstate M ,#
LaccessKlevel M 8
A(
=. ;isable the SQL Server and SQL Server gent service on the primary production
database server.
?. .xecute the following statement using SQL Server Query naly0er on the
secondary standby database server H execute the above command under the
3msdb9 database and not under the S"; or master database. !his statement will
copy the transaction log backup files from the primary production database server
and apply it to the secondary standby database. !his will change the status of the
secondary standby database to primary production database and hence remove the
4ead-(nly status and also enable the transaction log backup 1ob on this new
primary production database to the Secondary!Logs directory. !his will also
delete the copy and restore 1ob on the secondary standby database server.
.J.% spKchangeKsecondaryKrole
LdbKname M NS";N#
LdoKload M 8#
LforceKload M 8#
LfinalKstate M 8#
LaccessKlevel M 8#
Lterminate M 8#
Lstopat M @&LL
A(
I. .xecute the following statement using SQL Server Query naly0er on the
monitor server H execute the above command under the 3msdb9 database and not
under the S"; or master database. !his statement will inform all other secondary
that there is a new primary production database server and where to copy the
transaction logs files from. $erform this step even if you have no other secondary
servers.
.J.% spKchangeKmonitorKrole
LprimaryKserver M NS$SQLN#
LsecondaryKserver M NS$SQL6N#
Ldatabase M NS";N#
LnewKsource M NBBSapsqlbBSecondary!LogN
A(
O. %hange S$ $rofile parameter to point to the new primary production database
server.

>. "nstead of changing the S$ profile parameter in the above step# there is also a
possibility to create a SQL Server lias using the SQL Server %lient @etwork
&tility to point to the new primary production database server. "n this case there is
no need to ad1ust the profile parameter# but we recommend changing the profile
parameter than using this SQL Server lias method. Start the SQL Server %lient
@etwork &tility# choose liases tab# choose add# choose !%$<"$# enter @ew
primary production database server name in the 3Server name9 tab and enter the
old primary production database server name in the 3Server alias9 tab.

P. Start S$
8-. You will see in st-= the ;6 Server has changed H also you will notice there is no
more transaction log backup at the old primary production database server and
now the transaction log backups occur in the new primary production database
server.
88. "n case you installed and now have a new %entral "nstance on this new primary
production database server H ad1ust the profile you copied from the old primary
production database server and update the License 7ey from S$.
Adding bac( the o'd primar& production database ser)er after maintenance
.nable SQL Server and SQL Server gent service on the old primary production
database server. ;elete the old transaction log backup files from the old primary
production database server that are located in the $rimary!Logs directory Eyou can also
move them temporarilyF. !he Log Shipping plan has been moved from the old primary
production database server to the new primary production database server during
promotion. You can see there is no more Log Shipping tab on the Log Shipping
maintenance plan.
.dit the Log Shipping plan and add the old primary production database server as a
secondary standby database server. %hoose existing database as there is no need to
restore the database. SQL Server will copy new transaction logs from the new primary
production database server to old primary production database server and apply them and
make the database new secondary standby database.
SQL Server gent 1obs# to copy and to restore# are created on the new secondary standby
database server and the transaction log backup files are periodically copied and applied
on the new secondary standby database server.
You can check the status of the Log Shipping in the Log Shipping monitor. 'ere you can
see that the transaction logs are shipped from new primary production database server to
the new secondary standby database server.
You can double click on the entry and check the backup# copy and restore logs.
4epeat the above step of promoting the new secondary standby database server to
primary production database server and this will complete the planned promotion
process.
$np'anned promotion of secondar& to primar&
"n this case you have a potential data loss# the transactions that are not copied from the
primary production database server to secondary standby database server is lost. !his is
also a reason why you should think about backing up the transaction log and copying the
files more often.
!he steps are the same as planned promotion of secondary to primary# except you cannot
perform step number 8# ,# : and = as the primary is not available.
fter completing the rest of the steps# you will have promoted the secondary standby
database to primary production database. *hen you bring the original primary production
database server online# delete the old primary production database which is out of date
since S$ is new using the new primary production database server. 4estore the latest
full backup of the new primary production database to the new secondary standby
database server and choose the option 3Leave database non-operational but able to restore
additional transaction logs9. )rom the new primary production database server Log
Shipping maintenance plan# add this as a secondary and follow the steps mentioned in
adding back the old primary production database server after maintenance.
Adding an operator for notification
You can add an operator to get notification when the transaction log backup at the
primary production database server or transaction log restore at the secondary standby
database server past the threshold. "n the SQL Server .nterprise 2anager# go to
2anagement# SQL Server gent# (perators and define an operator.
!hen add the operator to be notified when the 6ackup lter or 4estore lert 1ob fails.
*hen the 1ob fails the operator will get the notification. !he 1ob history will show that
the operator was notified when the 1ob failed.
Re'ated Lin(s
2icrosoft SQL Server at
http/<<www.microsoft.com<sql

Das könnte Ihnen auch gefallen