Thursday, December 1, 2016

OBIEE 12c : Export and Import Service Instance (BAR) files

This is once of the best features in OBIEE 12c, FYI my system is on 12.2.1.1. The way you can export your RPD, catalog, security model all at once without you having to worry about going to places and backing up files is just AWESOME.

I will keep it as simple as possible, BI Application Archive Files (BAR) are just like zip files but in BI application readable format. The basic idea behind this concept is to enable us to migrate the RPD, Catalog and Security Model all at once, to keep it simple. Its a command line utility and there is no other way around it.

First thing is to understand that it is a WebLogic Scripting Tool (WLST) utility, and can be executed only against it. To open a WLST command line utility open the below location on command prompt.

[ORACLE_HOME]/oracle_common/common/bin/

and run the file wlst.sh using the ./wlst.sh


Now before we start we need to know few details like DOMAIN_HOME, Service Instance Name, Administrator Username/Password which are already available as part of installation. Now we need two directories (for export) one for TempWorkSpace and other for saving the Exported BAR file.

Giving mine for an idea

DOMAIN_HOME/oracle/systems/apps/Middleware/Oracle_Home/user_projects/domains/bi

Service Instance Name = ssi (definitely this one if dont know what it is)

you can find the same using the listBIServiceInstances('[DOMAIN_HOME') command where it will display the key.

Work Dir/userhome/oracle/Desktop/BARWorkDir 

Export Dir/userhome/oracle/Desktop/BARExpDir


We have prepared enough and now its time for action, Invoke the wlst.sh file and it will start in offline mode, dont worry about offline lets take it for another day. Today only concentrate on import and export Service instances.

The magical commands at last exportServiceInstance()    and  importServiceInstance() , definitely not expected them to be so simple when they are doing so much.

All the wlst commands are case sensitive so you must remember them as is. Let s see how to use.


exportServiceInstance()

Obviously this will export the service instance with RPD, Webcatalog and security info without any question, but we will need to specify some parameters to it, there are 9 of them, 4 mandatory.

1st -- DOMAIN _HOME
2nd -- Service Insatnce Name
3rd -- Work Dir
4th -- Export Dir
5th -- No Use as of now, Future Use
6th -- no Use as of now, Future Use
7th -- no Use as of now, Future Use
8th -- true or false ( will decide on exporting user specific info like personal folders etc)
9th -- Password for exporting DB credentials, if not given then DB details are not exported

Now we can either go for 1-4 and leave rest as below

exportServiceInstance('/oracle/systems/apps/Middleware/Oracle_Home/user_projects/domains/bi','ssi','/userhome/oraclebi/Desktop/BARWorkDir','/userhome/oraclebi/Desktop/BARExpDir')

or leave the 6,7 and 8 as blanks and give 8th and 9th as below

exportServiceInstance('/oracle/systems/apps/Middleware/Oracle_Home/user_projects/domains/bi','ssi','/userhome/oraclebi/Desktop/BARWorkDir','/userhome/oraclebi/Desktop/BARExpDir','','','',true,'Admin123')

Both the cases a Folder is created in Export Dir, with data and time as folder name with a file generally as ssi.bar , You are done by the way.

importServiceInstance()

So no more explaining on what it does, we look at how to get it done directly. Even import command needs some parameters 7 on the whole and 3 mandatory

1st -- DOMAIN_HOME
2nd -- Service Instance Name
3rd -- BAR file location with name
4th - Boolean to import RPD
5th -- Boolean to import Catalog
6th -- Boolean for User info
7th -- Password for DB credentials import

Now lets just use 3 , to get the RPD and catalog imported as below

importServiceInstance('/oracle/systems/apps/Middleware/Oracle_Home/user_projects/domains/bi','ssi','/userhome/oracle/Desktop/BARExpDir/20161130_151519/ssi.bar')

To get everything imported from BAR file use below

importServiceInstance('/oracle/systems/apps/Middleware/Oracle_Home/user_projects/domains/bi','ssi','/userhome/oraclebi/Desktop/BARExpDir/20161130_151519/ssi.bar','true','true','true','Admin123')

You can change the 4,5 & 6 Boolean parameters as per your need. Oracle doesn't say anything about restarts after the Import but i did notice some inconsistencies it can be anything may not be even related at all, but i did a restart of services. You can too if had a chance.

1 comment:

  1. Thanks for sharing valuable information. Your blogs were helpful to AWS learners. I
    request to update the blog through step-by-step. Also, find the AWS news at
    AWS Online Training

    ReplyDelete