zoukankan      html  css  js  c++  java
  • SQL Server 2012 无人值守安装(加入新实例)

    • 方法1,通过指定条个參数安装

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

    • 方法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 FilesMicrosoft 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 FilesMicrosoft SQL Server" ; 代理帐户名 AGTSVCACCOUNT="NT ServiceSQLAgent$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 ServiceMSSQL$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 ServiceMSSQLFDLauncher$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:UsersPatrick>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 hostNameinstanceName 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: DomainUser 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="MyDomainMyAccount" /SQLSVCPASSWORD="************" /SQLSYSADMINACCOUNTS="MyDomainMyAccount " /AGTSVCACCOUNT="MyDomainMyAccount" /AGTSVCPASSWORD="************" /ASSVCACCOUNT="MyDomainMyAccount" /ASSVCPASSWORD="************" /RSSVCACCOUNT="MyDomainMyAccount" /RSSVCPASSWORD="************" /ISSVCAccount="MyDomainMyAccount" /ISSVCPASSWORD="************" /ASSYSADMINACCOUNTS="MyDomainMyAccount" 按随意键退出... ^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
    


    效果图


  • 相关阅读:
    Java基本数据类型学习
    【异常】Docker安装elasticsearch7, 浏览使用 9200 无法打开
    docker logs-查看docker容器日志
    centos开开放防火墙
    软工超越日报-android的简单旋转效果实现 5/13
    软工超越日报-Android文件下载器 5/12
    软工超越日报-团队第一阶段冲刺十日谈回顾总结 5/11
    软工超越日报-安卓APP联网获取数据(3) 5/10
    软工超越日报-安卓APP联网获取数据(2) 5/9
    软工超越日报-安卓APP联网下载数据(1) 5/8
  • 原文地址:https://www.cnblogs.com/mthoutai/p/7390443.html
Copyright © 2011-2022 走看看