SQL 2005 Failing over to secondary DB

The following process must be followed in the event that the Primary SQL 2005 server fails. This is a manual process. This information is also available on the Microsoft site: http://msdn.microsoft.com/en-us/library/ms190016.aspx

Assumptions: The Primary and Secondary server are in sync

 

Step 1a:  Backup the transaction logs on the primary server (if possible)

Using the Query Analyser, run:

Backup log DBName to disk = "Local path or Network path" with NORECOVERY

 

On the secondary server, run:

Restore log DBName from disk = "Local path or Network path" with RECOVERY

 

 

Step 1b:  Restore the latest transaction log to the secondary server

Restore log DBName from disk = "Local path or Network path" with RECOVERY

 

 

Step 2:  Changing Roles Between Primary and Secondary servers

  1. Disable the log shipping backup job on the original primary server, and the copy and restore jobs on the original secondary server
  2. On the secondary database, configure log shipping using SQL Server Management Studio
  • Use the same share for creating backups that you created for the original primary server
  • When adding the secondary database, in the Secondary Database Settings dialog box, enter the name of the original primary database in the Secondary database box
  • In the Secondary Database Settings dialog box, select No, the secondary database is initialized
  1. Bring the secondary database online, backing up the transaction log on the primary server with NORECOVERY
  2. Disable the log shipping backup job on the original primary server, and the copy and restore jobs on the original secondary server
  3. Enable the log shipping backup job on the secondary server (the new primary server), and the copy and restore jobs on the primary server (the new secondary server).

 

Note: When you change a secondary database to the primary database, to provide a consistent experience to users and applications, you might have to re-create some or all of the metadata for the database, such as logins and jobs, on the new primary server instance.

 

 

Step 3:  Change database locations on all servers

Servers that have connections to the Primary database, e.g. Citrix and Blackberry, you will need to modify the SQL Server connection configuration. To do this either modify the ODBC connection properties or change the MF20.dns configuration file  on each Citrix server (stop the IMA service first).

 

OR

 

Change the DNS record for the primary server to the secondary server IP

 

 
Services