MicroStrategy - Command Manager - Caching

mstr
Command Manager

What is the recommended way to PURGE and the EXPIRE cache using Command Manager command?

Use the EXPIRE command:

EXPIRES ALL REPORT CACHES IN PROJECT "MicroStrategy Tutorial";
EXPIRE ( REPORT CACHES | REPORT CACHE "<cache_name>") IN PROJECT "<project_name>";

The 'EXPIRE' command will not delete the caches that are linked to History List messages, instead all caches will have the expired flag set which will clean up all 'Matching' caches and leave 'History' caches still available.

The command:

PURGE REPORT CACHING IN ALL PROJECTS;

deletes all caches regardless of the cache type. This means that caches linked to History List messages are deleted too. The full syntax for the command is as follows:

PURGE CACHING IN ( PROJECTS | "<project_name>");

As can be seen from the syntax there is no syntax for separating Matching, History, or both types of caches. Instead of using the 'PURGE' command, use the 'EXPIRE' command in MicroStrategy Administrator - Command Manager 8.x, as shown below:

EXPIRES ALL REPORT CACHES IN PROJECT "MicroStrategy Tutorial";
EXPIRE ( REPORT CACHES | REPORT CACHE "<cache_name>") IN PROJECT "<project_name>";

The 'EXPIRE' command will not delete the caches that are linked to History List messages, instead all caches will have the expired flag set which will clean up all 'Matching' caches and leave 'History' caches still available.

How can we use Command Manager to purge or expire caches?

EXPIRE ALL REPORT CACHES IN PROJECT "PROJECT NAME";
EXPIRE REPORT CACHES IN PROJECT "PROJECT NAME";
EXPIRE REPORT CACHE "CacheName" IN PROJECT "PROJECT NAME";

INVALIDATE 
    (
        [ALL] REPORT CACHES 
        [WHTABLE "<WH_Table_name>"] 
        [
            SECURITY (FILTER | FILTERS) 
            ( 
                <sec_filter_id1> [, <sec_filter_id2> ...] 
                | 
                NAME "<sec_filter_name1>" [FOLDER "<folder_name1>"] [, NAME "<sec_filter_name2>" [FOLDER "<folder_name2>"] ...]
            )
        ]
        [USER (<login_id> | NAME "<login_name>")] 
        [USER GROUP (<user_group_id> |NAME "<user_group_name>")] 
        [DBLOGIN (<dblogin_id> | NAME "<dblogin_name>")] 
        [DBCONNECTION (<dbconnection_id> |NAME "<dbconnection_name>")] 
        [LANGUAGE "<language_name>"] 
        | 
        REPORT CACHE 
        (
            "<cache_name>" [FOLDER "<location_path>"] 
            | 
            GUID <cache_guid> [, <cache_guid2> ...]
        ) 
        [CHECKCACHEEXISTENCE]
    ) 
IN PROJECT "<project_name>";

/* This instruction invalidates all report caches depending on PMT_INVENTORY table */
INVALIDATE ALL REPORT CACHES WHTABLE "PMT_INVENTORY" IN PROJECT "MicroStrategy Tutorial";

PURGE ALL CACHING IN ALL PROJECTS;
PURGE [(ALL | OBJECT | ELEMENT | REPORT)] CACHING IN ([ALL PROJECTS] | [PROJECT] "project_name"); 
PURGE REPORT CACHING IN ALL PROJECTS;
PURGE CACHING IN PROJECTS;
PURGE CACHING IN "PROJECT NAME";

DELETE (
    [ALL] [INVALID] REPORT CACHES 
    [WHTABLE "<WH_Table_name>"] 
    [
        SECURITY (FILTER | FILTERS) 
        (
            <sec_filter_id1> [, <sec_filter_id2> ...] 
            | 
            NAME "<sec_filter_name1>" [FOLDER "<folder_name>"][, "<sec_filter_name2>" [FOLDER "<folder_name>"]...]
        )
    ] 
    [USER (<login_id> | NAME "<login_name>")] 
    [USER GROUP (<user_group_id> |NAME "<user_group_name>")] 
    [DBLOGIN (<dblogin_id> |NAME "<dblogin_name>")] 
    [
        DBCONNECTION 
        (
            <dbconnection_id> 
            | 
            NAME "<dbconnection_name>"
        )
    ] 
    [LANGUAGE "<language_name>"] 
    | 
    REPORT CACHE 
        (
            "<cache_name>" [FOLDER "<location_path>"] 
            | 
            GUID <cache_guid> [, <cache_guid2> ...]
        ) 
    [CHECKCACHEEXISTENCE]
) 
[FROM (PROJECT | PROJECTS) "<project_name1>" [, "<projectname2>" ...]];

DELETE ALL INVALID REPORT CACHES;
DELETE INVALID REPORT CACHES FROM PROJECT "MicroStrategy Tutorial";
DELETE INVALID REPORT CACHES FROM PROJECTS "MicroStrategy Tutorial", "Customer Analysis Module";
DELETE REPORT CACHE "Customer List" FROM PROJECT "MicroStrategy Tutorial";

I think we should be using either EXPIRE or INVALIDATE and we should avoid PURGE (the equivalent of DELETE) because if we delete a cache that is used by a history list message, the user may see an error when accessing the report from the history list page. The outline for caches in MicroStrategy Command Manager 9.5.1 does not contains EXPIRES.

How can we delete the cache for a particular report?

DELETE REPORT CACHE "report 1" FROM PROJECT "project";

How can we disable or enable caching at the individual report level using Command Manager?

ALTER REPORT 'Profit Forecast' IN FOLDER '\Public Objects\Reports\Subject Areas\Enterprise Performance Management' 
    ENABLECACHE FALSE FOR PROJECT 'MicroStrategy Tutorial';

ALTER REPORT 'Profit Forecast' IN FOLDER '\Public Objects\Reports\Subject Areas\Enterprise Performance Management'
    ENABLECACHE TRUE FOR PROJECT 'MicroStrategy Tutorial';

How can we alter various cache settings at the project level?

ALTER ELEMENT CACHING IN [PROJECT] "<project_name>" 
    [MAXRAMUSAGE <number_of_MB>] 
    [MAXRAMUSAGECLIENT <number_of_MB>] 
    [CREATECACHESPERDBLOGIN (TRUE | FALSE)] 
    [CREATECACHESPERDBCONN (TRUE | FALSE)];

ALTER REPORT CACHING IN PROJECT "MicroStrategy Tutorial" 
    ENABLED 
    CACHEFILEDIR ".\Caches\RAVALOS4" 
    MAXRAMUSAGE 10240 
    CREATECACHESPERUSER FALSE 
    CACHEEXP IN 24 HOURS 
    MAXNOCACHES 10000;

ALTER REPORT CACHING IN [PROJECT] "<project_name>" 
    [(ENABLED | DISABLED)] 
    [CACHEFILEDIR "<cache_file_directory>"] 
    [MAXRAMUSAGE <number_of_MB>] 
    [MAXNOCACHES <number_of_Caches>] 
    [RAMSWAPMULTIPLIER <number_of_Multipliers>] 
    [LOADCACHESONSTARTUP (TRUE | FALSE)] 
    [ENABLEDOCUMENTCACHE (FALSE |ALL |(PDF |HTML|EXCEL|XML) [,(PDF |HTML|EXCEL|XML) ...])] 
    [ENABLEPROMPTEDCACHING (TRUE | FALSE)] 
    [ENABLENONPROMPTEDCACHING (TRUE | FALSE)] 
    [CREATECACHESPERUSER (TRUE | FALSE)] 
    [CREATECACHESPERDBLOGIN (TRUE | FALSE)] 
    [CREATECACHESPERDBCONN (TRUE | FALSE)] 
    [CACHEEXP (NEVER | [IN] <number_of_hours> HOURS)]  
    [RECORDPROMPTANSWERS (FALSE|TRUE)] 
    [ENABLEXMLCACHING (TRUE|FALSE)] 
    [FORMATTEDDOCMAXRAMCACHE <number_of_MB>] 
    [FORMATTEDDOCMAXNOCACHE <no_caches>];

ALTER OBJECT CACHING IN [PROJECT] "<project_name>" [MAXRAMUSAGE <number_of_MB>] [MAXRAMUSAGECLIENT <number_of_MB>];
ALTER OBJECT CACHING IN PROJECT "MicroStrategy Tutorial" MAXRAMUSAGE 10240 MAXRAMUSAGECLIENT 10240;

What is the syntax for the LIST command?

LIST [ALL] PROPERTIES FOR [(REPORT | OBJECT | ELEMENT)] CACHING IN [PROJECT] "<project_name>";

How can we list all properties for report caching in a particular project (not specific to a particular report)?

LIST ALL PROPERTIES FOR REPORT CACHING IN PROJECT "MicroStrategy Tutorial";

How can we list all caching properties in a project?

LIST ALL PROPERTIES FOR CACHING IN PROJECT "MicroStrategy Tutorial";

The above command display all caching properties in a particular project, including report cache, element cache, object cache. This is not specific to any particular report.

How can we list all properties for a report cache?

LIST ALL PROPERTIES FOR REPORT CACHE ("<cache_name>" [FOLDER "<location_path>"] | GUID <cache_guid>) IN PROJECT "<project_name>";
LIST ALL PROPERTIES FOR REPORT CACHE "Category Sales Report" IN PROJECT "MicroStrategy Tutorial";

How can we list all report caches (not properties) for a particular project?

LIST ALL REPORT CACHES FOR PROJECT "MicroStrategy Tutorial";

How can we list all report caches (not properties)?

LIST ALL REPORT CACHES [FOR PROJECT "<project_name>"];

Notices that the square brackets in the above command, which mean that we do not have to specify a project name. The Cache Monitor inside Desktop is specific to each server, so, I am not sure if this command will get all the report caches on all nodes and merge them together or it only display report caches on the particular node that Command Manager is connected to.

How can we disable caching at the project level?

NEED CONCRETE EXAMPLE. NEED TO LOOK AT THE OUTLINE FOR MANAGING CACHE.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License