Вы находитесь на странице: 1из 9

USING ORACLE ESSBASE RELEASE 11.1.

2 EXPORT OUTLINE TO XML


Gain quick documentation, snapshot, and comparison capability for Oracle Essbase metadata.

Written by: Christian Screen ArtOfBI.com Version: 2010.11.05

Oracle Essbase 11.1.2 Metadata to XML http://www.artofbi.com

Table of Contents
OBJECTIVE ................................................................................................................................................................... 3 AUTHOR INFORMATION ................................................................................................................................................. 3 NEW EXPORT CAPABILITIES FOR MAXL ............................................................................................................................. 4 OTHER OPTIONS ........................................................................................................................................................... 6 EXAMPLE XHTML REPORTING ........................................................................................................................................ 6 CONCLUSION ............................................................................................................................................................... 9

Last Saved: 3/11/2011 9:52 AM

http://www.artofbi.com

Oracle Essbase 11.1.2 Metadata to XML http://www.artofbi.com

Introduction
OBJECTIVE
This article provides insight to one of the new features in Oracle Essbase 11.1.2, Export Outline to XML via MaxL. By showcasing this feature Essbase developers will have new direction in extending clarity to end-users on the way they may slice and dice data without compromising security standards or embarking on superfluous installations. This functionality is ideal for project documentation of Essbase database metadata as well as conducting snapshots and comparisons.

AUTHOR INFORMATION
Christian Screen is an Oracle Essbase certified consultant and a Solutions Engineer at BI Consulting Group, an Oracle Partner and Oracle Pillar Award winning consulting group specializing in Business Intelligence and Enterprise Performance Management. Christian can be found blogging on all topics related to Business Intelligence at http://www.artofbi.com.

Last Saved: 3/11/2011 9:52 AM

http://www.artofbi.com

Oracle Essbase 11.1.2 Metadata to XML http://www.artofbi.com Oracle Essbase developers and end users have long been aware than in order to view the dimensional metadata defining an Essbase database (OLAP cube) there are few options: Essbase Administration Services Console o Mainly used by Essbase developers, the console requires a fat-client download (or opened via Java Web Start) but security privileges must be configured for a user to Read the database outline in question. Smart View or MS Excel Add-In o Requires a small download, all or part of the Microsoft Office Suite, and security privileges must be set for a user to Read the database outline in question Essbase API o Requires advanced programming language skills and a means to distribute the custom application to an end-user.

Traditionally, the way that developers and end-users alike view the Essbase database metadata has been through the Essbase Administration Services Consoles graphical interface. But best practice for security purposes, seeks to limit access to that interface. With the 11.1.2 release of Oracle Essbase developers now have the ability to programmatically export all or specific segments of the Essbase database outline to XML. Options to disseminate and utilize the extrapolated metadata outside of the confines of Essbase are now possible. In this article, we explain how the new feature works by exploring the MaxL export outline scripting option. In addition, we utilize some basic Extensible Stylesheet Language (XSL) code to transform the XML metadata output into a legible report ready to be consumed by end-users. The examples in this article require the following products to be installed and configured: Oracle Essbase Server (11.1.2) Oracle Essbase Administration Services (11.1.2) The examples in this article utilize the default Sample.Basic database application that installs with the Essbase Server. To try or review the examples presented in this article on your own, you may download the scripts from [Download Site].

NEW EXPORT CAPABILITIES FOR MAXL


The export class of MaxL commands has been extended to include the Export Outline command, which allows for an export to be constrained solely to a databases metadata. Like most MaxL commands several arguments can be configured in order to tailor the desired result when executing the command. The first argument of this command defines the location of the outline Last Saved: 3/11/2011 9:52 AM http://www.artofbi.com

Oracle Essbase 11.1.2 Metadata to XML http://www.artofbi.com in question; Metadata can be exported from an active database outline (i.e.: a database on the server that is currently started) or an outline (OTL file extension) file stored on the file system. In our example, we want to export all dimensions, go against the default alias table, and export the file to our local hard drive at C:\_dev\SampleBasicMetaData.xml. We will do so by using the option to source from an active database, Sample.Basic. We will create a MaxL script to use this new functionality. The MaxL script that will accomplish this task still conforms to the basic MaxL syntax and runtime logic required to interact with the Essbase Server. Since we are referencing an active database on the server the MaxL script will need to pass in our login credentials. We will also script out the loading of Sample.Basic database to ensure that it is started. In order to accomplish this perform the following steps: 1.) Open the Oracle Essbase Administration Services console, and log in to the Oracle Essbase server containing the Sample application. 2.) On the Essbase Administration Services console menu bar select File > Editors > MaxL Script Editor 3.) When the editor appears type the following scripting into the editor:
login 'admin' 'password' on 'localhost'; alter system load application 'Sample'; alter application 'Sample' load database 'Basic'; export outline sample.basic all dimensions to xml_file "c:/_dev/SampleBasicMetaData.xml"; logout;

4.) Click the Execute Script button in the editor dialog box or press the F5 key to run the script. When the script runs, it parses the Sample.Basic outline and stores all key elements about the outline and its members in a logical format represented by XML. The Export Outline function runs rather quickly against the server and the resulting XML file gets created at the specified location. If the file already exists it will be overwritten without warning. Opening the resulting XML file in a browser or text editor will show a standard XML structure with elements representing both the cube and the dimensions from the outline. The XML file is now ready for consumption.

Last Saved: 3/11/2011 9:52 AM

http://www.artofbi.com

Oracle Essbase 11.1.2 Metadata to XML http://www.artofbi.com

OTHER OPTIONS
As mentioned previously there a few other arguments that the Export Outline function can accept that will vary the amount of detail that will output to the resulting XML file. Other available syntax keywords that could be used may impact: The ability to export all dimensions or select dimensions The ability to export member names referencing a specific alias table The ability to export only member names, i.e.: no alias names, formulas, or attributes, etc.

EXAMPLE XHTML REPORTING


As mentioned previously one of the most powerful uses for the Export Outline to XML function is the ability to utilize the outline metadata outside of the Essbase Server itself. Once the export has completed the file is in essence a snapshot of the database metadata since it is not physically tethered to the Essbase Server. By utilizing either a third-party tool or some basic Java scripting, the exported XML file can be parsed and leveraged in just about any reporting structure, word processor, or subsequent integration. For this article we will quickly apply some custom

Last Saved: 3/11/2011 9:52 AM

http://www.artofbi.com

Oracle Essbase 11.1.2 Metadata to XML http://www.artofbi.com Extensible Stylesheet Language (XSL) to the exported XML document in order to transform the metadata into a XHTML that can be placed on a local web server for viewing. 1.) Open your favorite text editor. 2.) Enter (or Copy and Paste from the downloaded sample files) the following XSL into the text editor.
<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <h2>Essbase Cube Metadata</h2> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td><strong>Dimension</strong></td> <td><strong>Members</strong></td> </tr> <xsl:for-each select="application/Dimension"> <tr bgcolor="#ffffcc"> <td colspan="5"><xsl:value-of select="@name"/></td> </tr> <xsl:for-each select="Member"> <tr> <td width="100px"></td> <td width="130px" colspan="3"><xsl:value-of select="@name"/></td> </tr> <xsl:for-each select="Member"> <tr> <td></td> <td></td> <td><xsl:value-of select="@name"/></td> <td> <xsl:value-of select="@MemberFormula"/> </td> </tr> </xsl:for-each> </xsl:for-each> <tr> <td colspan="5"><i>Generation Names:</i> <font color="blue"> <xsl:for-each select="Generations/GenLevel"># <xsl:value-of select="@number"/>/<xsl:value-of select="@name"/>, </xsl:for-each> </font> </td> </tr> <tr><td style="height:10px;"></td></tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>

Last Saved: 3/11/2011 9:52 AM

http://www.artofbi.com

Oracle Essbase 11.1.2 Metadata to XML http://www.artofbi.com 3.) Save the file as MetaDataStyle.xsl 4.) Open the ExportSampleBasicMetaData.xml file and underneath the first line containing the XML start element enter the following:
<?xml-stylesheet type="text/xsl" href="MetaDataStyle.xsl"?>

5.) Save the file. 6.) Open the ExportSampleBasicMetaData.xml file in your favorite web browser.

Last Saved: 3/11/2011 9:52 AM

http://www.artofbi.com

Oracle Essbase 11.1.2 Metadata to XML http://www.artofbi.com

CONCLUSION
In the past extrapolating Essbase database outline metadata was an inefficient or costly process often involving third-party components, manual effort, or expert programming skills. With the Oracle Essbase 11.1.2 release, Essbase developers can now generate metadata for clients and end-users by programmatically executing MaxL script containing only a few lines of code. In addition, the 11.1.2 release incorporates the ability for the Java API to execute MaxL which enables an even bolder integration throughout the Essbase Servers architecture.

Last Saved: 3/11/2011 9:52 AM

http://www.artofbi.com

Вам также может понравиться