Monday, 14 March 2016

Refresh Transformer Cube from Windows Command Line

I would like to record the things I remember about refreshing cubes using Windows command line parameters before I forget about them. Here are the things and tips I remember.
First, open your cube from Cognos Transformer. Determine dimension(s) wherein the lowest levels might have duplicates during refresh. Right click on the lowest level and tick the “Move” option. This will prevent the process from terminating once a duplicate is encountered.

lowest_level
Next make sure you only have one cube defined. More specifically, remove the unneeded cubes as they would also be refreshed automatically, adding to your refresh time.

cube
Make sure you set the deployment parameters properly.
deployment
Create a singon for security. Give the correct username and password. Remember the name of the signon as it will be used in the command line. In the sample image below, the name of my signon is S1.

signon
At this point you are almost ready to create the command line script. Go to the machine from where you intend to run the script. Ideally, it is the same machine where Transformer and Framework Manager is installed. This is to make sure that the proper configuration is already in place.
From here on, basic knowledge of DOS is required. Locate the Cognos installation folder, it should contain the bin directory which in turn contains the cogtr.exe file. In your script it is advisable to run the CD command to this folder (although this is not necessary if you can set the search path, etc, that is if you are really good at DOS). For example:
cd \Program Files\ibm\cognos\cognos10\bin
Next run the cogtr.exe with the following options:
cogtr.exe -c -n2 -lS1=”admin/admin123″ -g”My Cube” -m”c:\cognos\cube\location\mycube.mdl”
You can use other options as necessary. Here is a simple explanations on the sample options I used:
-c = This option loads a model file, interprets MDL statements, generates categories, and creates cubes.
-n2 = opens Transformer in batch mode with the Transformer application window hidden. There is no space between -n and the display_state argument, 2.
-lS1 = “admin/admin123″ = uses the signon “S1″ as specified above. admin/admin123 is the login name and password
-g”My Cube” = deploys “My Cube” as created above
-m”c:\cognos\cube\location\mycube.mdl” = location of your cube.

No comments:

Post a Comment