Wednesday, April 15, 2015

Purge OBIEE Cache Using Oracle Data Integrator Automatically when Load Completes


Purge OBIEE Cache Using Oracle Data Integrator Automatically when Load Completes


Step 1:  Create file purge.txt and write  CALL SAPURGEALLCACHE();  and save the file in below Location
C:\OBIEE_HOME\instances\instance1\bifoundation\OracleBIApplication\coreapplication\setup
Step 2: Create a Shell Script purgecache.sh and save it any location or in Custom scripts location and insert below Unix code in purge.sh file, this code will clear both Presentation Server and Query Cache
#!/bin/bash
#Script to purge the cache

#Declare variables
SETUP_DIR=$/u01/app/biapps/instances/instance1/bifoundation/OracleBIApplication/coreapplication/setup
NQCMD_DIR=$/u01/app/biapps/Oracle_BI1/bifoundation/server/bin
RUNCAT_DIR=$/u01/app/biapps/instances/instance1/bifoundation/OracleBIPresentationServicesComponent/coreapplication_obips1/catalogmanager
LOG_FILE=$/u01/app/biapps/Oracle_BI1/logs/purgecache.log
CAT_URL=http://bi-dev2:9704/analytics/saw.dll?
USR_NM=`awk -F”=” ‘{print $2}’ $SETUP_DIR/catmancredentials.properties|xargs|cut -d’ ‘ -f1`;
PASS=`awk -F”=” ‘{print $2}’ $SETUP_DIR/catmancredentials.properties|xargs|cut -d’ ‘ -f2`;

#Initialize the environment
source $SETUP_DIR/bi-init.sh;

#Run Server cache Purge command
$NQCMD_DIR/nqcmd -d AnalyticsWeb -u $weblogic -p $Admin123 -s $SETUP_DIR/purgecache.txt -o $LOG_FILE;

#Run Web Cache Purge command
$RUNCAT_DIR/runcat.sh -cmd clearQueryCache -online $CAT_URL -credentials $SETUP_DIR/catmancredentials.properties >> $LOG_FILE;

SUCCESS_FLG=`grep -E ‘Operation SAPurgeAllCache succeeded|Cleared the query cache successfully’ $LOG_FILE|wc -l`;

if [ $SUCCESS_FLG = 2 ]
then
        echo “———————————————-“;
        echo “Cleared Server and Web cache successfully”;
        echo “———————————————-“;
else
        echo “Error clearing cache. Please check the log file: $LOG_FILE”;
fi

Step 3:
 Create ODi Package and call OS Command 1:










Step 4: Click on OS Command 1 and go to Properties and enter the command








Step 5: Generate Scenario








Call the Scenario in the Last task of Load Plan and Regenerate the Load Plan, This will Purge the OBIEE cache immediately after Load completes automatically

2 comments :

  1. I get the following error message

    /OBIEE11g/Oracle_BI1/bifoundation/server/bin/nqcmd: error while loading shared libraries: libARicu27.so: cannot open shared object file: No such file or directory

    ReplyDelete