exporting the essbase database

3
Exporting the essbase database: The Command used is “export database” to export the data from the essbase cube. To meet the requirement for exporting data from an essbase cube interactively , a process was developed. This process consists of a batch file which invokes the Maxl script. The batch file prompts for the server name, cube name,database name,the file name and the path for the file to be placed. Positional parameters were passed to the maxl script , based upon the input from the user .The maxl accepts this parameters and it does the export of data. The data we are exporting here is the level 0 data in coloumn format. The output is spooled out to a file. And the batch file logs out the log and it is sent as amail. The password is encrypted through the public key generated through maxl and decrypted through the private key generated through maxl. This parameters are passed along with the user input parameters. The batch file also can be converted into .exe using any batch to .exe converters, but the output file contains the password. Note: In versions 11.1.2.1 and up you will need to call the startmaxl.cmd instead of essmsh as Oracle has phased out essmsh. Batch file code: @echo off echo "start of log" >> "E:\MAXL\maxlscripts\dataexportlog.log" set /p ServerN=Enter Server IP: set /p CubeN=Enter Cube Name: set /p DBN=Enter Database Name: set /p FileN=Enter File Name to save export:

Upload: jeevan

Post on 04-Sep-2015

221 views

Category:

Documents


3 download

DESCRIPTION

This bat file does an automation of the data export from the server.

TRANSCRIPT

Exporting the essbase database:The Command used is export database to export the data from the essbase cube.To meet the requirement for exporting data from an essbase cube interactively , a process was developed.This process consists of a batch file which invokes the Maxl script. The batch file prompts for the server name, cube name,database name,the file name and the path for the file to be placed.Positional parameters were passed to the maxl script , based upon the input from the user .The maxl accepts this parameters and it does the export of data. The data we are exporting here is the level 0 data in coloumn format.The output is spooled out to a file. And the batch file logs out the log and it is sent as amail.The password is encrypted through the public key generated through maxl and decrypted through the private key generated through maxl. This parameters are passed along with the user input parameters.The batch file also can be converted into .exe using any batch to .exe converters, but the output file contains the password.Note: In versions 11.1.2.1 and up you will need to call the startmaxl.cmd instead of essmsh as Oracle has phased out essmsh.Batch file code:@echo offecho "start of log" >> "E:\MAXL\maxlscripts\dataexportlog.log"set /p ServerN=Enter Server IP:set /p CubeN=Enter Cube Name:set /p DBN=Enter Database Name:set /p FileN=Enter File Name to save export:set /p DirN=Enter Path to re-direct the file:E:\Oracle\Middleware\user_projects\epmsystem1\EssbaseServer\essbaseserver1\bin\startMaxL.bat -D "E:\MAXL\maxlscripts\maxltest.msh" 225468249,382703179 admin 189055623600756242080083413510897830 %ServerN% %CubeN% %DBN% %FILEN% %DIRN% >> "E:\MAXL\maxlscripts\dataexportlog.log"rem sendmail -b E:\MAXL\maxlscripts\dataexportlog.log -s "dataexport completed". -f sendersemail -r receivers email -r anotherreceiver email -X SMTP.Yourcompany.net

Maxl scriptspool on to "$7/filename.out";set timestamp on;login $1 $key $2 on $3;export database $4.$5 level0 data in columns to data_file "$7/$6";echo "file is copied";Spool off;logout;Exit;Encryption and decryption:essmsh gk This can also be passed to a file Essmsh gk >E:\MAXL\keys.txtExample:Public Key for Encryption: 30393,382703179 Private Key for Decryption: 225468249,382703179 This generates the public and private key.Pass the password and pubic key to the maxl essmsh ep Password PublicKeyThis produce the encrypted password.essmsh ep Password PublicKey >EncryptedPassword.txtExample:essmsh -ep password 30393,382703179Essbase MaxL Shell 64-bit - Release 11.1.2 (ESB11.1.2.1.0B347) Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Encrypted Data: 189055623600756242080083413510897830

MaxL Shell completedThis is passed as a parameter along with the input parameters and the private key whichis used for decrypting.E:\Oracle\Middleware\user_projects\epmsystem1\EssbaseServer\essbaseserver1\bin\startMaxL.bat -D "E:\MAXL\maxlscripts\maxltest.msh" 225468249,382703179 admin 189055623600756242080083413510897830 %ServerN% %CubeN% %DBN% %FILEN% %DIRN% >> "E:\MAXL\maxlscripts\dataexportlog.log"