使用組態檔安裝 SQL Server 2014Install SQL Server 2014 Using a Configuration File

[SQL Server]SQL Server 安裝程式可供您根據系統預設值與執行階段輸入,產生組態檔。Setup provides the ability to generate a configuration file based upon the system default and run-time inputs. 您可以使用相同的設定,於整個企業中利用組態檔部署 [SQL Server]SQL ServerYou can use the configuration file to deploy [SQL Server]SQL Server throughout the enterprise with the same configuration. 您也可以透過建立啟動 Setup.exe 的批次檔,在企業中將手動安裝標準化。You can also standardize manual installations throughout the enterprise, by creating a batch file that launches Setup.exe.

安裝程式僅支援透過命令提示字元使用組態檔。Setup supports the use of the configuration file only through the command prompt. 使用組態檔時,參數的處理順序如下所述:The processing order of the parameters while using the configuration file is outlined below:

  • 組態檔會覆寫封裝中的預設值The configuration file overwrites the defaults in a package

  • 命令列的值會覆寫組態檔中的值Command-line values overwrite the values in the configuration file

組態檔可用來追蹤每個安裝的參數和值。The configuration file can be used to track the parameters and values for each installation. 這點會讓組態檔適用於驗證和稽核安裝。This makes the configuration file useful for verifying and auditing the installations.

組態檔結構Configuration File Structure

ConfigurationFile.ini 檔案是包含參數 (名稱/值組) 和描述性註解的文字檔。The ConfigurationFile.ini file is a text file with parameters (name/value pair) and descriptive comments.

下面是 ConfigurationFile.ini 檔案的範例:The following is an example of a ConfigurationFile.ini file:

; Microsoft SQL Server Configuration file  
[OPTIONS]  
; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE.   
; This is a required parameter.   
ACTION="Install"  
; Specifies features to install, uninstall, or upgrade.   
; The list of top-level features include SQL, AS, RS, IS, and Tools.   
; The SQL feature will install the database engine, replication, and full-text.   
; The Tools feature will install Management Tools, Books online,   
; SQL Server Data Tools, and other shared components.   
FEATURES=SQL,Tools  

如何產生組態檔How to generate a configuration file

  1. 插入 [SQL Server]SQL Server 安裝媒體。Insert the [SQL Server]SQL Server installation media. 在根資料夾中,按兩下 Setup.exe。From the root folder, double-click Setup.exe. 若要從網路共用進行安裝,請找出共用上的根資料夾,然後按兩下 Setup.exe。To install from a network share, locate the root folder on the share, and then double-click Setup.exe.

    注意

    [SQL Server]SQL Server Express Edition 安裝程式不會自動建立設定檔。Express Edition setup does not create a configuration file automatically. 下列命令將會啟動安裝程式並建立設定檔。The following command will start setup and create a configuration file.

    SETUP.exe /UIMODE=Normal /ACTION=INSTALLSETUP.exe /UIMODE=Normal /ACTION=INSTALL

  2. 遵循精靈的指示,直到 [準備安裝] 頁面。Follow the wizard through to the Ready to Install page. 組態檔的路徑已指定於 [準備安裝] 頁面的 [組態檔路徑] 區段中。The path to the configuration file is specified in the Ready to Install page in the configuration file path section. 如需有關如何安裝[SQL Server]SQL Server,請參閱 < 從安裝精靈安裝 SQL Server 2014(安裝)For more information about how to install [SQL Server]SQL Server, see Install SQL Server 2014 from the Installation Wizard (Setup).

  3. 取消安裝程式而不實際完成安裝,即可產生 INI 檔案。Cancel the setup without actually completing the installation, to generate the INI file.

    注意

    安裝程式基礎結構會針對已執行的動作寫出所有適當的參數,但密碼等機密資訊除外。The setup infrastructure writes out all the appropriate parameters for the actions that were run, with the exception of sensitive information such as passwords. /IAcceptSQLServerLicenseTerms 參數也不會寫出至組態檔,而且需要修改組態檔或在命令提示字元中提供某個值。The /IAcceptSQLServerLicenseTerms parameter is also not written out to the configuration file and requires either a modification of the configuration file or a value to be supplied at the command prompt. 如需詳細資訊,請參閱從命令提示字元安裝 SQL Server 2014For more information, see Install SQL Server 2014 from the Command Prompt. 此外,若為通常不會透過命令提示字元提供值的布林值參數,系統就會包含一個值。In addition, a value is included for Boolean parameters where a value is usually not supplied through the command prompt.

使用組態檔安裝 [SQL Server]SQL ServerUsing the Configuration File to Install [SQL Server]SQL Server

您只能針對命令列安裝使用組態檔。You can only use the configuration file on command-line installations.

注意

如果您需要對組態檔進行變更,我們建議您製作副本並使用此副本進行變更。If you need to make changes to the configuration file, we recommend that you make a copy and work with the copy.

如何使用組態檔安裝獨立式 [SQL Server]SQL Server 執行個體。How to use a configuration file to install a stand-alone [SQL Server]SQL Server instance

  • 透過命令提示字元執行安裝,並且使用 ConfigurationFile 參數來提供 ConfigurationFile.ini。Run the installation through the command prompt and supply the ConfigurationFile.ini using the ConfigurationFile parameter.

如何使用組態檔準備及完成獨立式 [SQL Server]SQL Server 執行個體 (SysPrep) 的映像How to use a configuration file to prepare and complete an image of a stand-alone [SQL Server]SQL Server instance (SysPrep)

  1. 若要在同一部電腦上準備一個或多個 [SQL Server]SQL Server 執行個體並進行設定。To prepare one or more instances of [SQL Server]SQL Server and configure them on the same machine.

    • 從安裝中心的 [進階] 頁面執行 [準備 [SQL Server]SQL Server 獨立執行個體的映像] ,並擷取備妥的映像組態檔。Run Image preparation of a stand-alone instance of [SQL Server]SQL Server from the Advanced page of the Installation Center and capture the prepare image configuration file.

    • 使用相同的準備映像組態檔當做範本,以便準備其他 [SQL Server]SQL Server 執行個體。Use the same prepare image configuration file as a template to prepare more instances of [SQL Server]SQL Server.

    • 從 [安裝中心] 的 [進階] 頁面執行 [完成備妥的 [SQL Server]SQL Server 獨立執行個體的映像] ,在電腦上設定備妥的執行個體。Run Image completion of a prepared stand-alone instance of [SQL Server]SQL Server from the Advanced page of the Installation Center to configure a prepared instances on the machine.

  2. 若要使用 Windows SysPrep 工具來準備作業系統的映像,包括未設定的已備妥 [SQL Server]SQL Server 執行個體。To prepare an image of the operating system including an unconfigured prepared instance of [SQL Server]SQL Server, using Windows SysPrep tool.

    • 從 [安裝中心] 的 [進階] 頁面執行 [準備 [SQL Server]SQL Server 獨立執行個體的映像] ,並擷取備妥的映像組態檔。Run the Image preparation of a stand-alone instance of [SQL Server]SQL Server from the Advanced page of the Installation Center and capture the prepare image configuration file.

    • 從 [安裝中心] 的 [進階] 頁面執行 [完成備妥的 [SQL Server]SQL Server 獨立執行個體的映像] ,但在擷取完成的組態檔之後,在 [準備開始完成] 頁面上取消它。Run the Image completion of a prepared stand-alone instance of [SQL Server]SQL Server from the Advanced page of the Installation Center, but cancel it on the Ready to Complete page after capturing the complete configuration file.

    • 完成映像組態檔可以與 Windows 映像儲存在一起,以便自動化已備妥執行個體的組態設定作業。The complete image configuration file can be stored with the Windows image for automating the configuration of the prepared instances.

如何使用組態檔安裝 [SQL Server]SQL Server 容錯移轉叢集How to install a [SQL Server]SQL Server failover cluster using the configuration file

  1. 整合式安裝選項 (在節點上建立單一節點容錯移轉叢集並且在其他節點上執行 AddNode):Integrated Install option (create a single node failover cluster on a node and for additional nodes, run AddNode on them):

    • 執行「安裝容錯移轉叢集」選項並且擷取列出所有安裝設定的組態檔。Run the "Install a Failover Cluster" option and capture the configuration file that lists all the installation settings.

    • 透過提供 ConfigurationFile 參數,執行命令列容錯移轉叢集安裝。Run the command-line failover cluster install by supplying the ConfigurationFile parameter.

    • 在要加入的其他節點上,執行 AddNode 來擷取適用於現有容錯移轉叢集的 ConfigurationFile.ini 檔案。On an additional node to be added, run AddNode to capture the ConfigurationFile.ini file applicable to the existing failover cluster.

    • 透過使用 ConfigurationFile 參數來提供相同的組態檔,在即將聯結容錯移轉叢集的所有其他節點上執行命令列 AddNode。Run the command-line AddNode on all the additional nodes that will join the failover cluster, by supplying the same configuration file using the ConfigurationFile parameter.

  2. 進階安裝選項 (在所有容錯移轉叢集節點上準備容錯移轉叢集。然後,準備所有節點之後,在擁有共用磁碟的節點上執行「完成」):Advanced install option (prepare failover cluster on all failover cluster nodes, then, after preparing all the nodes, run complete on the node that owns the shared disk):

    • 在其中一個節點上執行 [準備] ,然後擷取 ConfigurationFile.ini 檔案。Run Prepare on one of the nodes, and capture the ConfigurationFile.ini file.

    • 在即將針對容錯移轉叢集準備的所有節點上,提供相同的 ConfigurationFile.ini 檔案給安裝程式。Supply the same ConfigurationFile.ini file to Setup on all the nodes that will be prepared for the failover cluster.

    • 備妥所有節點之後,請在擁有共用磁碟的節點上執行「完成容錯移轉叢集」作業,並且擷取 ConfigurationFile.ini 檔案。After all the nodes have been prepared, run a complete failover cluster operation on the node that owns the shared disk and capture the ConfigurationFile.ini file.

    • 然後,您就可以提供這個 ConfigurationFile.ini 檔案來完成容錯移轉叢集。You can then supply this ConfigurationFile.ini file to complete the failover cluster.

如何使用組態檔為 [SQL Server]SQL Server 容錯移轉叢集加入或移除一個節點How to add or remove a node to a [SQL Server]SQL Server failover cluster using the configuration file

  • 如果您擁有先前用來在容錯移轉叢集中加入節點或移除節點的組態檔,就可以重複使用相同的檔案來加入或移除其他節點。If you have a configuration file that was previously used to add a node to or remove a node from a failover cluster, you can reuse that same file to add or remove additional nodes.

如何使用組態檔升級 [SQL Server]SQL Server 容錯移轉叢集How to upgrade a [SQL Server]SQL Server failover cluster using the configuration file

  1. 在被動節點上執行「升級」,然後擷取 ConfigurationFile.ini 檔案。Run upgrade on the passive node and capture the ConfigurationFile.ini file. 您可以透過執行實際升級或在結束時退出而不進行實際升級,完成此作業。You can do this either by performing the actual upgrade, or exiting at the end without doing the actual upgrade.

  2. 在要升級的所有其他節點上,提供 ConfigurationFile.ini 檔案來完成此程序。On all the additional nodes to be upgraded, supply the ConfigurationFile.ini file to complete the process.

範例語法Sample Syntax

下面是有關如何使用組態檔的部分範例:Following are some examples on how to use the configuration file:

  • 若要在命令提示字元中指定組態檔:To specify the configuration file at the command prompt:
Setup.exe /ConfigurationFile=MyConfigurationFile.INI  
  • 若要在命令提示字元而非組態檔中指定密碼:To specify passwords at the command prompt instead of in the configuration file:
Setup.exe /SQLSVCPASSWORD="************" /AGTSVCPASSWORD="************" /ASSVCPASSWORD="************" /ISSVCPASSWORD="************" /RSSVCPASSWORD="************" /ConfigurationFile=MyConfigurationFile.INI  

另請參閱See Also

從命令提示字元安裝 SQL Server 2014 Install SQL Server 2014 from the Command Prompt
SQL Server 容錯移轉叢集安裝 SQL Server Failover Cluster Installation
升級 SQL Server 容錯移轉叢集Upgrade a SQL Server Failover Cluster