MS SQL® Server Installation

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

Enable TCP/IP

The MS SQL® Server must be able to use the TCP/IP protocol. To enable a TCP\IP connection, follow the instruction on https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-a-server-to-listen-on-a-specific-tcp-port?view=sql-server-ver16

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

Install the MS SQL® Server (see the setup of the MS SQL® Server DB).

On the WinCC OA server:

Windows:

Linux: