My Blog

Welcome to OBIEE 12c – Scripting BAR file backups

by Paul Cannon on 9th May 2016 2 comments

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:

http://www.redstk.com/welcome-to-obiee12c-using-bi-application-archive-bar-files/

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.:

./wlst.sh  backup_command.py

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:

exportServiceInstance('/u01/app/obiee/user_projects/domains/bi','ssi','/u01/backups/workDir','/u01/backups','','','',true,'Admin123')

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:

bar file backups

You can then schedule this to run any way you want.

Enjoy!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Paul CannonWelcome to OBIEE 12c – Scripting BAR file backups

Related Posts

Take a look at these posts

2 comments

Join the conversation
  • Safer - 26th July 2016 reply

    Thks a lot!, this post help me, but export is .bar not ssi.bar so mv ssi.bar ssi_$(date ‘+%Y%m%d_%H%M’).bar not work, why ?

  • Nicolas - 11th July 2017 reply

    Hi Paul,
    One question, is it possible to only export the catalog? Is there any options to use a flag or something?
    I want to copy the catalog from my prod env to dev env.

Join the conversation