// SQL Server 錯誤參考

SQL Server 錯誤 1105:檔案群組已滿,無法配置

檔案群組中的資料檔已達大小上限,或磁碟已滿,SQL Server 無法為資料表或索引配置空間。

錯誤號碼
1105
嚴重性
17
類別
記憶體、記錄與儲存
錯誤訊息
Could not allocate space for object '%.*ls'%.*ls in database '%.*ls' because the '%.*ls' filegroup is full due to lack of storage space or database files reaching the maximum allowed size. Note that UNLIMITED files are still limited to 16TB. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

它的意義

資料表和索引存放在由一個或多個資料檔案組成的檔案群組中。當檔案群組中的檔案都沒有可用空間,也因為自動成長已關閉而無法成長時,一個 MAXSIZE 當達到上限或磁碟已滿時,插入與索引建立會失敗並出現 1105。錯誤 1101 是配置新頁面時的相同情況。在 SQL Server Express 中,10 GB 的資料庫大小上限也會造成同樣問題。

常見原因

  • 自動成長已停用,或 MAXSIZE 已在資料檔案上設定。
  • 儲存資料檔案的磁碟或磁碟區已滿。
  • SQL Server Express 已達到每個資料庫 10 GB 的限制。
  • 索引重建或大量載入暫時需要大得多的空間。

如何修正

  1. 檢查檔案大小、限制和增長設定。

    SELECT name, physical_name, size / 128 AS size_mb,
           CASE max_size WHEN -1 THEN NULL ELSE max_size / 128 END AS max_mb,
           growth, is_percent_growth
    FROM sys.database_files;
  2. 允許檔案增長,或提高其限制。

    ALTER DATABASE SalesDb MODIFY FILE (NAME = SalesDb_data, MAXSIZE = UNLIMITED, FILEGROWTH = 1GB);
  3. 如果磁碟已滿,在另一個磁碟區上新增檔案。

    ALTER DATABASE SalesDb ADD FILE (NAME = SalesDb_data2, FILENAME = N'E:\Data\SalesDb_data2.ndf', SIZE = 10GB, FILEGROWTH = 1GB) TO FILEGROUP [PRIMARY];
  4. 透過封存或清除舊資料騰出空間,然後重建碎片化的索引。

相關錯誤

更多記憶體、記錄和儲存錯誤

程式碼和訊息文字來自 Microsoft 資料庫引擎事件和錯誤參考。瀏覽完整的 SQL Server 錯誤清單 或 搜尋每個資料庫錯誤.

// 錯誤更少,修復更快

在 SQLly 裡操作 SQL Server

適用於 macOS、Windows 和 Linux 的原生 SQL 客戶端,具備結構描述感知的 IntelliSense、高風險陳述式防護與清楚的錯誤訊息,適用於 SQL Server 和你使用的其他資料庫。