Database Engine 組態 - 資料目錄Database Engine Configuration - Data Directories

請使用此頁面來指定 [SQL Server]SQL ServerDatabase EngineDatabase Engine程式和資料檔案的安裝位置。Use this page to specify the installation location for [SQL Server]SQL ServerDatabase EngineDatabase Engine program and data files. 根據安裝類型,支援的儲存體可能包括本機磁碟、共用儲存體或 SMB 檔案伺服器。Based on the type of installation, the supported storage may include local disk, shared storage, or an SMB file server.

若要將 SMB 檔案共用指定為目錄,您必須手動輸入支援的 UNC 路徑。To specify an SMB file share as a directory, you must manually type the supported UNC path. 不支援瀏覽 SMB 檔案共用。Browsing to an SMB file share is not supported. 以下是 SMB 檔案共用支援的 UNC 路徑格式: \\Servername\ShareName\....The following is a supported UNC path format of an SMB file share: \\Servername\ShareName\....

[SQL Server]SQL Server 的獨立執行個體Stand-Alone Instance of [SQL Server]SQL Server

下表列出 [SQL Server]SQL Server 獨立執行個體支援的儲存類型,以及使用者可以在 [SQL Server]SQL Server 安裝期間設定的預設目錄。The following table lists the supported storage types and the default directories for a stand-alone instance of [SQL Server]SQL Server that are user configurable during [SQL Server]SQL Server Setup.

UIElement 清單UIElement List

描述Description 支援的儲存類型Supported Storage Type 預設目錄Default directory 建議Recommendations
資料根目錄Data root directory 本機磁碟、 SMB 檔案伺服器、 共用儲存體1Local Disk, SMB File Server, Shared Storage 1 C:\Program Files\ MicrosoftMicrosoft [SQL Server]SQL Server | [SQL Server]SQL Server安裝程式會設定 Acl[SQL Server]SQL Server目錄和組態的一部分的中斷繼承。C:\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server|[SQL Server]SQL Server Setup will configure ACLs for [SQL Server]SQL Server directories and break inheritance as part of configuration.
使用者資料庫目錄User database directory 本機磁碟、 SMB 檔案伺服器、 共用儲存體1Local Disk, SMB File Server, Shared Storage 1 C:\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\mssql12.\。<執行個體識別碼 > \MSSQL\DataC:\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\MSSQL12.<InstanceID>\MSSQL\Data 使用者資料目錄的最佳作法取決於工作負載和效能需求。Best practices for user data directories depend on workload and performance requirements.
使用者資料庫記錄檔目錄User database log directory 本機磁碟、 SMB 檔案伺服器、 共用儲存體1Local Disk, SMB File Server, Shared Storage 1 C:\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\mssql12.\。<執行個體識別碼 > \MSSQL\DataC:\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\MSSQL12.<InstanceID>\MSSQL\Data 請確定記錄檔目錄具有足夠的空間。Ensure that the log directory has adequate space.
暫存資料庫目錄Temp DB directory 本機磁碟、 SMB 檔案伺服器、 共用儲存體1Local Disk, SMB File Server, Shared Storage 1 C:\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\mssql12.\。<執行個體識別碼 > \MSSQL\DataC:\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\MSSQL12.<InstanceID>\MSSQL\Data 暫存目錄的最佳作法取決於工作負載和效能需求。Best practices for the Temp directory depend on workload and performance requirements.
暫存資料庫記錄檔目錄Temp DB log directory 本機磁碟、 SMB 檔案伺服器、 共用儲存體1Local Disk, SMB File Server, Shared Storage 1 C:\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\mssql12.\。<執行個體識別碼 > \MSSQL\DataC:\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\MSSQL12.<InstanceID>\MSSQL\Data 請確定記錄檔目錄具有足夠的空間。Ensure that the log directory has adequate space.
備份目錄Backup directory 本機磁碟、 SMB 檔案伺服器、 共用儲存體1Local Disk, SMB File Server, Shared Storage 1 C:\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\mssql12.\。<執行個體識別碼 > \MSSQL\BackupC:\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\MSSQL12.<InstanceID>\MSSQL\Backup 請設定適當的權限來防止資料遺失,並且確定 [SQL Server]SQL Server 服務的使用者帳戶具有足夠的權限,可寫入備份目錄。Set appropriate permissions to prevent data loss, and ensure that the user account for the [SQL Server]SQL Server service has adequate permissions to write to the backup directory. 不支援針對備份目錄使用對應的磁碟機。Using a mapped drive for backup directories is not supported.

1儘管支援共用的磁碟,它不是獨立執行個體的建議的作法[SQL Server]SQL Server1 Although shared disks are supported, it is not a recommended practice for a stand-alone instance of [SQL Server]SQL Server.

[SQL Server]SQL Server 容錯移轉叢集執行個體Failover Cluster Instance of [SQL Server]SQL Server

下表列出 [SQL Server]SQL Server 容錯移轉叢集執行個體支援的儲存類型,以及使用者可以在 [SQL Server]SQL Server 安裝期間設定的預設目錄。The following table lists the supported storage types and the default directories for a failover cluster instance of [SQL Server]SQL Server that are user configurable during [SQL Server]SQL Server Setup.

描述Description 支援的儲存類型Supported Storage Type 預設目錄Default Directory 建議Recommendations
資料根目錄Data root Directory 共用儲存體、SMB 檔案伺服器Shared Storage, SMB File Server <磁碟機:>\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server<Drive:>\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\

提示:如果在 [叢集磁碟選取] 頁面上選取共用磁碟,預設為第一個共用磁碟。Tip: If shared disk was selected on the Cluster Disk Selection page, the default is the first shared disk. 如果在 [叢集磁碟選取] 頁面上沒有進行任何選擇,此欄位預設為空白。This field defaults to blank if no selection was made on the Cluster Disk Selection page.
進行組態設定時,[SQL Server]SQL Server 安裝程式將會設定 [SQL Server]SQL Server 目錄的 ACL 並中斷繼承。[SQL Server]SQL Server Setup will configure ACLs for [SQL Server]SQL Server directories and break inheritance as part of configuration.
使用者資料庫目錄User database directory 共用儲存體、SMB 檔案伺服器Shared Storage, SMB File Server <磁碟機: > 程式檔案\MicrosoftMicrosoft[SQL Server]SQL Server\mssql12.\。<執行個體識別碼 > \MSSQL\Data<Drive:>Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\MSSQL12.<InstanceID>\MSSQL\Data

提示:如果在 [叢集磁碟選取] 頁面上選取共用磁碟,預設為第一個共用磁碟。Tip: If shared disk was selected on the Cluster Disk Selection page, the default is the first shared disk. 如果在 [叢集磁碟選取] 頁面上沒有進行任何選擇,此欄位預設為空白。This field defaults to blank if no selection was made on the Cluster Disk Selection page.
使用者資料目錄的最佳作法取決於工作負載和效能需求。Best practices for user data directories depend on workload and performance requirements.
使用者資料庫記錄檔目錄User database log directory 共用儲存體、SMB 檔案伺服器Shared Storage, SMB File Server <磁碟機: > \Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\mssql12.\。<執行個體識別碼 > \MSSQL\Data<Drive:>\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\MSSQL12.<InstanceID>\MSSQL\Data

提示:如果在 [叢集磁碟選取] 頁面上選取共用磁碟,預設為第一個共用磁碟。Tip: If shared disk was selected on the Cluster Disk Selection page, the default is the first shared disk. 如果在 [叢集磁碟選取] 頁面上沒有進行任何選擇,此欄位預設為空白。This field defaults to blank if no selection was made on the Cluster Disk Selection page.
請確定記錄檔目錄具有足夠的空間。Ensure that the log directory has adequate space.
暫存資料庫目錄Temp DB directory 本機磁碟、共用儲存體、SMB 檔案伺服器Local Disk, Shared Storage, SMB File Server <磁碟機: > \Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\mssql12.\。<執行個體識別碼 > \MSSQL\Data<Drive:>\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\MSSQL12.<InstanceID>\MSSQL\Data

提示:如果在 [叢集磁碟選取] 頁面上選取共用磁碟,預設為第一個共用磁碟。Tip: If shared disk was selected on the Cluster Disk Selection page, the default is the first shared disk. 如果在 [叢集磁碟選取] 頁面上沒有進行任何選擇,此欄位預設為空白。This field defaults to blank if no selection was made on the Cluster Disk Selection page.
請確定指定的目錄對所有叢集節點都有效。Ensure that the specified directory is valid for all the cluster nodes. 在容錯移轉期間,如果容錯移轉目標節點上的 tempdb 目錄無法使用,則 [SQL Server]SQL Server 資源將無法上線。During failover, if the tempdb directories are not available on the failover target node, the [SQL Server]SQL Server resource will fail to come online.
暫存資料庫記錄檔目錄Temp DB log directory 本機磁碟、共用儲存體、SMB 檔案伺服器Local Disk, Shared Storage, SMB File Server <磁碟機: > \Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\mssql12.\。<執行個體識別碼 > \MSSQL\Data<Drive:>\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\MSSQL12.<InstanceID>\MSSQL\Data

提示:如果在 [叢集磁碟選取] 頁面上選取共用磁碟,預設為第一個共用磁碟。Tip: If shared disk was selected on the Cluster Disk Selection page, the default is the first shared disk. 如果在 [叢集磁碟選取] 頁面上沒有進行任何選擇,此欄位預設為空白。This field defaults to blank if no selection was made on the Cluster Disk Selection page.
請確定指定的目錄對所有叢集節點都有效。Ensure that the specified directory is valid for all the cluster nodes. 在容錯移轉期間,如果容錯移轉目標節點上的 tempdb 目錄無法使用,則 [SQL Server]SQL Server 資源將無法上線。During failover, if the tempdb directories are not available on the failover target node, the [SQL Server]SQL Server resource will fail to come online.
備份目錄Backup directory 本機磁碟、共用儲存體、SMB 檔案伺服器Local Disk, Shared Storage, SMB File Server <磁碟機: > \Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\mssql12.\。<執行個體識別碼 > \MSSQL\Backup<Drive:>\Program Files\MicrosoftMicrosoft[SQL Server]SQL Server\MSSQL12.<InstanceID>\MSSQL\Backup

提示:如果在 [叢集磁碟選取] 頁面上選取共用磁碟,預設為第一個共用磁碟。Tip: If shared disk was selected on the Cluster Disk Selection page, the default is the first shared disk. 如果在 [叢集磁碟選取] 頁面上沒有進行任何選擇,此欄位預設為空白。This field defaults to blank if no selection was made on the Cluster Disk Selection page.
請設定適當的權限來防止資料遺失,並且確定 SQL Server 服務的使用者帳戶具有足夠的權限,可寫入備份目錄。Set appropriate permissions to prevent data loss, and ensure that the user account for the SQL Server service has adequate permissions to write to the backup directory. 不支援針對備份目錄使用對應的磁碟機。Using a mapped drive for backup directories is not supported.

安全性考量Security Considerations

進行組態設定時,安裝程式將會設定 [SQL Server]SQL Server 目錄的 ACL 並中斷繼承。Setup will configure ACLs for [SQL Server]SQL Server directories and break inheritance as part of configuration.

以下建議適用於 SMB 檔案伺服器:The following recommendations apply to the SMB file server:

  • 如果使用 SMB 檔案伺服器, [SQL Server]SQL Server 服務帳戶必須是網域帳戶。The [SQL Server]SQL Server service account must be a domain account if an SMB file server is used.

  • 用於安裝 [SQL Server]SQL Server 的帳戶應該擁有當做資料目錄之 SMB 檔案共用資料夾的 FULL CONTROL NTFS 權限。The account used to install [SQL Server]SQL Server should have FULL CONTROL NTFS permissions on the SMB file share folder used as the data directory.

  • 用於安裝 [SQL Server]SQL Server 的帳戶應該具有 SMB 檔案伺服器的 SeSecurityPrivilege 權限。The account used to install [SQL Server]SQL Server should be granted SeSecurityPrivilege privileges on the SMB file server. 若要授與此權限,請使用檔案伺服器上的 [本機安全性原則] 主控台,將 [SQL Server]SQL Server 安裝程式帳戶新增至 [管理稽核和安全性記錄檔] 原則中。To grant this privilege, use the Local Security Policy console on the file server to add the [SQL Server]SQL Server setup account to the Manage auditing and security log policy. [本機安全性原則] 主控台中 [本機原則] 下的 [使用者權限指派] 區段可以找到此設定。This setting is available in the User Rights Assignments section under Local Policies in the Local Security Policy console.

注意Notes

  • 將功能加入現有的安裝時,您不能變更先前安裝之功能的位置,也不能指定新功能的位置。When adding features to an existing installation, you cannot change the location of a previously installed feature, nor can you specify the location for a new feature.

  • 如果您要指定非預設的安裝目錄,請確定安裝資料夾對於此 [SQL Server]SQL Server執行個體是唯一的。If you specify non-default installation directories, ensure that the installation folders are unique to this instance of [SQL Server]SQL Server. 此對話方塊上的任何目錄都不應該與其他 [SQL Server]SQL Server 執行個體中的目錄共用。None of the directories in this dialog box should be shared with directories from other instances of [SQL Server]SQL Server. Database EngineDatabase Engine 執行個體內的 Analysis ServicesAnalysis Services[SQL Server]SQL Server 元件也應該安裝在不同的目錄中。The Database EngineDatabase Engine and Analysis ServicesAnalysis Services components within an instance of [SQL Server]SQL Server should also be installed to separate directories.

  • 程式檔和資料檔案無法安裝在下列位置中:Program files and data files cannot be installed in the following situations:

    • 抽取式磁碟機On a removable disk drive

    • 使用壓縮的檔案系統On a file system that uses compression

    • 系統檔案所在的目錄To a directory where system files are located

    • 容錯移轉叢集執行個體上的對應網路磁碟機On a mapped network drive on a failover cluster instance

另請參閱See Also

SQL Server 的預設和具名執行個體的檔案位置 File Locations for Default and Named Instances of SQL Server
檔案伺服器的共用及 NTSF 權限Share and NTFS Permissions on a File Server