Sie sind auf Seite 1von 45

Disclaimer

These slides represent the work and opinions of the presenter and do not constitute official positions of Hyperion or any other organization. This material has not been peer reviewed and is presented here with the permission of the presenter. This material should not should not be reproduced without the written permission of interRel Consulting.

Look Smarter Than You Are with Essbase

3 Essbase Books Available:


Complete Guide System 9 Complete Guide End User Guide

Find out more at www.interrel.com Search lulu.com for Essbase to see all 3 books
2 Copyright 2007, Hyperion. All rights reserved.

Automation via MaxL Scripts (And How to Break Yourself Away From EssCMD)

Agenda
Describe uses for MaxL scripts Explain how to create and save a MaxL script Describe different commands within MaxL Demonstrate how to write a simple MaxL script List the steps to run a MaxL script New features / enhancements to MaxL Q&A

Overview of MaxL
Replacement for EssCMD scripting language
Full support was not available until 7.0 EssCMD-to-MaxL conversion utility: cmd2mxl.exe

Can be used within other programming languages such as Perl and Python (available on www.essbase.com) I/O can be redirected (STDIN/STDOUT/STDERR) Built-in editor with auto-completion in EAS

Why Use MaxL?


Update outlines Load data Run calculations Nightly processes Repetitive processes Update substitution variables Database maintenance What else? *Make your objects dynamic
Substitution variables in load rules and calc scripts

Creating a MaxL Script


Within Administration Services, select File >> New >> Editors >> MaxL Script Editor from the Menu OR Select File >> New Select Scripts>>MaxL Scripts

MaxL Script Editor


Editor is color-coded and will auto-complete commands

MaxL Commands - Login


Important for logging into the server
login UserName Password on ServerName;

For example, to login to localhost


login 'admin' 'password' on localhost';

MaxL Commands Import Dimensions

import database sample.basic dimensions from data_file '/data/calcdat.txt' using rules_file '/data/rulesfile.rul' on error append to '/logs/dimbuild.log';

MaxL Commands Import Data

import database sample.basic data from data_file '/data/calcdat.txt using rules_file '/data/rulesfile.rul' on error write to '/logs/dimbuild.log';

MaxL Commands Calculate Data

execute calculation Sample.Basic.calcname; Or execute calculation 'SET MSG ERROR; CALC ALL;' on Sample.basic;

MaxL Commands Export Data

Exports all data concurrently to a list of file names: export database sample.basic data to data_file 'D:\\fileout','D:\\fileout2','D:\\fileout3'; Exports input data to a file: export database sample.basic input data to data_file 'exp_input.exp'; Executes a report script: export database sample.basic using report_file '$ARBORPATH/App/Sample/Basic/asym.rep to data_file 'home/month2.rpt';

MaxL Commands Create User

Creates a user called Fiona with the password sunflower: create user Fiona identified by sunflower; Creates a user called Guest with the password password, and adds Guest to the group called Visitors. Quotation marks are required because password is a MaxL keyword: create user Guest identified by 'password member of group Visitors;

MaxL Commands Alter Database


Clears all data from the database:
alter database Sample.Basic reset data;

Changes the number of seconds to wait for blocks to be unlocked. If a transaction request is made which cannot be granted in 120 seconds, the transaction is rolled back until a lock can be granted:
alter database Sample.Basic set lock_timeout after 120;

Alter Database cont.


Recovers free spaces from fragmented data file: alter database Sample.Basic recover freespace; Forces database to restructure alter database Sample.Basic force restructure; Set the variable Current_Month to June alter database Sample.Basic variable Current_Month June;

MaxL Commands Display Database

Displays information about all databases on the system: display database; Displays information about the Sample.Basic database: display database Sample.Basic;

Validate a MaxL Script

There is no Validate option for MaxL scripts You test and troubleshoot by actually running the MaxL script This should be done in a development environment with a subset of data

Saving the MaxL Script


1. 2. Select File >> Save Specify the file name and location

Saving the MaxL Script


Save to the File System or Administration Server

20

Running the MaxL Script


You can run a MaxL script from:
Essbase Administration Services Console Command line (.bat or .sh file)

Executing a MaxL Script in EAS

1.

2.

Select MaxL >> Execute from the Menu The results are displayed within EAS

Create a MaxL Script

Create a Basic Script

Finding Help

Executing a MaxL Script via Command Line


A .bat or .sh file can be created or this syntax can be run in command line Navigate to the folder containing the MaxL script Type in the following syntax
essmsh filename

Variables in Script
Type essmsh followed by a file name followed by an argument or list of space-separated arguments Essmsh remembers the command-line arguments, which can be referenced as $1, $2, etc. in the specified file. If spooling is turned on, all variables are expanded in the log file. Example:
D:\Scripts> essmsh filename.mxl Fiona sunflower localhost newuser

Variables in Script cont. Starts the shell to read MaxL statements from filename.msh, located in the current directory. Contents of script filename.msh:
spool on to $HOME\\output\\filename.out; login $1 $2 on $3; create user $4 identified by $2; echo "Analytic Services is installed in $ARBORPATH"; spool off; exit;

Contents of logfile filename.out:


MaxL> login Fiona sunflower on localhost; 49 - User logged in: [Fiona]. MaxL> create user newuser identified by sunflower; 20 - User created: ['newuser']. Analytic Services is installed in D:\Hyperion\ESSBASE

Variables in a Script Easy to Update

Why Move from Esscmd to MaxL?


All of the scripting commands are available in MaxL plus more New features are only supported in MaxL

32

Whats New in Recent Versions?

33

MaxL User and Password Encryption


Encrypts user names and password in automated scripts Public/Private key encryption method Encrypted scripts can be only run with key Cannot visually decrypted New Innovation modes:
ESSMSH E: encrypts script

Scrpt name, public key


ESSMSH D: decrypt and execute

Script name, private key


ESSMSH gk: generates key pair ESSMSH ep: encrypts input and displays on console

Data, private key

Process
Step 1 ESSMSH gk
Generates a key pair

Public and private key Step 2 essmsh E script_name public_key Step 3 Maxl will parse out that information and generate a new file XXX.MLS Step 4 Move main script to private directory

Process
Same process to decrypt, using the ESSMSH D option

Run As
Introduced for batch bursting in Financial Reporting Use for security testing in Analytic Services Report script and MDX batch query execution New Invocation modes:
ESSMSH la: login as another user

Username, password, usernameas

Other New Supported MaxL Commands


Support for reference cubes Group preservation when replacing a user Support for alternate hierarchies in aggregate storage Export the Essbase.sec file in a readable format Support for incremental loads to ASO databases Support for level zero exports of data in ASO databases Estimate compression for ASO databases when different dimensions are used as the accounts dimension for compression Data mining enhancements New statements to assist in the migration of security from Essbase to Shared Services Support for duplicate member names Timestamp command that displays a timestamp after each operation

38

So How do I Migrate?
Manually cmd2mxl

39

ESSCMD To Maxl Conversion Utility


cmd2mxl Fully supported utility for converting existing ESSCMD scripts to their corresponding MaxL scripts. Go to the operating-system command prompt and enter the executable name, the ESSCMD script name, the desired MaxL script name, and the name of a logfile to write to in case of errors
cmd2mxl esscmd_script maxl_output logfile

For example, if the ESSCMD script name is %ARBORPATH%\dailyupd.scr:


cmd2mxl %ARBORPATH%\dailyupd.scr %ARBORPATH%\dailyupd.mxl %ARBORPATH%\log\dailyupd.log

40

ESSCMD To Maxl Conversion Utility Considerations


The utility will only translate syntactically and semantically valid ESSCMD scripts For invalid ESSCMD scripts, the resulting MaxL script is undefined. All ESSCMD statements in the scripts should end with a semicolon ( ; ) statement terminator Windows platforms only For older Essbase versions.
Although most ESSCMD commands have corresponding MaxL statements, there are exceptions. For such exceptions, a comment will be generated in the logfile, and the resulting MaxL script will have to be modified to work correctly. Note that if an ESSCMD command is still needed, it can be invoked from a MaxL script using shell esscmd <scriptname>

All strings in the ESSCMD scripts should be surrounded by double quotation marks ("")

41

Supported Commands for Conversion


ADDUSER BEGINARCHIVE BEGININCBUILDDI M BUILDDIM CALC CALCDEFAULT CALCLINE COPYAPP COPYDB COPYFILTER COPYOBJECT CREATEAPP CREATEDB CREATEGROUP CREATELOCATION CREATEUSER CREATEVARIABLE DELETEAPP DELETEDB DELETEGROUP DELETELOCATION DELETELOG DELETEUSER DELETEVARIABLE DISABLELOGIN DISPLAYALIAS ENABLELOGIN ENDARCHIVE ENDINCBUILDDIM ESTIMATEFULLDB SIZE EXIT EXPORT GETALLREPLCELL S GETAPPINFO GETAPPSTATE GETATTRIBUTESP ECS GETATTRINFO GETDBINFO GETDBSTATE GETDBSTATS GETCRRATE GETDEFAULTCALC GETMBRCALC GETMBRINFO GETPERFSTATS GETUPDATEDREPL CELLS GETUSERINFO GETVERSION IMPORT LISTFILES LISTFILTERS LISTGROUPS LISTGROUPUSERS LISTLINKEDOBJECT S LISTLOCATIONS LISTLOCKS LISTLOGINS LISTOBJECTS LISTUSERS LISTVARIABLES LOADALIAS LOADAPP LOADDB LOADDATA LOGIN LOGOUT LOGOUTALLUSERS LOGOUTUSER OUTPUT PURGELINKEDOBJE CTS PUTALLREPLCELLS PUTUPDATEDREPLC ELLS REMOVELOCKS RENAMEFILTER RENAMEOBJECT RENAMEUSER RESETDB RESETPERFSTATS RUNCALC RUNREPT SELECT SETALIAS SETAPPSTATE SETDBSTATE SETDBSTATEITEM SETDEFAULTCALC SETDEFAULTCALCFI LE SETMSGLEVEL SETPASSWORD SHUTDOWNSERVER SLEEP UNLOADALIAS UNLOADAPP UNLOADDB UNLOCKOBJECT UPDATE UPDATEFILE UPDATEVARIABLE VALIDATE

42

Summary and Design Considerations


MaxL is used for automation and scheduling If you can do it in Administration Services, you can most likely do it in MaxL Technical Reference is VERY helpful

Q&A THANK YOU!!!


Tracy McMullen tmcmullen@interrel.com www.interrel.com

44

Upcoming Webcasts & Training Classes


Webcasts
Best Practices in Financial Reporting & Consolidation
Thursday, May 1

Training Classes
Hyperion Planning Accelerated Fundamentals
Monday, April 21-24th Advanced Hyperion Planning Friday, April 25th Interactive Reporting: Analyze & Report for End Users Monday, May 12th Interactive Reporting: Report & Dashboard for End Users Tuesday, May 13th 14th

Best Practices in Essbase Design


Thursday, May 8

Best Practices in Budgeting, Planning and Forecasting


May 15

Best Practices in Reporting & Analysis Design


May 22

Email dwhite@interrel.com to receive a copy of our Spring 2008 Events

Interactive Reporting: Whats New in 9.3 Thursday, May 15th

Das könnte Ihnen auch gefallen