Monday, February 13, 2012 1:11 PM
I want to get the Logical Names of the Databases on Secondary server when the Mirroring is setup?
Monday, February 13, 2012 1:17 PM
When you say Logical Names of databases, do you mean getting the Logical Name of Database Files?
Regards Gursethi Blog: http://gursethi.blogspot.com/ ++++ Please mark "Propose As Answer" if my answer helped ++++
Monday, February 13, 2012 1:53 PMYes, Do you have any idea?
Monday, February 13, 2012 2:13 PM
SELECT db_name(dm.database_id) as database_name, mf.name as file_logical_name, mf.physical_name FROM sys.database_mirroring dm INNER JOIN sys.master_files mf ON mf.database_id = dm.database_id WHERE dm.mirroring_role = 2
- Marked As Answer by maddy28 Monday, February 13, 2012 2:26 PM
Monday, February 13, 2012 2:26 PMThanks Ana Mihalj
Monday, February 13, 2012 5:16 PM
Try this one to get the partner name
SELECT TOP 1 mirroring_partner_instance from msdb.sys.database_mirroring (nolock)
where mirroring_partner_instance is not null
And this one to get the status of the database mirroring session for each database