Creating History Infrastructure

Scenario: You want to create and configure HDB on the Desigo CC Server and link it to the project so that the data is logged in the HDB. You can also create an LTS to archive project data such as values, events, activities, and incidents.

For working with the HDB on a remote server, follow the steps as indicated. Once created you should link it to the project and encrypt the communication between the HDB on the remote server and the server project. (see Encrypting the Communication Between Project and Remote HDB)

For information on creating and configuring the notification database, see Creating Notification Database (NDB).

 

Reference: For background information, see the reference section.

 

Workflow diagram:

 

 

Prerequisites:

  • For the hard disk sector-size support boundaries in the SQL server, you have reviewed the http://support.microsoft.com/kb/926930/[language code] from Microsoft.
  • SQL Server or SQL Server Express is installed and available.
  • A named instance is defined on the SQL Server.
  • The host name of the SQL Server is not more than 15 characters.
  • The Windows user configured in the System Account and in the HDB Service Account must be valid and assigned all required rights. See Log on as a Service Right in System Settings Procedures.
  • The SQL Server Browser is set to automatic (see Enabling the SQL Server Browser).
  • All required Windows system users are available.
  • To work with SQL Server on the remote machine, the following prerequisites apply:
  • SMC must be launched , the following prerequisites apply :
    • The required Windows account configured on SQL Server with sysadmin fixed server role is available.
    • If the required privileges are not available a dialog box appears to provide a Windows account configured on SQL Server with sysadmin fixed server role.
    • SMC launched with a Windows HDB owner user when HDB workflow do not need system administrator privileges.
    • HDB workflows such as change HDB owner, which need system administrator privileges, a dialog box displays to provide a user having system administrator privileges on the SQL Server.
  • For linking the HDB to the Server project, the Server project is created in SMC.

 

Steps:

1 – Scan and Link an SQL Server Instance
  • A named instance is defined on the SQL Server.
  1. In the SMC tree, select Database Infrastructure.
  1. Select the Historic Data tab.
  1. Select the SQL Servers expander and click Scan Local. This detects all SQL Servers on the local computer. To work with remote HDB do any of the following steps:
  • Click Scan Network: Detects all SQL Servers on the local network. Only those Server names are displayed that are found within 30 seconds.
  • In the Manual search text field, type the Server and instance number, for example, CH1Wxxxx\SQL Server Name and click Search Server (validation of computer name).
    This Search Server option is only required when no SQL Server could be found locally or on the network because of the fact that customer system administrators or SQL administrators can setup and hide their SQL servers to remain invisible with the two options of Scan Local and Scan Network.
  1. In the SQL Servers expander, select the SQL Server name.
  1. Click Link .
  • The server is connected. The server does not yet contain a History Database if you connect for the first time.

 

2 – Create a New HDB with Long Term Storage
  • The destination folder where the HDB data and log files will be stored, typically GMSDatabases, is not compressed.
  1. In the SMC tree, select Database Infrastructure > [SQL Server Name].
  1. Click Create and select Create History Database from the displayed options.
  1. Open the Database Information expander and enter data into the following fields:
  • DB name: Enter a name for the HDB (do not use special characters, for more information, see Settings.)
  • Database size: Set the size of the HDB:
    ‒ Maximum 10 GB for SQL Server Express
    ‒ Maximum 250 GB for SQL Server
    (For additional information on the database size, see the NOTE following this procedure).
  • Recovery model: Select the backup model Simple or Full for the history database. The backup model can be manually changed in both directions at any time. Long term storage databases are always in recovery model Full. (For more information, see Recovery Models).
  • Administration model: Select the option Automatic or Manual.
    Automatic (strongly recommended): Select automatic to run all HDB maintenance tasks by the HDB service.
    Manual (not recommended): This is set only in specific cases wherein the customer does not want the Siemens GMS HDB Service to run with advanced privileges or even does not want the service itself.
    For more details, see the Manual Administration Model (A6V11559132).
  1. Select the Files and Paths expander (do not use special characters - for more information, see Files and Paths) and enter the following data:
  • Data file: C:\[MyHDB]\HDB.mdf
  • Log file: C:\[MyLog]\HDB.ldf
  • Backup file: C:\[MyBak]\HDB.bak
  • Recovery log path: C:\[MyRevoveryPath]
    NOTE:
    If you do not use the standard paths in the Data file, Log file, Backup file, and Recovery log path fields and if the SQL Server is on a different computer, you must first create the folders before you click Save.
  1. Select the Security expander and check the displayed user names.
    a. DB owner: Desigo CC SMC user who requires HDB owner rights. You can change it as required. The HDB owner must be different than the HDB user and the HDB service user.
    b. DB user: Desigo CC project user who requires HDB user rights for read and write operations. You can change it as required in System Account Settings. See Settings Expander in SMC System Settings.
    c. DB service user: Desigo CC service user who requires HDB service user rights for maintenance operations. You can change it as required HDB Service Account Settings. See Settings Expander in SMC System Settings.
  1. (Optional) Select the Long Term Storage expander and enter or select the following data:
  • Data files: Select the destination where you want to save the data files (.mdf).
  • Log files: Select the destination where you want to save the log files (.ldf).
    NOTE: Due to security and performance reasons, save the data and log files on two separate physical hard disks (not two separate partitions).
  • Recovery files: Select the destination where you want to save the recovery files.
  • Storage slices: Enter how many storage slices the Long Term Storage should have (max. 10). When this number is reached, the oldest storage slice is archived. The Slices table shows the storage slices.
  • Max size: Set the maximum size of a storage slice.
    Maximum 9 GB on SQL Server Express, default is 9 GB
    Maximum 250 GB on SQL Server, default is 9 GB
    When this number is reached, another storage slice is created. As long term storage databases are always in recovery model Full each database slice would require twice as much as space of the max size specified, one portion for the Data file and the other for the T-Log file.
    NOTE: This entry may override the entry in the Time Sliced field.
  • Archives: Select a destination where you want to save the archived storage slices. The Archives table shows the archived storage slices.
    NOTE: If you do not use the standard paths in the Data files, Log files, Recovery files, and Archives fields and if the SQL Server is on a different computer, you must first create the folders before you click Save.
  • Start: Select to activate the storage. The storage will be activated when you click Save.
  • Time Sliced: Select when the storage has to be sliced.
    No: A new storage slice is created when the current slice reaches the max size.
    Monthly: A new storage slice is created each month.
    Yearly: A new storage slice is created each year
    NOTE: This entry may override the entry in the Max size field.
  • Closing Time: Select at what time a new storage slice is created in case of time sliced.
  • Add Storage: Click to create more Long Term Storages.
    NOTE: Rename the default storage name in System Browser if requested.
  1. Click Save .
  1. Click Yes.
  • The History Database is created and displays in the SMC tree. This may take a few minutes depending on the selected database size. When you create a new HDB it gets automatically linked to the SQL Server. However, if the History Database creation fails due to mismatch in the localization settings, see troubleshooting.
  • The History Database starts automatically.
  • History data is logged after linking to the project.
Information

NOTE 1:
Select a database size on the engineering computer that is not overly large (1 to 5 GB). The larger the database, the longer it takes to restore date to a customer computer. After restoring data to the customer computer, select Change HDB Properties and extend the database file size according to the project requirements (50 to 250 GB).
NOTE 2:
We recommend not encrypting the hard disk where the database is located. If you encrypt the hard disk with a software application, such as BitLocker, the SMC may not be able to connect to the database. If you want to encrypt your hard disk, use the SQL Server Enterprise Edition, which has Transparent Data Encryption (TDE).

 

NOTICE
Data Loss

Data loss will differ depending on the selected recovery model (Simple or Full). For more information, see Recovery Models.

 

3 – Link an HDB to the Project
  1. In the SMC tree, select the project.
  1. Select the Project Settings tab and then the Server Project Information expander.
  1. In the Linked HDB drop-down list, select the History Database.
  1. Click Save .
  • The History Database is linked with the project and logs history data.

Once the HDB and LTS are created, you can assign the default archive groups and custom archive groups to the LTS storage or STS/HDB. You can also configure the filter groups for filtering the COV data to be stored in the configured HDB or configured Archive group. For more information, see Examples of Archiving Concepts.