Automate Essbase Data Backup with ESSCMD and BAT

Backup! Backup! Backup!

The three most important aspects of managing an enterprise application as explained to me by one of the key personnel for the current client I’m working for. She hasn’t failed to stress enough, the need to ensure timely and complete backups.

I haven’t been managing the deployed application but I noticed that the team looking after essbase was taking backups manually. Somehow they weren’t comfortable with the command line interface to automate their task so I thought I’d chip in and hammer out a primitive backup method to help them out.

I think there are better and more elegant solutions out there, so if any of my readers’ feel that they have a better one I’d really appreciate if they can give in their suggestions.

My method was pretty simple, it consists of a batch file that launches an esscmd script. The reason I use a batch file to launch the script is to ensure that the backup files generated are then moved to a specified location and timestamped for archiving purposes.

The code for the batch file is as follows:

REM Backup current directory
SET OLDDIR=%CD%
SET BACKUPPATH=”E:\DATABACKUP”

ESSCMD backup.scr

DEL %BACKUPPATH%\AD.TXT /f /q
DEL %BACKUPPATH%\ADC.TXT /f /q
DEL %BACKUPPATH%\L0.TXT /f /q
DEL %BACKUPPATH%\L0C.TXT /f /q
DEL %BACKUPPATH%\ILDB.TXT /f /q
DEL %BACKUPPATH%\ILDBC.TXT /f /q

MOVE %ARBORPATH%\app\AD.TXT %BACKUPPATH%\
MOVE %ARBORPATH%\app\ADC.TXT %BACKUPPATH%\

MOVE %ARBORPATH%\app\L0.TXT %BACKUPPATH%\
MOVE %ARBORPATH%\app\L0C.TXT %BACKUPPATH%\

MOVE %ARBORPATH%\app\ILDB.TXT %BACKUPPATH%\
MOVE %ARBORPATH%\app\ILDBC.TXT %BACKUPPATH%\

set hour=%time:~0,2%
if “%time:~0,1%”==” ” set hour=0%time:~1,1%
set _my_datetime=%date:~10,4%%date:~4,2%%date:~7,2%-%hour%%time:~3,2%

REN %BACKUPPATH%\AD.TXT %_my_datetime%-AD.TXT
REN %BACKUPPATH%\ADC.TXT %_my_datetime%-ADC.TXT
REN %BACKUPPATH%\L0.TXT %_my_datetime%-L0.TXT
REN %BACKUPPATH%\L0C.TXT %_my_datetime%-L0C.TXT
REN %BACKUPPATH%\ILDB.TXT %_my_datetime%-ILDB.TXT
REN %BACKUPPATH%\ILDBC.TXT %_my_datetime%-ILDBC.TXT

The esscmd script is very simple. It is:

LOGIN “LOCALHOST” “username” “password”;
SELECT “application” “database”;

EXPORT “AD.TXT” 1 0;
EXPORT “ADC.TXT” 1 1;

EXPORT “L0.TXT” 2 0;
EXPORT “L0C.TXT” 2 1;

EXPORT “ILDB.TXT” 3 0;
EXPORT “ILDBC.TXT” 3 1;

EXIT;

10 thoughts on “Automate Essbase Data Backup with ESSCMD and BAT

  1. hi Shezad ,
    i was wondering whether it is possible to have a batch file which firstly logins into the essbase application manager
    then log outs the users forcefully and finally deletes a database from one of the 3 applications present .
    This pertains to Essbase 6.5 version and its application manager .

    • Hi Prashant,

      I haven’t looked into such a scenario and I really can’t give an answer immediately. However I will look into it and definitely give you an answer soon.

      Shehzad

  2. It shouldn’t be ‘MOVE’ command, use “COPY” instead. “MOVE” deletes the original file and copies it to the new location and if the important files are moved then the Essbase crashes.

    • The move command specifies the exact file that is generated as a data backup. So I don’t think it would affect any of the important files. However if you feel that you need to keep the files at their original location then it is also possible.

      However please note, that the backup scripts generates the backup with the same names, so the old ones will probably be overwritten the next time the backup is run. The move and rename part is what backs up the files with a unique timestamp to uniquely identify them later on.

  3. I want to copy de files of an aggregate database (.dat) to a new database with the same outline and name in other server, but when i retrieve the information only see zero’s. What wrong??

    Any ideas guys

    Thank´s in advance!

    Luis

  4. Hi,

    We have already automated the backups using the above method. I want to know is there any ESSCMD which either sends a notification or mail after each database is exported? This can be with either ESSCMD or batch file?

    • Hi Manvi,

      I haven’t personally generated an email alert in the backup script. Without getting into the ESSCMD capabilities, I think the best option is to use a batch file to generate an email alert. This way you will be able to monitor the creation of the backup files to ensure the backup was done. Maybe you can use Blat to send the smtp mail from the command line.

      Another alternate is to make a VBS Script using CDO to send the email and invoking it after the backup process is complete.

      It basically boils down to your environment and what you are comfortable in using.

    • To be honest, this is the first time I’ve heard of the product but it definitely promises to be something that should become essential for any large scale implementations.

      I’ve seen the spec sheet and it definitely brings the ‘missing’ features to essbase. Would it be ok if I can contact you on your email for further information?

Leave a reply to Shehzad Cancel reply