MaxL Examples
MaxL Examples
MaxL Examples
com
People who are new to Essbase find it very difficult to memorize or understand as there are
plenty of MaxL functions are used. This is my efforts to give a list of MaxL commands which we
use in our day to day life, specially when we as Essbase Admin or Production Support. These are
the list of MaxL commands along with some sample examples of MaxL file to load data and
execute calculation script.
spool on to 'd:\temp\exec_cal.txt';
spool off;
logout;
Example#2
login $1 $2; /* login section */
/*--------------------------------------------------------------------------*/
/* LOAD APPLICATION AND DATABASE */
/*--------------------------------------------------------------------------*/
alter system load application ASOsamp;
alter application ASOsamp load database Sample;
/*--------------------------------------------------------------------------*/
/* COPY BSO OTL TO ASO APPLICATION */
/*--------------------------------------------------------------------------*/
CREATE OR REPLACE OUTLINE ON AGGREGATE_STORAGE DATABASE ASOsamp.Sample AS
OUTLINE ON DATABASE Sample.Basic ;
/*--------------------------------------------------------------------------*/
/* BUILD ACCOUNTS DIMENSION */
/*--------------------------------------------------------------------------*/
set Dimension=Accounts;
set RulesFile=AcctASO;
import database ASOsamp.Sample dimensions
from local data_file 'C:\Temp\Accounts.txt'
using server rules_file 'Accounts'
on error write to 'DimAcct.err';
NOTE: This process is useful when the export files are very large and go over the standard 2GB
size and this gives you the ability to control how many files are created (always 8
files)...especially if you have automated processes that rebuilds your databases each night.
/*--------------------------------------------------------------------------*/
/* SET VARIABLE FOR CURRENTMONTH */
/*--------------------------------------------------------------------------*/
alter database Basic.Sample set variable "CurrentMonth" "July";
/*--------------------------------------------------------------------------*/
/* EXPORT DATA USING REPORT SCRIPT */
/*--------------------------------------------------------------------------*/
export database ASOsamp.Sample using report_file
"'$ARBORPATH/app/ASOsamp/Sample/XptData.rep'" to data_file 'C:\Temp\ReportExport.txt';
/*--------------------------------------------------------------------------*/
/* EXECUTE CALCULATION */
/*--------------------------------------------------------------------------*/
execute calculation Sample.Basic.CALCALL;
Learn Hyperion/OBIEE by Amit Sharma learnhyperion.wordpress.com or aloo_a2@yahoo.com
/*--------------------------------------------------------------------------*/
/* KILL ALL REQUESTS TO DATABASE */
/*--------------------------------------------------------------------------*/
alter system kill request on application Sample;
/*--------------------------------------------------------------------------*/
/* LOGOUT ALL SESSIONS TO DATABASE */
/*--------------------------------------------------------------------------*/
alter system logout session on application Sample;
/*--------------------------------------------------------------------------*/
/* DISABLE CONNECTIONS TO DATABASE */
/*--------------------------------------------------------------------------*/
alter application Sample disable connects;
/*--------------------------------------------------------------------------*/
/* ENABLE CONNECTIONS TO DATABASE */
/*--------------------------------------------------------------------------*/
alter application Sample enable connects;
/*--------------------------------------------------------------------------*/
/* EXPORT LRO AS A MIGRATION STRATEGY */
/*--------------------------------------------------------------------------*/
export database FinOps.Findb lro to server directory 'exportedLROs';
/*--------------------------------------------------------------------------*/
/* CLEAR APPLICATION LOG FILE */
/*--------------------------------------------------------------------------*/
alter application Sample clear logfile;
/*--------------------------------------------------------------------------*/
/* CLEAR ESSBASE LOG FILE */
/*--------------------------------------------------------------------------*/
alter system clear logfile;
/*--------------------------------------------------------------------------*/
/* LOAD DATA TO ASO SLICE */
/*--------------------------------------------------------------------------*/
Learn Hyperion/OBIEE by Amit Sharma learnhyperion.wordpress.com or aloo_a2@yahoo.com
import database ASOsamp.Sample data from load_buffer with buffer_id 1 override values create
slice;
* to execute:
essmsh scriptname username password
*/
Collect Statistics
login $1 $2;
spool on to 'c:\mxlouts\pstatsouts.txt';
alter database sample.basic set performance statistics enabled;
execute calculation
'SET MSG ERROR;
CALC ALL;'
on Sample.basic;
alter database sample.basic set performance statistics mode to medium persistence server
scope;
query database sample.basic get performance statistics kernel_io table;
alter database sample.basic set performance statistics mode to long persistence database
scope;
query database sample.basic get performance statistics kernel_cache table;
alter database sample.basic set performance statistics mode to medium persistence
database scope;
query database sample.basic get performance statistics end_transaction table;
query database sample.basic get performance statistics database_synch table;
query database sample.basic get performance statistics database_asynch table;
spool off;
logout;
Esscmd Example
LOGIN "amit-PC" "Admin" "password";
select "sample" "basic";
disablelogin;
loaddata 2 freeformload.txt
calcdefault;
ENABLELOGIN;
EXIT;