Install SQL scripts

  • Hi,

    How can I install SQL Server 2005 STD by script?

    It is possible?

    Thanks.

  • there is a Template.ini file on your install dvd.

    It describes all parameters.

    You may come up with something like this:

    ; C = Software X = data

    ; IMPORTANT: THIS IS A TEMPLATE .INI FILE FOR THE SQL SERVER 2005 UNATTENDED INSTALLATION,

    ; MODIFICATION TO THIS FILE IS REQUIRED TO USE DURING SETUP.

    ; User must fill in the required information for installation and comment out or delete any non-related information.

    ; To comment out a line, preface it with a semicolon ‘;’. Items in angled brackets ‘<>’ should be replaced with information without brackets. To determine the information required by your installation, read the descriptions that are provided for each parameter or refer to the SQL Server Books Online help for additional information.

    ; To use this .ini file, use the /settings switch on the SQL Server 2005 Setup.exe command line.

    ; For example:

    ; ALZDBA (dvddrive = drive E)

    ;start /wait E:\SQL2005STDV_Source\Servers\setup.exe /qb /settings C:\Install_ALL_Parameterset_NamedInstance_DevEdtn_CX.ini

    ; ALZDBA logs can be found at C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG

    ; *********************************************************************************

    ; Command line examples:

    ; /qn is quiet mode, no GUI is displayed.

    ; /qb is quiet mode, basic GUI information is displayed, no user interaction is required. Use /qb for troubleshooting command line problems.

    ;1b. New Named instance installation: (Applies to all other SQL Server Editions)

    ; i) Install Database Services instance, Replication, connectivity and SQLXML components:

    ; start /wait setup.exe /qb INSTANCENAME=SQL2005STD ADDLOCAL=SQL_Engine,SQL_Replication,Client_Components,Connectivity,SQLXML SAPWD=

    ; 4. Uninstall Default Standalone installation: (This removes all features of default SQL Server)

    ; start /wait setup.exe /qb REMOVE=ALL INSTANCENAME=SQL2005STD

    ;--------------------------------------------------------------------

    ;--------------------------------------------------------------------

    ; The following line is REQUIRED when using a settings file.

    [Options]

    ;--------------------------------------------------------------------

    ; If USERNAME or COMPANYNAME are not specified, the default operating system username and company name values for the server are used.

    ; Note: If names contain spaces, surround the names with quotes.

    ;

    USERNAME=

    COMPANYNAME=

    ;--------------------------------------------------------------------

    ;--------------------------------------------------------------------

    ; PIDKEY specifies the Product Identification Key.

    ; Usage: PIDKEY=ABCDE12345FGHIJ67890KLMNO (This is not an actual key value.)

    ; NOTE: PIDKEY is not required for SQL Server Express Edition.

    ; NOTE: Do not include "-" in the PIDKEY.

    PIDKEY=

    ;--------------------------------------------------------------------

    ; INSTALLSQLDIR specifies the location for the instance specific binary files.

    ; Default location is: %ProgramFiles%\Microsoft SQL Server; To use the default path, do not specify the following parameter.

    ; ALZDBA use default path

    ;INSTALLSQLDIR=

    ;--------------------------------------------------------------------

    ; INSTALLSQLSHAREDDIR specifies a custom location for Integration Services

    ; Notification Services, Client Components, SQL Server Books Online and Samples.

    ; To use the default path, do not specify the following parameter. Default path is %ProgramFiles%\Microsoft SQL Server

    ; If Tools components are already installed on the computer, this parameter is ignored.

    ; NOTE: If there is a space in a specified path, surround the path with quotes

    ; and end every path with a '\'.

    ; The installation paths will be:

    ; \90\DTS

    ; \90\Notification

    ; \90\Tools

    ; ALZDBA default path

    ;INSTALLSQLSHAREDDIR=

    ;--------------------------------------------------------------------

    ; INSTALLSQLDATADIR specifies the location for the SQL Server data files.

    ; Default: INSTALLSQLDIR\Data; To use the default path, do not specify the following parameter.

    ; NOTE: INSTALLSQLDATADIR is REQUIRED for clustered installations and must point to a

    ; shared drive which is a member of the cluster group specified for installation.

    ; NOTE: If there is a space in a specified path, surround the path with quotes

    ; and end every path with a '\'.

    ; ALZDBA D-drive is datadrive

    ; Installatie creeert eigen folders !

    INSTALLSQLDATADIR=X:;--------------------------------------------------------------------

    ; INSTALLASDATADIR specifies the location for the Analysis Server Data Files.

    ; Default: INSTALLSQLDIR\Data; If Analysis Server is already installed on the computer, this parameter is ignored.

    ; To use the default path, do not specify the following parameter.

    ; ALZDBA gebruik eigen datadir voor SSAS (is being created automaticaly)

    INSTALLASDATADIR=X:

    ;--------------------------------------------------------------------

    ; ADDLOCAL specifies which components to install. If ADDLOCAL is not

    ; specified, setup will fail.

    ; To install all components specify 'ADDLOCAL=ALL' on the command line.

    ; ADDLOCAL Rules:

    ; Features are case sensitive.

    ; To use ADDLOCAL, provide a comma-delimited list with no spaces of the features to install.

    ; Selecting a parent feature only installs the parent feature, not the parent and the child.

    ; For example: SQL_Engine is the parent feature, SQL_Data_Files is the child feature.

    ; Installing the child feature automatically installs the parent feature.

    ; Removing the parent feature removes the parent and all child features. See BOL for more information on this topic.

    ; ALZDBA install all components

    ADDLOCAL=ALL

    ;REMOVE=

    ; all options for ADDLOCAL/REMOVE

    ;=SQL_Engine,SQL_Data_Files,SQL_Replication,SQL_FullText

    ;,Analysis_Server,AnalysisDataFiles

    ;,RS_Server,RS_Web_Interface

    ;,Notification_Services,NS_Engine,NS_Client

    ;,SQL_DTS

    ;,Client_Components,Connectivity,SQL_Tools90,SQL_WarehouseDevWorkbench,SDK,SQLXML,Tools_Legacy

    ;,SQL_Documentation,SQL_BooksOnline,SQL_DatabaseSamples,SQL_AdventureWorksSamples,SQL_AdventureWorksDWSamples,SQL_AdventureWorksASSamples,SQL_Samples

    ;--------------------------------------------------------------------

    ; INSTANCENAME is REQUIRED; for a default instance use SQL2005STD

    ; For shared components (IS, NS and client components) INSTANCENAME is not required.

    ; ALZDBA SQL2005STD for instance name

    INSTANCENAME=SQL2005STD

    ;--------------------------------------------------------------------

    ; The UPGRADE property specifies which product to upgrade.

    ; The allowed values are SQL_Engine, Analysis_Server, RS_Server, SQL_DTS, Notification_Services, Client_Components

    ; If the UPGRADE option is specified for the values (SQL_Engine, Analysis_Server, RS_Server), the INSTANCENAME parameter

    ; is REQUIRED to define which instance to upgrade.

    ; For example, to upgrade a default instance of Database Services

    ; use the following command line:

    ; UPGRADE=SQL_Engine INSTANCENAME=SQL2005STD

    ; To upgrade a named instance of SQL in which the SQL Service

    ; is running under a domain account, and you would like to

    ; add the client components and tools, run this command:

    ; UPGRADE=SQL_Engine INSTANCENAME=

    ; SQLACCOUNT=

    ; ADDLOCAL=Client_Components

    ; ALZDBA new instance, no upgrade

    ;UPGRADE=

    ;--------------------------------------------------------------------

    ; The RSUPGRADEDATABASEACCOUNT and RSUPGRADEPASSWORD properties specify the Reporting Services database account and Reporting Services upgrade password respectively.

    ; For example to upgrade Default instance of Reporting Services and Database Services use the following command:

    ;/qb ADDLOCAL=All RSCONFIGURATION=Default RSSQLLOCAL=1 RSACCOUNT=

    ; ALZDBA new instance, no upgrade

    ;RSUPGRADEDATABASEACCOUNT=

    ;RSUPGRADEPASSWORD=

    ;--------------------------------------------------------------------

    ; SKIPUPGRADEBLOCKERS switch can be used during unattended upgrade setup. To enable this switch Specify 1 and to disable do not use this switch.

    ; NOTE: During upgrade if this switch is used, Upgrade Blockers checks will run, however blocked results will be skipped.

    ; If Upgrade Blockers identifies blocked results, using this switch may result into failed setup.

    ;SKIPUPGRADEBLOCKERS=1

    ;--------------------------------------------------------------------

    ; SAVESYSDB can be used during uninstall to not delete system databases.

    ; If SAVESYSDB is set to 1 during uninstall, the system databases are left behind in the SQL data directory.

    ; ALZDBA new instance, no upgrade

    ;SAVESYSDB=

    ;--------------------------------------------------------------------

    ; USESYSDB specifies the root path to the data directory of the system databases during upgrade.

    ; For example: If the system databases were installed to "D:\Microsoft SQL Server\MSSQL.1\MSSQL\DATA", use SAVESYSDB during uninstall to save the system databases and then use USESYSDB="D:\Microsoft SQL Server\MSSQL.1\MSSQL" during installation of a new SQL Server instance to reuse the saved system databases.

    ; ALZDBA new instance, no upgrade

    ;USESYSDB=

    ;--------------------------------------------------------------------

    ; The services for SQL Server and Analysis Server are set auto start. To use the *ACCOUNT settings

    ; make sure to specify the DOMAIN, e.g. SQLACCOUNT=DOMAINNAME\ACCOUNT

    ; NOTE: When installing SQL_Engine 3 accounts are REQUIRED: SQLACCOUNT, AGTACCOUNT and SQLBROWSERACCOUNT.

    ; SQLACCOUNT Examples:

    ; SQLACCOUNT=

    ; SQLACCOUNT="NT AUTHORITY\SYSTEM"

    ; SQLACCOUNT="NT AUTHORITY\NETWORK SERVICE"

    ; SQLACCOUNT="NT AUTHORITY\LOCAL SERVICE"

    ; Note: To install localized versions of SQL Server, refer to the Localized Service Names table in the SQL Server Books Online topic "Setting Up Windows Service Accounts"

    ; Note that if SQLBrowser is already installed, SQLBROWSERACCOUNT and SQLBROWSERPASSWORD are ignored.

    ; ALZDBA voorlopig alles op local system gezet !

    SQLBROWSERACCOUNT="NT AUTHORITY\SYSTEM"

    ;SQLBROWSERPASSWORD=

    SQLACCOUNT="NT AUTHORITY\SYSTEM"

    ;SQLPASSWORD=

    AGTACCOUNT="NT AUTHORITY\SYSTEM"

    ;AGTPASSWORD=

    ASACCOUNT="NT AUTHORITY\SYSTEM"

    ;ASPASSWORD=

    RSACCOUNT="NT AUTHORITY\SYSTEM"

    ;RSPASSWORD=

    ;--------------------------------------------------------------------

    ; To use the *AUTOSTART features, specify 1 to start automatically or 0 to start manually.

    ; NOTE: If you decide to start SQL Agent automatically, then SQL is also started automatically.

    ; If *AUTOSTART is not specified on the command line, startup is set to manual.

    ; ALZDBA enkel sqlserver en sqlagent starten

    SQLBROWSERAUTOSTART=1

    SQLAUTOSTART=0

    AGTAUTOSTART=0

    ASAUTOSTART=0

    RSAUTOSTART=0

    ;--------------------------------------------------------------------

    ; To use Mixed mode authentication, use SECURITYMODE=SQL.

    ; If SECURITYMODE=SQL is not specified, then Windows Authentication only will be used by default.

    ; If you use SQL Authentication, you are REQUIRED to provide a strong system administrator (SA) password.

    ; If you use Windows Authentication, the SA account will be disabled.

    ; To set SA password specify SAPWD.

    ;ALZDBA always use mixed mode !

    SECURITYMODE=SQL

    SAPWD=

    ;--------------------------------------------------------------------

    ; SQLCOLLATION specifies the collation for Database Services.

    ; ASCOLLATION specifies the collation for Analysis Server.

    ; See SQL Server Books Online for more information on collation options.

    ;ALZDBA

    SQLCOLLATION=Latin1_General_CP1_CI_AS

    ASCOLLATION=Latin1_General_CP1_CI_AS

    ;--------------------------------------------------------------------

    ; Information for rebuilding system databases

    ; When system databases are corrupted, they need to be brought back to the original installed state. To rebuild the system databases set REBUILDDATABASE=1.

    ; This option is only available in unattended setup; either option /qb or /qn must be used

    ; When system databases are rebuilt it removes all database objects and data in master, model and msdb.

    ; In order to rebuild system databases new sa password is REQUIRED and system collation can be provided. In addition, the following parameters need to be provided: SQLACCOUNT, SQLPASSWORD, SQLAGTACCOUNT, SQLAGTPASSWORD, SQLBROWSERACCOUNT, SQLBROWSERPASSWORD

    ; ALZDBA new instance, no repair

    ;REBUILDDATABASE=

    ;--------------------------------------------------------------------

    ;REINSTALLMODE is used to repair installed components. The supported values are:

    ;O – Reinstall if file is missing, or an older version is present.

    ;M – Rewrite machine specific reg keys under HKLM

    ;U – Rewrite user specific reg keys under HKCU

    ;S – Reinstall all shortcuts

    ;When using REINSTALLMODE you are REQUIRED to use REINSTALL

    ;REINSTALL uses the same values as ADDLOCAL.

    ;This option is only available in unattended setup either option /qb or /qn must be used.

    ;For example, to repair the Management Studio shortcut in case you accidentally delete it,

    ;run REINSTALL=SQL_Tools90 REINSTALLMODE=S where “S” will repair only shortcuts.

    ; For example:

    ; REINSTALLMODE=S

    ; REINSTALLMODE=OMUS

    ; ALZDBA new instance, no repair

    ;REINSTALLMODE=

    ;--------------------------------------------------------------------

    ; RSCONFIGURATION specifies the Reporting Services installation option.

    ; The installation options can be either “FilesOnly” or “Default”.

    ; The “FilesOnly” option will only install the files without configuring the Reporting Services.

    ; The “Default” option will install the files and configure the Reporting Services.

    ; If you specify RSCONFIGURATION=Default, you must set RSSQLLOCAL=1

    ; NOTE: If no option is specified the default is “FilesOnly”.

    ; For example:

    ; RSCONFIGURATION=Default

    ; RSCONFIGURATION=FilesOnly

    ; ALZDBA RS kan niet worden geïnstalleerd omdat IIS niet actief is !

    ; ALZDBA RSCONFIGURATION=FilesOnly (in princiepe is IIS niet geactiveerd)

    RSCONFIGURATION=FilesOnly

    ;--------------------------------------------------------------------

    ; The RSUPGRADEDATABASEACCOUNT and RSUPGRADEPASSWORD are used for upgrading a report service.

    ; The account is used to connect to SQL instance that hosts RS databases. If it is not specified

    ; NT authenticatuion is used.

    ; ALZDBA new instance, no upgrade

    ;RSUPGRADEDATABASEACCOUNT=

    ;RSUPGRADEPASSWORD=

    ;--------------------------------------------------------------------

    ; SAMPLEDATABASESERVER specifies the SQL Server instance where the sample

    ; databases will be attached. The parameter is used when AdventureWorks Samples or

    ; AdventureWorksDW Samples features are being installed.

    ; Sample databases need to be attached to an existing local SQL instance that is the same

    ; version as sample databases.

    ; For example: SAMPLEDATABASESERVER=

    ; ALZDBA local default instance to be used for samples

    SAMPLEDATABASESERVER=.\SQL2005STD

    ;--------------------------------------------------------------------

    ; The DISABLENETWORKPROTOCOLS switch is used to disable network protocol for SQL Server instance.

    ; Set DISABLENETWORKPROTOCOLS = 0; for Shared Memory= On, Named Pipe= On, TCP= On

    ; Set DISABLENETWORKPROTOCOLS = 1; for Shared Memory= On, Named Pipe= Off (Local Only), TCP= Off

    ; Set DISABLENETWORKPROTOCOLS = 2; for Shared Memory= On, Named Pipe= Off (Local Only), TCP= On

    ; Note: DISABLENETWORKPROTOCOLS if not specified has the following defaults.

    ; Default value for SQL Server Express/Evaluation/Developer: DISABLENETWORKPROTOCOLS =1

    ; Default value for Enterprise/Standard /Workgroup: DISABLENETWORKPROTOCOLS =2

    ; ALZDBA only use TCP\IP

    DISABLENETWORKPROTOCOLS=2

    ;--------------------------------------------------------------------

    ; If you enable ERRORREPORTING, SQL Server, SQL Server Agent and Analysis Server will be configured to automatically send a report to Microsoft if a fatal error occurs.

    ; Microsoft uses error reports to improve SQL Server functionality, and treats all information as confidential.

    ; To enable error reporting specify ERRORREPORTING=1

    ; By default ERRORREPORTING=0

    ; ALZDBA no errorreporting to Microsoft

    ERRORREPORTING=0

    ;--------------------------------------------------------------------

    ; If you enable SQMREPORTING, SQL Server Products will be configured to automatically

    ; send periodic reports to Microsoft on feature usage. These reports are used to better understand

    ; how our customers use our products: which SQL services are installed, which features are being used,

    ; database deployment, use, and maintenance patterns, etc. This will help us determine how to improve reliability and how to better target resources in ; future offerings.

    ; To enable error reporting specify SQMREPORTING=1;

    ; By default SQMREPORTING=0

    ; ALZDBA no usage info send to Microsoft

    SQMREPORTING=0

    ;--------------------------------------------------------------------

    ; The ENABLERANU switch is used to configure Run as Normal User (User Instances).

    ; Set ENABLERANU = 0 to turn User Instances off.

    ; Set ENABLERANU = 1 (default) to turn User Instances on.

    ; Note: User Instances only apply to SQL Server Express SKUs.

    ; ALZDBA parameter commented because we do not use SSExS

    ;ENABLERANU=

    ; ALZDBA clustering parameters removed !

    Check your parameters and adjust them to your needs.

    Only install what you actualy need !

    (you can add on later)

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Some useful links which i have regarding your query...

    Using LOGNAME Parameter to get output from one time installation and later you can use them in your template.ini

    http://www.devx.com/dbzone/Article/31648

    Some experiences of Unattended Installation

    http://blogs.sqlservercentral.com/haidong_ji/archive/2005/10/14/231.aspx

    Regards,
    Sakthi
    My Blog -> http://www.sqlserverdba.co.cc

  • Hi,

    ALZDBA, your script is very good. I will trying execute tonight ...

    Thank's so much..

    Sakthivel Chidambaram, tkank's your hint ..

    Sorry my bad English

  • FYI, the template.ini file can be found on your installation media (D:\Servers\template.ini, for example). This sample file explains each of the parameters in detail.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply