Sql-Server

SQL Server 安裝 - 未在 ConfigurationFile.ini 中指定的目錄中創建 TempDB

  • September 20, 2019

我正在嘗試在新創建的 EC2 實例上安裝 SQL Server 2016 SP2。我正在使用我之前生成的配置文件。在配置文件中,我指定了要在何處創建 TempDB 文件以及數據庫根數據和日誌目錄。看起來像這樣:

; The number of Database Engine TempDB files. 
SQLTEMPDBFILECOUNT="8"

; Specifies the initial size of a Database Engine TempDB data file in MB. 
SQLTEMPDBFILESIZE="88500"
; Specifies the automatic growth increment of each Database Engine TempDB data file in MB. 
SQLTEMPDBFILEGROWTH="0"

; Specifies the initial size of the Database Engine TempDB log file in MB. 
SQLTEMPDBLOGFILESIZE="88500"
; Specifies the automatic growth increment of the Database Engine TempDB log file in MB. 
SQLTEMPDBLOGFILEGROWTH="0"

; Directories for Database Engine TempDB files. 
SQLTEMPDBDIR="T:\Data"
; Directory for the Database Engine TempDB log files. 
SQLTEMPDBLOGDIR="T:\Log"

; The Database Engine root data directory. 
INSTALLSQLDATADIR="O:\Data"
; Default directory for the Database Engine user database logs. 
SQLUSERDBLOGDIR="O:\Log"

安裝後我收到此錯誤消息:

MODIFY FILE encountered operating system error 112(There is not enough space on the disk.) while attempting to expand the physical file 'O:\Data\MSSQL13.BI\MSSQL\DATA\templog.ldf'.

安裝的日誌輸出具有在配置文件中為 TempDB 和使用者數據/日誌目錄指定的相同目錄路徑。

對於我的生活,我無法理解為什麼在錯誤消息中指定的文件路徑中創建 TempDB 文件。

我不能具體說明原因,但是當減小 TempDB 文件的初始大小時,它們是在 ConfigurationTile.ini 中指定的目錄中創建的。

我將 ConfigurationFile 更新為以下內容:

; The number of Database Engine TempDB files. 
SQLTEMPDBFILECOUNT="8"

; Specifies the initial size of a Database Engine TempDB data file in MB. 
SQLTEMPDBFILESIZE="256"
; Specifies the automatic growth increment of each Database Engine TempDB data file in MB. 
SQLTEMPDBFILEGROWTH="0"

; Specifies the initial size of the Database Engine TempDB log file in MB. 
SQLTEMPDBLOGFILESIZE="256"
; Specifies the automatic growth increment of the Database Engine TempDB log file in MB. 
SQLTEMPDBLOGFILEGROWTH="0"

; Directories for Database Engine TempDB files. 
SQLTEMPDBDIR="T:\Data"
; Directory for the Database Engine TempDB log files. 
SQLTEMPDBLOGDIR="T:\Log"

; The Database Engine root data directory. 
INSTALLSQLDATADIR="O:\Data"
; Default directory for the Database Engine user database logs. 
SQLUSERDBLOGDIR="O:\Log"

作為附加的設置步驟,我將執行一個腳本來重新調整 tempdb 文件的大小。

引用自:https://dba.stackexchange.com/questions/249298