Configuration

無人值守安裝 MS SQL Server (2008|2012) EXPRESS?

  • December 20, 2015

我的目標是安裝 MS SQL Server 2012 R2 Express。

我已經下載SQLEXPRADV_x64_ENU.exe並用於/ACTION=Install /UIMODE=Normal生成和修改配置文件。無論我如何擺弄配置,它都會安裝標準版的“預設”或“命名”實例,儘管我沒有指定許可證(忽略此圖像中的紅色箭頭,我選擇另一個選項)。

是什麼賦予了?為了安裝 Express 版本,我需要提供或更改哪個設置?

更新:有人告訴我我可能安裝了錯誤版本的安裝程序。(他們將所有版本命名為相同的名稱。)我目前正在再次下載,不確定它是否不是我已經擁有的(如果我右鍵點擊並選擇“屬性”,它會告訴我這是一個“Microsoft SQL Server 2012 Express 高級版”)。

我知道在哪裡可以下載Microsoft SQL Server 2008 R2 Express,我也知道在哪裡可以下載Microsoft SQL Server 2012 Express,但是 Microsoft SQL Server 2012 R2 Express到底在哪裡?客戶希望在 2008 年或 2012 年(最終甚至是 2014 年)中使用“帶有高級工具的 MS SQL Server R2”。


由於您很可能會問這個問題,因此我在此處包含了我的完整配置文件:

;SQL Server 2012 Configuration File

; DEVELOPER'S NOTE
; This file was obtained from the installer using the switches "/ACTION=Install /UIMODE=Normal" which yields the FULL set of wizard pages AND the ability to save a new configuration file.
; See also: https://technet.microsoft.com/en-us/library/ms144259%28v=sql.110%29.aspx

; Values that need to be changed before use:
;INSTANCENAME="{INSTANCENAME}"
;INSTANCEID="{INSTANCEID}"
;SQLSVCACCOUNT="NT Service\MSSQL${INSTANCENAME}"
;SQLSVCPASSWORD="{SQLSVCPASSWORD}"
;SQLSYSADMINACCOUNTS="{HOSTNAME}\Administrator"
;SAPWD="{SAPWD}"
;RSSVCACCOUNT="NT Service\ReportServer${INSTANCENAME}"
;FTSVCACCOUNT="NT Service\MSSQLFDLauncher${INSTANCENAME}"
;QUIETSIMPLE="True" -- I recommend you pass "/QS" to the installer rather than editing this value

[OPTIONS]
; Required to acknowledge acceptance of the license terms.
IACCEPTSQLSERVERLICENSETERMS="True"
; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter.
ACTION="Install"
; Detailed help for command line argument ROLE has not been defined yet.
;ROLE="AllFeatures_WithDefaults"
; Detailed help for command line argument ENU has not been defined yet.
ENU="True"
; Parameter that controls the user interface behavior. Valid values are Normal for the full UI,AutoAdvance for a simplied UI, and EnableUIOnServerCore for bypassing Server Core setup GUI block.
;UIMODE="Normal"
; Setup will not display any user interface.
;QUIET="False"
; Setup will display progress only, without any user interaction.
QUIETSIMPLE="False"
; Specify whether SQL Server Setup should discover and include product updates. The valid values are True and False or 1 and 0. By default SQL Server Setup will include updates that are found.
UpdateEnabled="False"
; Specifies features to install, uninstall, or upgrade. The list of top-level features include SQL, AS, RS, IS, MDS, and Tools. The SQL feature will install the Database Engine, Replication, Full-Text, and Data Quality Services (DQS) server. The Tools feature will install Management Tools, Books online components, SQL Server Data Tools, and other shared components.
FEATURES=SQL,AS,RS,DQC,IS,MDS,Tools,SNAC_SDK
;FEATURES=SQLENGINE,REPLICATION,FULLTEXT,RS,BIDS,BOL,SSMS,SNAC_SDK
; Specify the location where SQL Server Setup will obtain product updates. The valid values are "MU" to search Microsoft Update, a valid folder path, a relative path such as .\MyUpdates or a UNC share. By default SQL Server Setup will search Microsoft Update or a Windows Update service through the Window Server Update Services.
UpdateSource="MU"
; Displays the command line parameters usage
HELP="False"
; Specifies that the detailed Setup log should be piped to the console.
INDICATEPROGRESS="True"
; Specifies that Setup should install into WOW64. This command line argument is not supported on an IA64 or a 32-bit system.
X86="False"
; Specify the root installation directory for shared components. This directory remains unchanged after shared components are already installed.
INSTALLSHAREDDIR="C:\Program Files\Microsoft SQL Server"
; Specify the root installation directory for the WOW64 shared components. This directory remains unchanged after WOW64 shared components are already installed.
INSTALLSHAREDWOWDIR="C:\Program Files (x86)\Microsoft SQL Server"
; Specify a default or named instance. MSSQLSERVER is the default instance for non-Express editions and SQLExpress for Express editions. This parameter is required when installing the SQL Server Database Engine (SQL), Analysis Services (AS), or Reporting Services (RS).
INSTANCENAME="{INSTANCENAME}"
; Specify the Instance ID for the SQL Server features you have specified. SQL Server directory structure, registry structure, and service names will incorporate the instance ID of the SQL Server instance.
INSTANCEID="{INSTANCEID}"
; Specify that SQL Server feature usage data can be collected and sent to Microsoft. Specify 1 or True to enable and 0 or False to disable this feature.
SQMREPORTING="False"
; RSInputSettings_RSInstallMode_Description
RSINSTALLMODE="DefaultNativeMode"
; Specify if errors can be reported to Microsoft to improve future SQL Server releases. Specify 1 or True to enable and 0 or False to disable this feature.
ERRORREPORTING="False"
; Specify the installation directory.
INSTANCEDIR="C:\Program Files\Microsoft SQL Server"
; Agent account name
AGTSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE"
; Auto-start service after installation.
AGTSVCSTARTUPTYPE="Automatic"
; CM brick TCP communication port
COMMFABRICPORT="0"
; How matrix will use private networks
COMMFABRICNETWORKLEVEL="0"
; How inter brick communication will be protected
COMMFABRICENCRYPTION="0"
; TCP port used by the CM brick
MATRIXCMBRICKCOMMPORT="0"
; Startup type for the SQL Server service.
SQLSVCSTARTUPTYPE="Automatic"
; Level to enable FILESTREAM feature at (0, 1, 2 or 3).
FILESTREAMLEVEL="0"
; Set to "1" to enable RANU for SQL Server Express.
ENABLERANU="True"
; Specifies a Windows collation or an SQL collation to use for the Database Engine.
SQLCOLLATION="SQL_Latin1_General_CP1_CI_AS"
; Account for SQL Server service: Domain\User or system account.
SQLSVCACCOUNT="NT Service\MSSQL${INSTANCENAME}"
SQLSVCPASSWORD="{SQLSVCPASSWORD}"
; Windows account(s) to provision as SQL Server system administrators.
SQLSYSADMINACCOUNTS="{HOSTNAME}\Administrator"
; The default is Windows Authentication. Use "SQL" for Mixed Mode Authentication.
SECURITYMODE="SQL"
SAPWD="{SAPWD}"
; Provision current user as a Database Engine system administrator for SQL Server 2012 Express.
ADDCURRENTUSERASSQLADMIN="True"
; Specify 0 to disable or 1 to enable the TCP/IP protocol.
TCPENABLED="1"
; Specify 0 to disable or 1 to enable the Named Pipes protocol.
NPENABLED="1"
; Startup type for Browser Service.
BROWSERSVCSTARTUPTYPE="Disabled"
; Specifies which account the report server NT service should execute under.
RSSVCACCOUNT="NT Service\ReportServer${INSTANCENAME}"
; Specifies how the startup mode of the report server NT service.
RSSVCSTARTUPTYPE="Automatic"
; Add description of input argument FTSVCACCOUNT
FTSVCACCOUNT="NT Service\MSSQLFDLauncher${INSTANCENAME}"

錯誤的安裝程序?

我認為這將歸結為錯誤的安裝程序。我從您提到的連結下載了 SQL Server 2012 Express Advanced Edition 安裝程序,並且能夠廣泛地遵循您的步驟,但我看到了顯著的差異。

我的產品密鑰螢幕與您的螢幕截圖不同。我的僅在下拉菜單中列出 Express,而不是“評估”-我認為顯示的評估完全表明您有標準(或其他)版安裝程序。我的 sql server 2012 express 上的產品密鑰配置螢幕截圖

驗證安裝程序是不同文件的一種快速方法是比較雜湊。我在這個文件上得到的 sha1 雜湊是 E1F8DEC35422A67E6733E53ED260CCE538E97EDC。FCIV 或 Get-FileHash(PowerShell 4.0?)是 Windows 上的兩個範例。

不過,僅此一項並不能解決問題,因此我繼續進行了完整的無人值守安裝。首先,我像您一樣創建了一個 ConfigurationFile.ini。

無人值守安裝

SQLEXPRADV_x64_ENU.exe /ACTION=Install /UIMode=Normal

我跟隨安裝程序一直到安裝程序的“準備安裝”頁面,該頁面顯示了它創建的 ConfigurationFile.ini 的路徑。就我而言:

C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\<timestamp>\ConfigurationFile.ini

將此文件複製或保存到您想要的位置,並在關閉安裝程序之前複製整個安裝目錄。如果您正在進行無人值守安裝,您將不想每次都猜測和複製目錄名稱。我確實認為無人值守安裝需要提取的安裝目錄 + setup.exe,我沒有運氣嘗試直接使用 /CONFIGURATIONFILE 執行 SQLEXPRADV_x64_ENU.exe。

配置文件似乎沒有保留任何指定的密碼(在我的例子中只是 SAPWD,因為我在我的範例中啟用了混合模式身份驗證),因此之後需要將其添加到文件中或指定為命令行參數.

您需要編輯 ConfigurationFile.ini 以設置 Quiet=“True” 並註釋掉 UIMode=Normal,因為無人值守安裝通常不需要 GUI,如果沒有這個,它只會啟動安裝程序並等待使用者輸入。

;UIMODE="Normal"

; Setup will not display any user interface. 
QUIET="True"

或者,您可以使用 /? 呼叫 SQLEXPRADV_x64_ENU.exe。參數以獲取完整的參數列表,以及底部的無人值守範例,用於在不使用配置文件的情況下進行安裝,而只需手動傳遞所需的選項。它的範例指定了 setup.exe,所以我認為上面的內容需要提取的目錄。它真的很長,所以我沒有回答這個問題。這些也記錄在這裡,因此可以手動創建文件。請注意,該連結可能包含 Express 中不可用的選項。

最後,將安裝程序和配置文件複製到目標機器並對配置文件進行任何所需的修改:

setup.exe /CONFIGURATIONFILE=c:\path\to\myConfigurationFile.ini /IAcceptSQLServerLicenseTerms /SAPWD="****************"

值得注意的是 /IAcceptSQLServerLicenseTerms 很重要,如果你省略它,它會告訴你必須指定它。您可以在 .ini 中指定它,但我沒有對此進行測試。*** 代替了我的測試 SA 密碼。如果您不啟用混合模式或將任何 PW 添加到配置文件,則可能不需要該部分。

驗證 Express 版本

然後我在technet上找到了一個很酷的腳本來告訴你你的SQL Server伺服器(和版本)的版本,因為我不知道如何真正驗證我的版本安裝後,因為最初的問題是因為它似乎安裝了標準版版本而不是 Express。我承認,如果 MS 下載的 Express 安裝程序最終安裝了另一個版本,我會感到非常驚訝。

這部分當然不是必須的,但是直接連結在這裡

這是我在我的案例中得到的輸出:

---------------------------------------------------------------------------------------------------------
--//Your current Microsoft SQL Server information:
---------------------------------------------------------------------------------------------------------
Product Version:          11.0.2100.60
Product Name:             SQL Server 2012
Product Level:            RTM 
Product Edition:          Express Edition (64-bit)
---------------------------------------------------------------------------------------------------------
Note, if you want to know information about CU, please read this KB below.
KB321185, <https://support.microsoft.com/en-us/kb/321185>
---------------------------------------------------------------------------------------------------------
Support Lifecycle stage: Mainstream Support Phase, however security/non-security updates are not available for
current 2012 baseline. Upgrade to SP2 for security/Non-security updates. For additional information refer to:
https://support.microsoft.com/en-us/lifecycle/search?sort=PN&alpha=SQL%20Server&Filter=FilterNO, and Q6, Q18
in the FAQ section of Support Lifecycle page at: https://support.microsoft.com/en-us/lifecycle#gp/lifePolicy
---------------------------------------------------------------------------------------------------------
Full information:
Microsoft SQL Server 2012 - 11.0.2100.60 (X64) 
   Feb 10 2012 19:39:15 
   Copyright (c) Microsoft Corporation
   Express Edition (64-bit) on Windows NT 6.2 &lt;X64&gt; (Build 9200: ) (Hypervisor)

---------------------------------------------------------------------------------------------------------
--//Recommended updates: 
--### RTM -&gt; QFE or GDR
--### SP  -&gt; QFE or GDR
--### QFE -&gt; QFE
--### GDR -&gt; GDR or QFE
---------------------------------------------------------------------------------------------------------
Install the latest service pack:              SP3, <https://support.microsoft.com/en-us/kb/3072779>

---------------------------------------------------------------------------------------------------------
###### QFE branch updates
---------------------------------------------------------------------------------------------------------
11.0.2376 (SQL Server 2012 RTM QFE) http://support.microsoft.com/en-us/kb/2716441
11.0.3513 (SQL Server 2012 SP1 QFE) https://support.microsoft.com/en-us/kb/3045317
11.0.5613 (SQL Server 2012 SP2 QFE) https://support.microsoft.com/en-us/kb/3045319
---------------------------------------------------------------------------------------------------------
###### GDR branch updates
---------------------------------------------------------------------------------------------------------
11.0.2218 (SQL Server 2012 RTM GDR) https://support.microsoft.com/en-us/kb/2716442
11.0.3153 (SQL Server 2012 SP1 GDR) http://support.microsoft.com/kb/2977326/en-us
11.0.3156 (SQL Server 2012 SP1 GDR) https://support.microsoft.com/en-us/kb/3045318
11.0.5343 (SQL Server 2012 SP2 GDR) https://support.microsoft.com/en-us/kb/3045321
---------------------------------------------------------------------------------------------------------
Note, if you don’t want to upgrade to latest service pack right now, we recommend you install the latest
Cumulative Update CU11 of SQL Server 2012 RTM.
Install the latest Cumulative Update (CU) of RTM: CU11, <https://support.microsoft.com/en-us/kb/2908007>


---------------------------------------------------------------------------------------------------------
--//You can upgrade to any of the following product(s):
---------------------------------------------------------------------------------------------------------
If you want to upgrade to higher edition, please intall service pack.


For additional information about supported version and edition upgrades refer to:
https://technet.microsoft.com/en-us/library/ms143393(v=sql.120).aspx

引用自:https://serverfault.com/questions/743521