
正文
The Windows account sa does not exist and cannot be provisioned as a SQL Server system administrator
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
今天遇到一个案例,在使用命令修改一个测试服务器(SQL Server 2014标准版)的服务器排序规则时,遇到了下面错误信息
(具体账号信息脱敏处理,随机生成一个账号密码)
The Windows account sa does not exist and cannot be provisioned as a SQL Server system administrator
c:\SQLServer_12.0_Full>Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=MSSQL
SERVER /SQLSYSADMINACCOUNTS=sa /SAPWD=Sa!y#456 /SQLCOLLATION=Chinese_PRC_CI_AS
Microsoft (R) SQL Server 2014 12.00.5000.00
Copyright (c) Microsoft Corporation. All rights reserved.
The following error occurred:
The Windows account sa does not exist and cannot be provisioned as a SQL Server
system administrator.
Error result: -2061893626
Result facility code: 1306
Result error code: 6
Please review the summary.txt log for further details
后面折腾了很久后,发现这种写法居然是错误的,由于自己在动手之前参考了自己以前写的MS SQL 排序规则总结这篇博文,结果发现自己一些不严谨/错误的地方把自己也给坑了。希望不要把别人也坑了!!!时间太久远了,怎么也想不起当初怎么造就了这样一个错误, 总之,那篇博文里面确实有一个错误的地方。希望以后要引以为戒!
正确的写法为/SQLSYSADMINACCOUNTS参数后指定域账号或本机NT账号,这个可以通过查看帮助信息
c:\SQLServer_12.0_Full>Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=MSSQLSERVER
/SQLSYSADMINACCOUNTS=azrnt18\azrnt18 /SAPWD="Sa!y#456" /SQLCOLLATION=Chinese_PRC_CI_AS
Microsoft (R) SQL Server 2014 12.00.5000.00
Copyright (c) Microsoft Corporation. All rights reserved.
setup /? 或setup /help查看参数信息,SQLSYSADMINACCOUNTS的介绍、解释如下所示:
SQLSYSADMINACCOUNTS Windows account(s) to provision as SQL Server system administrators.
也就是说SQLSYSADMINACCOUNTS参数后指定的是有SQL Server管理员权限的Windows账号,由于最上面最上面指定参数的值为sa,所以才会一直报这个错误。
c:\SQLServer_12.0_Full>setup /help
CRLF
Microsoft (R) SQL Server 2014 12.00.5000.00
CRLF
Copyright (c) Microsoft Corporation. All rights reserved.
CRLF
CRLF
Usage:
CRLF
setup.exe /[option]={value} /[option]={value} ...
CRLF
CRLF
Options:
CRLF
ACTION Specifies a Setup work flow, like INSTALL,
CRLF
UNINSTALL, or UPGRADE. This is a required
CRLF
parameter.
CRLF
ADDCURRENTUSERASSQLADMIN Provision current user as a Database Engine
CRLF
system administrator for %SQL_PRODUCT_SHORT_NAME%
CRLF
Express.
CRLF
AGTDOMAINGROUP Either domain user name or system account
CRLF
AGTSVCACCOUNT Either domain user name or system account
CRLF
AGTSVCPASSWORD Password for domain user name. Not required for
CRLF
system account
CRLF
AGTSVCSTARTUPTYPE Startup type for the SQL Server Agent service.
CRLF
Supported values are Manual, Automatic or
CRLF
Disabled.
CRLF
ALLINSTANCES Specifies that all instances are to be included
CRLF
in the Setup operation. This parameter is
CRLF
supported only when applying a patch.
CRLF
ALLOWUPGRADEFORSSRSSHAREPOIN
CRLF
RSInputSettings_AllowUpgradeForSSRSSharePointMode_
CRLF
Description
CRLF
ASBACKUPDIR The location for the Analysis Services backup
CRLF
files.
CRLF
ASCOLLATION The collation used by Analysis Services.
CRLF
ASCONFIGDIR The location for the Analysis Services
CRLF
configuration files.
CRLF
ASDATADIR The location for the Analysis Services data
CRLF
files.
CRLF
ASLOGDIR The location for the Analysis Services log files.
CRLF
ASPROVIDERMSOLAP Specifies if the MSOLAP provider can run in
CRLF
process.
CRLF
ASSERVERMODE Specifies the server mode of the Analysis
CRLF
Services instance. Valid values are
CRLF
MULTIDIMENSIONAL and TABULAR. The default value
CRLF
is MULTIDIMENSIONAL.
CRLF
ASSVCACCOUNT The account used by the Analysis Services
CRLF
service.
CRLF
ASSVCPASSWORD The password for the Analysis Services service
CRLF
account.
CRLF
ASSVCSTARTUPTYPE Controls the service startup type setting for the
CRLF
service.
CRLF
ASSYSADMINACCOUNTS Specifies the list of administrator accounts to
CRLF
provision.
CRLF
ASTEMPDIR The location for the Analysis Services temporary
CRLF
files.
CRLF
BROWSERSVCSTARTUPTYPE Startup type for Browser Service.
CRLF
CLTCTLRNAME The computer name that the client communicates
CRLF
with for the Distributed Replay Controller
CRLF
service.
CRLF
CLTRESULTDIR The result directory for the Distributed Replay
CRLF
Client service.
CRLF
CLTSTARTUPTYPE The startup type for the Distributed Replay
CRLF
Client service.
CRLF
CLTSVCACCOUNT The account used by the Distributed Replay Client
CRLF
service.
CRLF
CLTSVCPASSWORD The password for the Distributed Replay Client
CRLF
service account.
CRLF
CLTWORKINGDIR The working directory for the Distributed Replay
CRLF
Client service.
CRLF
CLUSTERPASSIVE Specifies that SQL Server Setup should not manage
CRLF
the SQL Server services. This option should be
CRLF
used only in a non-Microsoft cluster environment.
CRLF
COMMFABRICENCRYPTION MATRIXCOMMMESSAGEPROTECTION {0,1}
CRLF
COMMFABRICNETWORKLEVEL MATRIXCOMMNETWORKISOLATION {0,1}
CRLF
COMMFABRICPORT MATRIXCOMMPORT <port>
CRLF
CONFIGURATIONFILE Specifies the configuration file to be used for
CRLF
Setup.
CRLF
CONFIRMIPDEPENDENCYCHANGE Indicates that the change in IP address resource
CRLF
dependency type for the SQL Server multi-subnet
CRLF
failover cluster is accepted.
CRLF
CTLRSTARTUPTYPE The startup type for the Distributed Replay
CRLF
Controller service.
CRLF
CTLRSVCACCOUNT The account used by the Distributed Replay
CRLF
Controller service.
CRLF
CTLRSVCPASSWORD The password for the Distributed Replay
CRLF
Controller service account.
CRLF
CTLRUSERS The Windows account(s) used to grant permission
CRLF
to the Distributed Replay Controller service.
CRLF
ENABLERANU Set to "1" to enable RANU for SQL Server Express.
CRLF
ENU Use the /ENU parameter to install the English
CRLF
version of SQL Server on your localized Windows
CRLF
operating system.
CRLF
ERRORREPORTING Specify if errors can be reported to Microsoft to
CRLF
improve future SQL Server releases. Specify 1 or
CRLF
True to enable and 0 or False to disable this
CRLF
feature.
CRLF
FAILOVERCLUSTERDISKS Specifies a cluster shared disk to associate with
CRLF
the SQL Server failover cluster instance.
CRLF
FAILOVERCLUSTERGROUP Specifies the name of the cluster group for the
CRLF
SQL Server failover cluster instance.
CRLF
FAILOVERCLUSTERIPADDRESSES Specifies an encoded IP address. The encodings
CRLF
are semicolon-delimited (;), and follow the
CRLF
format <IP Type>;<address>;<network name>;<subnet
CRLF
mask>. Supported IP types include DHCP, IPV4, and
CRLF
IPV6.
CRLF
FAILOVERCLUSTERNETWORKNAME Specifies the name of the SQ LServer failover
CRLF
cluster instance. This name is the network name
CRLF
that is used to connect to SQL Server services.
CRLF
FAILOVERCLUSTERROLLOWNERSHIP Specifies whether the upgraded nodes should take
CRLF
ownership of the failover instance group or not.
CRLF
Use 0 to retain ownership in the legacy nodes, 1
CRLF
to make the upgraded nodes take ownership, or 2
CRLF
to let SQL Server Setup decide when to move
CRLF
ownership.
CRLF
FEATURES Specifies features to install, uninstall, or
CRLF
upgrade. The list of top-level features include
CRLF
SQL, AS, RS, IS, MDS, and Tools. The SQL feature
CRLF
will install the Database Engine, Replication,
CRLF
Full-Text, and Data Quality Services (DQS)
CRLF
server. The Tools feature will install Management
CRLF
Tools, Books online components, SQL Server Data
CRLF
Tools, and other shared components.
CRLF
FILESTREAMLEVEL Level to enable FILESTREAM feature at (0, 1, 2 or
CRLF
3).
CRLF
FILESTREAMSHARENAME Name of Windows share to be created for
CRLF
FILESTREAM File I/O.
CRLF
FTSVCACCOUNT User account for Full-text Filter Daemon Host.
CRLF
FTSVCPASSWORD User password for Full-text Filter Daemon Host
CRLF
account.
CRLF
FTUPGRADEOPTION Full-text catalog upgrade option.
CRLF
HELP Displays the command line parameters usage
CRLF
IACCEPTSQLSERVERLICENSETERMS By specifying this parameter and accepting the
CRLF
SQL Server license terms, you acknowledge that
CRLF
you have read and understood the terms of use.
CRLF
INDICATEPROGRESS Specifies that the detailed Setup log should be
CRLF
piped to the console.
CRLF
INSTALLSHAREDDIR Specify the root installation directory for
CRLF
shared components. This directory remains
CRLF
unchanged after shared components are already
CRLF
installed.
CRLF
INSTALLSHAREDWOWDIR Specify the root installation directory for the
CRLF
WOW64 shared components. This directory remains
CRLF
unchanged after WOW64 shared components are
CRLF
already installed.
CRLF
INSTALLSQLDATADIR The Database Engine root data directory.
CRLF
INSTANCEDIR Specify the instance root directory.
CRLF
INSTANCEID Specify the Instance ID for the SQL Server
CRLF
features you have specified. SQL Server directory
CRLF
structure, registry structure, and service names
CRLF
will incorporate the instance ID of the SQL
CRLF
Server instance.
CRLF
INSTANCENAME Specify a default or named instance. MSSQLSERVER
CRLF
is the default instance for non-Express editions
CRLF
and SQLExpress for Express editions. This
CRLF
parameter is required when installing the SQL
CRLF
Server Database Engine (SQL), Analysis Services
CRLF
(AS), or Reporting Services (RS).
CRLF
ISSVCACCOUNT Either domain user name or system account.
CRLF
ISSVCPASSWORD Password for domain user.
CRLF
ISSVCSTARTUPTYPE Automatic, Manual or Disabled.
CRLF
MATRIXCMBRICKCOMMPORT MATRIXCMBRICKCOMMPORT portNumber
CRLF
MATRIXCMSERVERNAME MATRIXCMSERVERNAME hostName\instanceName
CRLF
MATRIXNAME MATRIXNAME=<name>
CRLF
NPENABLED Specify 0 to disable or 1 to enable the Named
CRLF
Pipes protocol.
CRLF
PID Specify the SQL Server product key to configure
CRLF
which edition you would like to use.
CRLF
QUIET Setup will not display any user interface.
CRLF
QUIETSIMPLE Setup will display progress only, without any
CRLF
user interaction.
CRLF
ROLE Detailed help for command line argument ROLE has
CRLF
not been defined yet.
CRLF
RSCATALOGSERVERINSTANCENAME The SQL Server server for the report server
CRLF
catalog database.
CRLF
RSINSTALLMODE RSInputSettings_RSInstallMode_Description
CRLF
RSSHPINSTALLMODE RSInputSettings_RSInstallMode_Description
CRLF
RSSVCACCOUNT Specify the service account of the report server.
CRLF
This value is required. If you omit this value,
CRLF
Setup will use the default built-in account for
CRLF
the current operating system (either
CRLF
NetworkService or LocalSystem). If you specify a
CRLF
domain user account, the domain must be under 254
CRLF
characters and the user name must be under 20
CRLF
characters. The account name cannot contain the
CRLF
following characters:
CRLF
" / \ [ ] : ; | = , + * ? < >
CRLF
RSSVCPASSWORD Specify a strong password for the account. A
CRLF
strong password is at least 8 characters and
CRLF
includes a combination of upper and lower case
CRLF
alphanumeric characters and at least one symbol
CRLF
character. Avoid spelling an actual word or name
CRLF
that might be listed in a dictionary.
CRLF
RSSVCSTARTUPTYPE Specifies the startup mode for the Report Server
CRLF
service. Valid values include Manual, Automatic,
CRLF
and Disabled. The default value for StartupType
CRLF
is Manual, where the server is started when a
CRLF
request is received.
CRLF
RSUPGRADEDATABASEACCOUNT RSInputSettings_RSInstallMode_Description
CRLF
RSUPGRADEPASSWORD RSInputSettings_RSInstallMode_Description
CRLF
RULES Specifies the list of rule IDs or rule group IDs
CRLF
to run.
CRLF
SAPWD Password for SQL Server sa account.
CRLF
SECURITYMODE The default is Windows Authentication. Use "SQL"
CRLF
for Mixed Mode Authentication.
CRLF
SQLBACKUPDIR Default directory for the Database Engine backup
CRLF
files.
CRLF
SQLCOLLATION Specifies a Windows collation or an SQL collation
CRLF
to use for the Database Engine.
CRLF
SQLSVCACCOUNT Account for SQL Server service: Domain\User or
CRLF
system account.
CRLF
SQLSVCPASSWORD A SQL Server service password is required only
CRLF
for a domain account.
CRLF
SQLSVCSTARTUPTYPE Startup type for the SQL Server service.
CRLF
SQLSYSADMINACCOUNTS Windows account(s) to provision as SQL Server
CRLF
system administrators.
CRLF
SQLTEMPDBDIR Directory for Database Engine TempDB files.
CRLF
SQLTEMPDBLOGDIR Directory for the Database Engine TempDB log
CRLF
files.
CRLF
SQLUSERDBDIR Default directory for the Database Engine user
CRLF
databases.
CRLF
SQLUSERDBLOGDIR Default directory for the Database Engine user
CRLF
database logs.
CRLF
SQMREPORTING Specify that SQL Server feature usage data can be
CRLF
collected and sent to Microsoft. Specify 1 or
CRLF
True to enable and 0 or False to disable this
CRLF
feature.
CRLF
TCPENABLED Specify 0 to disable or 1 to enable the TCP/IP
CRLF
protocol.
CRLF
UIMODE Parameter that controls the user interface
CRLF
behavior. Valid values are Normal for the full
CRLF
UI,AutoAdvance for a simplied UI, and
CRLF
EnableUIOnServerCore for bypassing Server Core
CRLF
setup GUI block.
CRLF
UpdateEnabled Specify whether SQL Server Setup should discover
CRLF
and include product updates. The valid values are
CRLF
True and False or 1 and 0. By default SQL Server
CRLF
Setup will include updates that are found.
CRLF
UpdateSource Specify the location where SQL Server Setup will
CRLF
obtain product updates. The valid values are "MU"
CRLF
to search Microsoft Update, a valid folder path,
CRLF
a relative path such as .\MyUpdates or a UNC
CRLF
share. By default SQL Server Setup will search
CRLF
Microsoft Update or a Windows Update service
CRLF
through the Window Server Update Services.
CRLF
USEMICROSOFTUPDATE If this parameter is provided, then this computer
CRLF
will use Microsoft Update to check for updates.
CRLF
X86 Specifies that Setup should install into WOW64.
CRLF
This command line argument is not supported on an
CRLF
IA64 or a 32-bit system.
CRLF
CRLF
Full unattended installation example, showing all required parameters:
CRLF
CRLF
CRLF
setup.exe /Q /IACCEPTSQLSERVERLICENSETERMS /ACTION=install /PID=<validpid> /FEAT
CRLF
URES=SQL,AS,RS,IS,Tools
CRLF
/INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="MyDomain\MyAccount"
CRLF
/SQLSVCPASSWORD="************" /SQLSYSADMINACCOUNTS="MyDomain\MyAccount "
CRLF
/AGTSVCACCOUNT="MyDomain\MyAccount" /AGTSVCPASSWORD="************"
CRLF
/ASSVCACCOUNT="MyDomain\MyAccount" /ASSVCPASSWORD="************"
CRLF
/RSSVCACCOUNT="MyDomain\MyAccount" /RSSVCPASSWORD="************"
CRLF
/ISSVCAccount="MyDomain\MyAccount" /ISSVCPASSWORD="************"
CRLF
/ASSYSADMINACCOUNTS="MyDomain\MyAccount"
CRLF
CRLF
Press any key to exit...
CRLF






