Microsoft® SQL Server® 2012 Bible

(Ben Green) #1

701


Chapter 27: Database Mirroring


27


Checking Database Mirroring Confi guration


After database mirroring is confi gured, you can verify the database mirroring setup in sev-
eral ways.

■ (^) View the status of the principal and mirror databases.
■ (^) Expand Databases in Management Studio to view the status of the principal and
mirror databases. Figure 27-9 shows an example for the principal database.
FIGURE 27-9
Status of principal database,
■ (^) Query the sys.database_mirroring catalog view to view the database
mirroring metadata for each mirrored database. For example, executing the follow-
ing T-SQL command against the principal and mirror server displays the results in
Table 27-2.
SELECT DB_NAME(database_id) AS Database_Name,
mirroring_state_desc,
mirroring_role_desc,
mirroring_safety_level_desc,
mirroring_partner_name,
mirroring_witness_name,
mirroring_witness_state_desc,
mirroring_failover_lsn
FROM sys.database_mirroring
WHERE mirroring_state IS NOT NULL;
c27.indd 701c27.indd 701 7/31/2012 9:50:28 AM7/31/2012 9:50:28 AM
http://www.it-ebooks.info

Free download pdf