檢視或變更資料及記錄檔的預設位置View or Change the Default Locations for Data and Log Files

適用於: 是SQL Server 否Azure SQL Database 否Azure SQL 資料倉儲 否平行處理資料倉儲 APPLIES TO: yesSQL Server noAzure SQL Database noAzure SQL Data Warehouse noParallel Data Warehouse

保護資料檔和記錄檔的最佳作法是確定它們受到存取控制清單 (ACL) 所保護。The best practice for protecting your data files and log files is to ensure that they are protected by access control lists (ACLs). 在建立這些檔案的根目錄下設定 ACL。Set the ACLs on the directory root under which the files are created.

檢視或變更資料庫檔案的預設位置View or change the default locations for database files

  1. 在物件總管中,以滑鼠右鍵按一下伺服器,然後按一下 [屬性] 。In Object Explorer, right-click on your server and click Properties.

  2. 在該 [屬性] 頁面的左面板中,按一下 [資料庫設定] 索引標籤。In the left panel on that Properties page, click the Database settings tab.

  3. [資料庫預設位置] 中,您可以檢視新資料檔和新記錄檔的目前預設位置。In Database default locations, view the current default locations for new data files and new log files. 若要變更預設位置,在 [資料][記錄] 欄位中輸入新的預設路徑名稱,或按一下 [瀏覽] 按鈕來尋找並選取路徑名稱。To change a default location, enter a new default pathname in the Data or Log field, or click the browse button to find and select a pathname.

注意: 變更預設位置之後,您必須停止並啟動 SQL Server 服務,才能完成變更。NOTE: After changing the default locations, you must stop and start the SQL Server service to complete the change.

另請參閱See also

CREATE DATABASE (SQL Server Transact-SQL) CREATE DATABASE (SQL Server Transact-SQL)
建立資料庫Create a Database