LOG FILE OF PRINCIPAL DATABASE IS GROWING ABNORMALLY IN MIRRORING.

Whenever there is any active transactions or REBUILD INDEXES activities are going there is a chance of log file growth in that particular principal database where that database has been participated in Mirroring. It means whenever Mirror database falls behind Principal please do the below steps.And if the amount of ACTIVE LOG is growing abnormally we can do the below steps

1) Stop Database Mirroring
2) Take the log backup that truncates the log and restore that in Mirroring WITH NORECOVERY option.
3)And RESTART the mirroing

---How to find how many databases are in mirroring state.
SELECT
A.name,
CASE
    WHEN B.mirroring_state is NULL THEN 'Mirroring not configured'
    ELSE 'Mirroring configured'
END as MirroringState
FROM
sys.databases A INNER JOIN sys.database_mirroring B
ON A.database_id=B.database_id
WHERE a.database_id > 4

ORDER BY A.NAME

--How to check database Mirroring state.

SELECT DB_NAME(database_id),  
mirroring_role_desc,   
mirroring_state_desc   
FROM sys.database_mirroring   
WHERE mirroring_guid IS NOT NULL; 

Comments

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period

Transparent Data Encryption(TDE) with Master Key and Certificate in SQL Server