SlideShare une entreprise Scribd logo
1  sur  36
Database Mirroring




                1
Preparation
• Minimum of two SQL servers
• Principal database/Mirror database
• “Witness” server (used for automatic
  failover)
• Will be done using SQL Server 2005 SP2




                               2
Types of mirroring
• High availability:
   – Synchronized writes on principal and mirror
   – Automated failover
   – Requires witness server
• High Protection:
   – Synchronized writes on principal and mirror
   – Manual failover
   – No witness server required
• High performance:
   – Not synchronized (assumed writes will be completed on both
     principal and mirror)
   – Forced failover only
   – Witness not required
                                                   3
Implementation
• Will be using high availability method
• Requires at least three separate instances of SQL Server 2005 SP1
  (Principal, Mirror, Witness)
• Ensure BlackBerry services on all machines are stopped
• Ensure the login credentials for all the SQL servers are the same
• Run the errors.sql script on all SQL servers before proceeding (the
  errors.sql script can be found in the BES installation folder). You can
  also get rid of the final line in the script (the USE database line) as it
  may produce errors. -this is now an obsolete step. Running
  errors.sql is no longer required for DB mirroring.
• It does not matter which servers you use for which purpose (i.e. M1
  can be principal, M2 can be mirror and M3 can be witness for DB1
  while M3 can be principal, M1 can be mirror and M2 can be witness
  for DB2.)



                                                         4
Implementation contd…
• Login to the SQL Server where your DB
  exists
• Right-click->Properties->Options page
• Select “Full” option under recovery model




                                 5
6
Implementation contd…
• Backup the database
  – Right-click->Tasks->Backup
  – Ensure the backup type is “Full”
  – On the options screen select “Overwrite all
    existing backup sets” to ensure you are not
    appending the backup set to an existing set
  – Optionally you can also check “Verify backup
    when finished” or “Perform checksum before
    writing to media” for verification of data
                                     7
8
9
Implementation contd…
• Backup the transaction log
   – Right-click->Tasks->Backup
   – Ensure the backup type is “Transaction log”. When restoring on
     the mirrored server, it may complain that no transaction log was
     found and may fail the database restoration on the mirrored
     server so this step is performed as a precaution
   – On the options screen ensure that “Append to the existing
     backup set” is checked. This will add the transaction log to your
     previous full backup of the database so you only require to copy
     the one .bak file to the mirrored server
   – Optionally you can also check “Verify backup when finished” or
     “Perform checksum before writing to media” for verification of
     data



                                                     10
11
12
Implementation contd…
• Copy the backups to another SQL Server
• Requires access to the SQL Server itself
  (through remote desktop or VMware
  console). What you want to do is copy the
  backed up file you created in the previous
  steps to the SQL server where you want
  the database to be mirrored
• Where you place the backup files on the
  second SQL Server does not matter
                                 13
Implementation contd…
• Restore the database on second SQL
  Server
  – Login to the SQL Server where your DB was
    copied to
  – Right-click on Database folder->Restore
    backup
  – Type the same name as the original database
    on the first SQL Server in the “To database”
    field

                                    14
15
Implementation contd…
• Select “From device” and click the “…”
  button
• Click the add button and find the backup
  file of the database
  – Select the backed up database that you
    copied from the principal SQL server




                                    16
17
Implementation contd…
• The two backups will appear in the
  window
• Checkmark both backups




                                 18
19
Implementation contd…
• Select the options page
• At the bottom under “Recovery state”
  select the second option (RESTORE
  WITH NORECOVERY)




                                 20
21
Implementation contd…
• Your database should
  now be listed in the
  database folder on the
  second SQL server and it
  should be in the
  “Restoring…” state
• *Note*: The “Restoring…”
  state is indefinite for the
  mirrored database. You
  will not be able to access
  a database while it is in
  the restoring state.

                                22
Setting up the mirroring
• Login to the first SQL Server:
  – Select the Principal database
  – Right-click->Properties
  – Select the “Mirroring page”
  – Click on “Configure security”




                                    23
24
25
Setting up the mirroring contd…
• On the Principal, Mirror and Witness
  Server Instance screens, settings may be
  grayed out due to the endpoint being
  setup already for use. If this is the case
  just select the appropriate server to
  connect to and use the default settings. If
  the endpoint has not been created yet,
  you can create a new endpoint that will be
  used for all database mirroring.
                                  26
27
Setting up the mirroring contd…
• If creating a new endpoint, use the default
  port of 5022 and enter any name for the
  endpoint. Use the same name on the
  following servers for consistency although
  using different names does not affect the
  mirroring in any way.



                                  28
Setting up the mirroring contd…
• When selecting the Mirror and Witness
  Server Instances, you may be required to
  connect to these servers using some form
  of authentication before you are able to
  continue. For consistency use the same
  logins for all servers.



                                29
30
Setting up the mirroring contd…
• The next screen you may encounter will
  ask for service accounts. This screen is to
  grant CONNECT permissions for the
  accounts that are running the SQL
  services on each machine. Generally all
  the SQL Server should be run on the
  same account so you can just leave the
  fields blank.

                                  31
32
• Click finish and
  the database
  mirroring should
  be setup
  successfully.




                     33
34
Setting up the mirroring contd…
• Ensure the settings are correct in the
  Mirroring window
• Synchronous operating mode should be
  selected
• Click on start mirroring
• Status should show the database is now
  mirrored correctly


                                35
Setting up the mirroring contd…
• Your databases
  should now be in the
  following states
• Upon failover, the
  mirror database will
  become principal and
  the principal database
  will become the mirror
  (similar in function to a
  high availability BES
  with the
  active/standby states)
                              36

Contenu connexe

Tendances

SQL Server High Availability Solutions (Pros & Cons)
SQL Server High Availability Solutions (Pros & Cons)SQL Server High Availability Solutions (Pros & Cons)
SQL Server High Availability Solutions (Pros & Cons)Hamid J. Fard
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConJérôme Petazzoni
 
Oracle Extended Clusters for Oracle RAC
Oracle Extended Clusters for Oracle RACOracle Extended Clusters for Oracle RAC
Oracle Extended Clusters for Oracle RACMarkus Michalewicz
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningMichel Schildmeijer
 
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfOracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfSrirakshaSrinivasan2
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Sandesh Rao
 
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIESORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIESLudovico Caldara
 
Oracle Database – Mission Critical
Oracle Database – Mission CriticalOracle Database – Mission Critical
Oracle Database – Mission CriticalMarkus Michalewicz
 
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best PracticesOracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best PracticesMarkus Michalewicz
 
Smart monitoring how does oracle rac manage resource, state ukoug19
Smart monitoring how does oracle rac manage resource, state ukoug19Smart monitoring how does oracle rac manage resource, state ukoug19
Smart monitoring how does oracle rac manage resource, state ukoug19Anil Nair
 
Oracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion EditionOracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion EditionMarkus Michalewicz
 
Understanding oracle rac internals part 1 - slides
Understanding oracle rac internals   part 1 - slidesUnderstanding oracle rac internals   part 1 - slides
Understanding oracle rac internals part 1 - slidesMohamed Farouk
 
Oracle Active Data Guard: Best Practices and New Features Deep Dive
Oracle Active Data Guard: Best Practices and New Features Deep Dive Oracle Active Data Guard: Best Practices and New Features Deep Dive
Oracle Active Data Guard: Best Practices and New Features Deep Dive Glen Hawkins
 
Oracle Latch and Mutex Contention Troubleshooting
Oracle Latch and Mutex Contention TroubleshootingOracle Latch and Mutex Contention Troubleshooting
Oracle Latch and Mutex Contention TroubleshootingTanel Poder
 
Standard Edition High Availability (SEHA) - The Why, What & How
Standard Edition High Availability (SEHA) - The Why, What & HowStandard Edition High Availability (SEHA) - The Why, What & How
Standard Edition High Availability (SEHA) - The Why, What & HowMarkus Michalewicz
 
HA, Scalability, DR & MAA in Oracle Database 21c - Overview
HA, Scalability, DR & MAA in Oracle Database 21c - OverviewHA, Scalability, DR & MAA in Oracle Database 21c - Overview
HA, Scalability, DR & MAA in Oracle Database 21c - OverviewMarkus Michalewicz
 
MySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & OperationsMySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & OperationsFrederic Descamps
 
Tips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudTips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudSeveralnines
 
What’s New in Oracle Database 19c - Part 1
What’s New in Oracle Database 19c - Part 1What’s New in Oracle Database 19c - Part 1
What’s New in Oracle Database 19c - Part 1Satishbabu Gunukula
 

Tendances (20)

SQL Server High Availability Solutions (Pros & Cons)
SQL Server High Availability Solutions (Pros & Cons)SQL Server High Availability Solutions (Pros & Cons)
SQL Server High Availability Solutions (Pros & Cons)
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
 
Oracle Extended Clusters for Oracle RAC
Oracle Extended Clusters for Oracle RACOracle Extended Clusters for Oracle RAC
Oracle Extended Clusters for Oracle RAC
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuning
 
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdfOracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
Oracle_Multitenant_19c_-_All_About_Pluggable_D.pdf
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
 
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIESORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
 
AWR and ASH Deep Dive
AWR and ASH Deep DiveAWR and ASH Deep Dive
AWR and ASH Deep Dive
 
Oracle Database – Mission Critical
Oracle Database – Mission CriticalOracle Database – Mission Critical
Oracle Database – Mission Critical
 
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best PracticesOracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
 
Smart monitoring how does oracle rac manage resource, state ukoug19
Smart monitoring how does oracle rac manage resource, state ukoug19Smart monitoring how does oracle rac manage resource, state ukoug19
Smart monitoring how does oracle rac manage resource, state ukoug19
 
Oracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion EditionOracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion Edition
 
Understanding oracle rac internals part 1 - slides
Understanding oracle rac internals   part 1 - slidesUnderstanding oracle rac internals   part 1 - slides
Understanding oracle rac internals part 1 - slides
 
Oracle Active Data Guard: Best Practices and New Features Deep Dive
Oracle Active Data Guard: Best Practices and New Features Deep Dive Oracle Active Data Guard: Best Practices and New Features Deep Dive
Oracle Active Data Guard: Best Practices and New Features Deep Dive
 
Oracle Latch and Mutex Contention Troubleshooting
Oracle Latch and Mutex Contention TroubleshootingOracle Latch and Mutex Contention Troubleshooting
Oracle Latch and Mutex Contention Troubleshooting
 
Standard Edition High Availability (SEHA) - The Why, What & How
Standard Edition High Availability (SEHA) - The Why, What & HowStandard Edition High Availability (SEHA) - The Why, What & How
Standard Edition High Availability (SEHA) - The Why, What & How
 
HA, Scalability, DR & MAA in Oracle Database 21c - Overview
HA, Scalability, DR & MAA in Oracle Database 21c - OverviewHA, Scalability, DR & MAA in Oracle Database 21c - Overview
HA, Scalability, DR & MAA in Oracle Database 21c - Overview
 
MySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & OperationsMySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & Operations
 
Tips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudTips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloud
 
What’s New in Oracle Database 19c - Part 1
What’s New in Oracle Database 19c - Part 1What’s New in Oracle Database 19c - Part 1
What’s New in Oracle Database 19c - Part 1
 

Similaire à SQL Database Mirroring setup

Database mirroring setup
Database mirroring setupDatabase mirroring setup
Database mirroring setupK Singh
 
Microsoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptxMicrosoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptxsamtakke1
 
Sql disaster recovery
Sql disaster recoverySql disaster recovery
Sql disaster recoverySqlperfomance
 
Sql server mirroring
Sql server mirroringSql server mirroring
Sql server mirroringsateesh7114
 
Sql server logshipping
Sql server logshippingSql server logshipping
Sql server logshippingZeba Ansari
 
Database Mirror for the exceptional DBA – David Izahk
Database Mirror for the exceptional DBA – David IzahkDatabase Mirror for the exceptional DBA – David Izahk
Database Mirror for the exceptional DBA – David Izahksqlserver.co.il
 
Geek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringGeek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringIDERA Software
 
Sa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administratorsSa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administratorsSharon James
 
Lesson 1 configuring
Lesson 1   configuringLesson 1   configuring
Lesson 1 configuringRam Kedem
 
Sql server 2019 New Features by Yevhen Nedaskivskyi
Sql server 2019 New Features by Yevhen NedaskivskyiSql server 2019 New Features by Yevhen Nedaskivskyi
Sql server 2019 New Features by Yevhen NedaskivskyiAlex Tumanoff
 
SQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout PlanSQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout Plan► Supreme Mandal ◄
 
Blue Green Sitecore Deployments on Azure
Blue Green Sitecore Deployments on AzureBlue Green Sitecore Deployments on Azure
Blue Green Sitecore Deployments on AzureRob Habraken
 
6212883126866262792 performance testing_cloud
6212883126866262792 performance testing_cloud6212883126866262792 performance testing_cloud
6212883126866262792 performance testing_cloudLocuto Riorama
 
Performance Tuning for Pirates!
Performance Tuning for Pirates!Performance Tuning for Pirates!
Performance Tuning for Pirates!John Sterrett
 
Moving Windows Applications to the Cloud
Moving Windows Applications to the CloudMoving Windows Applications to the Cloud
Moving Windows Applications to the CloudRightScale
 
Hands-on Lab: Migrating Oracle to PostgreSQL
Hands-on Lab: Migrating Oracle to PostgreSQL Hands-on Lab: Migrating Oracle to PostgreSQL
Hands-on Lab: Migrating Oracle to PostgreSQL Amazon Web Services
 
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBAKoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBATobias Koprowski
 
SQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud FeaturesSQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud FeaturesGuillermo Caicedo
 

Similaire à SQL Database Mirroring setup (20)

Database mirroring setup
Database mirroring setupDatabase mirroring setup
Database mirroring setup
 
Microsoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptxMicrosoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptx
 
Sql disaster recovery
Sql disaster recoverySql disaster recovery
Sql disaster recovery
 
MSSQL SERVER
MSSQL SERVERMSSQL SERVER
MSSQL SERVER
 
Sql server mirroring
Sql server mirroringSql server mirroring
Sql server mirroring
 
Sql server logshipping
Sql server logshippingSql server logshipping
Sql server logshipping
 
Database Mirror for the exceptional DBA – David Izahk
Database Mirror for the exceptional DBA – David IzahkDatabase Mirror for the exceptional DBA – David Izahk
Database Mirror for the exceptional DBA – David Izahk
 
Geek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringGeek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database Mirroring
 
Sa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administratorsSa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administrators
 
Lesson 1 configuring
Lesson 1   configuringLesson 1   configuring
Lesson 1 configuring
 
A to z for sql azure databases
A to z for sql azure databasesA to z for sql azure databases
A to z for sql azure databases
 
Sql server 2019 New Features by Yevhen Nedaskivskyi
Sql server 2019 New Features by Yevhen NedaskivskyiSql server 2019 New Features by Yevhen Nedaskivskyi
Sql server 2019 New Features by Yevhen Nedaskivskyi
 
SQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout PlanSQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout Plan
 
Blue Green Sitecore Deployments on Azure
Blue Green Sitecore Deployments on AzureBlue Green Sitecore Deployments on Azure
Blue Green Sitecore Deployments on Azure
 
6212883126866262792 performance testing_cloud
6212883126866262792 performance testing_cloud6212883126866262792 performance testing_cloud
6212883126866262792 performance testing_cloud
 
Performance Tuning for Pirates!
Performance Tuning for Pirates!Performance Tuning for Pirates!
Performance Tuning for Pirates!
 
Moving Windows Applications to the Cloud
Moving Windows Applications to the CloudMoving Windows Applications to the Cloud
Moving Windows Applications to the Cloud
 
Hands-on Lab: Migrating Oracle to PostgreSQL
Hands-on Lab: Migrating Oracle to PostgreSQL Hands-on Lab: Migrating Oracle to PostgreSQL
Hands-on Lab: Migrating Oracle to PostgreSQL
 
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBAKoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
 
SQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud FeaturesSQL Server 2014 Hybrid Cloud Features
SQL Server 2014 Hybrid Cloud Features
 

SQL Database Mirroring setup

  • 2. Preparation • Minimum of two SQL servers • Principal database/Mirror database • “Witness” server (used for automatic failover) • Will be done using SQL Server 2005 SP2 2
  • 3. Types of mirroring • High availability: – Synchronized writes on principal and mirror – Automated failover – Requires witness server • High Protection: – Synchronized writes on principal and mirror – Manual failover – No witness server required • High performance: – Not synchronized (assumed writes will be completed on both principal and mirror) – Forced failover only – Witness not required 3
  • 4. Implementation • Will be using high availability method • Requires at least three separate instances of SQL Server 2005 SP1 (Principal, Mirror, Witness) • Ensure BlackBerry services on all machines are stopped • Ensure the login credentials for all the SQL servers are the same • Run the errors.sql script on all SQL servers before proceeding (the errors.sql script can be found in the BES installation folder). You can also get rid of the final line in the script (the USE database line) as it may produce errors. -this is now an obsolete step. Running errors.sql is no longer required for DB mirroring. • It does not matter which servers you use for which purpose (i.e. M1 can be principal, M2 can be mirror and M3 can be witness for DB1 while M3 can be principal, M1 can be mirror and M2 can be witness for DB2.) 4
  • 5. Implementation contd… • Login to the SQL Server where your DB exists • Right-click->Properties->Options page • Select “Full” option under recovery model 5
  • 6. 6
  • 7. Implementation contd… • Backup the database – Right-click->Tasks->Backup – Ensure the backup type is “Full” – On the options screen select “Overwrite all existing backup sets” to ensure you are not appending the backup set to an existing set – Optionally you can also check “Verify backup when finished” or “Perform checksum before writing to media” for verification of data 7
  • 8. 8
  • 9. 9
  • 10. Implementation contd… • Backup the transaction log – Right-click->Tasks->Backup – Ensure the backup type is “Transaction log”. When restoring on the mirrored server, it may complain that no transaction log was found and may fail the database restoration on the mirrored server so this step is performed as a precaution – On the options screen ensure that “Append to the existing backup set” is checked. This will add the transaction log to your previous full backup of the database so you only require to copy the one .bak file to the mirrored server – Optionally you can also check “Verify backup when finished” or “Perform checksum before writing to media” for verification of data 10
  • 11. 11
  • 12. 12
  • 13. Implementation contd… • Copy the backups to another SQL Server • Requires access to the SQL Server itself (through remote desktop or VMware console). What you want to do is copy the backed up file you created in the previous steps to the SQL server where you want the database to be mirrored • Where you place the backup files on the second SQL Server does not matter 13
  • 14. Implementation contd… • Restore the database on second SQL Server – Login to the SQL Server where your DB was copied to – Right-click on Database folder->Restore backup – Type the same name as the original database on the first SQL Server in the “To database” field 14
  • 15. 15
  • 16. Implementation contd… • Select “From device” and click the “…” button • Click the add button and find the backup file of the database – Select the backed up database that you copied from the principal SQL server 16
  • 17. 17
  • 18. Implementation contd… • The two backups will appear in the window • Checkmark both backups 18
  • 19. 19
  • 20. Implementation contd… • Select the options page • At the bottom under “Recovery state” select the second option (RESTORE WITH NORECOVERY) 20
  • 21. 21
  • 22. Implementation contd… • Your database should now be listed in the database folder on the second SQL server and it should be in the “Restoring…” state • *Note*: The “Restoring…” state is indefinite for the mirrored database. You will not be able to access a database while it is in the restoring state. 22
  • 23. Setting up the mirroring • Login to the first SQL Server: – Select the Principal database – Right-click->Properties – Select the “Mirroring page” – Click on “Configure security” 23
  • 24. 24
  • 25. 25
  • 26. Setting up the mirroring contd… • On the Principal, Mirror and Witness Server Instance screens, settings may be grayed out due to the endpoint being setup already for use. If this is the case just select the appropriate server to connect to and use the default settings. If the endpoint has not been created yet, you can create a new endpoint that will be used for all database mirroring. 26
  • 27. 27
  • 28. Setting up the mirroring contd… • If creating a new endpoint, use the default port of 5022 and enter any name for the endpoint. Use the same name on the following servers for consistency although using different names does not affect the mirroring in any way. 28
  • 29. Setting up the mirroring contd… • When selecting the Mirror and Witness Server Instances, you may be required to connect to these servers using some form of authentication before you are able to continue. For consistency use the same logins for all servers. 29
  • 30. 30
  • 31. Setting up the mirroring contd… • The next screen you may encounter will ask for service accounts. This screen is to grant CONNECT permissions for the accounts that are running the SQL services on each machine. Generally all the SQL Server should be run on the same account so you can just leave the fields blank. 31
  • 32. 32
  • 33. • Click finish and the database mirroring should be setup successfully. 33
  • 34. 34
  • 35. Setting up the mirroring contd… • Ensure the settings are correct in the Mirroring window • Synchronous operating mode should be selected • Click on start mirroring • Status should show the database is now mirrored correctly 35
  • 36. Setting up the mirroring contd… • Your databases should now be in the following states • Upon failover, the mirror database will become principal and the principal database will become the mirror (similar in function to a high availability BES with the active/standby states) 36