在安靜模式下安裝 SQL Server 2008 Express Edition 問題?
我想以安靜模式安裝 SQL Server Express 2008。
我知道我們可以使用
/ConfigurationFile="ConfigurationFile.INI"
參數從配置文件中安裝 SQL Server。以下是我的
Configuration.ini
文件:;SQLSERVER2008 Configuration File [SQLSERVER2008] ; Specify the Instance ID for the SQL Server features you have specified. SQL Server directory structure, registry structure, and service names will reflect the instance ID of the SQL Server instance. INSTANCEID="SQLEXPRESS" ; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter. ACTION="Install" ;License Terms IACCEPTSQLSERVERLICENSETERMS = "True" ; 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, Business Intelligence Development Studio, and other shared components. FEATURES=SQLENGINE ; Displays the command line parameters usage HELP="False" ; The directory for the extracted service pack files used to update the setup media. ; PCUSOURCE="" ; Specify the root installation directory for native shared components. ; INSTALLSHAREDDIR="C:\Program Files\Microsoft SQL Server" ; Specifies that the detailed Setup log should be piped to the console. INDICATEPROGRESS="False" ; Setup will not display any user interface. QUIET="False" ; Setup will display progress only without any user interaction. QUIETSIMPLE="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 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 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" ; 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="SQLEXPRESS" ; Auto-start service after installation. AGTSVCSTARTUPTYPE="Manual" ; Startup type for Integration Services. ISSVCSTARTUPTYPE="Automatic" ; Account for Integration Services: Domain\User or system account. ISSVCACCOUNT="NT AUTHORITY\NetworkService" ; Controls the service startup type setting after the service has been created. ASSVCSTARTUPTYPE="Automatic" ; The collation to be used by Analysis Services. ASCOLLATION="Latin1_General_CI_AS" ; The location for the Analysis Services data files. ASDATADIR="Data" ; The location for the Analysis Services log files. ASLOGDIR="Log" ; The location for the Analysis Services backup files. ASBACKUPDIR="Backup" ; The location for the Analysis Services temporary files. ASTEMPDIR="Temp" ; The location for the Analysis Services configuration files. ASCONFIGDIR="Config" ; Specifies whether or not the MSOLAP provider is allowed to run in process. ASPROVIDERMSOLAP="1" ; 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 AUTHORITY\NETWORK SERVICE" ; Windows account(s) to provision as SQL Server system administrators. SQLSYSADMINACCOUNTS="BUILTIN\ADMINISTRATORS" ; The default is Windows Authentication. Use "SQL" for Mixed Mode Authentication. SECURITYMODE="SQL" ; SAPWD="mds134" ; Specify 0 to disable or 1 to enable the TCP/IP protocol. TCPENABLED="0" ; Specify 0 to disable or 1 to enable the Named Pipes protocol. NPENABLED="0" ; Startup type for Browser Service. BROWSERSVCSTARTUPTYPE="Disabled" ; Specifies how the startup mode of the report server NT service. When ; Manual - Service startup is manual mode (default). ; Automatic - Service startup is automatic mode. ; Disabled - Service is disabled RSSVCSTARTUPTYPE="Automatic" ; Specifies which mode report server is installed in. ; Default value: “FilesOnly” RSINSTALLMODE="FilesOnlyMode"
我把它放在
SQLEXPR_x86_ENU.exe
文件旁邊。但如您所知SQLEXPR_x86_ENU.exe
,它是壓縮的,必須提取。我的問題是:解壓後
SQLEXPR_x86_ENU.exe
提示找不到Configuration.ini
!我怎樣才能繞過這個問題?
謝謝
我相信您必須指定文件的完整路徑,例如
C:\Temp\Configuration.ini
- 否則 SQL Server 安裝程序會嘗試在安裝程序的提取文件夾中找到它,通常是C:\some_big_long_gui\
.您還有一些配置選項(例如
IAcceptSQLServerLicenseTerms
)對於您使用的版本無效(特別是在 SQL Server 2008 R2 中添加的版本)。我能夠使用以下配置文件成功安裝 SQL Server 2008 Express(我刪除了 Express 的不必要的 SSAS / SSRS / SSIS 選項、所有詳細註釋和無效條目):[SQLServer2008] INSTANCEID="SQLEXPRESS" ACTION="Install" FEATURES=SQLENGINE HELP="False" INDICATEPROGRESS="False" X86="False" ERRORREPORTING="False" SQMREPORTING="False" INSTANCENAME="SQLEXPRESS" SQLSVCSTARTUPTYPE="Automatic" ENABLERANU="True" SQLCOLLATION="SQL_Latin1_General_CP1_CI_AS" SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" SQLSYSADMINACCOUNTS="BUILTIN\ADMINISTRATORS" SECURITYMODE="SQL" ADDCURRENTUSERASSQLADMIN="True" SAPWD="mds134" TCPENABLED="0" NPENABLED="0" BROWSERSVCSTARTUPTYPE="Disabled"
以及以下命令行:
SQLEXPR_x86_ENU.exe /QS /ConfigurationFile="C:\Temp\Configuration.ini"
您必須指示您的使用者為此指定路徑。您可以將此作為引導程序的參數,但我不知道如何讓安裝程序找到您的配置文件而不為其指定顯式路徑。如果您告訴您的使用者將 exe 和 ini 文件複製到同一個文件夾,我相信您的包裝器可以找出必要的命令行。否則,您的使用者將不得不幫助確定路徑。
另一種選擇是只使用大量命令行而不是使用配置文件。無論如何,這似乎在設置過程中少了兩個步驟(確保已複製 ini 文件並確定它在哪裡)。除非目的是允許使用者使用配置文件更改某些參數。我認為這些可能應該在您使用包裝器部署的配置文件中,而不是 Express 的配置文件中。
如果您正在建構一個新的應用程序來部署 SQL Server,為什麼不使用 SQL Server 2012?我不確定它是否能解決配置文件問題(此頁面似乎暗示它不是必需的,但我在 2008 年或 2012 年沒有成功),但至少你將使用更新的版本,與更多功能和更長的支持時間,更可預測的命令行參數(我沒想到它們會在 2008 和 2008 R2 之間更改),並且數據庫對於安裝的引擎版本來說太現代的可能性更小。