Smart Grid Applications Overview > Smart Operations Solution > AMI Integration > Set Up SQL Server Database |
Version: 10.1 |
Before starting AMI configuration, you will need to run several scripts that generate tables as well as configure existing tables to support AMI events. Follow the steps on this page to run these scripts.
AMI requires read-committed snapshot isolation on the database that will contain the AMI tables. The SQL commands below require a user with dba permissions with exclusive access to the database. In the examples below, replace <database name> with the name of the database that will hold the AMI tables.
|
By default, the scripts are installed in the following location: C:\Program Files (x86)\Miner and Miner\Responder\Developer Resources\Implementation Scripts\MS-SQL\Addons
These scripts must be run in the order listed.
Ensure that you are the only database connection (i.e., no other services running against the database, open applications connected to the database, etc.) |
Script | Description |
---|---|
SmartGridAMI_01_ConfigureServicePoints.bat |
Configures the ServicePoint (or equivalent) feature class for use with AMI objects. |
SmartGridAMI_02_CreateStateStore.sql |
Script requires modification. Creates the schema for AMI state store. |
SmartGridAMI_03_RegisterAMIEvents.bat |
Configures the necessary ArcSDE components necessary to support AMI events. |
SmartGridAMI_04_CreateConfigStore.sql |
Creates the Configuration table for centralized configuration. |
SmartGridAMI_05_LoadConfigStore.sql |
Loads the initial values for centralized configuration of the Responder AMI integration. |
SmartGridAMI_05a_LoadEventMapping2010.sql |
Run this script only if you are implementing Responder AMI 10.0.2, which leverages the event types defined in the CIM 61968-9 standard tested in the January, 2010. Do not run this script if you have run or plan to run other scripts that load event types (for example, SmartGridAMI_05a_LoadEventMapping201111.sql). |
SmartGridAMI_05a_LoadEventMapping201111.sql |
Run this script only if you are implementing Responder AMI 10.0.3 or greater, which leverages the event types defined in the CIM 61968-9 2nd Ed. standard tested in November, 2011. Do not run this script if you have run or plan to run other scripts that load event types (for example, SmartGridAMI_05a_LoadEventMapping201110.sql). |
SmartGridAMI_06_LoadConfigRole.sql |
Creates the Smartgrid Administrator role and assigns it to the administrator user. |
SmartGridAMI_07_LoadStateStore.sql |
Script requires modification. Loads the AMI state store from the Responder RX_CUSTOMERS table and the ServicePoint_ST feature class. |
SmartGridAMI_08_RefreshStateStore.sql |
Refreshes the state store based on changes that may have occurred in the ServicePointFeature class or the RX_CUSTOMERS table. |
Use the steps outlined below to run the scripts listed above. Use an application such as SQL Plus to execute these scripts.
Before you begin the set-up process using the scripts described on this page, it is important to first make a backup of the database. |
This script configures the ServicePoint feature class. The steps below will walk through how to modify the script to point to the feature class that represents service points in your geodatabase.
This script will break any existing spatial views based on the ServicePoint feature class. These should be dropped before starting and created after AMI configuration is complete. |
This script has a few pre-requisites:
Follow the steps below to execute the script:
Do I have a multi-versioned view? In ArcCatalog, look for an object named similarly to your ServicePoint feature class. This object will likely have a suffix of _MV. This object will not reside in the dataset next to the ServicePoint feature class, but rather in the root of the geodatabase. In the example below, the multi-versioned view is named ELECDIST.SERVICEPOINT_MV. The feature class used to create this view is called ELECDIST.SERVICEPOINT. If you don't see a view named like this in ArcCatalog, you may need to query the database. Below is a sample query. Replace the values in blue with values specific to your database. select imv_view_name from database.schema.SDE_table_registry where table_name='SERVICEPOINT' and owner='TableOwner' |
This script creates the AMI tables in the geodatabase. The following pre-requisites exist:
Before executing this script, you'll need the following information.
To edit and then execute this script, follow the steps outlined below.
use powerstream
/***************SET THESE VARIABLES!!***************************/
-- Set these to the same values as your servicepoint feature class
SET @MINX = 582314.87000
SET @MINY = 4845356.71806
SET @MAXX = 646752.15600
SET @MAXY = 4961888.36000
-- Set the DB and SCHEMA name for your servicepoint feature class
SET @SERVICEPOINT_DB = 'POWERSTREAM'
SET @SERVICEPOINT_OWNER = 'PSGIS'
-- Set the DB and SCHEMA name for your rx_customers table
SET @RX_CUSTOMERS_DB = 'RESPONDER'
SET @RX_CUSTOMERS_OWNER = 'RESPONDER'
-- Set the name of your multiversioned view against the servicepoint feature class.
SET @MULTIVERSIONED_VIEW_NAME='SERVICEPOINTS_MV'
This script registers the AMI_Events database view as a layer with ArcSDE. It also grants View permissions to the owner of the AMI objects so that it can be viewed in ArcMap. This script requires some modification. The script will prompt you to provide the following information:
Follow the steps below to execute the script:
This script creates a centralized configuration schema for the Responder AMI integration. Login as owner of the Responder tables (e.g., responder) and run SmartGridAMI_04_CreateConfigStore.sql in an application such as SQL Server Client or SQL Server Management Studio.
This script loads the initial values into the centralized configuration (Configuration Manager) of the Responder AMI integration. The settings this script loads into the Configuration Manager may not be accurate for your system. However, you will modify these initial values in the Configuration Manager in a future step.
Execute the script as the owner of the Responder tables (e.g., responder). You can use an application such as SQL Server Client or SQL Server Management Studio.
This script creates a Responder security role for the administrator user required by the Responder AMI integration. Login as the owner of the Responder tables (e.g., Responder). Run SmartGridAMI_06_LoadConfigRole.sql in an application such as SQL Server Client or SQL Server Management Studio.
Values in the Meter field of the RX_CUSTOMERS table must be unique. Before executing this next script, ensure that there ar no duplicate values in this field. Before executing SmartGridAMI_07_LoadStateStore.sql, you'll need the following information.
Follow the steps below to edit the SmartGridAMI_07_LoadStateSTore.sql script before executing it.
/***************SET THESE VARIABLES!!***************************/
-- Set these to the same values as your servicepoint feature class
SET @MINX = 580644.09381
SET @MINY = 4845356.71906
SET @MAXX = 646752.15600
SET @MAXY = 4961888.36000
-- Set the DB and SCHEMA name for your servicepoint feature class
SET @SERVICEPOINT_DB = 'POWERSTREAM'
SET @SERVICEPOINT_OWNER = 'PSGIS'
-- Set the DB and SCHEMA name for your rx_customers table
SET @RX_CUSTOMERS_DB = 'RESPONDER'
SET @RX_CUSTOMERS_OWNER = 'RESPONDER'
-- Set the name of your multiversioned view against the servicepoint feature class.
SET @MULTIVERSIONED_VIEW_NAME='SERVICEPOINTS_MV'
This script refreshes the AMI state store table based on changes that may have occurred in the ServicePoint feature class or the RX_CUSTOMERS table. Login as owner of the AMI tables (e.g., smartgrid) and run SmartGridAMI_08_RefreshStateStore.sql in an application such as SQL Server Client or SQL Server Management Studio.
Set the default database for the SmartGrid user to the database that contains the AMI State Store. Likewise, set the default database for the Responder user to the database containing Responder tables.