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

KB41595: How to switch between warehouse databases for a 3-tier project in realtime without restarting Intelligence Server in MicroStrategy Developer 9.x or 10.x


Stefan Zepeda

Salesforce Solutions Architect • Strategy


Suppose the project contains a dashboard, and users of the dashboard require realtime data to be displayed. This is achieved by having the primary database undergo ETL several times during the daytime. During the ETL the project needs to point to the secondary database, and after ETL is completed the project should switch back to the primary database.

SCENARIO: 
Suppose there are two data warehouses for a project which are identical in structure, and one is the primary database and the other is a secondary database. Suppose the project contains a dashboard, and users of the dashboard require realtime data to be displayed. This is achieved by having the primary database undergo ETL several times during the daytime. During the ETL the project needs to point to the secondary database, and after ETL is completed the project should switch back to the primary database.
Creating a separate database instance for each data warehouse and switching the database instance for the project at runtime requires restarting the Intelligence Server. This is not an option because multiple other live projects are connected to the Intelligence Server and would get disconnected at restart.
 
SOLUTION:
The following list describes a couple of different options for how to achieve switching between warehouse databases for a 3-tier project in realtime without restarting Intelligence Server in Strategy Developer 9.x or 10.x
 
Option 1: Keep the same Database Instance but change the Database Connection and the associated DSN to the alternate warehouse.
Option 2: Keep the same Database Instance and Database Connection but just change the DSN and/or Database Login.
Option 3: Keep the same Database Instance, Database Connection and DSN but change the Database Login to point to the secondary database. This is permissible in database configurations where a different schema (i.e. different set of Database Login credentials) represents a different database location.
 
Note: In order for each of these changes to take effect, it may be necessary to unload and reload the project, or to drop the connection from the DB Connection Monitor.
 
There are Command Manager scripts for automating all of the above, under the DBConnection_Outlines, DBInstance_Outlines, and DBLogin_Outlines. The database connection can be dropped using the Disconnect outline in the Database_Connection_Monitor_Outlines. The outlines unload and reload a project can be found under Project_Outlines.
 
EXAMPLE:
 
This is an example of how to achieve Option 2 using Strategy Tutorial project in 3-tier, keeping the same Database Instance and Database Connection but changing the DSN. 

  • Create a copy of the Tutorial Warehouse, call it Tutorial_WH_Copy.
  • Create a DSN to Tutorial_WH_Copy, call it Ttrl_WH_Cpy_DSN
  • Connect to Ttrl_WH_Cpy_DSN with DB Query Tool.
  • Change the age of customer with CUSTOMER_ID=1 to something else, e.g. 100. (This will be used to check that we have successfully switched databases)
ka02R000000kcXnQAI_0EM440000002HNJ.png
  • Create a report in Desktop in the 3-tier Strategy Analytics Modules project source, in the Strategy Tutorial project, consisting of Customer and Customer Age, with a report filter of Customer ID = 1. Notice that with the original data warehouse, the age for Maxwell is 45.
ka02R000000kcXnQAI_0EM440000002HNG.png
  • To switch databases, open Command Manager and use the following script:
    ALTER DBCONNECTION "Data" ODBCDSN "Ttrl_WH_Cpy_DSN";
    UNLOAD PROJECT "Strategy Tutorial";
    LOAD PROJECT "Strategy Tutorial";
  • Delete the cache for the earlier report and re-run the report.  Notice Maxwell's new age.
ka02R000000kcXnQAI_0EM440000002HNF.png

Comment

0 comments

Details

Knowledge Article

Published:

April 13, 2017

Last Updated:

April 13, 2017