How to fix Error 679 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 679 – Filegroup Offline

Why This Error Happens

This error occurs when SQL Server 2025 attempts to access a partitioned index or table whose underlying filegroup has been marked OFFLINE, often due to a missing, corrupted, or inaccessible data file (.ndf/.mdf). It commonly happens after an unexpected storage disconnect, a failed autogrow operation on Windows Server 2025 storage volumes, or when a database was restored without all associated filegroup files present. Until the filegroup is brought back ONLINE and its files are verified as accessible, any partition mapped to that filegroup will remain unreadable.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Filegroup and File Path

  • Run the following query to confirm the filegroup status:
SELECT name, type_desc, state_desc FROM sys.database_files;
  • Cross-reference the filegroup name from the error message with sys.filegroups to confirm which physical file is impacted.
  • Check the file path (commonly under C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\) to see if the .ndf file still exists.

Step 2: Verify Storage and File Permissions

  • Open File Explorer or PowerShell on Windows Server 2025 and confirm the drive/volume hosting the .ndf file is mounted and online:
Get-Disk | Where-Object {$_.OperationalStatus -ne 'Online'}
  • Ensure the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Read/Write permissions on the folder containing the data file.
  • If the disk was disconnected (common in VM or SAN-based Windows Server 2025 deployments), reattach it via Disk Management and bring it online.

Step 3: Bring the Filegroup Back Online

  • If the file exists and permissions are correct, attempt to bring the filegroup online manually:
ALTER DATABASE [YourDatabaseName] 
MODIFY FILEGROUP [YourFilegroupName] ONLINE;
  • If the file is missing or corrupted, restore it from the most recent full or differential backup using RESTORE DATABASE ... WITH FILE targeting only the affected filegroup.

Step 4: Restart SQL Server Service (If Needed)

  • If the filegroup still shows OFFLINE after remediation, restart the SQL Server service via SQL Server Configuration Manager.
  • This forces SQL Server to re-read the file metadata and re-attempt mounting all filegroups at startup.

Alternative or Verification Steps

  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to confirm no further corruption exists on the affected filegroup.
  • If the file is permanently lost and no backup is available, consider recreating the filegroup and re-populating the partitioned data from an alternate replicated source (e.g., Always On secondary).