SQL Server Error 490: Fix Resync Disabled
In this article
SQL Server error 490, "The resync functionality is temporarily disabled," occurs when a database mirroring or Always On Availability Group session cannot automatically recover from a failed data synchronization. This usually happens after a forced failover, a network outage, or when the principal and mirror databases have diverged. The direct fix is to manually resume the data synchronization session, which re-establishes a common log sequence number (LSN) and allows resync to proceed. Below is a step-by-step guide to resolve this error.
What You'll Need
- SQL Server Management Studio (SSMS) or access to a query tool like sqlcmd.
- Permissions to run ALTER DATABASE statements (typically sysadmin or db_owner).
- Access to both the principal and mirror (or secondary) server instances.
- The database name and the role (principal or mirror) of each server.
Step-by-Step
- Identify the database and its role. Connect to the server that hosts the principal database. Run:
SELECT DB_NAME(database_id) AS DBName, mirroring_role_desc, mirroring_state_desc FROM sys.database_mirroring WHERE DB_NAME(database_id) = 'YourDB';This shows if the database is principal (1) or mirror (2) and the current state. - Check the mirroring state. The state should be SUSPENDED (or DISCONNECTED). If it is SUSPENDED, you can proceed. If it is DISCONNECTED, the servers cannot communicate; check network and endpoints first (see Troubleshooting).
- Resume the mirroring session. On the principal server, run:
ALTER DATABASE YourDB SET RESUME;This re-establishes the session and starts the resync process. If the error persists, proceed to step 4. - If RESUME fails, remove and re-establish mirroring. This is a last resort because it requires a full backup and restore. On the principal, run:
ALTER DATABASE YourDB SET PARTNER OFF;(or for Availability Groups, remove the database from the AG). Then on the mirror, restore the latest full backup with NORECOVERY, then re-configure mirroring withALTER DATABASE YourDB SET PARTNER = 'TCP://mirror_server:port';(or add the database back to the AG). - Verify the resync. After resuming, run the query from step 1 again. The state should change to SYNCHRONIZED or SYNCHRONIZING. If it stays SUSPENDED, check the error log for details.
- Monitor the session. Use
SELECT * FROM sys.dm_db_mirroring_connections;to see connection status. Also check the SQL Server error log on both servers for messages like "Database mirroring is active with database 'YourDB' as the principal copy."
Common Mistakes
- Running RESUME on the wrong server. You must run RESUME on the principal. If you run it on the mirror, you get an error. Always confirm the role first.
- Ignoring the root cause. If the network is unstable, resuming may work temporarily but the error will return. Fix the underlying connectivity issue first.
- Forgetting to restore with NORECOVERY. When re-establishing mirroring, the mirror database must be in the restoring state. If you restore with RECOVERY, mirroring cannot start.
- Using the wrong port. The endpoint port in the SET PARTNER command must match the mirror server's endpoint. Check with
SELECT * FROM sys.tcp_endpoints;on both servers.
Tips
- Always back up the database before making changes, especially before removing mirroring.
- Test the network latency and connectivity between the two servers using
pingandtnsping(if using SQL Server with Oracle, but for SQL Server just ping). - Use a dedicated network for mirroring to avoid congestion.
- Set the mirroring timeout to a reasonable value (e.g., 10 seconds) using
ALTER DATABASE YourDB SET PARTNER TIMEOUT 10;to detect failures faster. - Consider using Always On Availability Groups instead of database mirroring for better automatic failover and resync capabilities.
Troubleshooting
If the error persists after following the steps:
- Check the SQL Server error log. Look for messages around the time of the error. Common issues include: "The remote mirroring partner is not available" or "Database mirroring connection error 4 'An error occurred while receiving data: 10054'." These indicate network problems.
- Verify the endpoint is running. On both servers, run:
SELECT state_desc FROM sys.tcp_endpoints WHERE type = 4;(type 4 is for database mirroring). If the state is not STARTED, run:ALTER ENDPOINT [Mirroring] STATE = STARTED;(replace with your endpoint name). - Check firewall rules. Ensure the port used by the mirroring endpoint (default 5022) is open on both servers. Test with
telnet server_ip 5022. - Ensure the service accounts have permissions. The SQL Server service accounts must have CONNECT permission on the endpoint. Grant with:
GRANT CONNECT ON ENDPOINT::[Mirroring] TO [DOMAIN\SQLServiceAccount]; - If you removed mirroring and re-adding it fails, check that the backup and restore are from the same point in time. The mirror database must be restored from a full backup taken after the last failed resync, and then apply all subsequent log backups.
Frequently Asked Questions
What exactly does "resync functionality is temporarily disabled" mean?
It means the mirroring session has been suspended due to an error, and SQL Server will not automatically retry resynchronization until you manually issue a RESUME command.
Can I avoid this error in the future?
Yes, by ensuring a stable network, keeping both servers in sync with regular log backups, and monitoring the mirroring health. Setting a proper timeout helps detect issues early.
Is it safe to run SET RESUME during peak hours?
Yes, it is generally safe because it only re-establishes the session. However, if the databases are far behind, the resync process may generate heavy log traffic, so you might want to do it during low activity.
What if I don't have sysadmin rights?
You need at least ALTER permission on the database. If you don't have it, contact your DBA. Without these permissions, you cannot fix the error.
Does this error affect the principal database's availability?
No, the principal database remains online and fully functional. The error only affects the mirroring copy, which may be out of sync until you resume.
Can I use this guide for Always On Availability Groups?
Yes, the concept is similar. For AGs, you would use ALTER DATABASE YourDB SET HADR RESUME; instead of SET RESUME. The rest of the steps are analogous.