1. 程式人生 > >SQL Server 2012 無人值守安裝(加入新實例)

SQL Server 2012 無人值守安裝(加入新實例)

let disable agen ctu 獲取 miss ont logs windows

  • 方法1,通過指定條個參數安裝

setup.exe /Q /IACCEPTSQLSERVERLICENSETERMS /ACTION=install /PID=<validpid> /FEAT
URES=SQL,AS,RS,IS,Tools
/INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="MyDomain\MyAccount"
/SQLSVCPASSWORD="************" /SQLSYSADMINACCOUNTS="MyDomain\MyAccount "
/AGTSVCACCOUNT="MyDomain\MyAccount" /AGTSVCPASSWORD="************"
/ASSVCACCOUNT="MyDomain\MyAccount" /ASSVCPASSWORD="************"
/RSSVCACCOUNT="MyDomain\MyAccount" /RSSVCPASSWORD="************"
/ISSVCAccount="MyDomain\MyAccount" /ISSVCPASSWORD="************"
/ASSYSADMINACCOUNTS="MyDomain\MyAccount"

  • 方法2,指定配置文件安裝

I:\>Setup.exe /ConfigurationFile="d:\ConfigurationFile.ini"
Microsoft (R) SQL Server 2012 11.00.2100.60
版權全部 (c) Microsoft Corporation。保留全部權利。


用另外一種方法安裝。

下面是我的配置文件,為sql server 2012 加入名為I01的實例。;是凝視,像


; Required to acknowledge acceptance of the license terms.
IACCEPTSQLSERVERLICENSETERMS="True"
註意
;UIMODE="False"

註意
二選一,不然報錯
; 安裝程序將不會顯示不論什麽用戶界面。 

QUIET="False"

; 安裝程序將僅僅顯示運行進度,而不須要不論什麽用戶交互。

QUIETSIMPLE="True"<

註意; 默認值為 Windows 身份驗證。使用 "SQL" 表示採用混合模式身份驗證。 

SECURITYMODE="SQL"
SAPWD="1qaz2WSX"

下面是完整文件,

;SQL Server 2012 Configuration File
[OPTIONS]
; Required to acknowledge acceptance of the license terms.
IACCEPTSQLSERVERLICENSETERMS="True"
; 指定安裝程序的工作流。如 INSTALL、UNINSTALL 或 UPGRADE。

這是必需的參數。 ACTION="Install" ; 尚沒有定義命令行參數 ENU 的具體幫助。 ENU="False" ; 用於控制用戶界面行為的參數。

有效值對於完整 UI 為 Normal,對於簡化的 UI 為 AutoAdvance,為 EnableUIOnServerCore 則跳過 Server Core 安裝程序 GUI 塊。

;UIMODE="False" ; 安裝程序將不會顯示不論什麽用戶界面。

QUIET="False" ; 安裝程序將僅僅顯示運行進度。而不須要不論什麽用戶交互。

QUIETSIMPLE="True" ; 指定 SQL Server 安裝程序是否應發現和包含產品更新。

有效值是 True 和 False 或者 1 和 0。默認情況下,SQL Server 安裝程序將包含找到的更新。

UpdateEnabled="False" ; 指定要安裝、卸載或升級的功能。頂級功能列表包含 SQL、AS、RS、IS、MDS 和工具。SQL 功能將安裝數據庫引擎、復制、全文和 Data Quality Services (DQS)server。

工具功能將安裝管理工具、聯機叢書組件、SQL Server Data Tools 和其它共享組件。 FEATURES=SQLENGINE,REPLICATION,FULLTEXT,DQ ; 指定 SQL Server 安裝程序將獲取產品更新的位置。有效值為 "MU" (以便搜索產品更新)、有效文件夾路徑以及 .\MyUpdates 或 UNC 共享文件夾之類的相對路徑。默認情況下,SQL Server 安裝程序將通過 Window Server Update Services 搜索 Microsoft Update 或 Windows Update 服務。 UpdateSource="MU" ; 顯示命令行參數使用方法 HELP="False" ; 指定應將具體的安裝程序日誌傳送到控制臺。

INDICATEPROGRESS="False" ; 指定安裝程序應該安裝到 WOW64 中。IA64 或 32 位系統不支持此命令行參數。 X86="False" ; 指定共享組件的安裝根文件夾。在已安裝共享組件後。此文件夾保持不變。 INSTALLSHAREDDIR="C:\Program Files\Microsoft SQL Server" ; 指定 WOW64 共享組件的安裝根文件夾。在已安裝 WOW64 共享組件後,此文件夾保持不變。

INSTALLSHAREDWOWDIR="C:\Program Files (x86)\Microsoft SQL Server" ; 指定默認實例或命名實例。MSSQLSERVER 是非 Express 版本號的默認實例,SQLExpress 則是 Express 版本號的默認實例。

在安裝 SQL Server 數據庫引擎(SQL)、Analysis Services (AS)或 Reporting Services (RS)時,此參數是必需的。 INSTANCENAME="I01" ; 為您已指定的 SQL Server 功能指定實例 ID。SQL Server 文件夾結構、註冊表結構和服務名稱將包含 SQL Server 實例的實例 ID。

INSTANCEID="I01" ; 指定能夠收集 SQL Server 功能使用情況數據。並將數據發送到 Microsoft。

指定 1 或 True 將啟用此功能。指定 0 或 False 將禁用此功能。

SQMREPORTING="False" ; 指定是否可將錯誤報告給 Microsoft 以便改進以後的 SQL Server 版本號。指定 1 或 True 將啟用此功能。指定 0 或 False 將禁用此功能。 ERRORREPORTING="False" ; 指定安裝文件夾。 INSTANCEDIR="e:\Program Files\Microsoft SQL Server" ; 代理帳戶名 AGTSVCACCOUNT="NT Service\SQLAgent$I01" ; 安裝後自己主動啟動服務。

AGTSVCSTARTUPTYPE="Manual" ; CM 程序塊 TCP 通信port COMMFABRICPORT="0" ; 矩陣怎樣使用專用網絡 COMMFABRICNETWORKLEVEL="0" ; 怎樣保護程序塊間的通信 COMMFABRICENCRYPTION="0" ; CM 程序塊使用的 TCP port MATRIXCMBRICKCOMMPORT="0" ; SQL Server 服務的啟動類型。 SQLSVCSTARTUPTYPE="Manual" ; 啟用 FILESTREAM 功能的級別(0、1、2 或 3)。 FILESTREAMLEVEL="0" ; 設置為 "1" 可為 SQL Server Express 啟用 RANU。 ENABLERANU="False" ; 指定要用於數據庫引擎的 Windows 排序規則或 SQL 排序規則。 SQLCOLLATION="Chinese_PRC_CI_AS" ; SQL Server 服務的帳戶: 域\用戶或系統帳戶。

SQLSVCACCOUNT="NT Service\MSSQL$I01" ; 要設置為 SQL Server 系統管理員的 Windows 帳戶。 SQLSYSADMINACCOUNTS="ADMINISTRATOR" ; 默認值為 Windows 身份驗證。使用 "SQL" 表示採用混合模式身份驗證。

SECURITYMODE="SQL" SAPWD="1qaz2WSX" ; 將當前用戶設置為 SQL Server 2012 Express 的數據庫引擎系統管理員。 ADDCURRENTUSERASSQLADMIN="False" ; 指定 0 禁用 TCP/IP 協議,指定 1 則啟用該協議。 TCPENABLED="1" ; 指定 0 禁用 Named Pipes 協議,指定 1 則啟用該協議。 NPENABLED="0" ; Browser 服務的啟動類型。 BROWSERSVCSTARTUPTYPE="Manual" ; 加入輸入參數 FTSVCACCOUNT 的描寫敘述 FTSVCACCOUNT="NT Service\MSSQLFDLauncher$I01"

1 掛載鏡像

2進入命令行:


技術分享

3執行
I:\>Setup.exe /ConfigurationFile="d:\ConfigurationFile.ini"
技術分享

4安裝完畢

技術分享

怎樣快捷編寫配置文件,通過改動ui安裝過程中的向導,生民第一個配置文件。配置保存在下圖的路徑中,打開並按例如以下改動它

加入

; Required to acknowledge acceptance of the license terms.
IACCEPTSQLSERVERLICENSETERMS="True"
不顯示ui
;UIMODE="False"
註意
二選一。不然報錯
; 安裝程序將不會顯示不論什麽用戶界面。 

QUIET="False"

; 安裝程序將僅僅顯示運行進度。而不須要不論什麽用戶交互。 

QUIETSIMPLE="True"
註意; 默認值為 Windows 身份驗證。使用 "SQL" 表示採用混合模式身份驗證。 

SECURITYMODE="SQL"
SAPWD="1qaz2WSX"

技術分享

HELP

Microsoft Windows [版本號 6.1.7601]
版權全部 (c) 2009 Microsoft Corporation。保留全部權利。

C:\Users\Patrick>I: I:\>setup.exe /help Microsoft (R) SQL Server 2012 11.00.2100.60 版權全部 (c) Microsoft Corporation。

保留全部權利。 使用方法: setup.exe /[選項]={value} /[選項]={value} ... 選項: ACTION 指定安裝程序的工作流。如 INSTALL、UNINSTALL 或 UPG RADE。

這是必需的參數。 ADDCURRENTUSERASSQLADMIN Provision current user as a Database Engine system administrator for SQL Server 2012 Express. AGTDOMAINGROUP Either domain user name or system account AGTSVCACCOUNT Either domain user name or system account AGTSVCPASSWORD Password for domain user name. Not required for system account AGTSVCSTARTUPTYPE Startup type for the SQL Server Agent service. Supported values are Manual, Automatic or Disabled. ALLINSTANCES 指定全部實例都將包含在安裝操作中。僅僅有在應用修補程 序時才支持此參數。 ALLOWUPGRADEFORSSRSSHAREPOIN RSInputSettings_AllowUpgradeForSSRSSharePointMode_ Description ASBACKUPDIR The location for the Analysis Services backup files. ASCOLLATION The collation used by Analysis Services. ASCONFIGDIR The location for the Analysis Services configuration files. ASDATADIR The location for the Analysis Services data files. ASLOGDIR The location for the Analysis Services log files. ASPROVIDERMSOLAP Specifies if the MSOLAP provider can run in process. ASSERVERMODE Specifies the server mode of the Analysis Services instance. Valid values are MULTIDIMENSIONAL and TABULAR. The default value is MULTIDIMENSIONAL. ASSVCACCOUNT The account used by the Analysis Services service. ASSVCPASSWORD The password for the Analysis Services service account. ASSVCSTARTUPTYPE Controls the service startup type setting for the service. ASSYSADMINACCOUNTS Specifies the list of administrator accounts to provision. ASTEMPDIR The location for the Analysis Services temporary files. BROWSERSVCSTARTUPTYPE Startup type for Browser Service. CLTCTLRNAME The computer name that the client communicates with for the Distributed Replay Controller service. CLTRESULTDIR The result directory for the Distributed Replay Client service. CLTSTARTUPTYPE The startup type for the Distributed Replay Client service. CLTSVCACCOUNT The account used by the Distributed Replay Client service. CLTSVCPASSWORD The password for the Distributed Replay Client service account. CLTWORKINGDIR The working directory for the Distributed Replay Client service. CLUSTERPASSIVE 指定 SQL Server 安裝程序不應管理 SQL Server 服務。

此選項應該僅在非 Microsoft 群集環境中使用。

COMMFABRICENCRYPTION MATRIXCOMMMESSAGEPROTECTION {0,1} COMMFABRICNETWORKLEVEL MATRIXCOMMNETWORKISOLATION {0,1} COMMFABRICPORT MATRIXCOMMPORT <port> CONFIGURATIONFILE 指定將用於安裝程序的配置文件。 CONFIRMIPDEPENDENCYCHANGE Indicates that the change in IP address resource dependency type for the SQL Server multi-subnet failover cluster is accepted. CTLRSTARTUPTYPE The startup type for the Distributed Replay Controller service. CTLRSVCACCOUNT The account used by the Distributed Replay Controller service. CTLRSVCPASSWORD The password for the Distributed Replay Controller service account. CTLRUSERS The Windows account(s) used to grant permission to the Distributed Replay Controller service. ENABLERANU Set to "1" to enable RANU for SQL Server Express. ENU 尚沒有定義命令行參數 ENU 的具體幫助。

ERRORREPORTING 指定是否可將錯誤報告給 Microsoft 以便改進以後的 SQ L Server 版本號。指定 1 或 True 將啟用此功能。指定 0 或 False 將禁用此功能 。

FAILOVERCLUSTERDISKS Specifies a cluster shared disk to associate with the SQL Server failover cluster instance. FAILOVERCLUSTERGROUP Specifies the name of the cluster group for the SQL Server failover cluster instance. FAILOVERCLUSTERIPADDRESSES Specifies an encoded IP address. The encodings are semicolon-delimited (;), and follow the format <IP Type>;<address>;<network name>;<subnet mask>. Supported IP types include DHCP, IPV4, and IPV6. FAILOVERCLUSTERNETWORKNAME Specifies the name of the SQ LServer failover cluster instance. This name is the network name that is used to connect to SQL Server services. FAILOVERCLUSTERROLLOWNERSHIP Specifies whether the upgraded nodes should take ownership of the failover instance group or not. Use 0 to retain ownership in the legacy nodes, 1 to make the upgraded nodes take ownership, or 2 to let SQL Server Setup decide when to move ownership. FEATURES 指定要安裝、卸載或升級的功能。頂級功能列表包含 SQL 、AS、RS、IS、MDS 和工具。SQL 功能將安裝數據庫引擎、復制、全文和 Data Quality Se rvices (DQS)服務器。工具功能將安裝管理工具、聯機叢書組件 、SQL Server Data Tools 和其它共享組件。 FILESTREAMLEVEL Level to enable FILESTREAM feature at (0, 1, 2 or 3). FILESTREAMSHARENAME Name of Windows share to be created for FILESTREAM File I/O. FTSVCACCOUNT User account for Full-text Filter Daemon Host. FTSVCPASSWORD User password for Full-text Filter Daemon Host account. FTUPGRADEOPTION Full-text catalog upgrade option. HELP 顯示命令行參數使用方法 IACCEPTSQLSERVERLICENSETERMS 通過指定此參數並接受 SQL Server 許可條款,您確認已 閱讀並理解使用條款的內容。 INDICATEPROGRESS 指定應將具體的安裝程序日誌傳送到控制臺。

INSTALLSHAREDDIR 指定共享組件的安裝根文件夾。在已安裝共享組件後,此目 錄保持不變。 INSTALLSHAREDWOWDIR 指定 WOW64 共享組件的安裝根文件夾。

在已安裝 WOW64 共 享組件後,此文件夾保持不變。 INSTALLSQLDATADIR The Database Engine root data directory. INSTANCEDIR 指定實例根文件夾。 INSTANCEID 為您已指定的 SQL Server 功能指定實例 ID。SQL Serve r 文件夾結構、註冊表結構和服務名稱將包含 SQL Server 實 例的實例 ID。 INSTANCENAME 指定默認實例或命名實例。MSSQLSERVER 是非 Express 版本號的默認實例,SQLExpress 則是 Express 版本號的默認 實例。

在安裝 SQL Server 數據庫引擎(SQL)、Analysis Services (AS)或 Reporting Services (RS)時,此參數是必需的。 ISSVCACCOUNT Either domain user name or system account. ISSVCPASSWORD Password for domain user. ISSVCSTARTUPTYPE Automatic, Manual or Disabled. MATRIXCMBRICKCOMMPORT MATRIXCMBRICKCOMMPORT portNumber MATRIXCMSERVERNAME MATRIXCMSERVERNAME hostName\instanceName MATRIXNAME MATRIXNAME=<name> NPENABLED Specify 0 to disable or 1 to enable the Named Pipes protocol. PID 指定 SQL Server 產品密鑰以配置您要使用哪個版本號。 QUIET 安裝程序將不會顯示不論什麽用戶界面。 QUIETSIMPLE 安裝程序將僅僅顯示運行進度,而不須要不論什麽用戶交互。

ROLE 尚沒有定義命令行參數 ROLE 的具體幫助。 RSCATALOGSERVERINSTANCENAME The SQL Server server for the report server catalog database. RSINSTALLMODE RSInputSettings_RSInstallMode_Description RSSHPINSTALLMODE RSInputSettings_RSInstallMode_Description RSSVCACCOUNT Specify the service account of the report server. This value is required. If you omit this value, Setup will use the default built-in account for the current operating system (either NetworkService or LocalSystem). If you specify a domain user account, the domain must be under 254 characters and the user name must be under 20 characters. The account name cannot contain the following characters: " / \ [ ] : ; | = , + * ? < > RSSVCPASSWORD Specify a strong password for the account. A strong password is at least 8 characters and includes a combination of upper and lower case alphanumeric characters and at least one symbol character. Avoid spelling an actual word or name that might be listed in a dictionary. RSSVCSTARTUPTYPE Specifies the startup mode for the Report Server service. Valid values include Manual, Automatic, and Disabled. The default value for StartupType is Manual, where the server is started when a request is received. RSUPGRADEDATABASEACCOUNT RSInputSettings_RSInstallMode_Description RSUPGRADEPASSWORD RSInputSettings_RSInstallMode_Description RULES 指定要執行的規則 ID 或規則組 ID 的列表。

SAPWD Password for SQL Server sa account. SECURITYMODE The default is Windows Authentication. Use "SQL" for Mixed Mode Authentication. SQLBACKUPDIR Default directory for the Database Engine backup files. SQLCOLLATION Specifies a Windows collation or an SQL collation to use for the Database Engine. SQLSVCACCOUNT Account for SQL Server service: Domain\User or system account. SQLSVCPASSWORD A SQL Server service password is required only for a domain account. SQLSVCSTARTUPTYPE Startup type for the SQL Server service. SQLSYSADMINACCOUNTS Windows account(s) to provision as SQL Server system administrators. SQLTEMPDBDIR Directory for Database Engine TempDB files. SQLTEMPDBLOGDIR Directory for the Database Engine TempDB log files. SQLUSERDBDIR Default directory for the Database Engine user databases. SQLUSERDBLOGDIR Default directory for the Database Engine user database logs. SQMREPORTING 指定能夠收集 SQL Server 功能使用情況數據,並將數據 發送到 Microsoft。

指定 1 或 True 將啟用此功能,指定 0 或 False 將禁用此功能 。

TCPENABLED Specify 0 to disable or 1 to enable the TCP/IP protocol. UIMODE 用於控制用戶界面行為的參數。

有效值對於完整 UI 為 N ormal,對於簡化的 UI 為 AutoAdvance,為 EnableUIOnServerCore 則跳過 Server Core 安裝程序 GUI 塊。 UpdateEnabled 指定 SQL Server 安裝程序是否應發現和包含產品更新。 有效值是 True 和 False 或者 1 和 0。默認情況下,SQL Server 安裝程序將包含 找到的更新。 UpdateSource 指定 SQL Server 安裝程序將獲取產品更新的位置。有效 值為 "MU" (以便搜索產品更新)、有效文件夾路徑以及 .\MyUpdates 或 UNC 共享文件夾之類的相對路徑。

默認情況下,SQL Server 安 裝程序將通過 Window Server Update Services 搜索 Microsoft Update 或 Windows Update 服務。 X86 指定安裝程序應該安裝到 WOW64 中。IA64 或 32 位系統 不支持此命令行參數。 完整的無人參與安裝演示樣例,顯示全部必需的參數: setup.exe /Q /IACCEPTSQLSERVERLICENSETERMS /ACTION=install /PID=<validpid> /FEAT URES=SQL,AS,RS,IS,Tools /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="MyDomain\MyAccount" /SQLSVCPASSWORD="************" /SQLSYSADMINACCOUNTS="MyDomain\MyAccount " /AGTSVCACCOUNT="MyDomain\MyAccount" /AGTSVCPASSWORD="************" /ASSVCACCOUNT="MyDomain\MyAccount" /ASSVCPASSWORD="************" /RSSVCACCOUNT="MyDomain\MyAccount" /RSSVCPASSWORD="************" /ISSVCAccount="MyDomain\MyAccount" /ISSVCPASSWORD="************" /ASSYSADMINACCOUNTS="MyDomain\MyAccount" 按隨意鍵退出... ^C I:\>


PowerShell 批量啟動關閉實例:

start test instances .bat

@powershell -command "Get-Service |Where-Object {$_.Name -like 'MSSQL$I*'}|Start-Service -ErrorAction SilentlyContinue"
@pause


stop test instances .bat

@powershell -Command " Get-Service |Where-Object {$_.Name -like 'MSSQL$I*'}|Stop-Service -ErrorAction SilentlyContinue"

@pause


效果圖

技術分享

SQL Server 2012 無人值守安裝(加入新實例)