A few months ago I wrote a blog on using BI Application Archive (BAR) files to back up the RPD, web catalog and security model from an OBIEE instance. Since then I’ve been asked by a client how this could be scripted for a regular schedule to run.
My original blog can be accessed here:
As this calls the WLST scripting tool, all we need to do is wrap this in an outer calling script and, optionally, rename the BAR file created with the current date & time.
The WLST scripting tool is capable of using input files to supply the commands to run, rather than entering them manually, and this is simply done my supplying the command file-name as an argument to the WLST script, e.g.:
The language of the weblogic scripting tool is python, so the default extension on files is .py, but .txt would do just as well, it’s just a text file containing one or more commands.
In my case I’ve created a file called backup_command.py with the following entry:
I’ve saved this in a directory called /u01/scripts. The exportServiceInstance command above requires two additional directories:
/u01/backups where the backup BAR files will be stored
/u01/backups/workDir a temporary working directory required by the exportServiceInstance command
Now that I have my command file, I just need a script file to call it. Called backup_obiee.sh, this is my script:
cd /u01/app/obiee/oracle_common/common/bin ./wlst.sh /u01/scripts/backup_command.py cd /u01/backups mv ssi.bar ssi_$(date '+%Y%m%d_%H%M').bar
This changes directory to where the wlst.sh script is kept, then runs it with the command file as input (fully pathed).
Once the export is complete it switches to the backup directory and renames the BAR file to include the date & time.
The Windows equivalent of this, called something like backup_obiee.cmd, would be:
cd C:\app\obiee\oracle_common\common\bin call wlst.cmd c:\scripts\export.py cd c:\backups ren ssi.bar ssi_%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%_%time:~0,2%%time:~3,2%.bar
Running this script then simply produces the BAR file:
You can then schedule this to run any way you want.