Importing data into operational tables

Importing data into operational tables always runs integrity checks on the data in the staging tables before doing the import. The staging tables must contain no rows that trigger an integrity check error. If an integrity check fails, PolicyCenter rolls back the whole import.

Before you import data into operational tables, you must set the server run level to maintenance. After the import completes, set the server run level back to multiuser.

The server removes all data from staging tables on successful completion of the load. If the integrity check generated errors, data remains in the staging tables.

Example commands are shown below.

  • Web service method examples
    var batchProcessID =
      TableImportAPI.integrityCheckStagingTableContentsAndLoadSourceTablesAsBatchProcess(
                                                                    clearErrorTable : true,
                                                                    populateExclusionTable : false,
                                                                    updateDBStatisticsWithEstimates : false,
                                                                    allowRefsToExistingNonAdminRows : false,
                                                                    numThreadsIntegrityChecking : 1)
  • Command prompt tool example
    table_import -password password -integritycheckandload -batch

Automated setting of properties and entities

The PolicyCenter load process uses callbacks to create various properties and entities. These callbacks populate user and time properties on imported entities as well as other internal or calculated values. If a property has a null value in the staging table and the data model specifies a default value, PolicyCenter sets the value of that property to the default value. In the data model files, properties that the callbacks create have the loadedByCallback attribute set to true.

PolicyCenter sets the value of the CreateUserID and UpdateUserID properties to the user ID of the user that authenticated the web service or command prompt tool. To facilitate the selection of imported records by a database query, use a specific PolicyCenter user to import the staging table data into operational tables.

Importing zone data into operational tables

To import only zone data to the operational tables, use the -zonedataonly option on the command prompt tool. For the web service TableImportAPI, call the method integrityCheckZoneStagingTableContentsAndLoadZoneSourceTablesAsBatchProcess. Specifying zone data import runs only the integrity checks for zone data and therefore completes in less time.

Oracle database statistics

The Oracle database optimizer chooses a query plan based on the database statistics. If you load large amounts of data to operational tables that have no records or only a few records, the tables in the database grow significantly. To ensure that the optimizer uses a suitable query plan after the load completes, Guidewire recommends that you update the database statistics to reflect the expected size of the table.

The load tools provide an option to estimate the database statistics for row and block counts when you perform the load. Use of this option causes the load tool to execute row counts and set database statistics on the operational tables based on the contents of the staging tables. For the web service, set the updateDBStatisticsWithEstimates parameter to true. For the command prompt tool, use the -estimateorastats option. For a non-Oracle database, PolicyCenter ignores this parameter and option.

Estimate the database statistics only on Oracle databases that contain few or no policy records. Estimating the statistics on databases that have more data significantly reduces database performance.