Javascript to Refresh All OBIEE Dashboard Analysis

Javascript to Refresh All OBIEE Dashboard Analysis

Get Social!

oracle-biOBIEE isn’t designed for (near) real time reporting, and as such doesn’t have an out of the box page refresh option.

There are times when I’ve needed a dashboard to be refreshed – when looking at query performance dashboards, for example, and would like the charts and tables to be constantly updated.

After searching on-line I found a few different ways to to refresh a dashboard but they all refreshed the whole page, rather than just the Analysis themselves. It’s not the end of the world, but it results in the whole page flickering as the Browser reloads it. It’s most annoying when you’re half way through the ‘Dashboards’ menu, about to click the navigate away and BAM! The page refreshes and you loose your position on the menu.

The following script is a combination of HTML, CSS and JavaScript code to loop through each Analysis on a single Dashboard page and issue the OBIEE Refresh command. A small box towards the bottom left hdashboard-refreshand side of the page that overlays the Dashboard with some controls and stats for the page refresh. It will show when the page was last refreshed, a countdown in seconds to the next refresh and a button to start and stop the automatic refresh.

chrome_256x256 Works in Chrome 44 internet-explorer_256x256 and Internet Explorer 8 and 10

There are 3 variables that are user changeable:

  • vRefreshDuration controls how many seconds between refreshes. Make sure this is higher than how long each query takes, otherwise an Answer will be asked to refresh before it’s finished refreshing!
  • vMessageLastRefreshed is the message displayed before the date and time of the last refresh.
  • vMessageNextRefresh is the message displayed before the countdown in seconds to the next refresh.

Feel free to change the below code, but please keep the header information. If you make any improvements, please let me know!

To add the Refresh code to a Dashboard, create a Text Dashboard drag-text-dashboard-objectObject and drag it onto any Dashboard that you’d like to automatically refresh. Then paste the below code into the Text box and check the ‘Contains HTML Markup’ checkbox. Click save and view your Dashboard!

<!--
        Title:      OBIEE in page refresh
	Author:     James Coyle (www.jamescoyle.net)
	Date:       2015-08-10
	Description:Self contained code to loop through each analysis on a 
                    Dashboard page and issue a Refresh command. This will 
                    refresh each analysis, going back to the data source, 
                    without refreshing the whole page. 
				 
	Version:    2015-08-10                  First revision. 
				
-->
<style type="text/css">
.toggle {
    margin: 4px;
    background-color: #EFEFEF;
    border-radius: 4px;
    border:1px solid #D0D0D0;
    overflow: auto;
    float: left;
}
.toggle label {
    float: left;
    width: 32px;
}
.toggle label span {
    text-align: center;
    padding: 3px 0px;
    display: block;
    cursor: pointer;
}
.toggle label input {
    position: absolute;
    top: -20px;
}
.toggle .input-not-checked:hover{
    background-color: #AAAAAA;
}
.toggle .input-checked{
    background-color: #404040;
    color: #F7F7F7;
	cursor: default;
}
#left-refresh-wrapper{
	float: left;
	padding: 6px 12px 6px 12px;
}
#refresh-heading-wrapper{
	font-size: 16px;
}
#refresh-button-wrapper{
	width: 90px;
	margin-left: auto;
	margin-right: auto;
}
#refresh-text-wrapper{
	padding: 6px 0px 6px 12px;
	float: left;
	font-size: 12px;
	line-height: 17px;
	border-left: 1px solid grey;
}
#floating-refresh-wrapper{
	border: 1px solid grey;
	width: 290px;
	overflow: hidden;
	border-radius: 8px;
	position: fixed;
	left: 20px;
	bottom: 22px;
	margin: auto; 
	background: rgb(255, 255, 255);
    background: rgba(255, 255, 255, .7);
}


</style>
<div id="floating-refresh-wrapper">
	<div id="left-refresh-wrapper">
		<div id="refresh-heading-wrapper">
			Refresh Status
		</div>
		<div id="refresh-button-wrapper">
			<div class="toggle">
				<label id="refresh-on" onclick="event.preventDefault(); toggleButton(this);"><input type="radio" name="toggle"><span class="input-checked">On</span></label>    
			</div>
			<div class="toggle">
				<label id="refresh-off" onclick="event.preventDefault(); toggleButton(this);"><input type="radio" name="toggle"><span class="input-not-checked">Off</span></label>
			</div>
		</div>
	</div>
	<div id="refresh-text-wrapper">
		<div id="last-refresh">Please wait...</div>
		<div id="next-refresh">Please wait...</div>
	</div>
	<div style="clear: both;"></div> 
</div>
<script type="text/javascript">
	// Get report IDs into an array
	function initRefresh(){
		if (typeof vReportIds !== 'undefined'){
			for (key in vReportIds){
				if (key != 'undefined' && key != null){
					vObjectIds.push(vReportIds[key]);
				}
			}
		}
		else{
			vObjectIds = [];
		}
	}

	// Start timer if refreshTimerObject is null
	function startRefreshTimer(){
		if (refreshTimerObject === null || typeof refreshTimerObject === 'undefined'){
			refreshTimerObject = setInterval(function () {timerTick()}, 1000);
			vCountdown = vRefreshDuration;
		}
	}
	
	// Stop timer if refreshTimerObject is not null
	function stopRefreshTimer(){
		if (refreshTimerObject !== null && typeof refreshTimerObject !== 'undefined'){
			clearTimeout(refreshTimerObject);
			refreshTimerObject = null;
			updateNextRefresh('-');
		}
	}

	// Loop known report IDs and send them to the OBIEE refresh function
	function timerTick(){
		if (vCountdown === 1){
			refreshReports();
			vCountdown = vRefreshDuration;
			updateLastRefreshed();
		}
		else{
			vCountdown = vCountdown - 1;
		}
		
		updateNextRefresh(vCountdown);
		
	}
	
	// Update display countdown
	function refreshReports(){
		for (key in vObjectIds){
			HereLink(vObjectIds[key], 'Refresh');
		}
	}
	
	// Update last refresh time on Dashboard
	function updateLastRefreshed(){
		document.getElementById("last-refresh").innerHTML = vMessageLastRefreshed + formatDate(new Date());
	}
	
	function formatDate(dt) {
		var dd = dt.getDate();
		var m = dt.getMonth() + 1;
		var yyyy = dt.getFullYear();
		var hh = dt.getHours();
		var mm = dt.getMinutes();
		var ss = dt.getSeconds();
		return padZero(dd, 2) + '-' + padZero(m, 2) + '-' + yyyy + ' ' + padZero(hh, 2) + ':' + padZero(mm, 2) + ':' + padZero(ss, 2) ;
	}
	
	function padZero(v, l){
		var r = v;
		if (v.toString().length < l){
			for(a = v.toString().length; a < l; a++){
				r = '0' + v;
			}
		}
		return r;
	}
	
	// Update last refresh time on Dashboard
	function updateNextRefresh(i){
		document.getElementById("next-refresh").innerHTML = vMessageNextRefresh + i;
	}
	
	// toggle button and change timer status
	function toggleButton(o){
		if (o.childNodes[1].innerHTML !== vLastSpanClick){
			vLastSpanClick = o.childNodes[1].innerHTML;
			var spans = document.getElementById('refresh-button-wrapper').getElementsByTagName('span');
			for (el in spans){
				spans[el].className = 'input-not-checked';
			}
			
			o.childNodes[1].className = 'input-checked';
			
			if (o.childNodes[1].innerHTML === 'Off'){
				stopRefreshTimer();
			}
			else{
				startRefreshTimer();
			}
		}
	}
	
	var vRefreshDuration = 5;
	var vMessageLastRefreshed = '<strong>Last refreshed :</strong> <br />';
	var vMessageNextRefresh =  '<strong>Next refresh : </strong>';
	
	var vObjectIds = [];
	var refreshTimerObject = null;
	var vCountdown = 0;
	var vLastSpanClick = 'On';
	
	initRefresh();
	updateLastRefreshed((new Date).toLocaleString());
	updateNextRefresh(0);
	startRefreshTimer();
	
</script>

 

 

 

 


Download Oracle Java From The Terminal With wget

Get Social!

java-logoOracle have a very restrictive license that applies to most of their software downloads which prohibits you from distributing the binaries yourself. What this means, for example, is that you could not download the Java binaries and upload them to your own APT repository for others to use.

There are a few workarounds that exist to help making this install easier, but here we’re going to look at downloading the Java runtime environment (JRE) binaries and installing them all from a command line.

Use wget to download the binaries, so make sure that’s available on your system. If it isn’t, simply apt-get install wget.

One of the important things to note is that the Java version changes over time and therefore the links and commands below may need to be changed to ensure you’re always getting the latest version. Check out the Java Download Page to make sure you have the latest.

wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u51-b16/server-jre-8u51-linux-x64.tar.gz

I’m using an minimal version of Debian that doesn’t have the worlds Certificate Authorities installed and therefore wget gives me an error:

ERROR: cannot verify edelivery.oracle.com's certificate, issued by '/C=US/O=GeoTrust, Inc./CN=GeoTrust SSL CA':
  Unable to locally verify the issuer's authority.
To connect to edelivery.oracle.com insecurely, use `--no-check-certificate'.

The fix is to either install the correct CA certificate on the machine or add the no-check-certificate switch to wget to avoid checking the certificate:

wget --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u51-b16/server-jre-8u51-linux-x64.tar.gz

Once you have the Java archive downloaded you’ll need to create a target folder and extract the downloaded archive with tar:

mkdir /opt/jre
tar -zxf server-jre-8u51-linux-x64.tar.gz -C /opt/jre

The last couple of steps are to tell your OS to use the Java binaries you’ve just moved into place.

update-alternatives --install /usr/bin/java java /opt/jre/jdk1.8.0_51/bin/java 1000
update-alternatives --install /usr/bin/javac javac /opt/jre/jdk1.8.0_51/bin/javac 1000

Running anything in Java, or using the -version switch should now use your newly installed binaries.

java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

 

 

 


Share a Single MDS Schema Between Multiple OBIEE Installations

Category : How-to

Get Social!

oracle-biIf you’ve installed OBIEE as many times as I have you’ll be more than familiar with the RCU and the two schemas it creates, MDS and BIPLATFORM. What you may not know, howerver, is that the MDS schema can be shared with multiple installations of OBIEE. A BIPLATFORM schema is still required for each OBIEE environment.

obiee_shared_mds

The above diagram shows a single MDS schema which is shared with each OBIEE environment; Dev, Test and Prod. Each of the OBIEE environments still has it’s own BI_PLATFORM schema. When running the RCU, you will need to run it 3 times in total; once with the MDS and BIPLATFORM components selected, and twice with just the BIPLATFORM component selected.

obiee-rcu-components

 

When it comes to installing OBIEE, you simpley use the same MDS details for all servers, but change the BIPLATFORM credentials to match the environment.

Obviously this method introduces it’s own problems with several environments using the same database when it comes to patching and upgrading. I’m not saying you should do it this way, just that you can!

 


Add a new skin to an OBIEE scaled out cluster

Category : How-to

Get Social!

oracle-biIf you are using a cluster configuration, there are multiple methods you can use to deploy a skin. Below details a method which results in a single shared resource location that each member of the OBIEE cluster will use.

This walk through assumes you already have an OBIEE cluster installed. You will also need a shared storage mount on each of the servers. The storage must be shared, so that if you add a file on one server, it’s available for all the others. You can mount this storage in any location accessible by the oracle user. For this guide, we’ll assume you’ve mounted it in /path/to/share however a more realistic example would be something like /mnt/obiee_skins.

Create a folder in the shared area called analyticsRes.

mkdir /path/to/share/analyticsRes

Copy both the sk_ and s_ directories to the analyticsRes directory.

cp -r/middleware/Oracle_BI1/bifoundation/web/app/res/sk_blafp /path/to/share/analyticsRes/
cp -r/middleware/Oracle_BI1/bifoundation/web/app/res/s_blafp /path/to/share/analyticsRes/

Edit the instance config file on all nodes of the cluster

vi /middleware/instances/instance2/config/OracleBIPresentationServicesComponent/coreapplication_obips1/instanceconfig.xml

Add or edit the following tags between <ServerInstance><WebConfig>.

<URL>
<!--     <CustomerResourceVirtualPath>/analyticsRes</CustomerResourceVirtualPath> -->
    <CustomerResourcePhysicalPath>/path/to/share/analyticsRes</CustomerResourcePhysicalPath>
</URL>

Note: The line which is commented out can be used, however this will be relative to each instances install location. This is fine for a single node install, but will cause problems with clustering as each cluster has it’s own instance.

Add or edit the following tags replacing SkinName with the name of your skin. The skin name will be the name of the folder after sk_.

<UI>
    <DefaultSkin>SkinName</DefaultSkin>
    <DefaultStyle>SkinName</DefaultStyle>
</UI>

Repeat the above instanceconfig steps for each node of the cluster.

We now need to add an Application in Weblogic so that the images, JS and CSS in the skins and style folders can be served to clients browsers. Log in to the Weblogic console.

This can be found on port 7001, by default, on the primary node of your OBIEE cluster: http://biurl.com:7001/console/

Select Deployments and click Lock and Edit on the left. Click the Install button to add a new deployment.

Summary of Deployments WLS Console
Enter the full path to your analyticsRes folder, including the analyticsShare part in the Path textbox and click next. For example, enter:

/path/to/share/analyticsRes

Select Install this deployment as an application and click Next. Select the tickbox bi_cluster to enable this application for all nodes in the cluster and click Next.

The next screen should be left as default for all options except the bottom one which should be I will make the deployment accessible from the following location with the path to your AnalyticsRes folder already filled in. Click Finish to complete the deployment.

Install Application Assistant WLS Console

The next step is to start the newly deployed application.  Log in to the Weblogic console. This can be found on port 7001, by default, on the primary node of your OBIEE cluster: http://biurl.com:7001/console/

Click Deployments and find your new analyticsRes application which should be in a Prepared state. Click the tickbox next to the deployment and click Start and then Servicing all requests.

Summary of Deployments - WLS Console

You will have to restart all cluster nodes for the changes to take effect – specifically the Presentation Services.
You can add other static resources to this folder which will be accessible from http://biurl.com/analyticsRes/example-resource.png.


Refresh Oracle Business Intelligence GUIDs

Get Social!

webcatWhen copying or making significant changes to the OBIEE 11G web catalog, users can experience difficulty with login. This includes OBIEE patching and upgrades, or moving to a new server such as releasing. To correct this issue, you must force OBIEE to refresh the web catalog. This is done by manually editing two configuration files, restarting the OBIEE system, removing the changes and restarting the OBIEE system once more.

Open the following file for editing:

ORACLE_INSTANCE/config/OracleBIServerComponent/coreapplication_obisn/NQSConfig.ini

Locate the attribute FMW_UPDATE_ROLE_AND_USER_REF_GUIDS and change the value to YES.

FMW _UPDATE_ROLE_AND_USER_REF_GUIDS = YES

Save and close the file.

Open the following file for editing:

ORACLE_INSTANCE/config/OracleBIServerComponent/OracleBIPresentationServicesComponent/instanceconfig.xml

Locate the following text:

<Catalog>
<UpgradeAndExit>false<UpgradeAndExit>
</Catalog>

Add “<UpdateAccountGUIDs>UpdateAndExit</UpdateAccountGUIDs>” to match below:

<Catalog>
<UpgradeAndExit>false<UpgradeAndExit>
<UpdateAccountGUIDs>UpdateAndExit</UpdateAccountGUIDs>
</Catalog>

Save and close the file.

Restart the OBIEE system components using opmnctl in a terminal window.

#cd ORACLE_HOME/admin/instance/bin
#./opmnctl stopall
#./opmnctl startall

Change the settings back to the original values. Open the following file for editing:

ORACLE_INSTANCE/config/OracleBIServerComponent/coreapplication_obisn/NQSConfig.ini

Locate the attribute FMW_UPDATE_ROLE_AND_USER_REF_GUIDS and change the value to NO.

FMW _UPDATE_ROLE_AND_USER_REF_GUIDS = NO

Save and close the file.

Open the following file for editing:

ORACLE_INSTANCE/config/OracleBIServerComponent/OracleBIPresentationServicesComponent/instanceconfig.xml

Locate the following text:

<Catalog>
<UpgradeAndExit>false< UpgradeAndExit>
<UpdateAccountGUIDs>UpdateAndExit</UpdateAccountGUIDs>
</Catalog>

Remove “<UpdateAccountGUIDs>UpdateAndExit</UpdateAccountGUIDs>” to match below:

<Catalog>
<UpgradeAndExit>false<UpgradeAndExit>
</Catalog>

Save and close the file.

Restart the OBIEE system components using opmnctl in a terminal window.

#cd ORACLE_HOME/admin/instance/bin
#./opmnctl stopall
#./opmnctl startall

Your OBIEE server will now start up normally and your users should be able to log in.


Visit our advertisers

Quick Poll

Do you use ZFS on Linux?

Visit our advertisers