MS SQL® Server Installation

Proceed as follows to install an MS SQL® Server on your operating system:

  • Download and install the MS SQL® Server. For the supported server version, see chapter Software Requirements .

During the MS SQL® Server installation:

  • In the Feature Selection tab check the following options:
    • Database Engine Services.
    • SQL Server replication.
    • Client Tools Connectivity.
      Figure 1. MS SQL® Server Installation - Feature Selection
  • Click on next until the Database Engine Configuration window is opened. Set the server authentication type to Mixed Mode (SQL Server and Windows Authentication mode).
    Figure 2. SQL Server - Authentication Mode
  • Specify the password for the SQL Server system administrator (sa) account (see above).
Note: The password for the default sa user must be specified. Otherwise the sa user will be disabled.

Enable TCP/IP

  • The MS SQL® Server must be able to use the TCP/IP protocol. To enable a TCP\IP connection, follow these steps:

    • Open the SQL Server Configuration Manager via the Start menu.
    • Select the SQL Server Network Configuration.
    • Double-click on protocols for your instance name.
    • If not enabled already, right-click on TCP/IP and choose Enable (See the figure SQL Server Network Configuration below).
      Figure 3. SQL Server Network Configuration
  • Double-click on the TCP/IP entry.
  • Click on the IP Addresses tab and navigate to IPAll.
  • Specify the TCP port, type the port number you want use for MS SQL® Server, and then click on OK - See the figure TCP Port Configuration below.
    Figure 4. TCP Port Configuration
  • Restart the SQL Server service via Services (Windows start menu > Services).
    Figure 5. Restart the SQL Server

DB schema creation

  • For example, here the "D:/mssql" directory is used for Windows as the main directory for storing the WinCC OA database.
  • Create the database directories:
  • D:/mssql/db
  • D:/mssql/backups

Create a DB schema

Navigate to wincc_oa\data\NGA\MSSQLServer\Sql

  • Set the database parameters in db.windows.config for Windows or in db.linux.config for Linux. The available parameters including the default values are shown below.
    CAUTION: Only letters and numbers ([a-zA-Z0-9]) can be used for the content of the db.windows.config file.
    # DB connection settings
    dbServer=localhost	          # Server name.
    port=1433		            # Server port.
    adminUsername=sa		     # Database administrator user. The database that will be created will belong to the associated user.
    adminPassword=password	      # Database administrator user password.
    winccoaLogin=winccoa		 # Database server login. The login will be created if it does not exists.
    winccoaUsername=winccoa	     # Database user. The user will be created if it does not exists. The user will get minimum permission to work with the backend.
    winccoaPassword=password	    # Database user password.
    dbName=winccoa			# Name of DB instance to create.
    # DB specific options
    sqlscriprtpath=schema.sql          # The path to the SQL file to create the schema.
    numberType=DOUBLE PRECISION	 # Colum type of float values. Possible values are: DOUBLE PRECISION and NUMERIC
    dbInitSize=8MB                     # Specifies the initial size of the data file. The kilobyte (KB), megabyte (MB), gigabyte (GB), or terabyte (TB) suffixes can be used. Examples: 2KB, 2MB, 2GB, 2TB.
    dbFileGrowth=64MB                  # Specifies the automatic growth increment of the data file. The kilobyte (KB), megabyte (MB), gigabyte (GB), or terabyte (TB) suffixes can be used. Examples: 2KB, 2MB, 2GB, 2TB.
    logInitSize=8MB                    # Specifies the initial size of the log file. The kilobyte (KB), megabyte (MB), gigabyte (GB), or terabyte (TB) suffixes can be used. Examples: 2KB, 2MB, 2GB, 2TB.
    logFileGrowth=64MB                 # Specifies the automatic growth increment of the log file. The kilobyte (KB), megabyte (MB), gigabyte (GB), or terabyte (TB) suffixes can be used. Examples: 2KB, 2MB, 2GB, 2TB.
    logMaxSize=2097152MB               # Specifies the maximum size to which the log file can grow. The kilobyte (KB), megabyte (MB), gigabyte (GB), or terabyte (TB) suffixes can be used. Exam-ples: 2KB, 2MB, 2GB, 2TB.
    # DB directories
    dbPath="d:\mssql\db"		 # Path to DB schema files.
    dbBackupPath="d:\mssql\backups"    # Path to backed up segment files.                    
    • In the wincc_oa\data\NGA\MSSQLServer\Sql directory, run create_database_windows.ps1 for Windows or create_database_linux.sh for Linux to create a DB schema.
    • You can also use command line parameters for create_database_windows.ps1 and create_database_linux.sh instead of using the config file. For the command line parameters, see chapter Database settings .
    Note: The backup folder must be accessible for users under which the WinCC OA is running.

WinCC OA and MS SQL® Server on separate servers

For a WinCC OA project to work with an MS SQL® Server Backend, you need to perform the following steps:

On the database server

On the WinCC OA server:

Windows:

Linux:

  • Install the MS SQL® Server client packages:
  • For backups to work, create a symbolic link for the bcp utility:

    ln -s /opt/mssql-tools/bin/bcp /usr/local/bin/bcp