Appendix H. Using stand-alone SQL scripts
Repository Configuration Wizard uses default SQL server settings when it creates new SQL server database(s). If you want to create Sentinet Repository and/or Monitoring databases with custom settings (e.g. non-default location of the database files), you can create new empty databases with required custom settings using regular SQL server tools, and execute scripts located in the default Sentinet installation folder (C:\Program Files\Nevatech\Sentinet\SQL).
After you run SQL scripts described below in this chapter, you can run Repository Configuration Wizard selecting to use existing database(s). Automated deployment scripts can also be used against existing database(s).
The order of executing scripts depends on the deployment scenario, single Repository database or stand-alone Monitoring database. Once the order is determined based on selected scenario, the scripts can be executed sequentially according to the steps described below in this document. Administrators who execute these scripts can also merge scripts of the same step in a single SQL script before executing them.
Single Repository Database scenario
Execute the following SQL scripts in the order listed below:
Initialize Repository.sql
Create Tables Repository.sql
Create Tables Monitoring.sql
Create Procedures Repository.sql
Create Procedures Monitoring.sql
Populate Tables Repository.sql
Create Table Partitioning Monitoring.sql – execute this script if Monitoring tables partitioning is needed (optional)
Finalize Repository.sql
Repository Database with Stand-alone Monitoring Database scenario
Execute the following SQL scripts in the order listed below against new (empty and existing) Repository Database:
Initialize Repository.sql
Create Tables Repository.sql
Create Procedures Repository.sql
Populate Tables Repository.sql
Create Replication Repository.sql
Finalize Repository.sql
Execute the following SQL scripts in the order listed below against new (empty and existing) Monitoring Database:
Create Tables Monitoring.sql
Create Procedures Monitoring.sql
Create Replication Monitoring.sql
Create Table Partitioning Monitoring.sql – execute this script if Monitoring tables partitioning is needed (optional)
Important
Before executing Create Replication Repository.sql and Create Replication Monitoring.sql scripts, they must be initialized with parameters by uncommenting :setvar section at the top of the scripts.
Parameters are described in the comments of these scripts and in this document below.
Note
In some localized versions of SQL Server, you may receive an error, which contains The locale identifier (LCID) … is not supported by SQL Server. In this case, try to change SQL Server Agent’s account (for example, select built-in Network Service account) using SQL Server Configuration Manager tool.
Dropping SQL Server Replications
To ease possible management tasks on dropping replications created by Sentinet, the product is shipped with two additional helper SQL scripts. To drop replications, they have to be executed in the following order:
Drop Monitoring Data Replication.sql
Drop Repository Data Replication.sql
The scripts can be executed using either sqlcmd.exe SQL Server utility, or using SQL Server Management Studio’s query window in SQLCMD mode.
Drop Monitoring Data Replication.sql script must be executed against the Sentinet Monitoring Database. The script has the following input parameters, which must be initialized in the script by uncommenting :setvar section at the top of the script:
subscriberDb - required, the name of Sentinet Repository Database, i.e. Sentinet.
publisherDb - required, the name of Sentinet Monitoring Database, i.e. SentinetMonitoring.
publicationName - required, the publication name. The default value is SentinetMonitoringData.
publisher - required, the name of SQL Server instance that hosts Sentinet Monitoring Database.
subscriber - required, the name of SQL Server instance that hosts Sentinet Repository Database.
dropDistributor - required, 0 to drop the distributor or 1 to keep it. The default value is 0.
Drop Repository Data Replication.sql script must be executed against the Sentinet Repository Database. The script has the following input parameters, which must be initialized in the script by uncommenting :setvar section at the top of the script:
publisherDb - required, the name of Sentinet Repository Database, i.e. Sentinet.
publicationName - required, the publication name. The default value is SentinetConfigurationData.
publisher - required, the name of SQL Server instance that hosts Sentinet Repository Database.
subscriber - required, the name of SQL Server instance that hosts Sentinet Monitoring Database.
dropDistributor - required, 0 to drop the distributor or 1 to keep it. The default value is 0.