Wednesday, December 28, 2016

OBIEE 12c : Single script to export the service instance

As we are all aware, in OBIEE 12c all the code movements are recommended to be performed using the service instance export files called BAR ( BI Application Archive) files.

In General we will have to open the Weblogic command in offline mode and use the export service instance command with parameters as described in my previous post Export and Import Service Instances. But we can also make all this steps into a single script and the just run that so everything happens on it own. This helps you save time as each time you have to navigate to different locations and remember directories and write export script which might have typo errors etc.

Lets see what we can do, if we have the Work and Export Directories fixed then we can decide on  the export instance command, which generally will not change. Mine is as below.

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

now save this command in a file with extension .py and make sure to give full permissions to user who runs the script. My case the file name is  SIExport.py located in below location


/home/oracle/scripts/SIExport.py 

Now all you need is to run this against the WLST  opened in offline mode. to do this we can actually use the below syntax.


java weblogic.WLST /home/oracle/scripts/SIExport.py 


But if you run this directly you will not be able to initialize the weblogic scripting tool, we need to set the environment before this using the below command.

source setWLSEnv.sh


Now we know the order and what needs to be done, include all the commands in a .sh file in required sequence. my file is ServiceInstanceExport.sh which is as below.


#!/bin/bash
# Purpose : Export the Service Instance
# Author : Rampradeep Pakalapati


ORACLE_HOME=/oracle/systems/apps/Middleware/Oracle_Home
WL_PATH=$ORACLE_HOME/wlserver/server/bin
source $WL_PATH/setWLSEnv.sh
sleep 5
java weblogic.WLST /home/oracle/scripts/SIExport.py


#End of File

Now if you just run the file as ./ ServiceInstanceExport.sh , your service instance will be exported to the mentioned export directoty.

No comments:

Post a Comment