As we learned before, cubes are a big cache in the Intelligence Server memory. Their data is static. We need to update them when new data is available, typically after an ETL job is run.
Refreshing a cube's data involves connecting to the data warehouse and re-executing the underlying SQL statements. Normally, the best time to do it is during off-peak hours, and since BI developers like to sleep at night, there must be a way to automate that.
MicroStrategy offers a scheduling mechanism to automate cube updates very similar to cron on *nix or the Task Scheduler on Windows.
In order to automate a cube refresh, we need two objects: a schedule and a subscription.
A schedule is just a recurring timer, like every day at 3 A.M., or every Monday; it does not perform any action. A subscription is an object that binds a report, document, or cube to a schedule and a delivery type. There are several delivery types in MicroStrategy, such as e-mail and printer; in our case we will use a special delivery type called Cube Refresh.
Subscription can be used to automatically mail data to users on a schedule basis; or execute long running reports before working hours (so that they are already cached); or—like in our case—to execute and publish cubes after a data load. Let's see how to do it.
Imagine that our ETL jobs run from 1 A.M. until 2:30 A.M. daily. We need to create a subscription to refresh the cube 54 at 3 A.M. every day:
Every day at 3AM
and hit Next.3AM
and click on Next.The time—trigger works with the system clock of the Intelligence Server. In case you work for an international company across several time zones, plan your schedules carefully to make sure the cubes are refreshed at times when no one is using them.
It has happened to me more than once that the data got refreshed one hour later due to daylight saving time in summer; I discovered the hard way how to explain to an Oracle server that in most European countries we move the clock one hour ahead from spring to autumn in order to save energy and bring misery to ETL jobs.