EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB39948: Data Manipulation Language (DML) upgrade for statistics repository


Community Admin

• Strategy


Data Manipulation Language (DML) upgrade for statistics repository.

The DML upgrade of the statistics repository must be performed after the DDL upgrade i.e. upgrade via Configuration Wizard 9.3.0 - 9.4.x or Enterprise Manager Console 9.3.0 - 9.4.x. The information provided in this technical note pertains to step 2 shown below:
 

ka04W00000148FiQAI_0EM4400000029mU.png

 
 
 
Prerequisites for running a DML script:

  1. User is upgrading the Statistics Repository from version 9.x to 9.3.0 - 9.4.x.
     
    Note: The DML scripts need not be executed if users are upgrading Statistics tables from version 9.3.x to version 9.4.1 and when the DML scripts have already been run when users upgraded from a pre-9.3.0 version to 9.3.x. If the DML scripts were not executed when users upgraded to version 9.3.0 from a previous version, users can run the DML scripts when upgrading to version 9.4.x. In other words, users should NOT execute the DML scripts multiple times.
  2. The Statistics Repository is located in either of the following databases:
    1. Microsoft SQL Server
    2. Teradata
    3. IBM DB2
    4. Sybase
    5. Oracle (without partitioning only).
      1. Oracle (with partitioning), if the Statistics Repository is in this configuration, refer to the following Strategy Knowledge Base technical note:
         
        KB41180: Data Manipulation Language (DML) upgrade for statistics repository located in an Oracle database with partitioning in MicroStrategy 9.3.0
  3. DDL upgrade of the Statistics Repository i.e. upgrade via Configuration Wizard 9.3.0 - 9.4.x or Enterprise Manager Console 9.3.0 - 9.4.x is completed.
  4. Enterprise Manager warehouse tables should be present in the same repository as the Statistics Tables.
  5. Create a backup of the Statistics Repository before running the DML scripts.

 
Purpose of the DML script:
In Strategy 9.3.0, a new column named 'REPOSITORYID' is created during the DDL upgrade of the Statistics Repository and has been added to the following tables:

  • IS_REPORT_STATS
  • IS_DOCUMENT_STATS
  • IS_PROJ_SESS_STATS
  • IS_REP_STEP_STATS
  • IS_DOC_STEP_STATS
  • IS_REP_SQL_STATS
  • IS_REP_COL_STATS
  • IS_REP_MANIP_STATS
  • IS_CACHE_HIT_STATS
  • IS_REP_SEC_STATS
  • IS_SCHEDULE_STATS
  • IS_PR_ANS_STATS
  • IS_MESSAGE_STATS
  • IS_INBOX_ACT_STATS
  • IS_CUBE_REP_STATS

The DML script populates the newly created REPOSITORYID column in each table listed above.
 
The DML script contains the following workflow at a high level:

  1. Creates a temporary table.
  2. Inserts data from the Enterprise Manager warehouse tables (e.g., EM_MD, IS_PROJ) into the temporary table.
  3. Populates the REPOSITORYID column in the tables listed above by joining each table with the temporary table.
  4. Drops the temporary table.

 
Location of the DML script: 
DML scripts for all databases (except an Oracle Database with Partitioning) can be found at the following two locations:

  1. At the end of this Technical Note
  2. <Installation Folder>\Strategy\Enterprise Manager\DML Scripts

Users should download the appropriate zip file based on the type of database where the Statistics Repository is located. As an example, for Microsoft SQL Server, download the zip file SQL_Server_DML_Statistics.zip.
 
Note: Except Oracle, there is only a single DML script for each of the other databases. The Oracle DML scripts are categorized into with or without partitioning. All other database DML scripts work independent of partitioning.
 
 
Requirements and Best Practices:

  1. Before running the DML script, purge all unnecessary data from the statistics tables. Ensure that only the most recent data is kept if possible. This will also improve overall performance.
  2. Ensure that all 9.3.0 - 9.4.x Strategy Intelligence Servers logging data to the statistics tables are shutdown.
  3. The duration of execution for the DML scripts will depend on the amount of data in the Statistics Tables and this is the reason for not including the DML script as part of the DDL upgrade process of the Statistics Repository via Configuration Wizard 9.3.0 - 9.4.x or Enterprise Manager Console 9.3.0 - 9.4.x.
  4. For best performance, run the DML scripts when the load on the database server is low.
  5. The DML scripts against each table should be run as transactions as indicated in the script file. It is necessary to run each SQL statement as a transaction in case errors are encountered during SQL execution. Users should look for the begin and end <TRANSACTION NAME> text in the script files which indicate the necessity to run that SQL statement as a transaction, as shown below:
     

    Sample Code/Error
    /* BEGIN <TRANSACTION NAME> */
    ...
    script to be executed
    ...
    /* END <TRANSACTION NAME> */

     
  6. Run the DML script against the Statistics database from a database client application such as Strategy DB Query Tool or any native SQL execution tool provided by the database. Make sure the Intelligence Server is stopped while performing this DML upgrade.
ka04W00000148FiQAI_0EM4400000029mY.png

 
 
DML Scripts for Download:

ka04W00000148FiQAI_0EM4400000029mS.png

Statistics_upgrade_9xto930_DML_DB2
 
Note: When Statistics tables are hosted on a DB2 database, users upgrading Statistics tables from version 9.x to version 9.4.1 should use the scripts provided below.

ka04W00000148FiQAI_0EM4400000029mS.png

Statistics_upgrade_9xto931_DB2
 

ka04W00000148FiQAI_0EM4400000029mS.png

SQL Server DML Statistics
 

ka04W00000148FiQAI_0EM4400000029mS.png

Sybase DML Statistics
 

ka04W00000148FiQAI_0EM4400000029mS.png

Teradata DML Statistics
 

ka04W00000148FiQAI_0EM4400000029mS.png

Oracle (without partitioning) DML Statistics
 
 
Upgrade Scripts Modification:
WARNING:
Manually editing values in the upgrade scripts may cause serious, database-wide problems that may make your Enterprise Manager project unusable. Since these are user-initiated changes, they are not covered by any Strategy warranty.


Comment

0 comments

Details

Knowledge Article

Published:

June 1, 2017

Last Updated:

June 1, 2017