Beruflich Dokumente
Kultur Dokumente
Failover steps
February 21, 2013 Manikandan Rajagopalan High Availablity, Log Shipping, UncategorizedHigh
Availablity
2 Votes
Requirements
Permissions
Backup directory with read & write permissions: For the backup job
to be successful, the SQL Server service account on the primary
server instance and the proxy account of the backup job (by default,
this is the SQL Server Agent account on the primary server
instance) must have read/write permissions to the backup
directory.
Copy directory with write permissions: For the copy job to be
successful, the proxy account of the copy job (by default, this is the
SQL Server Agent account on the secondary server instance) must
have read permissions to the backup directory and write access to
the copy directory.
For the restore job to be successful, the SQL Server service account
on the secondary server instance and the proxy account of the
restore job (by default, this is the SQL Server Agent account on the
secondary server instance) must have read/write access to the copy
directory.
Let us assume that the log shipping is configured with the following
setup:
Primary Server
1. Right click the database you want to use as your primary database
in the log shipping configuration, and then click Properties.
5. In the Network path to the backup folder box, type the network
path to the share you created for the transaction log backup folder.
Say : \\ Primary\Logshipping
6. If the backup folder is located on the primary server, type the
local path to the backup folder in the If the backup folder is located
on the primary server, type a local path to the folder box. (If the
backup folder is not on the primary server, you can leave this box
empty.)
Say : D:\Logshipping
Important:
Say: Secondary
12. In the Secondary Database box, choose a database from the list
or type the name of the database you want to create.
Note:
14. On the Copy Files tab, in the Destination folder for copied
files box, type the path of the folder into which the transaction logs
backups should be copied. This folder is often located on the
secondary server.
18. If you want to delay the restore process on the secondary server,
choose a delay time under Delay restoring backups at least.
20. Note the restore schedule listed in the Schedule box under
Restore job. If you want to customize the schedule for your
installation, click Schedule and then adjust the SQL Server Agent
schedule as needed. This schedule should approximate the backup
schedule.
23. Click Connect and connect to the instance of SQL Server that
you want to use as your monitor server.
25. Under History retention, choose the length of time you want to
retain a record of your log shipping history.
Failover Steps
1. Copy any remaining transaction log backup files from the backup
share to the copy destination folder. You can do this manually, or
start the copy job on each secondary server instance to copy the
files.
The first time you want to fail over to the secondary database and
make it your new primary database, there is a series of steps you
must take. After you have followed these initial steps, you will be
able to swap roles between the primary database and the secondary
database easily.
failover
1. If the primary database server dies, is it possible to allow users to connect to the
secondary database so as to continue working with Read/Write access?
2. Once the primary server comes back online, is it a difficult process to switch back to the
primary database server?
3. Will changing the Recovery model to Full (from simple) have any issues?
4. Will my existing backups (using Symantec Backup Exec) be affected by enabling log
shipping and switching to a full recovery model?
add a
comme
nt
2 Answers
activeoldestvotes
up
vote2 1) If the primary database server dies, is it possible to allow users to connect to the
down secondary database so as to continue working with Read/Write access?
vote accept ed
You have to manually failover to the secondary server as logshipping does not have a
built-in mechanism to support automatic failover.
Once you failover, your application/s (provided they are using ADO.NET or SQL
Native Client) can leverage the Failover Partner=Secondary_server
Brent has blogged about failover partner:
you dont need to use database mirroring to use Failover Partner. Whether youre using
database mirroring, replication, log shipping, or duct tape, much like the honey badger,
your applications dont care. Theyll just try to connect to the Failover Partner name
whenever the primary server is down.
2) Once the primary server comes back online, is it a difficult process to switch back to
the primary database server?
Traditionally, depending on the size and number of database that are invloved in
logshipping, it may or may not be difficult.
Database size and your network bandwidth matters a lot. Normally, you just have to
resetup log-shipping. Meaning - point all your apps to primary and in background, do a
full backup of primary, copy that to secondary server and restore it with no-recovery
with subsequent log backups.
To minimize the downtime, you can use "Reverse logshipping" will prove to be a
huge help.
3) Will changing the Recovery model to Full (from simple) have any issues?
Yes. Changing recovery model breaks the log chain. Paul Randall talks in his myths
section. Also, see below chart :
As I mentioned above, any change to the recover model should be followed by a FULL
backup. That will be your base backup. Any adhoc backups (even full) should be taken
with a COPY_ONLY option as if you are relying on differential backups then it will be
an issue if someone takes an adhoc full backup.
As a side note, always fully document, test, test and test + automate (as much possible)
your disaster recovery strategy. See Paul's DR Poster for more details.
shareimprove this answer edited Oct 14 '14 at 2:06 answered Oct 14 '14 at 1:42
Kin
35.3k348112
One point is missed about users connecting to Secondary database: You must mention that
users cannot immediately connect because of orphaned users scenario and unless they have
build in script to take care of this even after when database comes online users would not be
able to connect. You should also include how to resolve orphaned users that would complete
your answer Shanky Oct 14 '14 at 17:38
add a comment
up
vote1down Kin provided some good details but just to address the questions directly:
vote
3) Well, you can only log ship a database in full recovery model, so not sure how
to answer that one.
2) Once the primary server comes back online, is it a difficult process to switch
back to the primary database server?
No, you can just re-initialize the process from the new primary. It's:
a full backup;
start log backups (which you should be doing anyway,
even without log shipping);
then find a server that's up to serve as the new secondary
and set up similar jobs there to perform the restores.
3) Will changing the Recovery model to Full (from simple) have any issues?
Well, you can only log ship a database in full recovery model, so not sure how to
answer.
Hard to answer without knowing exactly what you are using Symantec for. As
Kin noted, you don't want this thing to try to take log backups outside of your log
shipping mechanism.