Sunteți pe pagina 1din 8

OBIEE: Call SAPurgeAllCache()

Just a note to myself on how to clear the entire BI Server cache. Mr. Minkjan has a great article here and Gerard Nico has one here. Caching has been enabled (via <BI_SERVER_HOME>\server\Config\NQSConfig.ini) For a list of ODBC Function extensions, read here. First up, I run a simple report and then verify that there is an entry in the cache

I then create a small SQL script and put it in my c:\ folder:

(OK, just ignore what it says in the Title bar, I moved it) Open up a cmd prompt and issue the following:

nqcmd -d AnalyticsWeb -u Administrator -p Administrator -s purgeallcache.sql


Hit enter and you should see the following:

-----------------------------------------------------------------------------Oracle BI Server Copyright (c) 1997-2009 Oracle Corporation, All rights reserved -----------------------------------------------------------------------------CALL SAPurgeAllCache() CALL SAPurgeAllCache() -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------RESULT_CODE RESULT_MESSAGE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------1 [59118] Operation SAPurgeAllCache succeeded! -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Row count: 1 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Processed: 1 queries
Check the Cache Manager and voila!

For future reference, here are the options available for the nqcmd utility:

Command: nqcmd - a command line client which can issue SQL statements against either Oracle BI server or a variety of ODBC compliant backend databases. SYNOPSIS nqcmd [OPTION]... DESCRIPTION -d -u -p -s -o -D -C<# number of fetched rows by column-wise binding> -R<# number of fetched rows by row-wise binding> -a (a flag to enable async processing) -f (a flag to enable to flush output file for each write) -H (a flag to enable to open/close a request handle for each query) -z (a flag to enable UTF8 instead of ACP) -utf16 (a flag to enable UTF16 instead of ACP) -q (a flag to turn off row output) -NoFetch (a flag to disable data fetch with query execution) -NotForwardCursor (a flag to disable forwardonly cursor) -SessionVar =

Oracle BI EE 10.1.3.3/2 Scheduling Cache Purging


Posted by Venkatakrishnan J on December 18, 2007 One of the common questions that i typically get while on customer calls is how do we about purging the cache on a regular basis. Well this blog entry would give you a step by step approach for doing the same. This is just an example. You can customize this to your needs. Before going into the actual procedure lets look at an easier approach of purging the caches. If you go to the Admin tool you would basically find a cache Manager under Manager. If you open the cache manager you would find all the Logical SQL statements that have been cached. You can purge each of these one by one or you can do a Purge All.

Now lets look at automating the above process. In order to automate this we shall be using a utility called NQCMD. What this utility can do is it can accept ODBC sql calls and can execute them. So, our aim is to call this utility from an ibot via a java script. Lets first look at the syntax of NQCMD. If you go to {OracleBI}\Server\bin via command line and type in nqcmd/?, you would get the syntax as shown below.

So, basically it accepts the following important parameters 1. 2. 3. 4. 5. Username Password BI Server DSN Input file containing the Purge SQL Statement Output result file

Now, lets look at the list of steps to purge the cache one by one.

1. Open a text editor and type in the following command. This command will be purging the cache.

{call SAPurgeAllCache()}; Save this file in say D drive as SQL.txt. This will be our input file.

2. Lets start creating a simple javascript. Open a text editor and enter the following list of statements. var nqCmd = D:\\Oracle\\OracleBI\\server\\Bin\\nqcmd.exe; var dsn = AnalyticsWeb; var user = Administrator; var pswd = Administrator; var tempInFileName = D:\\SQL.txt; var tempOutFileName = D:\\Output.txt; var wshShell = new ActiveXObject(WScript.Shell); var dosCmd = nqCmd + -d \" + dsn + \ -u \" + user+ \ -p \" + pswd + \ -s \" + tempInFileName + \" + -o \" + tempOutFileName + \"; try { wshShell.Run(dosCmd, 0, true); } catch(e) { throw e; } Save this file in {OracleBI}\Server\Scripts\Common as Purge.js. As you see above what this java script does it calls the nqcmd utility by passing in the relevant arguments.

3. Now go to BI EE Delivers and start creating a simple ibot. Go to the advanced section and enter the details of the Java Script that we created. In the schedules section choose the frequency with which you would like to run this script. For testing purposes lets test this by running the script immediately

4. Once this is done save the ibot. Now you can see that all the cache would have been purged and also you can see how much have been purged from the output.tx file.

S-ar putea să vă placă și