ASO Essbase cubes have an amazing architecture overall. Unfortunately, like every beautiful thing, there are some flaws up close. Today, I am going to be talking about the issue of outline fragmentation and what to do about it.
The issue will arise when an ASO cube has been set up to automatically rebuilt it's dimensionality from an external source using a load rule. Whether this be one or all dimensions in the outline, it does not matter. This fragmentation also exists with ASO cubes built with EPMA Shared Libraries, but it is less of an issue as the fragmentation is less severe. Just keep in mind the higher the frequency of dimensionality rebuilds, the higher fragmentation rate. Eventually, without proper treatment, your ASO outline will expand in size and eventually you will not be able to open it in EAS.
Luckily, Oracle offers a free utility that will allow us to compact ASO outlines and return them to their normal size. This utility is called ESSCMDQ.cmd. No, that is not a typo, it is a utility similar to ESSCMD containing ASO outline compaction functions. This utility is most likely not installed on your system and you will need to install it on the server you are running your batch scripts from. You can download the utility from Oracle at the link below.
Please make sure that prior to installation, you read and understand the documentation accompanied with it.
http://www.oracle.com/technetwork/middleware/bi-foundation/esscmdq-sampleapps-093105.html
Installing ESSCMDQ
- Download the documentation PDF file from the Oracle link
- Download the ZIP file that corresponds to your operating system and version of Oracle Essbase.
- Unzip the ZIP file into a TEMP directory.
- Copy the ESSCMDG and ESSCMDQ files to your [arborpath]\bin directory.
- Typically: C:\Hyperion\products\Essbase\EssbaseClient\bin
Scott's Compaction Script
I created the windows batch script below that shows how to compact your ASO outlines. This file as it sits is dynamic enough for you to call it from your batch scripts.Please note: Do not run this utility on every dimension build. (read why in the "ESSCMDQ Compaction Issues" section at the end of this post)
Batch Script Process Flow:
- Creates MaxL script on the fly (since you cannot pass variables to the MaxL using the ESSCMDQ utility)
- Launches the utility using the temporarily created MaxL
- Outputs the utility results to a log file
- Deletes the temporary MaxL script (Important because the MaxL will contain the password of the account used to compact the OTL)
Below is the code for the batch script. Please be aware that there are 2 environment variables that must be set for this script to function properly. I also recommend that you call the batch script CompactOTL.bat.
ECHO off REM ###################### IMPORTANT NOTE ############################################ REM ## Before this batch can be run, the ESSCMDQ.exe REM ## application must be downloded and copied to the REM ## ESSCMDQpath below. REM ## REM ## You can get this utility and it's associated documentation from the URL below REM ## http://www.oracle.com/technetwork/middleware/bi-foundation/esscmdq-sampleapps-093105.html REM ################################################################################## REM **********************Version***************************************************** REM Version: 1.1 REM Created By Scott Danesi REM ********************************************************************************** REM **********************PASSED PARAMETERS******************************************* REM %1 = ServerName REM %2 = AppName REM %3 = DBName REM %4 = UserName REM %5 = Passord REM ********************************************************************************** REM *************Environment Variable Declarations (Change These)********************* SET ESSCMDQpath=C:\Hyperion\products\Essbase\EssbaseClient\bin SET LocalPath=C:\Scripts\CompactOTL REM ********************************************************************************** REM *************System Variable Declarations (DO NOT CHANGE)************************* SET ServerName=%1 SET AppName=%2 SET DBName=%3 SET UserName=%4 SET Password=%5 set TimeStamp=%Date:~-4,4%%Date:~-10,2%%Date:~-7,2%_%Time:~0,2%%Time:~3,2% SET LogFilePath=%LocalPath%\CompactOutline_%TimeStamp%_%AppName%-%DBName%.log SET MaxLpath=%LocalPath%\CompactOutline.mxl REM ********************************************************************************** ECHO on del %MaxLpath% REM ****************Create MXL File from variables************************************ ECHO Login "%ServerName%" "%UserName%" "%Password%" ; >> %MaxLpath% ECHO Select "%AppName%" "%DBName%" ; >> %MaxLpath% ECHO Openotl "2" "1" "%AppName%" "%DBName%" "%DBName%" "y" "y" "1"; >> %MaxLpath% ECHO Writeotl "1" "2" "1" "%AppName%" "%DBName%" "%DBName%" ; >> %MaxLpath% ECHO Restructotl "1"; >> %MaxLpath% ECHO Closeotl "1"; >> %MaxLpath% ECHO Unlockobj "1" "%AppName%" "%DBName%" "%DBName%" ; >> %MaxLpath% ECHO Logout; >> %MaxLpath% REM ********************************************************************************** REM ************Call ESSCMDQ for Restructure****************************************** call %ESSCMDQpath%\esscmdq.exe %MaxLpath% > "%LogFilePath%" REM ********************************************************************************** del %MaxLpath%
Usage:
You can call the batch script from another batch script with the following syntax:CompactOTL.bat EssbaseServerName AppName DBName UserName Password
ESSCMDQ Compaction Issues (Please Read Before Running)
Beautiful right? Right, but again not without some minor flaws. I have been using this script for many years without any issues until recently. I have an environment that is running v11.1.1.3 and doing ASO dimension builds twice a day. Out ASO outlines were starting to get out of hand in size. I decided to put the compaction code in the twice daily batch scripts to compact after every rebuild. This worked great for a little while, but eventually it corrupted one of the outlines so bad that it could not be recovered except from a backup. This corruption was a result of the dimension build not making any changes to the outline. Apparently compacting an outline that is 100% unfragmented will cause it to corrupt I am still in the process of researching exactly why this is happening. Please do not run this utility on every dimension build. I will post back my findings as I get them.