Disclaimer
These slides represent the work and opinions of the presenter and do not constitute official positions of Oracle. 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 the presenter and interRel Consulting.
Next session
Getting It All Automated With Perl Scripting
Get back
MAXL> login essadmin essbase on d630 ; OK/INFO - 1051034 - Logging in user [essadmin]. OK/INFO - 1051035 - Last login on Friday, May 08, 2009 12:02:32 PM. OK/INFO - 1241001 - Logged in to Essbase.
Get back
COMPUTERNAME=D630
Response
MAXL> login essadmin essbase on D630 ; OK/INFO - 1051034 - Logging in user [essadmin]. OK/INFO - 1051035 - Last login on Friday, May 08, 2009 12:01:33 PM. OK/INFO - 1241001 - Logged in to Essbase.
Response
MAXL> login essadmin essbase on d630 ; OK/INFO - 1051034 - Logging in user [essadmin]. OK/INFO - 1051035 - Last login on Friday, May 08, 2009 12:54:10 PM. OK/INFO - 1241001 - Logged in to Essbase. essadmin MaxL Shell completed
local.log
essadmin
And you cant fix it with local variables But you can if positional
So which is best?
Positional
Must be on command line Most flexible Cryptic
Environment
Must be defined within OS
Local
Easiest to understand/read Not good for server migration
Encryption review
Public key encryption
Asymmetric key algorithms
Encrypt (public) and decrypt (private) keys are different Generated through large random number and black-box magic
MaxL generates both keys for you Different every time its run Stick with the same pair
Response
Public Key for Encryption: 26429,694177571 Private Key for Decryption: 316108469,694177571 MaxL Shell completed
Simple code
login essadmin essbase on d630 ; exit ;
Response
Essbase MaxL Shell - Release 9.3.1 (ESB9.3.1.3.0B017) Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
tobeencrypted.mshs
login $key 994958605500155654401932116812299621 $key 080321016292835195975318016812299621 on d630; exit ;
Response
MAXL> login $key 994958605500155654401932116812299621 $key 080321016292835195975318016812299621 on d630; essmsh error: Variable doesn't exist - $key essmsh error: Variable doesn't exist - $key
Response
MAXL> login $key 994958605500155654401932116812299621 $key 080321016292835195975318016812299621 on d630; OK/INFO - 1051034 - Logging in user [essadmin]. OK/INFO - 1051035 - Last login on Friday, May 08, 2009 2:24:59 PM. OK/INFO - 1241001 - Logged in to Essbase.
Useless by themselves
properties.msh
/* Declare variables */ set varUserName = essadmin ; set varPassword = essbase ; set varServerName = d630 ; set varSpoolFile = 'c:\tempdir\odtug_2009\nested.log' ;
connect.msh
/* Connect to server */ login $varUserName $varPassword on $varServerName; /* Write STDOUT to log file */ spool on to $varSpoolFile ;
disconnect.msh
/* Exit from MaxL shell exit ; */
Stole it from:
http://essbaselabs.blogspot.com/2009/04/organizing-maxlscripts.html
Whoops
Type
C:\>essmsh hellomurphy.msh
Response (trimmed)
MAXL> alter database Sample.Basic1 reset data ; ERROR - 1056024 - Database Sample.Basic1 does not exist. MAXL> import database Sample.Basic data from local text data_file 2> 'C:\Hyperion\AnalyticServices\app\Sample\Basic\calcdat.txt' 3> on error write to 'c:\tempdir\odtug_2009\calcdat.err' ;
Response
MAXL> login essadmin essbase on d630; OK/INFO - 1051034 - Logging in user [essadmin]. OK/INFO - 1051035 - Last login on Friday, May 08, 2009 2:55:24 PM. OK/INFO - 1241001 - Logged in to Essbase. MAXL> alter database Sample.Basic1 reset data ; ERROR - 1056024 - Database Sample.Basic1 does not exist.
Response
'2' is not recognized as an internal or external command, operable program or batch file.
No errors = 0
Type
C:\>essmsh parameters.msh essadmin essbase d630
Response
MAXL> login essadmin essbase on d630 ; OK/INFO - 1051034 - Logging in user [essadmin]. OK/INFO - 1051035 - Last login on Friday, May 08, 2009 3:05:02 PM. OK/INFO - 1241001 - Logged in to Essbase. MaxL Shell completed C:\>%errorlevel% '0' is not recognized as an internal or external command, operable program or batch file.
Output = bad
Error! - CatchThatError.msh ran with errors and return code 2
Or log both
Two of a kind
spool stdout on to 'c:\tempdir\odtug_2009\SpoolMe.log' ; spool stderr on to 'c:\tempdir\odtug_2009\SpoolMe.err' ; login essadmin essbase on d630; iferror 'ErrorHandler' ; alter database Sample.Basic1 reset data ; iferror 'ErrorHandler' ; etc. etc. etc.
SpoolMe.err
ERROR - 1056024 - Database Sample.Basic1 does not exist.
Throw in %ERRORLEVEL%
Atypical
Fixing Planning
Why?
Member specification
"BalanceSheet",@IDES("IncomeStatement"),@IDES("E02"),"F orecast","Plan","Working","BU Version_1","Final" @IDES("Account"),@IDES("Scenario"),@IDES("Version"),@ID ES("Entity")
Member specification
"BalanceSheet",@IDES("IncomeStatement"),@IDES("E02"),"F orecast","Plan","Working","BU Version_1","Final" @IDES("Account"),@IDES("Scenario"),@IDES("Version"),@ID ES("Entity") "BalanceSheet",@IDES("IncomeStatement"),@IDES("E02"),"F orecast","Plan","Working","BU Version_1","Final"
Member specification
"BalanceSheet",@IDES("IncomeStatement"),@IDES("E02"),"F orecast","Plan","Working","BU Version_1","Final" @IDES("Account"),@IDES("Scenario"),@IDES("Version"),@ID ES("Entity")
How do we do this?
Automate
CubeRefresh.cmd NT CMD, VBScript, and MaxL script(s)
Drive values through OS parameters Wrap the whole thing in error checking
ERRORLEVEL spool
Steps
1. 2. 3. 4. Planning refresh with CubeRefresh.cmd Write filters to disk Read them into memory Generate MaxL code to apply METAREAD 5. Run the new nested script 6. Be happy
Looks like
refresh_planning.cmd c:\tempdir\odtug_2009\password.txt plansamp admin /R /FS %computername% 316108469,694177571
write_filters_to_disc.mshs
/* Create log file that will contain the filter contents spool on to 'Write_Filters_To_Disc.log'; */ /* Log on to the server using the: userid, password, and servername */ login $key 152862484425455861686132835 $key 420285733240440925357332674133471265 on $COMPUTERNAME ; /* Set the column width to 1000 characters to allow the filter plenty of room. */ set column_width 1000 ; /* Show those filters display filter row all ; /* End the spooling. spool off ; /* End of code. exit ; */
*/
*/
Metaread_Add_Filters.msh
ALTER FILTER 'PlanSamp'.'Consol'.'fplanuser' ADD META_READ ON '"BalanceSheet",@IDES("IncomeStatement"),@IDES("E02"),"Forecast ","Plan","Working","Final","BU Version_1"' ;
call_metaread_add_filters.mshs
/* Write out only errors to the log file. Use this to determine error status. */ spool stderr on to 'call_metaread_add_filters.err' ; /* Log on to the server using the: userid, password, and servername*/ login $key 152862484425455861686132835 $key 420285733240440925357332674133471265 on $COMPUTERNAME ; /* Include the VBScript-generated METAREAD ADD MaxL code. msh 'metaread_add_filters.msh'; /* End the spooling. spool off ; /* End of code. exit ; */
*/
*/
Refresh_Planning.log
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* Planning refresh of plansamp on DEMO111 beginning at: Current time at \\DEMO111 is 5/10/2009 11:14 AM The command completed successfully. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.Output from ModCubeRefresh.cmd Cube refresh completed successfully. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.Planning refresh succeeded Now getting filters from all Essbase databases -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.Filter dump successful. Parse all filters to create MaxL include for plansamp -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.Creation of MaxL include code successful Execute MaxL include code to create METAREAD filters -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.Error! - Execution of MaxL include file for METAREAD ADD failed -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.Planning refresh of plansamp on and application of METAREAD filters ended at: Current time at \\DEMO111 is 5/10/2009 11:14 AM The command completed successfully. *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
Q&A