Forum Discussion
SQL Migration from SQL2017 to SQL2022
AG1: Win OS 2016, SQL 2017
AG2: Win OS 2019, SQL 2022
We are trying to migrate database from AG1 to AG2 via distributed AG. As the database is on different version, the status of the db on AG2 will be in Synchronized/In Recovery mode which is not readable. Are there any ways to verify the data integrity of the database as its not readable?
2 Replies
- MurraySobol985Brass Contributor
Verify the data integrity of the database
To verify the data integrity of a SQL Server database in "Synchronized/In Recovery mode," you can use the following methods:
Check the SQL Server Error Log: Look for progress updates indicating the recovery phase, such as "Recovery of database 'DatabaseName' is 50% complete."
1
Use DBCC CHECKDB: This command checks the logical and physical integrity of all objects in the database. It runs checks on the database, tables, and views, and validates the contents of indexed views.
1
Restore from Backup: If recovery is not progressing, restoring from a known good backup is usually the safest outcome.
1
These methods help ensure that the database is transactionally consistent and that the data is not corrupted. If recovery is not progressing, it is important to take action to prevent data loss or corruption.
- MurraySobol985Brass Contributor
Here's what AI suggests:
SELECT * FROM sys.dm_exec_requests WHERE command LIKE '%RECOVERY%';
Ensure disk latency is low and CPU is not maxed out.
If log backups are missing or corrupted, you may need to restore from a good backup and rejoin the AG.
When adding a database to an AG, ensure it is fully recovered and log backups are up-to-date before joining. This minimizes "In Recovery" delays.