Install OLAP

Hi,
I have installed oracle 10g and applied 10.2.0.3 patch set and interim patch also. During first install I didn't install OLAP and I didn't choose OLAP while installing patch set. I am getting below ORA- error in alert log.
Errors in file /opt/app/oracle/admin/EPDEV/udump/epdev_ora_16453.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-12663: Services required by client not available on the server
ORA-36961: Oracle OLAP is not available.
ORA-06512: at "SYS.OLAPIHISTORYRETENTION", line 1
ORA-06512: at line 15
Now If I want to install OLAP only. Can some body guide me the steps please.
Thank you for your help in advance
-B

Installing OLAP means your database options must have the OLAP options enabled, OLAP is available among the Enterprise Edition Options, verify if this is installed.
SQL> R
  1  select * from v$option
  2* where parameter like '%OLAP%'
PARAMETER                                        VALUE
OLAP Window Functions                            TRUE
OLAP                                             TRUEand the database must have the OLAP catalog created and valid:
SQL> R
  1  select comp_name, version, status from dba_registry
  2* where comp_name like '%OLAP%'
COMP_NAME                        VERSION                        STATUS
OLAP Analytic Workspace          10.1.0.2.0                     VALID
Oracle OLAP API                  10.1.0.2.0                     VALID
OLAP Catalog                     10.1.0.2.0                     VALID
Scenario 1: OLAP option installed and upgraded, component name not installed:
Enter to your dbca and:
a. Select configure database options
b. Select your target database
c. Skip the EM configuration in case the checkbox is not greyed, we don't need it now.
d. At the database components, check the Oracle OLAP option.
e. After a while, this will have run the required scripts and your database will be OLAP enabled.
f. Verify with the above queries.
Scenario 2: OLAP options not installed.
1. Install the OLAP from your media, explicitly select the components and install them.
2. Afterwards apply the patchset to upgrade the newly installed components.
3. Proceed with scenario 1.
~ Madrid

Similar Messages

  • Cant able install olap sevices using oracle 9i enterprise edition

    help needed to install oracle olap worksheet , do any other requirements is needed to install oracle olap other than oracle 9i installation,unable to view oracle olap worksheet, what is the problem?

    help needed to install oracle olap worksheet , do any other requirements is needed to install oracle olap other than oracle 9i installation,unable to view oracle olap worksheet, what is the problem?

  • How to install OLAP component in ORACLE 9.2?

    Hello!
    I run Oracle database version 9.2. I have read that it is possible to use an OLAP engine/component/software with Oracle. I can't find it out in my Oracle menu. How can I install it? I read somewhere that this component only runs under UNIX, is this true? I want to use it to perform BusinessObjects reports using OLAP cubes.
    Thank you very much.
    Julen.

    For both Oracle OLAP 9.2 and 10g, you need to install the Enterprise Edition of Oracle Database with a Data Warehouse database configuration. Oracle Database then contains an enabled OLAP configuration.
    Yes, to run Oracle OLAP on 9.2, you must patch up to OLAP 9.2.0.4.1 (PS# 3084634 from MetaLink) at a minimum. Ideally you would install the latest 9.2.0.6.0 patch set (PS #3948480). For 10g, you must patch up to OLAP 10.1.0.3.0A (PS #3769360) at a minimum. Ideally you would install the latest OLAP 10.1.0.3.0C patch (PS #4074620).

  • How to install OLAP Intelligence and Test

    Hi,
    IN XIR2,  I want to work on OLAP Intelligence. I have uploaded the Key.
    Please advise me How to enable OLAP Intelligence and hwo to work.
    I have not found any OLAP Connection section in CMC.
    Developer sent a OLAP report, and uploaded to BO Environment. now it is showing connection filed..
    Please steps to fallow, enable the OLAP Intelligence in currently running BOXIR2 Env, and how to test whetehr OLAP is working or not.
    Thanks,
    Srinivas

    Hi,
    OLAP Intelligence does not manage its connections in the CMC. You can create an OLAP Intelligence connection by going to InfoView and clicking on the New menu. You should see two OLAP Intelligence related items. One called 'OLAP Intelligence Report' and another called 'OLAP Intelligence Connection'.
    In order to use OLAP Intelligence through InfoView you need to have your third party OLAP connectivity components installed in the same maching as the web application server that is hosting InfoView. To test which connectivity you have installed and set up correctly you can click on the 'OLAP Intelligence Connection' option under the New button described above. One the new connection page you should see a drop down list of available OLAP providers. You will always see connectivity options for Hyperion Essbase and IBM DB2 OLAP regardless of whether you have set this connectivity up. If you don't see a connection for Microsoft Analysis Services you will need to install the Analysis Services client connectivity on your web application server machine. If you don't see SAP BW connectivity you need to install something like the SAP GUI that will place librfc32.dll on the path and you will have to install the Business Objects SAP Integration kit.
    If you see your connectivity available, you can test whether you can reach the OLAP server by creating a connection. Use the same OLAP server pointed to by the report that you uploaded.
    If you are able to creat and test succesfully a connection, can you post what error message you were seeing when you tried to access the published file?
    Reuben

  • Can I use OLAP kind of functionality  without installing OLAP ( using materialized views etc)

    Hi,
    Can OLAP cube be implemented without having ORACLE OLAP installed? As per my understanding, cubes are something which keeps aggregate data. So can I just use materialized view functionality ( which is already there in Oracle)?
    Which other Oracle object can I use without  installing ORACLE OLAP ( Dimension etc?)
    Thanks a lot.
    Nitin

    If you mean by implementing an OLAP cube, you mean setting up reports for various summary level data analysis, it is possible to query materialized views to get the same data in some cases.   A position paper that describes the advantages of the OLAP Cube v. among other things standard materialized views may be found at this URL: http://www.oracle.com/technetwork/database/options/olap/olap-wp-12c-1896136.pdf?ssSourceSiteId=ocomen
    I also would recommend posting this question on the general database forum (General Database Discussions) as well.
    Hope this helps,
    Ken Chin

  • Error installing RAPID INSTALL R12 on Linux

    I did a Rapid Install of Oracle Applications R12 (which contains 10g database) from the root user. After the installation, the system validates the configuration and it shows some problem with database availability. I have attached the log for database availability (bottom of this email), which shows the error "RW-50011: Error: - Apps ORACLE_HOME connection test has returned an error: 2"
    Log for Database Availability :-
    Database Availability
    command: su oracle -c "/home/apps_rapid_install/startCD/Disk1/rapidwiz/bin/riwTDBup.sh /d01/oracle/VIS/db/tech_st/10.2.0/VIS_localhost.env APPS/APPS"
    riwTDBup.sh started at Wed Sep 26 10:50:45 PDT 2007
    Parameters passed are : /d01/oracle/VIS/db/tech_st/10.2.0/VIS_localhost.env APPS/APPS
    The environment settings are as follows ...
    ORACLE_HOME : /d01/oracle/VIS/db/tech_st/10.2.0
    ORACLE_SID : VIS
    TWO_TASK :
    PATH : /d01/oracle/VIS/db/tech_st/10.2.0/perl/bin:/d01/oracle/VIS/db/tech_st/10.2.0/bin:/usr/bin:/usr/sbin:/d01/oracle/VIS/db/tech_st/10.2.0/appsutil/jre/bin:/usr/ccs/bin:/bin:/usr/bin/X11:/usr/local/bin:/usr/bin:/home/apps_rapid_install/startCD/Disk1/rapidwiz/unzip/Linux:/usr/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/java/jre1.5.0_06/bin:/root/bin:/sbin:/usr/sbin:/usr/java/jre1.5.0_06/bin
    LD_LIBRARY_PATH : /d01/oracle/VIS/db/tech_st/10.2.0/lib:/usr/X11R6/lib:/usr/openwin/lib:/d01/oracle/VIS/db/tech_st/10.2.0/lib:/usr/dt/lib:/d01/oracle/VIS/db/tech_st/10.2.0/ctx/lib
    Executable : /d01/oracle/VIS/db/tech_st/10.2.0/bin/sqlplus
    riwTDBup.sh exiting with status 0
    Database ORACLE_HOME connection test has succeeded
    command: su applmgr -c "/home/apps_rapid_install/startCD/Disk1/rapidwiz/bin/riwTDBup.sh /d01/oracle/VIS/inst/apps/VIS_localhost/ora/10.1.2/VIS_localhost.env APPS/APPS"
    riwTDBup.sh started at Wed Sep 26 10:50:47 PDT 2007
    Parameters passed are : /d01/oracle/VIS/inst/apps/VIS_localhost/ora/10.1.2/VIS_localhost.env APPS/APPS
    The environment settings are as follows ...
    ORACLE_HOME : /d01/oracle/VIS/apps/tech_st/10.1.2
    ORACLE_SID :
    TWO_TASK : VIS
    PATH : /d01/oracle/VIS/apps/tech_st/10.1.2/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/usr/bin:/home/apps_rapid_install/startCD/Disk1/rapidwiz/unzip/Linux:/usr/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/java/jre1.5.0_06/bin:/root/bin:/sbin:/usr/sbin:/usr/java/jre1.5.0_06/bin
    LD_LIBRARY_PATH : /d01/oracle/VIS/apps/tech_st/10.1.2/lib32:/d01/oracle/VIS/apps/tech_st/10.1.2/lib:/usr/X11R6/lib:/usr/openwin/lib:/d01/oracle/VIS/apps/tech_st/10.1.2/jdk/jre/lib/i386:/d01/oracle/VIS/apps/tech_st/10.1.2/jdk/jre/lib/i386/server:/d01/oracle/VIS/apps/tech_st/10.1.2/jdk/jre/lib/i386/native_threads
    Executable : /d01/oracle/VIS/apps/tech_st/10.1.2/bin/sqlplus
    riwTDBup.sh exiting with status 2
    RW-50011: Error: - Apps ORACLE_HOME connection test has returned an error: 2
    As the database is not available, the login page does not come up. It gives this error.
    Login Page
    checking URL = http://localhost.localdomain:8016/OA_HTML/AppsLogin
    RW-50016: Error: - {0} was not created:
    File = {1}
    Even the Configuration Upload gives this error :-
    Configuration Upload
    uploading config file at /d01/oracle/VIS/db/tech_st/10.2.0/appsutil/conf_VIS.txt
    Failed upload of config file at /d01/oracle/VIS/db/tech_st/10.2.0/appsutil/conf_VIS.txt
    Can you please advice on where I could be going wrong. There was no error during the installation. It seems that some setups may be missing in the Linux Box.

    Hi Tom,
    This excerpts the pre-upgrade patches MW recommends:
    Patch 4685497...11i UPGRADE TO R12: OPTIONAL
    PRE-UPGRADE PROGRAMS IN 11i Product: General Ledger
    Patch 4676589...11i.ATG_PF.H.RUP4 Product:
    Applications Technology Family
    Patch 3438354...Patch 11i.ATG_PF.H Product:
    Applications Technology Family
    Patch 5120936...TUMS for R12: TO DELIVER TUMS UTILITY
    FOR UPGRADES FROM 11i TO R12
    Patch 4712852...Minipack 11i.AD.I.4 Product:
    Applications DBA
    Patch 4963569...CN UPGRADE - PRE-UPGRADE PATCH FOR
    RELEASE 12.0 Product: Incentive Compensation
    Patch 5382135...CSD R12 PRE-UPGRADE DATA VERIFICATION
    PATCH UPDATE Product: Depot Repair
    Patch 5259121...R12.FIN.A.UI.XB.3: ASM PRE/POST
    DIAGNOSIS PROGRAM OUTPUT EDITS Product: General
    Ledger
    Patch 3649470...11i.10 Pre-Upgrade patch to find
    carrier ship method inconsistencies Product: Shipping
    Execution Common
    Patch 3464936...AD.I NT PREREQ Product: Applications
    DBA
    Patch 5233248...SLA PRE-UPGRADE PROGRAM MODIFICATIONS
    FOR 11i Product: Subledger Accounting.These are either optional pre-upgrade patches where you can control how much 11i data you migrate, or were included in the list of R12 upgrade patches provided.
    And this excerpts the patches listed in 403339.1 Path C:
    For all platforms:
    * 4733582 - APPSPERF: AQ: UPGRADE SCRIPT
    (A1001000.SQL) DELETES STATISTICS ON AQ TABLES. -
    Product: RDBMS Server
    * 4906594 - APPSST10201:ORA-39706 WHILE UPGRADE
    FROM 8174 TO 10201 - Product: Oracle Intermedia
    * 5567658 - ORACLE CONFIGURATION MANAGER UPDATE -
    Product: Oracle Configuration Manager Family
    * 5601428 - MLR BACKPORT FOR 5126270, 5238255 ON
    TOP OF VERSION 10.2.0.2 - Product: RDBMS Server
    * 4247037 - RFID-EPC GENERATION FEATURE FROM
    DATABASE SERVER. TO BE USED WITH APPS WMS R12 -
    Product: Spatial
    * 4868804 - REGRESSION WHEN PATCH 4628170 IS
    APPLIED TO 10.1.0.4 AND 10.2.0.1. ENV - Product:
    RDBMS Server
    * 4898580 - APPSST10G: UNABLE TO EXTRACT COMMENT
    COLUMN DEFINITION ON A MVIEW - Product: RDBMS
    Server
    * 5005469 - NEED SCRIPT TO ASSIST WITH MIGRATION
    FROM KOREAN_LEXER TO KOREAN_MORPH_LEXER - Product:
    Oracle Text
    * 5153209 - R12: AS10G: REHOST JRE 1.5.0_06 FOR
    RDBMS ORACLE HOME 10.2.0.2 - Product: Techstack
    * 5477912 - APPST:MEMORY LEAK ISSUE FOR R12 -
    Product: RDBMS Server
    * 5865568 UPDATE TO JVM TIME ZONE CLASSES NEEDED -
    Product: Java/VM
    or Linux and Unix only:
    * 4380928 - APPSST102 : ALTER MATERIALIZED VIEW
    LOG FAILS WITH ORA-03113 ERROR - Product: RDBMS
    Server
    * 4518443 - LISTENER GETS HUNG UP - Product:
    Oracle Database Family
    * 4592596 - APPSST102: ORA-01410 INVALID ROWID
    WHEN SELECTING FROM A TABLE - Product: RDBMS Server
    * 4639977 - APPSST102: ORA-00600: [KKQCBY: QBCFKKC
    NOT ZERO], - Product: RDBMS Server
    * 4643322 - APPSST: GETTING ERROR "ORA-22167"
    WHILE DOING BULK UPDATE OPERATION - Product: RDBMS
    Server
    * 4686006 - QUERY ON VIEW WITH EXISTS AND HAVING
    CLAUSE RAISES ORA-600 [KKQSALJG:NOBJS IS 0] -
    Product: RDBMS Server
    * 4689959 - DST RULE CHANGE IN US, NEED PATCHED
    TIMEZONE FILES - Product: CORE
    * 4744317 - SCMATGR12:D5 APPSST-XSLT TRANS FAILS
    WHEN TAG CONTAINS '_' AT BEGINNING IN 10GR2 -
    Product: XML Developers Kit
    * 4751145 - ARRAYINDEXOUTOFBOUNDSEXCEPTION ON
    QUERY EXECUTION WITH 10G JDBC - Product: JDBC
    * 4932527 - CLIENT SIDE PLSQL CRASHES PASSING
    RECORD PARAMETER TO STORED FUNCTION - Product: RDBMS
    Server
    * 4949257 - UNNESTED SUBQUERY RETURNS WRONG RESULT
    - Product: RDBMS Server * 4966417
    * 4967236 - APPSST10201:ORA 600[17282], WHILE
    PERFORMING DATA IMPORT. R12 PROJECT - Product: XML
    Developers Kit
    * 5128946 - APPSPERF: RDBMS: MEMORY LEAK DUE TO
    DDL REPARSE - Product: RDBMS Server
    * 5150177 - APPSST: CREATE INTERMEDIA (TEXT)
    INDEX ON 10G TAKES A LONG TIME - Product: Oracle
    Text
    * 5206570 - DUMP IN KSUSRS() WHEN SESSION FROM SQL
    DEVELOPER IS SNIPED - Product: RDBMS Server
    * 5254539 - INTERNAL ERROR CODE ON EXECUTING
    HIERARCHICAL QUERY - Product: RDBMS Server
    * 5434572 - MERGE LABEL REQUEST ON TOP OF 10.2.0.2
    FOR BUGS 5106909 4151363 - Product: RDBMS Server
    * 5455623 - MERGE LABEL REQUEST ON TOP OF 10.2.0.2
    FOR BUGS 5392772 4759183 - Product: RDBMS Server
    * 5460159 - MERGE LABEL REQUEST ON TOP OF 10.2.0.2
    FOR BUGS 4417341 5092134 - Product: RDBMS Server
    * 5548758 - MERGE LABEL REQUEST ON TOP OF 10.2.0.2
    FOR BUGS 5253806 5125886 5117856 - Product: RDBMS
    Server
    * 5718367 - MERGE LABEL REQUEST ON TOP OF 10.2.0.2
    FOR BUGS 5647056 5691091 5199213 - Product: RDBMS
    Server
    * 4450497 - UPGRADE 9.0.1.4.0 TO 10.1.0.4 RESULTS
    IN SDO_INDEX_METADATA NULL FETCH - Product: Spatial
    * 5066528 -
    DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_EXCEP
    IONS) ROWS - Product: PLSQL
    * 5612127 - (Except HP-UX Itanium) THE OLAP C-
    MINUS PATCH - Product: Oracle OLAPThese patches are required if you upgrade you 11.5.9 or higher 9i database to 10.2.0.2 in preparation for an R12 upgrade. You can do this and run 11i on 10.2.0.2 for some time before the R12 upgrade in order to split up your downtimes. When you install the R12 Upgrade Filesystem, the 10.2.0.2 Oracle Home includes all of these database patches already. After the database upgrade, you just need to run the manual steps from these patch readmes, which can be condensed down to the following:
    cd $ORACLE_HOME/rdbms/admin
    sqlplus “/as sysdba”
    spool post_install.log
    @?/rdbms/admin/catdph
    @?/rdbms/admin/catdpb
    @?/md/admin/catmgdidcode
    @?/rdbms/admin/dbmsxmld.sql
    @?/rdbms/admin/prvtxmld.plb
    @?/rdbms/admin/dbmspbt.sql
    @?/rdbms/admin/prvtpbt.plb
    @?/rdbms/admin/tracetab.sql
    @?/rdbms/admin/prvtaw.plb
    @?/olap/admin/apsrelod.sql
    @?/olap/admin/xoqrelod.sql
    @?/olap/admin/amdpatch.sql
    @?/rdbms/admin/utlrp.sql
    cd $ORACLE_HOME/md/admin
    alter session set current_schema=MDSYS;
    @?/md/admin/prvtimd.plb
    spool off
    exit
    cd ORACLE_HOME/javavm/lib/zi/
    @fix5075470a.sql
    shutdown immediate
    startup
    @fix5075470b.sql
    Install OLAP and ODM for R12 Analytical Workspaces:
    Install Oracle Data Mining and OLAP (conditional)
    Verify that Oracle Data Mining and OLAP are installed in your database by using SQL*Plus to connect to the database as SYSDBA and running the following command:
    SQL> select comp_id from dba_registry where comp_id='ODM' or comp_id='AMD';
    If the query does not return ODM, then you do not have Oracle Data Mining installed. To install Data Mining, use SQL*Plus to connect to the database as SYSDBA and run the following command:
    SQL> @$ORACLE_HOME/rdbms/admin/dminst.sql SYSAUX TEMP
    If the query does not return AMD, then you do not have OLAP installed. To install OLAP, use SQL*Plus to connect to the database as SYSDBA and run the following command:
    SQL> @$ORACLE_HOME/olap/admin/olap.sql SYSAUX TEMP

  • Olap script is missing after installation

    Hello all,
    We have Oracle 9.2.0.6 Enterprise Edition running on our Solaris8 server. Through our developers' request, I have installed 9.2.0.1 OLAP option on the database by choosing the Custom installation option and "Oracle OLAP" checkbox. After the installation, I patched it to 9.2.0.6 . However, I cannot find the "olap" script in its place, which is supposed to reside in /etc/init.d . Therefore cannot start the environment and so on.
    I have also read the Metalink note 208335.1 but don't think I have done anything much different than it.
    What might be wrong with the installation, has anyone ever experienced anything similar?
    Kind Regards

    nothing about /etc/init.d
    I copied this from Note:177205.1 for you:
    ==========================================================
    MANUAL INSTALLATION OF OLAP SERVICES DATABASE OBJECTS
    Alternatively, you may install OLAP Services database objects manually by
    running scripts, as follows:
    First of all, you must already have installed Oracle JVM
    objects. For instructions on how to do this manually, please see:
    Note 149393.1 What scripts are needed to manually install Oracle9i JVM (9.0.1)
    After performing the above, you will need to run the olap.sql script
    while connected as SYSDBA, from SQL*plus :
    1) First go to the olap/admin directory under the Oracle Home
    cd $ORACLE_HOME/olap/admin
    2) Run SQL*Plus and connect as sysdba:
    sqlplus /nolog
    SQLPLUS> connect / as sysdba
    3) Run the oneinstl.sql and olap.sql scripts:
    a) Refer to Note 208335.1 for running oneinstl.sql. Although it is written
    for 9.2.0.1, the same applies for 9.0.1.
    b) Use the following for running olap.sql.
    You will need to provide the SID as a parameter to the script.
    SQLPLUS> spool olap.log
    SQLPLUS> @olap CWMLITE TEMP
    SQLPLUS> spool off
    SQLPLUS> exit
    Review the olap.log spool file, there should be no errors.
    4) You must verify that the OLAP Services folder /etc/OLAPServer has
    been successfully created in the Oracle JVM. You may have to create
    it manually on Windows NT.
    Note 157822.1 contains instructions for this.

  • Can't start OLAPServer service after installing patches #9.0.1.3

    I had a running OLAPServer service before I installed the 9i latest patches (#9.0.1.3) yesterday.
    I have tried to use either Windows Service Manager or OLAP Services Instances Manager to start that service.
    When I tried to use OLAP OSIM, I got error message like this :
    XPINSMGR - 10565 Cannot access olap service from this database. Cause : an attempt was made to access OLAP services on a database on which it is not installed (?). Action: Install OLAP Service in the database...
    I have tried to create a new database and set all the OLAP configuration, but it is still not working..
    Is there someone can help me to figure out what happened ?
    thanks, Sjarif

    Thank's for your suggestion. But my problem occured after I installed the 9.0.1.3.1 patch on my 9i database server (in run on XP Pro machine). I have checked OLAPDBA,OLAPSYS,and OLAPSVR security status, they are NOT LOCKED and NOT EXPIRED.
    I have checked the content of OLAPServicesAgent.log file and I find ORA-03113 error.
    This is the content of OLAPServicesAgent.log file:
    [08-Apr-2002, 12:47:28PM] Finished waiting for init thread to finish; wait result: 0
    [08-Apr-2002, 12:47:28PM] Waiting for serviceDoneEvent to be triggered.
    [08-Apr-2002, 12:47:28PM] Filtering output using VERBOSE DEBUG (level 3 of 3) mode.
    [08-Apr-2002, 12:47:28PM]
    [08-Apr-2002, 12:47:28PM] Retrieving privilege information from registry and RDBMS.
    [08-Apr-2002, 12:47:28PM] New RDBMSInstance() allocated.
    [08-Apr-2002, 12:47:28PM] ztcsr failed with error code -1013
    [08-Apr-2002, 12:47:28PM]
    [08-Apr-2002, 12:47:37PM] GetRDBMSConnection(): setConnection() failed.
    [08-Apr-2002, 12:47:37PM] Was trying to connect to tns listener, OLAPDATA, with user id, olapsvr
    [08-Apr-2002, 12:47:37PM] Error message was: ORA-03113: end-of-file on communication channel
    [08-Apr-2002, 12:47:37PM]
    [08-Apr-2002, 12:47:37PM] Error code was: 4294967295, Function was: TxsRdbOCIConnection::connect
    [08-Apr-2002, 12:47:37PM] RDBMSInstance() destructor called.
    [08-Apr-2002, 12:47:37PM] New RDBMSInstance() allocated.
    [08-Apr-2002, 12:47:37PM] ztcsr failed with error code -1013
    [08-Apr-2002, 12:47:37PM]
    [08-Apr-2002, 12:47:37PM] GetRDBMSConnection(): setConnection() failed.
    [08-Apr-2002, 12:47:37PM] Was trying to connect to tns listener, OLAPDATA, with user id, olapsvr
    [08-Apr-2002, 12:47:37PM] Error message was: ORA-03113: end-of-file on communication channel
    [08-Apr-2002, 12:47:37PM]
    [08-Apr-2002, 12:47:37PM] Error code was: 4294967295, Function was: TxsRdbOCIConnection::connect
    [08-Apr-2002, 12:47:37PM] RDBMSInstance() destructor called.
    [08-Apr-2002, 12:47:37PM] New RDBMSInstance() allocated.
    [08-Apr-2002, 12:47:37PM] ztcsr failed with error code -1013
    [08-Apr-2002, 12:47:37PM]
    [08-Apr-2002, 12:47:38PM] GetRDBMSConnection(): setConnection() failed.
    [08-Apr-2002, 12:47:38PM] Was trying to connect to tns listener, OLAPDATA, with user id, olapsvr
    [08-Apr-2002, 12:47:38PM] Error message was: ORA-03113: end-of-file on communication channel
    [08-Apr-2002, 12:47:38PM]
    [08-Apr-2002, 12:47:38PM] Error code was: 4294967295, Function was: TxsRdbOCIConnection::connect
    [08-Apr-2002, 12:47:38PM] RDBMSInstance() destructor called.
    [08-Apr-2002, 12:47:38PM] New RDBMSInstance() allocated.
    [08-Apr-2002, 12:47:38PM] ztcsr failed with error code -1013
    [08-Apr-2002, 12:47:38PM]
    [08-Apr-2002, 12:47:38PM] GetRDBMSConnection(): setConnection() failed.
    [08-Apr-2002, 12:47:38PM] Was trying to connect to tns listener, OLAPDATA, with user id, olapsvr
    [08-Apr-2002, 12:47:38PM] Error message was: ORA-03113: end-of-file on communication channel
    [08-Apr-2002, 12:47:38PM]
    [08-Apr-2002, 12:47:38PM] Error code was: 4294967295, Function was: TxsRdbOCIConnection::connect
    [08-Apr-2002, 12:47:38PM] RDBMSInstance() destructor called.
    [08-Apr-2002, 12:47:38PM] Done retrieving privilege information.
    [08-Apr-2002, 12:47:38PM] Starting IOR listener on port: 7051
    [08-Apr-2002, 12:47:38PM] ServiceManager Constructor called.
    [08-Apr-2002, 12:47:38PM] ScmEnumServicesStatus()***ret = 234***m_hServiceManager = 1417944***bufsize = 10180***numServices = 0
    [08-Apr-2002, 12:47:38PM] ScmEnumServicesStatus()***ret = 0***m_hServiceManager = 1417944***bufsize = 0***numServices = 98
    [08-Apr-2002, 12:47:39PM] An access provider was found reading the Security/AuthenticationProviderPath registry key (C:\OraHome1\bin\xsapdbms.dll) for the service name, OLAPServer
    [08-Apr-2002, 12:47:39PM] New RDBMSInstance() allocated.
    [08-Apr-2002, 12:47:39PM] ztcsr failed with error code -1013
    [08-Apr-2002, 12:47:39PM]
    [08-Apr-2002, 12:47:39PM] GetRDBMSConnection(): setConnection() failed.
    [08-Apr-2002, 12:47:39PM] Was trying to connect to tns listener, OLAPDATA, with user id, olapsvr
    [08-Apr-2002, 12:47:39PM] Error message was: ORA-03113: end-of-file on communication channel
    [08-Apr-2002, 12:47:39PM]
    [08-Apr-2002, 12:47:39PM] Error code was: 4294967295, Function was: TxsRdbOCIConnection::connect
    [08-Apr-2002, 12:47:39PM] RDBMSInstance() destructor called.
    [08-Apr-2002, 12:47:39PM] ExecuteRDBMSCommand() failed, command = select * from ALL_OLAP_os_child_instances
    [08-Apr-2002, 12:47:39PM] Unable to add Olap child instance, OLAPServer, to the Oracle ALL_OLAP_os_child_instances table.
    [08-Apr-2002, 12:47:39PM] Check to see if the usernames and passwords within olap.key associated with
    [08-Apr-2002, 12:47:39PM] this instance are correct. If not, use the /CreateKeyval option of xsdaemon to reset the values, or use
    [08-Apr-2002, 12:47:39PM] the script provided for that purpose.
    [08-Apr-2002, 12:47:39PM] xsdaemon process is terminating abnormally.
    It seems to me there is a problem in OCI connection ...
    Thanks.
    Sjarif

  • Web Agent in 10g OLAP??

    Hi all,
    I was wondering whether the Web Agent component for 10g OLAP is available. From what I can see on the Oracle sites, there is only an install for 9.2.0.4.
    Can some one please confirm, as I am interested in upgrading to the New version, to take a look at the newer features available with the AW, however I require Web Agent.
    Regards,
    Imran

    Hi Imran,
    If you want to run Oracle OLAP Web Agent with the Oracle 10g database, you should install OLAP Web Agent 9.2.1 base version - patch 3467263 on Metalink, and then install Web Agent 9.2.1 patch 1 - patch 3941853 on Metalink. Patch 1 is required for 10g compatability.
    I will try and ensure that it gets correctly listed for the 10g database.
    We will soon release 9.2.1 Patch 2 with updated Java certificates.
    Regards,
    Aneel Shenker
    Senior Product Manager
    Oracle Business Intelligence

  • Oracle OLAP installation problem

    Hello,
    I want to test Oracle OLAP and have come to a problem while installing cube script
    I am following this document http://www.oracle.com/technetwork/database/options/olap/global-11g-readme-082667.html
    It seems as if some steps were missing in the manual, but strangely I did not manage to find anyone online having the same problem, so it must be me overseeing something.
    SQL> @global_11g_create_cubes
    This procedure creates the cubes for the sample GLOBAL schema.
    You should be logged on as a DBA to execute this procedure.
    Specify file system directory containing this installation program.
    Example:
    c:\download\Global_Schema_11g or /home/oracle/Global_Schema_11g
    Directory: /home/oracle/olap
    Specify a password for the GLOBAL user.
    Enter password:
    Connected.
    Begin installation
    ... deleting GLOBAL AW (if it exists)
          dbms_cube.import_xml(xmlCLOB);
    ERROR at line 68:
    ORA-06550: line 68, column 7:
    PLS-00201: identifier 'DBMS_CUBE.IMPORT_XML' must be declared
    ORA-06550: line 68, column 7:
    PL/SQL: Statement ignored
    Any ideas?

    Hi Srini,
    MOS Doc helped me to install OLAP and DBMS_CUBE Library is not a problem any more. Now I have following error, again without similar error/solution to be found using Google
    SQL> @global_11g_create_cubes.sql;
    This procedure creates the cubes for the sample GLOBAL schema.
    You should be logged on as a DBA to execute this procedure.
    Specify file system directory containing this installation program.
    Example:
    c:\download\Global_Schema_11g or /home/oracle/Global_Schema_11g
    Directory: /home/oracle/olap
    Specify a password for the GLOBAL user.
    Enter password:
    Connected.
    Begin installation
    ... deleting GLOBAL AW (if it exists)
    ... creating GLOBAL AW
      begin
    ERROR at line 1:
    ORA-37162: OLAP error
    ORA-33292: Insufficient permissions to access analytic workspace GLOBAL.GLOBAL
    using the specified access mode.
    XOQ-01600: OLAP DML error while executing DML "SYS.AWXML!R11_INITIALIZE_AW"
    ORA-06512: at "SYS.DBMS_CUBE", line 433
    ORA-06512: at "SYS.DBMS_CUBE", line 465
    ORA-06512: at "SYS.DBMS_CUBE", line 523
    ORA-06512: at "SYS.DBMS_CUBE", line 486
    ORA-06512: at "SYS.DBMS_CUBE", line 501
    ORA-06512: at "SYS.DBMS_CUBE", line 512
    ORA-06512: at line 2
    Lookin into the code of global_11g_create_cubes.sq it is this command where error happens:
    dbms_cube.import_xml('GLOBAL_INSTALL', 'GLOBAL_MV.XML');

  • Oracle 9i _ OLAP

    Hi,
    does Oracle 9i support OLAP...if it does is it regular install?//?
    I want to install OLAP Global sample schema http://www.oracle.com/technology/products/bi/olap/Readme_Global_Sample_Schema.html
    appreciate your response

    Thanks for the response OrionNet .That installation looks bit complicated for me.....
    I came across http://download.oracle.com/docs/html/B10924_01/toc.htm
    Does Installing these 3 components get me OLAP in 9i ???
    Oracle9i Database Release 2 (9.2.0.1.0) for Windows
    Oracle Universal Installer release 2.2.0.18.0 for Windows
    Oracle9i Database Release 2 (9.2.0.3.0) Patch Set for Windows
    Appreciate your response.

  • D40-1015 Could not connect to Oracle OLAP

    Hello,
    I have installed new 10g R2 database on Sun Solaris 64 bit, When I access the discoverer I am getting this 'D40-1015 Could not connect to Oracle OLAP' error. I have installed OLAP and XDB everything.
    How do I recover from this error, any idea would be greatly appreciated.
    FYI,
    OracleBI Discoverer
         Diagnose Connection
    BI Beans Catalog Version....=N/A; not installed in uv
    Discoverer Catalog version....=N/A; not installed in uv
    Thanks,

    Hi,
    Did you install the Discoverer catalog and authorize users? (see the Configuration Guide)
    Regards

  • OLAP Component is invalid

    Hi,
    We have a environment where current version of database is 10.2.0.4 but OLAP component version shows 9.2.0.7 from dba_registry and it is invalid. What could be the possible solution in this case.
    removeand re-install the OLAP components will help?

    Was OLAP valid in 9.2.0.7?  Did you run catupgrd.sql or dbua to upgrade the database?
    If you open an SR with support, then we can look at your upgrade logs. 
    It is not necessary to re-install OLAP at this point, looking at the install logs should help us understand what caused the problem.

  • OLAP View Generator Sample

    Creating relational views over dimensions and cubes in an analytic workspace has never been easier. Check out the new sample plug-in for Analytic Workspace Manager 10.2.0.3 that makes creating views a snap.
    1) Right-click a dimension or cube object, then choose Create Relational View...
    2) Choose the columns you'd like to see in your view, then click Create View.
    Your OLAP data is now available to any relational tool. Download the OLAP View Generator from OTN and give it a try. It's fun for the whole family!
    http://www.oracle.com/technology/products/bi/olap/index.html

    I logged a TAR with Oracle and they gave me a pl/sql fix, which works for me now. It looked to be a bug of sorts.
    This is the whole install_olap_view_generator.sql but beware it drops and creates things.....
    prompt Installing OLAP View Generator sample - Version 1.0.2
    prompt
    prompt >> Turning off prompting for substitution variables (set scan off)
    set scan off
    prompt >> Removing the olap_views user. Ignore error if user does not exist.
    drop user olap_views cascade;
    prompt >> Creating OLAP_VIEWS tablespace...
    CREATE TABLESPACE OLAP_VIEWS
    DATAFILE 'OLAP_VIEWS.DBF' SIZE 20M AUTOEXTEND ON NEXT 5M;
    prompt >> Creating OLAP_VIEWS_TEMP temporary tablespace...
    CREATE TEMPORARY TABLESPACE OLAP_VIEWS_TEMP
    TEMPFILE 'OLAP_VIEWS_TEMP.DBF' SIZE 20M AUTOEXTEND ON NEXT 5M
    UNIFORM SIZE 256K;
    prompt >> Creating OLAP_VIEWS user...
    CREATE USER OLAP_VIEWS
    IDENTIFIED BY OLAP_VIEWS DEFAULT TABLESPACE OLAP_VIEWS
    TEMPORARY TABLESPACE OLAP_VIEWS_TEMP
    QUOTA UNLIMITED ON OLAP_VIEWS;
    grant olap_user to OLAP_VIEWS;
    grant create public synonym to olap_views;
    prompt >> Connecting as olap_views user
    connect olap_views/olap_views
    prompt >> Creating tables that store information about OLAP views and mappings
    CREATE TABLE OLAP_VIEWS.OLAP_MAPPINGS
    (     LAST_UPDATED DATE,
         AW_LAST_UPDATED DATE,
         AW_OWNER VARCHAR2(30 BYTE),
         AW_NAME VARCHAR2(30 BYTE),
         CUBE_NAME VARCHAR2(30 BYTE),
         CLAUSE VARCHAR2(30 BYTE),
         OBJECT_NAME VARCHAR2(30 BYTE),
         HIERARCHY VARCHAR2(30 BYTE),
         LEVEL_NAME VARCHAR2(30 BYTE),
         COLUMN_NAME VARCHAR2(30 BYTE),
         AW_OBJECT VARCHAR2(100 BYTE),
         DATA_TYPE VARCHAR2(30 BYTE),
         DIMENSION_DESC VARCHAR2(100 BYTE),
         POSITION NUMBER,
         COLUMN_LABEL VARCHAR2(100 BYTE),
    DESCRIPTION VARCHAR2(1000),
    INCLUDE NUMBER DEFAULT 1
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.LAST_UPDATED IS 'Timestamp when the view was created';
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.AW_LAST_UPDATED IS 'Timestamp of the AW when the view was created';
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.AW_OWNER IS 'Schema containing the analytic workspace';
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.AW_NAME IS 'Name of the analytic workspace';
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.CUBE_NAME IS 'Name of the cube for the given measure';
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.CLAUSE IS 'Clause in the limitmap (FAMILYREL, DIMENSION, etc.)';
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.OBJECT_NAME IS 'The name of the object (measure or dimension) being mapped';
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.HIERARCHY IS 'The hierarchy for the dimension. A dimension may have multiple hierarchies.';
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.LEVEL_NAME IS 'A level within a hierarchy.';
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.COLUMN_NAME IS 'Column name for an AW object';
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.AW_OBJECT IS 'The mapped AW object';
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.DATA_TYPE IS 'Relational data type for the column';
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.DIMENSION_DESC IS 'AW object representing the description for a dimension member';
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.POSITION IS 'Sort order for levels in a hierarchy (aggregate to detail)';
    COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.COLUMN_LABEL IS 'Label that can be displayed to users in client tools';
    CREATE TABLE OLAP_VIEWS.OLAP_VIEW_OBJECTS
    (     LAST_UPDATED DATE,
         AW_OWNER VARCHAR2(30),
         AW_NAME VARCHAR2(30),
         VIEW_NAME VARCHAR2(61),
         DIMENSION_NAME VARCHAR2(30),
         CUBE_NAME VARCHAR2(30)
    CREATE TABLE OLAP_VIEWS.OLAP_VIEW_LIMITMAP
    (     LAST_UPDATED DATE,
         AW_OWNER VARCHAR2(30),
         AW_NAME VARCHAR2(30),
         VIEW_NAME VARCHAR2(61),
         LIMITMAP CLOB
    CREATE TABLE OLAP_VIEWS.OLAP_VIEW_LOG
    ( msg_key number,
    MSG_ID TIMESTAMP (9),
         MESSAGE VARCHAR2(4000)
    create sequence OLAP_VIEWS.olap_log_seq
    start with 1
    increment by 1
    nomaxvalue;
    create trigger OLAP_VIEWS.olap_log_trigger
    before insert on OLAP_VIEWS.OLAP_VIEW_LOG
    for each row
    begin
    select OLAP_VIEWS.olap_log_seq.nextval into :new.msg_key from dual;
    end;
    CREATE or REPLACE VIEW olap_views.version as
    SELECT 'Version 1.0.2' version
    FROM dual;
    prompt >> Create synonyms for the tables
    CREATE OR REPLACE PUBLIC SYNONYM olap_mappings FOR olap_views.olap_mappings;
    CREATE OR REPLACE PUBLIC SYNONYM OLAP_VIEW_LIMITMAP FOR olap_views.OLAP_VIEW_LIMITMAP ;
    CREATE OR REPLACE PUBLIC SYNONYM OLAP_VIEW_OBJECTS FOR olap_views.OLAP_VIEW_OBJECTS;
    CREATE OR REPLACE PUBLIC SYNONYM OLAP_VIEW_LOG FOR olap_views.OLAP_VIEW_LOG;
    prompt >> Grant privileges on synonyms to PUBLIC
    grant all on olap_mappings to public;
    grant all on OLAP_VIEW_LIMITMAP to public;
    grant all on olap_view_objects to public;
    grant all on olap_view_log to public;
    grant select on olap_views.version to public;
    prompt >> Define PL/SQL Package OLAP_VIEWGENERATOR
    create or replace PACKAGE OLAP_ViewGenerator authid current_user AS
    -- Create a report of the views created over the cube
    PROCEDURE reportViewInfo (
    strOwner varchar2,
    strAWname varchar2
    -- Create views over all the dimensions and cubes in the AW
    PROCEDURE createAWViews (
    strOwner varchar2,
    strAWname varchar2);
    -- Generate a view over a cube
    PROCEDURE createCubeView (
    strOwner varchar2,
    strAWname varchar2,
    strCubename varchar2);
    -- Generate a view over a dimension
    -- RETURN: name of generated view
    PROCEDURE createDimensionView (
    strOwner varchar2,
    strAWname varchar2,
    strDimname varchar2);
    -- Get the limitmap text for a cube
    -- RETURN: limitmap text
    FUNCTION getCubeLimitmap (
    strOwner varchar2,
    strAWname varchar2,
    strCubename varchar2) return clob;
    -- Get the limitmap text for a dimension
    -- RETURN: limitmap text
    FUNCTION getDimensionLimitmap (strOwner varchar2,
    strAWname varchar2,
    strDimname varchar2) return clob;
    -- Updates the OLAP_MAPPINGS table with info describing a dimension, including the following:
    -- AW object, column mapped to object, type of object (e.g. dimension, hierarchy, familyrel, etc.),
    -- label for the object, etc
    -- RETURN: true if successful, false if fails
    FUNCTION generateDimensionMap (
    strOwner varchar2,
    strAWname varchar2,
    strDimname varchar2) RETURN number;
    -- Updates the OLAP_MAPPINGS table with the info describing a cube's measures:
    -- AW object, column mapped to object, label for the object, etc
    -- RETURN: true if successful, false if fails
    FUNCTION generateCubeMap (
    strOwner varchar2,
    strAWname varchar2,
    strCubename varchar2) return number;
    FUNCTION getDataType (
    strOwner varchar2,
    strAWname varchar2,
    strPhysObj varchar2) return varchar2;
    END OLAP_ViewGenerator;
    create or replace PACKAGE BODY OLAP_ViewGenerator AS
    cachedate date; -- Date for the current run of the generator
    bad_limitmap exception;
    ATTACHED_RW constant number := 2;
    ATTACHED_RO constant number := 1;
    NOT_ATTACHED constant number := 0;
    INCLUDE_LEVEL_ID constant number := 0; -- 0=FALSE, 1=TRUE
    type log_record_type is record (msg_key number, msg_id timestamp, message varchar2(4000));
    type log_table_type is table of log_record_type INDEX BY BINARY_INTEGER;
    log_table log_table_type;
    -- PRIVATE METHODS and PROCEDURES
    -- Update the OLAP_VIEW_LOG table with contents of PL/SQL table
    PROCEDURE updateLogTable as
    BEGIN
    delete olap_view_log;
    commit;
    FORALL i IN INDICES OF log_table
    INSERT INTO olap_view_log
    VALUES log_table (i);
    commit;
    -- Clear the log table
    log_table.delete;
    END updateLogTable;
    -- Shortcut for displaying output
    PROCEDURE show (message varchar2) as
    msg varchar2(4000);
    i number;
    log_record log_record_type;
    BEGIN
    msg := '>> ' || to_char(systimestamp, 'MON-DD-YYYY HH:MI:SS') || ' - ' || message;
    dbms_output.put_line(substr(msg, 1, 254));
    i := log_table.count + 1;
    log_record.msg_id := systimestamp;
    log_record.message := message;
    log_table(i) := log_record;
    END show;
    FUNCTION getDataType (
    strOwner varchar2,
    strAWname varchar2,
    strPhysObj varchar2) return varchar2 as
    dataType varchar2(10);
    objName varchar2(100);
    BEGIN
    objName := upper(strOwner || '.' || strAWname || '!' || strPhysObj);
    dataType := dbms_aw.interp('show obj(data ''' || objName || ''')');
    -- Return NUMBER for all the number types
    if dataType in ('INTEGER', 'LONGINTEGER', 'SHORTINTEGER', 'DECIMAL', 'SHORTDECIMAL')
    then dataType := 'NUMBER';
    else dataType := null;
    end if;
    return dataType;
    EXCEPTION
    when others then
    return null;
    END getDataType;
    -- Attaches the specified AW r/w first
    -- Returns the previous state of the AW:
    -- 2 : Attached r/w
    -- 1 : Attached r/o
    -- 0 : Not attached
    -- This state will be passed to detachAW in order to restore the AW to the previous state
    FUNCTION attachAW (
    strOwner varchar2,
    strAWName varchar2) return number as
    owner varchar2(30);
    awname varchar2(30);
    awlongname varchar2(100);
    cmd varchar2(400);
    isAttached number;
    BEGIN
    owner := upper(strOwner);
    awname := upper(strAWName);
    awlongname := upper(strOwner || '.' || strAWname);
    -- Check if the AW is attached:
    -- 2 : Attached r/w
    -- 1 : Attached r/o
    -- 0 : Not attached
    cmd := 'if aw(attached ''' || awlongname || ''') and aw(rw ''' || awlongname || ''') then ' || ATTACHED_RW ||
    ' else if aw(attached ''' || awlongname || ''') and aw(ro ''' || awlongname || ''') then ' ||
    ATTACHED_RO || ' else ' || NOT_ATTACHED;
    isAttached := dbms_aw.eval_number(cmd);
    -- Attach the AW r/w first
    if isAttached = NOT_ATTACHED then
    dbms_aw.aw_attach(owner, awname, true, false, 'FIRST');
    elsif isAttached = ATTACHED_RO then
    dbms_aw.aw_detach(owner, awname);
    dbms_aw.aw_attach(owner, awname, true, false, 'FIRST');
    else
    dbms_aw.aw_attach(owner, awname, true, false, 'FIRST');
    end if;
    return isAttached;
    exception
    when others then
    show ('**');
    show ('** ERROR: Unable to attach AW ' || owner || '.' || awname || ' read-write.');
    show ('** Ensure that you have priviliges to access the AW in this mode.');
    show ('**');
    raise;
    END attachAW;
    -- "Detaches" the specified AW. Note - this is really a restore the attach
    -- mode of the AW to its previous state. So, if the AW was previously attached R/W - then
    -- the AW will remain attached.
    -- This previous state was returned by the attachAW function
    PROCEDURE detachAW (
    strOwner varchar2,
    strAWName varchar2,
    awState number
    ) as
    owner varchar2(30);
    awname varchar2(30);
    BEGIN
    owner := upper(strOwner);
    awname := upper(strAWName);
    if awState = ATTACHED_RW
    then return;
    elsif awState = NOT_ATTACHED
    then dbms_aw.AW_DETACH(owner, awname);
    else
    dbms_aw.AW_DETACH(owner, awname);
    dbms_aw.aw_attach(owner, awname, false);
    end if;
    return;
    exception
    when others then
    -- shouldn't hit this condition
    show ('**');
    show ('** ERROR: Unable to restore attach state to AW ' || owner || '.' || awname || '.');
    show ('**');
    raise;
    END detachAW;
    FUNCTION getLastUpdateDate (
    strOwner varchar2,
    strAWName varchar2) return date as
    owner varchar2(30);
    awname varchar2(30);
    awlongname varchar2(100);
    last_updated varchar2(100);
    isAttached number;
    BEGIN
    awlongname := upper(strOwner || '.' || strAWname);
    owner := upper(strOwner);
    awname := upper(strAWName);
    isAttached := attachAW(owner, awname);
    last_updated := dbms_aw.interp('show to_char(aw(date, ''' || awlongname || '''), ''YYYY-MON-DD,HH:MI:SS AM'')');
    detachAW(owner, awname, isAttached);
    return to_date(last_updated, 'YYYY-MON-DD,HH:MI:SS AM');
    exception
    when others then
    show ('**');
    show ('** ERROR: Unable to retrieve last updated date for AW ' || awname || '.');
    show ('** Ensure that you have priviliges to access the AW.');
    show ('**');
    raise;
    return null;
    END getLastUpdateDate;
    FUNCTION getDepthVar (
    strOwner varchar2,
    strAWName varchar2,
    strDimname varchar2,
    strHierDim varchar2,
    strParentRel varchar2) return varchar2 as
    owner varchar2(30);
    awname varchar2(30);
    awlongname varchar2(100);
    isAttached number;
    varName varchar2(100);
    shortName varchar2(100);
    varExists number;
    cmd varchar2(1000);
    BEGIN
    awlongname := upper(strOwner || '.' || strAWname);
    awname := upper(strAWname);
    owner := upper(strOwner);
    shortName := strDimname || '_DEPTHVAR';
    varName := awlongname || '!' || shortName;
    isAttached := attachAW(owner, awname);
    -- Check if the depth variable exists
    cmd := 'convert(exists(''' || varName || '''), int)';
    varExists := dbms_aw.eval_number(cmd);
    -- Define variable if it does not exist
    -- DEFINE [dim]_DEPTHVAR VARIABLE INTEGER <[dim] [hierdim]>
    -- PROPERTY '$NATRIGGER' 'statlen(limit(limit(organization to organization + 0 ) to ancestors using organization_parentrel))+1'
    -- PROPERTY '$VARCACHE' 'VARIABLE'
    if varExists = 0 then
    show ('..... creating ' || shortname || ' object to support value hierarchies');
    cmd := 'define ' || varName || ' variable integer <' || strDimname || ' ' || strHierDim || '>';
    dbms_aw.execute(cmd);
    cmd := 'PROPERTY ''$NATRIGGER'' ''statlen(limit(limit(' ||
    strDimname || ' to ' || strDimname || ' + 0 ) to ancestors using ' || strParentRel || '))+1''';
    dbms_aw.execute(cmd);
    cmd := 'PROPERTY ''$VARCACHE'' ''VARIABLE''';
    dbms_aw.execute(cmd);
    show ('..... populating depth information in variable ' || shortName);
    cmd := 'limit ' || strDimname || ' to ' || varName || ' eq 1';
    dbms_aw.execute(cmd);
    dbms_aw.AW_UPDATE(strOwner, strAWName);
    end if;
    detachAW(owner, awname, isAttached);
    return shortName;
    exception
    when others then
    show ('**');
    show ('** ERROR: Unable to set up depth object for value based hierarchy in dimension ' || strDimname || '.');
    show ('**');
    show (sqlerrm);
    raise;
    return null;
    END getDepthVar;
    -- Return the generated column name for an AW object.
    FUNCTION getColumnName (
    parent varchar2,
    awObj varchar2,
    objType varchar2) return varchar2 as
    displayName varchar2(100);
    retval varchar2(100);
    i number;
    j number;
    BEGIN
    case
    when objType = 'MEMBER_PARENTREL' then
    retval := substr(parent, 1, 10) || '_' || substr(awObj, 1, 12) || '_PRNT';
    when objType = 'LEVEL_LONG_DESCRIPTION' then
    -- retval := substr(awObj, 1, 20) || '_LDSC';
    retval := substr(parent, 1, 10) || '_' || substr(awObj, 1, 10) || '_LDSC';
    when objType = 'MEMBER_LONG_DESCRIPTION' then
    retval := substr(parent, 1, 10) || '_LDSC';
    when objType = 'MEMBER_SHORT_DESCRIPTION' then
    retval := substr(parent, 1, 10) || '_SDSC';
    when objType = 'END_DATE' then
    retval := substr(parent, 1, 10) || '_END_DATE';
    when objType = 'TIME_SPAN' then
    retval := substr(parent, 1, 10) || '_TIME_SPAN';
    when objType = 'MEMBER_LEVELREL' then
    retval := substr(parent, 1, 10) || '_' || substr(awObj, 1, 10) || '_LVL';
    when objType = 'MEMBER_LEVELREL_DESC' then
    retval := substr(parent, 1, 10) || '_' || substr(awObj, 1, 10) || '_LVLDSC';
    when objType = 'LEVEL_ATTRIBUTE' then
    retval := substr(parent, 1, 10) || '_LEVEL';
    when objType = 'USER' then
    retval := substr(parent, 1, 10) || '_' || substr(awObj, 1, 19);
    else
    retval := awObj;
    end case;
    return retval;
    END getColumnName;
    -- Generate a limitmap for a dimension based on the information in the cache
    FUNCTION getDimensionLimitmap (
    strOwner varchar2,
    strAWname varchar2,
    strDimname varchar2) return clob as
    owner varchar2(30);
    awname varchar2(30);
    dimname varchar2(30);
    limitmap clob;
    ov_rec olap_mappings%ROWTYPE;
    type hier_table is table of olap_mappings.hierarchy%TYPE INDEX BY BINARY_INTEGER;
    hierlist hier_table;
    target varchar2(2500);
    aw_source varchar2(2500);
    label_var varchar2(100);
    run_date date;
    no_values boolean;
    yesno number;
    aw_date date;
    BEGIN
    owner := upper(strOwner);
    awname := upper(strAWname);
    dimname := upper(strDimname);
    no_values := false;
    show('... generating limitmap for ' || dimname);
    -- Update the olap_mappings table if nec.
    begin
    aw_date := getLastUpdateDate(owner, awname);
    SELECT aw_last_updated
    INTO run_date
    FROM olap_mappings
    WHERE aw_name = awname and
    aw_owner = owner and
    object_name = dimname and
    rownum = 1;
    exception
    when NO_DATA_FOUND then
    no_values := true;
    end;
    -- Check if the dimension mapping table needs to be updated.
    -- This occurs if this current run is newer than the AW timestamp (i.e. an update
    -- has occurred in the AW)
    if no_values or run_date < aw_date
    then
    show ('..... mapping table out of date for dimension ' || dimname || '. Updating mapping table.');
    yesno := generateDimensionMap(owner, awname, dimname);
    if yesno = 0
    then return null;
    end if;
    end if;
    -- DIMENSION clause
    -- e.g. DIMENSION category_id AS varchar2(100) FROM category WITH
    SELECT *
    INTO ov_rec
    FROM olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    object_name = dimname and
    CLAUSE = 'DIMENSION';
    limitmap := 'DIMENSION ' || ov_rec.column_name || -- ' AS ' || ov_rec.data_type ||
    ' FROM ' || dimname || ' WITH ';
    -- Process each dimension hierarchy.
    -- Begin by retrieving the list of hierarchies for the dimension
    SELECT hierarchy
    BULK COLLECT
    INTO hierlist
    FROM olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    object_name = dimname and
    CLAUSE = 'HIERARCHY' and
    include = 1;
    for i in 1 .. hierlist.count loop
    -- HIERARCHY clause
    -- e.g. HIERARCHY category_primary_parent AS varchar2(100) FROM category_parentrel(category_hierlist 'PRIMARY')
    SELECT *
    INTO ov_rec
    FROM olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    object_name = dimname and
    hierarchy = hierlist(i) and
    CLAUSE = 'HIERARCHY' and
    include = 1;
    limitmap := limitmap || '-' || chr(10) || ' HIERARCHY ' || ov_rec.column_name ||
    -- || ' AS ' || ov_rec.data_type ||
    ' FROM ' || ov_rec.aw_object;
    -- INHIERARCHY clause
    -- e.g. INHIERARCHY category_inhier
    SELECT *
    INTO ov_rec
    FROM olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    object_name = dimname and
    clause = 'INHIERARCHY' and
    include = 1;
    limitmap := limitmap || ' -' || chr(10) || ' INHIERARCHY ' || ov_rec.aw_object;
    -- HATTRIBUTE clause (hierarchical attributes)
    -- e.g HATTRIBUTE time_end_date FROM aw_time_end_date
    DECLARE CURSOR hattr_cur is
    SELECT *
    FROM olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    object_name = dimname and
    clause = 'HATTRIBUTE' and
    include = 1;
    BEGIN
    for ov_rec in hattr_cur loop
    limitmap := limitmap || ' -' || chr(10) || ' HATTRIBUTE ' || ov_rec.column_name ||
    ' FROM ' || ov_rec.aw_object;
    end loop;
    end;
    -- FAMILYREL clause
    -- e.g. FAMILYREL total_category_id AS varchar2(10),
    -- category_id AS varchar2(10),
    -- item_id AS varchar2(10)
    -- FROM category_familyrelval (category_levellist 'TOTAL_CATEGORY'),
    -- category_familyrelval (category_levellist 'CATEGORY'),
    -- category_familyrelval (category_levellist 'ITEM')
    -- show('..... FAMILYREL clause');
    DECLARE CURSOR familyrel_cur is
    SELECT *
    FROM olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    object_name = dimname and
    hierarchy = hierlist(i) and
    clause = 'FAMILYREL' and
    include = 1
    ORDER BY position;
    BEGIN
    target := null;
    aw_source := null;
    for ov_rec in familyrel_cur loop
    if target is null
    then
    target := ' -' || chr(10) || ' FAMILYREL ' || ov_rec.column_name; -- || ' AS ' || ov_rec.data_type;
    aw_source := ' -' || chr(10) || ' FROM ' || ov_rec.aw_object;
    else
    target := target || ', -' || chr(10) || ' ' || ov_rec.column_name; -- || ' AS ' || ov_rec.data_type;
    aw_source := aw_source || ', -' || chr(10) || ' ' || ov_rec.aw_object;
    end if;
    end loop;
    end;
    limitmap := limitmap || target || aw_source;
    -- FAMILYREL LABEL clause
    -- e.g. FAMILYREL total_category_id AS varchar2(10),
    -- category_id AS varchar2(10),
    -- item_id AS varchar2(10)
    -- FROM category_familyrelval (category_levellist 'TOTAL_CATEGORY'),
    -- category_familyrelval (category_levellist 'CATEGORY'),
    -- category_familyrelval (category_levellist 'ITEM')
    DECLARE CURSOR familyrel_cur is
    SELECT *
    FROM olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    object_name = dimname and
    hierarchy = hierlist(i) and
    clause = 'FAMILYREL_LONG_DESC' and
    include = 1
    ORDER BY position;
    BEGIN
    target := null;
    aw_source := null;
    for ov_rec in familyrel_cur loop
    if target is null
    then
    target := ' -' || chr(10) || ' FAMILYREL ' || ov_rec.column_name; -- || ' AS ' || ov_rec.data_type;
    aw_source := ' -' || chr(10) || ' FROM ' || ov_rec.aw_object;
    else
    target := target || ', -' || chr(10) || ' ' || ov_rec.column_name; -- || ' AS ' || ov_rec.data_type;
    aw_source := aw_source || ', -' || chr(10) || ' ' || ov_rec.aw_object;
    end if;
    label_var := ov_rec.dimension_desc;
    end loop;
    end;
    if aw_source is not null
    then aw_source := aw_source || ' -' || chr(10) || ' LABEL ' || label_var;
    end if;
    limitmap := limitmap || target || aw_source;
    end loop; -- Hierarchy loop
    -- ATTRIBUTE clause
    -- e.g ATTRIBUTE category_long_description AS varchar2(100) FROM category_long_description
    DECLARE CURSOR attr_cur is
    SELECT *
    FROM olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    object_name = dimname and
    clause = 'ATTRIBUTE' and
    include = 1;
    BEGIN
    for ov_rec in attr_cur loop
    limitmap := limitmap || ' -' || chr(10) || ' ATTRIBUTE ' || ov_rec.column_name ||
    -- ' AS ' || ov_rec.data_type ||
    ' FROM ' || ov_rec.aw_object;
    end loop;
    end;
    return limitmap;
    show ('.. completed genrating limitmap for dimension ' || dimname);
    END getDimensionLimitmap;
    -- Returns the limitmap for a cube
    FUNCTION getCubeLimitmap (
    strOwner varchar2,
    strAWname varchar2,
    strCubename varchar2) return clob as
    type dim_table is table of all_olap2_aw_cube_dim_uses.dimension_aw_name%TYPE INDEX BY BINARY_INTEGER;
    dimlist dim_table;
    limitmap clob;
    owner varchar2(30);
    awname varchar2(30);
    cubename varchar2(30);
    meas_rec olap_mappings%ROWTYPE;
    meas_clause varchar2(1000);
    run_date date;
    no_values boolean;
    yesno number;
    dimmap clob;
    aw_date date;
    BEGIN
    show('... generating limitmap for cube ' || cubename);
    owner := upper(strOwner);
    awname := upper(strAWname);
    cubename := upper(strCubename);
    -- Update the metadata cache if nec.
    begin
    -- Get the timestamp for when the AW was last updated
    aw_date := getLastUpdateDate(owner, awname);
    SELECT aw_last_updated
    INTO run_date
    FROM olap_mappings
    WHERE aw_name = awname and
    aw_owner = owner and
    cube_name = cubename and
    rownum = 1;
    exception
    when NO_DATA_FOUND then
    no_values := true;
    end;
    -- Check if the cube cache needs to be updated.
    -- This occurs if the AW has been updated since the view was created
    if no_values or run_date < aw_date
    then
    show ('..... mapping table out of date for cube ' || cubename || '. Updating mapping table.');
    yesno := generateCubeMap(owner, awname, cubename);
    if yesno = 0
    then return null;
    end if;
    end if;
    -- Get the limitmap for each of the cube's dimensions
    show('..... retrieving dimensions for the cube. Need limitmap for each dimension.');
    SELECT dimension_aw_name
    BULK COLLECT
    INTO dimlist
    FROM all_olap2_aw_cube_dim_uses
    WHERE aw_owner = owner and
    aw_name = awname and
    aw_logical_name = cubename;
    for i in 1 .. dimlist.count loop
    dimmap := getDimensionLimitmap(owner, awname, dimlist(i));
    if dimmap is null
    then return null;
    end if;
    if limitmap is null
    then limitmap := dimmap;
    else limitmap := limitmap || '-' || chr(10) || dimmap;
    end if;
    end loop;
    -- Get the limitmap for the measures in the cube
    -- e.g. MEASURE amount AS number FROM expense_amount
    -- show ('..... MEASURE clause');
    DECLARE CURSOR meas_cur is
    SELECT *
    FROM olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    cube_name = cubename and
    include = 1;
    BEGIN
    for meas_rec in meas_cur
    loop
    meas_clause := ' MEASURE ' || meas_rec.column_name;
    -- Add data type if necessary (for numeric columns)
    if meas_rec.data_type is not null then
    meas_clause := meas_clause || ' AS ' || meas_rec.data_type;
    end if;
    meas_clause := meas_clause || ' FROM ' || meas_rec.aw_object;
    limitmap := limitmap || '-' || chr(10) || meas_clause;
    end loop;
    END;
    -- Add the ROW2CELL calc. This enables arbitrary OLAP DML calcs dynamically thru sql
    limitmap := limitmap || '-' || chr(10) || ' ROW2CELL olap_calc';
    show ('... completed generating limitmap for cube ' || cubename);
    return limitmap;
    END getCubeLimitmap;
    -- Returns the SQL Model Clause or Comments for a Dimension or Cube View
    FUNCTION getSQLText (
    strOwner varchar2,
    strAWName varchar2,
    strObjType varchar2, -- CUBE or DIMENSION
    strObject varchar2, -- Name of cube or dimension
    strType varchar2, -- MODEL or COMMENT
    strViewName varchar2
    ) return varchar2 as
    clause varchar2(10000);
    comments varchar2(32000);
    type om_table_type is table of olap_mappings%ROWTYPE;
    dimlist om_table_type;
    measlist om_table_type;
    owner varchar2(30);
    awname varchar2(30);
    objtype varchar2(30);
    obj varchar2(30);
    comma varchar2(2);
    BEGIN
    owner := upper(strOwner);
    awname := upper(strAWname);
    objtype := upper(strObjType);
    obj := upper(strObject);
    -- Need to generate a model clause that looks like the following:
    /* MODEL
    DIMENSION BY(
    channel_id
    MEASURES(
    channel_primary_parent,
    channel_total_channel_id,
    channel_total_channel_desc,
    channel_channel_id,
    channel_channel_desc,
    channel_level,
    channel_long_description,
    channel_short_description
    RULES UPDATE SEQUENTIAL ORDER(); */
    clause := 'MODEL ' || chr(10) || ' DIMENSION BY (';
    -- Collect dimension list
    if objtype = 'DIMENSION' then
    -- Retrieve the dimension's column
    SELECT *
    INTO dimlist(1)
    FROM olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    object_name = obj and
    clause = 'DIMENSION';
    else
    -- Retrieve the columns for each of the dimensions for this cube
    SELECT *
    BULK COLLECT
    INTO dimlist
    FROM olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    clause = 'DIMENSION' and
    object_name in (
    SELECT dimension_aw_name
    FROM all_olap2_aw_cube_dim_uses
    WHERE aw_owner = owner and
    aw_name = awname and
    aw_logical_name = obj);
    end if;
    -- Populate the clause with the dimension id column
    -- Populate the comments if there are any... (e.g. COMMENT ON COLUMN OLAP_VIEWS.OLAP_MAPPINGS.LAST_UPDATED IS 'Timestamp when the view was created'; )
    comments := '';
    for i in 1 .. dimlist.count loop
    if dimlist(i).description is not null
    then comments := comments || chr(10) || 'COMMENT ON COLUMN ' || strViewName || '.' || dimlist(i).column_name
    || ' IS ''' || dimlist(i).description || ''';';
    end if;
    if i = 1 then
    clause := clause || chr(10) || ' ' || dimlist(i).column_name;
    else
    clause := clause || ',' || chr(10) || ' ' || dimlist(i).column_name;
    end if;
    end loop;
    -- Close DIMENSION BY clause and add MEASURES clause
    clause := clause || ')' || chr(10) || ' MEASURES (';
    -- Begin by adding all the dimension attributes
    -- This is required for both dimensions and cubes
    comma := null;
    for i in 1 .. dimlist.count loop
    SELECT *
    BULK COLLECT
    INTO measlist
    FROM olap_mappings
    WHERE clause in ('HIERARCHY', 'FAMILYREL', 'FAMILYREL_LONG_DESC', 'ATTRIBUTE', 'HATTRIBUTE' ) and
    aw_name = awname and
    aw_owner = owner and
    include = 1 and
    object_name in (SELECT object_name
    FROM olap_mappings
    WHERE column_name = dimlist(i).column_name);
    for j in 1 .. measlist.count loop
    clause := clause || comma || chr(10) || ' ' || measlist(j).column_name;
    comma := ',';
    end loop;
    end loop;
    -- If this is a cube, then get all the measures as well
    measlist.delete;
    if objtype = 'CUBE'
    then
    SELECT *
    BULK COLLECT
    INTO measlist
    FROM olap_mappings
    WHERE cube_name = obj and
    aw_name = awname and
    aw_owner = owner and
    include = 1;
    for i in 1 .. measlist.count loop
    clause := clause || ',' || chr(10) || ' ' || measlist(i).column_name;
    end loop;
    -- Add the olap_calc column
    clause := clause || ',' || chr(10) || ' ' || 'OLAP_CALC';
    end if;
    clause := clause || chr(10) || ' ) RULES UPDATE SEQUENTIAL ORDER()';
    if strType = 'MODEL'
    then return clause;
    else return comments;
    end if;
    return null;
    END getSQLText;
    -- Returns the SQL Model Clause for a Dimension or Cube View
    FUNCTION getModelClause (
    strOwner varchar2,
    strAWName varchar2,
    strObjType varchar2, -- CUBE or DIMENSION
    strObject varchar2 -- Name of cube or dimension
    ) return varchar2 as
    clause varchar2(10000);
    type col_table is table of olap_mappings.column_name%TYPE INDEX BY BINARY_INTEGER;
    dimlist col_table;
    measlist col_table;
    owner varchar2(30);
    awname varchar2(30);
    objtype varchar2(30);
    obj varchar2(30);
    comma varchar2(2);
    BEGIN
    owner := upper(strOwner);
    awname := upper(strAWname);
    objtype := upper(strObjType);
    obj := upper(strObject);
    -- Need to generate a model clause that looks like the following:
    /* MODEL
    DIMENSION BY(
    channel_id
    MEASURES(
    channel_primary_parent,
    channel_total_channel_id,
    channel_total_channel_desc,
    channel_channel_id,
    channel_channel_desc,
    channel_level,
    channel_long_description,
    channel_short_description
    RULES UPDATE SEQUENTIAL ORDER(); */
    clause := 'MODEL ' || chr(10) || ' DIMENSION BY (';
    -- Collect dimension list
    if objtype = 'DIMENSION' then
    -- Retrieve the dimension's column
    SELECT column_name
    INTO dimlist(1)
    FROM olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    object_name = obj and
    clause = 'DIMENSION';
    else
    -- Retrieve the columns for each of the dimensions for this cube
    SELECT column_name
    BULK COLLECT
    INTO dimlist
    FROM olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    clause = 'DIMENSION' and
    object_name in (
    SELECT dimension_aw_name
    FROM all_olap2_aw_cube_dim_uses
    WHERE aw_owner = owner and
    aw_name = awname and
    aw_logical_name = obj);
    end if;
    -- Populate the clause with the dimension id column
    for i in 1 .. dimlist.count loop
    if i = 1 then
    clause := clause || chr(10) || ' ' || dimlist(i);
    else
    clause := clause || ',' || chr(10) || ' ' || dimlist(i);
    end if;
    end loop;
    -- Close DIMENSION BY clause and add MEASURES clause
    clause := clause || ')' || chr(10) || ' MEASURES (';
    -- Begin by adding all the dimension attributes
    -- This is required for both dimensions and cubes
    comma := null;
    for i in 1 .. dimlist.count loop
    SELECT column_name
    BULK COLLECT
    INTO measlist
    FROM olap_mappings
    WHERE clause in ('HIERARCHY', 'FAMILYREL', 'FAMILYREL_LONG_DESC', 'ATTRIBUTE', 'HATTRIBUTE' ) and
    aw_name = awname and
    aw_owner = owner and
    include = 1 and
    object_name in (SELECT object_name
    FROM olap_mappings
    WHERE column_name = dimlist(i));
    for j in 1 .. measlist.count loop
    clause := clause || comma || chr(10) || ' ' || measlist(j);
    comma := ',';
    end loop;
    end loop;
    -- If this is a cube, then get all the measures as well
    measlist.delete;
    if objtype = 'CUBE'
    then
    SELECT column_name
    BULK COLLECT
    INTO measlist
    FROM olap_mappings
    WHERE cube_name = obj and
    aw_name = awname and
    aw_owner = owner and
    include = 1;
    for i in 1 .. measlist.count loop
    clause := clause || ',' || chr(10) || ' ' || measlist(i);
    end loop;
    -- Add the olap_calc column
    clause := clause || ',' || chr(10) || ' ' || 'OLAP_CALC';
    end if;
    clause := clause || chr(10) || ' ) RULES UPDATE SEQUENTIAL ORDER()';
    return clause;
    END getModelClause;
    -- PUBLIC FUNCTIONS and PROCEDURES
    -- Populates the olap_mappings table with the structure of the limitmap
    FUNCTION generateDimensionMap (
    strOwner varchar2,
    strAWname varchar2,
    strDimname varchar2) RETURN number as
    owner olap_views.OLAP_MAPPINGS.AW_OWNER%TYPE;
    awname olap_views.OLAP_MAPPINGS.AW_NAME%TYPE;
    dimname olap_views.OLAP_MAPPINGS.OBJECT_NAME%TYPE;
    qdr varchar2(100);
    success boolean;
    columnName olap_views.OLAP_MAPPINGS.COLUMN_NAME%TYPE;
    displayName varchar2(100); -- Name displayed to users in end user tools
    dimDisplayName varchar2(100); -- For a dimension, name displayed to users in end user tools
    parent_obj varchar2(100); -- AW object that contains parent-child relation
    hierlist_obj varchar2(100); -- AW object containing list of hierarchies
    inhier_obj varchar2(100); -- AW object specifying members in a hierarchy
    familyrel_obj varchar2(100); -- AW object specifying family relationship for level-based hiers
    familyrelval_obj varchar2(100); -- AW object specifying family relationship for value-based hiers
    levelrel_obj varchar2(100); -- AW object specifying the level for a dimension member
    levelList_obj varchar2(100);
    gidDimension_obj varchar2(100);
    long_desc_obj varchar2(100);
    depth_obj varchar2(100);
    currentvalue varchar2(100);
    hier_levels all_olap2_aw_dim_hier_lvl_ord%ROWTYPE;
    attrib_record all_olap2_aw_attributes%ROWTYPE;
    str varchar2(100);
    TYPE awinfo_table IS TABLE OF all_olap2_aw_phys_obj_prop.aw_prop_value%TYPE
    INDEX BY varchar2(100);
    level_list awinfo_table;
    physobj_list awinfo_table;
    TYPE awinfo_type is RECORD (
    prop_value all_olap2_aw_phys_obj_prop.aw_prop_value%TYPE,
    prop_name all_olap2_aw_phys_obj_prop.AW_PROP_NAME%TYPE);
    propValue_record awinfo_type;
    isValueBased boolean;
    aw_date date;
    type olapCur is ref cursor;
    physObjCur olapCur;
    isAttached number;
    maxdepth number;
    i number;
    gid_value number;
    description varchar2(1000);
    BEGIN
    owner := upper(strOwner);
    awname := upper(strAWname);
    dimname := upper(strDimname);
    show ('... populating dimension map for ' || dimname);
    -- Ensure the AW is attached R/W first
    isAttached := attachAW (owner, awname);
    -- Get the timestamp for the last time the AW was updated
    aw_date := getLastUpdateDate(owner, awname);
    * Begin by caching key metadata objects and physical objects that will be required
    * for the dimension table cache.
    show ('..... clearing mappings for the dimension');
    DELETE olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    object_name = dimname;
    * Retrieve physical AW objects that represent the hierarchies, levels, descriptions, etc.
    * Will retrieve information directly from the AW dictionary
    show ('..... retrieving physical objects');
    -- Begin by defining a shadow dimension for the NAME dimension and a formula highlighting the object type.
    -- Populate this shadow dimension with the appropriate AW objects for this dimension
    -- Note: it's okay if the name_id dimension already exists - the define will simply
    -- cause a benign error. name_id is a temporary structure that does not need to be persisted
    begin
    dbms_aw.execute('oknullstatus = yes');
    dbms_aw.execute('define name_id dimension text temp session');
    -- list of AW objects
    dbms_aw.execute('define EXPRESS!name_obj_type formula text <name_id> session');
    dbms_aw.execute('eq if obj(property ''AW$ROLE'', name_id) eq ''ATTRDEF'' then obj(property ''AW$TYPE'', name_id) else obj(property ''AW$ROLE'', name_id)');
    -- list of physical level names
    dbms_aw.execute('define EXPRESS!level_physicalname formula text <name_id> session');
    dbms_aw.execute('eq obj(property ''PHYSICALNAME'', name_id)');
    -- list of level display names
    dbms_aw.execute('define EXPRESS!level_displayname formula text <name_id> session');
    dbms_aw.execute('eq obj(property ''DISPLAYNAME'', name_id)');
    -- list of value hierarchy names
    dbms_aw.execute('define valuehiers dimension text temp session');
    dbms_aw.execute('define EXPRESS!hier_logicalname formula text <valuehiers> session');
    dbms_aw.execute('eq obj(property ''AW$LOGICAL_NAME'', valuehiers)');
    -- maximum depth of a value hierarchy
    dbms_aw.execute('define EXPRESS!hier_maxdepth formula int <valuehiers> session');
    dbms_aw.execute('eq numlines(obj(property ''HIERARCHY_LEVELS'', valuehiers))');
    -- Check for exceptions..... occurs if the object supporting objects already exist.
    exception
    when others then
    null;
    end;
    -- Clear the cached list of names
    dbms_aw.execute('mnt name_id delete all');
    -- Populate the shadow dimension with all the dimension related objects
    dbms_aw.execute('mnt name_id merge limit(name to obj(property ''AW$PARENT_NAME'') eq ''' ||
    dimname || ''' or obj(property ''AW$ROLE'') eq ''GID_DIMENSION'')');
    -- Retrieve the objects and their properties
    open physObjCur for 'SELECT prop_value, prop_name
    FROM table(OLAP_TABLE(''EXPRESS duration session'', null, null,
    ''DIMENSION prop_name FROM name_id
    MEASURE prop_value FROM name_obj_type''))';
    BEGIN
    loop
    fetch physObjCur into propValue_record;
    exit when physObjCur%NOTFOUND;
    physobj_list(propValue_record.prop_value) := propValue_record.prop_name;
    end loop;
    close physObjCur;
    END;
    parent_obj := physobj_list('MEMBER_PARENTREL');
    hierlist_obj := physobj_list('HIERLIST');
    inhier_obj := physobj_list('MEMBER_INHIER');
    familyrel_obj := physobj_list('MEMBER_FAMILYREL');
    familyrelval_obj := physobj_list('MEMBER_FAMILYRELVAL');
    levelList_obj := physobj_list('LEVELLIST');
    levelrel_obj := physobj_list('MEMBER_LEVELREL');
    gidDimension_obj := physobj_list('GID_DIMENSION');
    long_desc_obj := physobj_list('MEMBER_LONG_DESCRIPTION');
    -- Populate the value hierarchy collection
    -- Use a similar technique to the one above to find the hierarchies
    show ('..... checking for value hierarchies');
    dbms_aw.execute('mnt valuehiers delete all');
    -- Populate the valuehiers dimension with all the value hierarchies for this dimension
    dbms_aw.execute('mnt valuehiers merge limit(name to obj(property ''AW$PARENT_NAME'') eq ''' ||
    dimname || ''' and obj(property ''AW$ROLE'') eq ''HIERDEF'' and obj(property ''VALUE_HIERARCHY'') eq True)');
    -- Populate the LEVEL labels collection
    -- Again, use techniques similar to the one above ** CHECK VALUE HIERARCHIES **
    show ('..... retrieving label for dimension levels');
    -- Populate the shadow dimension with all the dimension related objects
    dbms_aw.execute('mnt name_id delete all');
    dbms_aw.execute('mnt name_id merge limit(name to obj(property ''AW$PARENT_NAME'') eq ''' ||
    dimname || ''' and obj(property ''AW$ROLE'') eq ''LEVELDEF'')');
    -- Retrieve the objects and their properties
    open physObjCur for 'SELECT display_name prop_value, physical_name prop_name
    FROM table(OLAP_TABLE(''EXPRESS duration session'', null, null,
    ''DIMENSION level_name FROM name_id
    MEASURE physical_name FROM level_physicalname
    MEASURE display_name FROM level_displayname''))';
    BEGIN
    loop
    fetch physObjCur into propValue_record;
    exit when physObjCur%NOTFOUND;
    level_list(propValue_record.prop_name) := propValue_record.prop_value;
    end loop;
    close physObjCur;
    END;
    -- Update the cache with DIMENSION clause
    -- Example:
    -- DIMENSION category_id AS varchar2(100) FROM category WITH
    show ('..... populating mapping info for the DIMENSION clause');
    dimDisplayName := dbms_aw.eval_text('obj(property ''DISPLAYNAME'' ''' || dimname || ''')') || ' member';
    -- DIMENSION clause
    description := dimname || ' dimension member values';
    INSERT INTO olap_mappings(last_updated, aw_last_updated, aw_owner, aw_name, clause,
    object_name, column_name, aw_object,
    column_label, description)
    VALUES (cachedate, aw_date, owner, awname, 'DIMENSION',
    dimname, dimname, dimname,
    dimDisplayName, description);
    -- Update the cache with INHIER clause
    -- Example:
    -- INHIERARCHY category_inhier
    -- INHIERARCHY clause
    show ('..... populating mapping info for the INHIERARCHY clause');
    description := 'Identifies dimension members that are in a given hierarchy';
    INSERT INTO olap_mappings(last_updated, aw_last_updated, aw_owner, aw_name, clause,
    object_name, column_name, aw_object,
    column_label, description)
    VALUES (cachedate, aw_date, owner, awname, 'INHIERARCHY',
    dimname, null, inhier_obj,
    null, description);
    -- Loop over the HIERARCHIES for this dimension
    -- Update the cache with HIERARCHY and FAMILYREL clauses
    -- Example:
    -- HIERARCHY category_standard_prnt AS varchar2(100) FROM category_parentrel(category_hierlist \'STANDARD\')
    currentvalue := ' ';
    show ('..... retrieving hierarchy information');
    DECLARE
    CURSOR hier_levels_cur is
    SELECT *
    FROM all_olap2_aw_dim_hier_lvl_ord
    WHERE aw_owner = owner and
    aw_name = awname and
    aw_dimension_name = dimname and
    length(aw_hierarchy_name) > 0
    ORDER BY aw_hierarchy_name asc, position asc;
    BEGIN
    for hier_levels in hier_levels_cur
    loop
    str := hier_levels.aw_hierarchy_name;
    -- If there is a change in hierarchy, then add the HIERARCHY clause
    if str != currentvalue
    then
    show ('..... populating mapping info for the HIERARCHY and FAMILYREL clauses for hierarchy ' || str);
    currentvalue := hier_levels.aw_hierarchy_name;
    columnName := getColumnName (dimname, currentvalue, 'MEMBER_PARENTREL');
    qdr := parent_obj || '(' || hierlist_obj || ' \''' || currentvalue || '\'')';
    description := dimname || ' member''s parent in hierarchy ' || currentvalue;
    displayName := dimDisplayName || ' Parent';
    -- HIERARCHY clause
    INSERT INTO olap_mappings(last_updated, aw_last_updated, aw_owner, aw_name, clause,
    object_name, hierarchy, column_name, aw_object,
    column_label, description)
    VALUES (cachedate, aw_date, owner, awname, 'HIERARCHY',
    dimname, currentvalue, columnName, qdr,
    displayName, description);
    -- Check if current hierarchy is value based
    dbms_aw.execute('limit valuehiers to hier_logicalname eq ''' || currentvalue || '''');
    if dbms_aw.eval_number('statlen(valuehiers)') = 0
    then isValueBased := false;
    else isValueBased := true;
    end if;
    -- Get the maximum depth of a value hierarchy
    -- Also, set up the depth variable for a value-based hierarchy
    if isValueBased then
    maxdepth := dbms_aw.eval_number('hier_maxdepth');
    i := maxdepth;
    -- The depth object represents a level in a value based hierarchy
    -- This object is not in standard form and will be created if nec by
    -- getDepthVar
    if depth_obj is null then
    depth_obj := getDepthVar(owner, awname, dimname, hierlist_obj, parent_obj);
    end if;
    -- Add a LEVEL hierarchy attribute
    -- There must be a level (or depth) attribute by hierarchy, since the level may change by hierarchy
    columnName := substr(dimname, 1, 10) || '_' || substr(currentvalue, 1, 10) || '_LEVEL';
    description := 'Depth of ' || dimname || ' member in hierarchy ' || currentvalue;
    displayName := dimDisplayName || ' level';
    INSERT INTO olap_mappings(last_updated, aw_last_updated, aw_owner, aw_name, clause,
    object_name, column_name, aw_object,
    column_label, description)
    VALUES (cachedate, aw_date, owner, awname, 'HATTRIBUTE',
    dimname, columnName, depth_obj,
    displayName, description);
    end if;
    end if;
    -- Add the FAMILYREL clause for this level
    if isValueBased
    then
    i := i - 1;
    gid_value := power(2, i) - 1;
    -- columnName := getColumnName(dimname, hier_levels.aw_level_name, 'MEMBER_LEVELREL');
    qdr := familyrelval_obj || '(' || gidDimension_obj || ' ' || gid_value || ')';
    displayName := currentvalue || ' Level ' || hier_levels.position;
    str := substr(currentvalue, 1, 8) || hier_levels.position;
    columnName := getColumnName(dimname, str, 'MEMBER_LEVELREL');
    description := dimname || ' member''s ancestor value for level ' || hier_levels.position || ' in hierarchy ' || currentvalue;
    -- FAMILYREL clause
    INSERT INTO olap_mappings(last_updated, aw_last_updated, aw_owner, aw_name, clause,
    object_name, hierarchy, level_name, column_name, aw_object,
    position, column_label, description, include)
    VALUES (cachedate, aw_date, owner, awname, 'FAMILYREL',
    dimname, currentvalue, str, columnName, qdr,
    hier_levels.position, displayName || ' ID', description, include_level_id);
    -- FAMILYREL description clause
    description := dimname || ' member''s ancestor descriptive value for level ' || hier_levels.position || ' in hierarchy ' || currentvalue;
    columnName := getColumnName(dimname, str, 'MEMBER_LEVELREL_DESC');
    INSERT INTO olap_mappings(last_updated, aw_last_updated, aw_owner, aw_name, clause,
    object_name, hierarchy, level_name, column_name, aw_object,
    dimension_desc, position, column_label, description)
    VALUES (cachedate, aw_date, owner, awname, 'FAMILYREL_LONG_DESC',
    dimname, currentvalue, str, columnName, qdr,
    long_desc_obj, hier_levels.position, displayName || ' Description', description);
    else
    -- Level based hierarchies use the level list object
    -- They also use the FAMILYREL as the hierarchy structure
    -- columnName := getColumnName(dimname, hier_levels.aw_level_name, 'MEMBER_LEVELREL');
    columnName := getColumnName(dimname, hier_levels.aw_level_name, 'MEMBER_LEVELREL');
    qdr := familyrel_obj || '(' || levelList_obj || ' \''' ||
    hier_levels.aw_level_name || '\'')';
    displayName := level_list(hier_levels.aw_level_name);
    description := dimname || ' member''s ancestor value for level ' || hier_levels.aw_level_name || ' in hierarchy ' || currentvalue;
    -- FAMILYREL clause
    INSERT INTO olap_mappings(last_updated, aw_last_updated, aw_owner, aw_name, clause,
    object_name, hierarchy, level_name, column_name, aw_object,
    position, column_label, description, include)
    VALUES (cachedate, aw_date, owner, awname, 'FAMILYREL',
    dimname, currentvalue, hier_levels.aw_level_name, columnName, qdr,
    hier_levels.position, displayName || ' ID', description, INCLUDE_LEVEL_ID);
    -- FAMILYREL description clause
    -- columnName := getColumnName(dimname, hier_levels.aw_level_name, 'LEVEL_LONG_DESCRIPTION');
    columnName := getColumnName(dimname, hier_levels.aw_level_name, 'MEMBER_LEVELREL_DESC');
    description := dimname || ' member''s ancestor descriptive value for level ' || hier_levels.aw_level_name || ' in hierarchy ' || currentvalue;
    INSERT INTO olap_mappings(last_updated, aw_last_updated, aw_owner, aw_name, clause,
    object_name, hierarchy, level_name, column_name, aw_object,
    dimension_desc, position, column_label, description)
    VALUES (cachedate, aw_date, owner, awname, 'FAMILYREL_LONG_DESC',
    dimname, currentvalue, hier_levels.aw_level_name, columnName, qdr,
    long_desc_obj, hier_levels.position, displayName || ' Description', description);
    end if;
    END LOOP; -- Loop over hierarchy levels
    END; -- Cursor for hierarchy levels
    -- Add ATTRIBUTES for the dimension
    show ('..... populating mapping info for the ATTRIBUTE clause');
    DECLARE
    CURSOR attributes_cur is
    SELECT *
    FROM all_olap2_aw_attributes
    WHERE aw_owner = owner and
    aw_name = awname and
    aw_dimension_name = dimname;
    BEGIN
    for attrib_record in attributes_cur
    loop
    columnName := getColumnName(attrib_record.aw_dimension_name,
    attrib_record.aw_logical_name,
    attrib_record.attribute_type);
    description := attrib_record.description;
    displayName := attrib_record.display_name;
    /* if attrib_record.attribute_type in ('MEMBER_SHORT_DESCRIPTION', 'MEMBER_LONG_DESCRIPTION')
    then
    description := attrib_record.description;
    displayName := attrib_record.display_name;
    else
    description := attrib_record.aw_dimension_name || ' attribute ' || attrib_record.aw_physical_object;
    displayName := attrib_record.display_name;
    end if;
    -- ATTRIBUTE clause
              --      Throwing column name
         show ('Attribute clause column name= ' || columnName);
    INSERT INTO olap_mappings(last_updated, aw_last_updated, aw_owner, aw_name, clause,
    object_name, column_name, aw_object,
    column_label, description)
    VALUES (cachedate, aw_date, owner, awname, 'ATTRIBUTE',
    dimname, columnName, attrib_record.aw_physical_object,
    displayName, description);
    end loop;
    END;
    -- Add the LEVELREL object as an attribute of the dimension.
    columnName := getColumnName(dimname, null, 'LEVEL_ATTRIBUTE');
    description := dimDisplayName || ' level';
    displayName := description;
              --      Throwing column name
         show ('Levelrel clause column name= ' || columnName);
    INSERT INTO olap_mappings(last_updated, aw_last_updated, aw_owner, aw_name, clause,
    object_name, column_name, aw_object,
    column_label, description)
    VALUES (cachedate, aw_date, owner, awname, 'ATTRIBUTE',
    dimname, columnName, levelrel_obj,
    displayName, description);
    -- Finally, ensure that the columns are unique across the the AW.
    -- For example, if month_lvl is in two hierarchies, there will need to be two
    -- columns: 1) month_lvl and 2) month_lvl1. Or, if there is a product dimension
    -- and a product measure, these will also be uniquely identified
    UPDATE olap_mappings map
    SET map.column_name =
    (SELECT case when (b.cum_occurrence > 1) then b.column_name || (b.cum_occurrence - 1)
    else b.column_name
    end as column_name
    FROM
    (SELECT a.aw_owner,
    a.aw_name,
    a.cube_name,
    a.column_name,
    SUM(a.occurrence) over(PARTITION BY cube_name, column_name ORDER BY occurrence ROWS unbounded preceding) cum_occurrence
    FROM
    (SELECT aw_owner,
    aw_name,
    cube_name,
    column_name,
    1 occurrence
    FROM olap_mappings
    WHERE aw_name= awname and
    aw_owner=owner) a
    ) b
    WHERE map.rowid = b.rowid)
    WHERE map.aw_name = awname and
    map.aw_owner = owner;
    commit;
    show ('... completed populating mapping for ' || dimname);
    detachAW(owner, awname, isAttached);
    return 1;
    exception
    when NO_DATA_FOUND then
    rollback;
    show ('**');
    show ('** Error retrieving metadata for dimension ' || dimname);
    show ('** You do not have access to the data in the AW.');
    show ('** View creation failed');
    show ('**');
    show (SQLERRM);
    detachAW(owner, awname, isAttached);
    return 0;
    when others then
    rollback;
    show ('**');
    show ('** Error retrieving metadata for dimension ' || dimname);
    show ('** View creation failed');
    show ('**');
    show (SQLERRM);
    detachAW(owner, awname, isAttached);
    return 0;
    END generateDimensionMap;
    -- Updates the OLAP_MAPPINGS table with information about a cube
    FUNCTION generateCubeMap (
    strOwner varchar2,
    strAWname varchar2,
    strCubename varchar2) return number as
    owner varchar2(30);
    awname varchar2(30);
    cubename varchar2(30);
    aw_date date;
    BEGIN
    owner := upper(strOwner);
    awname := upper(strAWname);
    cubename := upper(strCubename);
    aw_date := getLastUpdateDate(owner, awname);
    show ('... populating mapping for cube ' || cubename);
    show ('..... clearing mappings for the cube');
    DELETE olap_mappings
    WHERE aw_owner = owner and
    aw_name = awname and
    cube_name = cubename;
    -- Retrieve each of the measures
    show ('..... collecting metadata for measures in cube');
    INSERT INTO olap_mappings(last_updated, aw_last_updated, aw_owner, aw_name, cube_name, clause,
    object_name, column_name, aw_object,
    data_type,
    column_label, description)
    (SELECT cachedate, aw_date, aw_owner, aw_name, aw_cube_name, 'MEASURE',
    aw_measure_name, aw_measure_name, aw_physical_object,
    olap_views.olap_viewGenerator.getDataType(aw_owner, aw_name, aw_physical_object),
    display_name, 'Measure ' || aw_measure_name
    FROM all_olap2_aw_cube_measures);
    commit;
    return 1;
    exception
    when others then
    rollback;
    show ('**');
    show ('** Error retrieving metadata for cube ' || cubename);
    show ('** View creation failed');
    show ('**');
    show (SQLERRM);
    return 0;
    END generateCubeMap;
    PROCEDURE createCubeView (
    strOwner varchar2,
    strAWname varchar2,
    strCubename varchar2,
    commitLog boolean) as
    owner varchar2(30);
    awname varchar2(30);
    cubename varchar2(30);
    limitmap clob;
    cmd varchar2(4000);
    output varchar2(4000);
    varname varchar2(100);
    sql_text varchar2(32767);
    viewname varchar2(61);
    cube_rec all_olap2_aw_cubes%rowtype;
    type dim_table is table of all_olap2_aw_cube_dim_uses.dimension_aw_name%TYPE INDEX BY BINARY_INTEGER;
    dimlist dim_table;
    isAttached number;
    BEGIN
    owner := upper(strOwner);
    awname := upper(strAWname);
    cubename := upper(strCubename);
    varname := cubename || '_CUBE_LIMITMAP';
    viewname := owner || '.' || substr(cubename, 1, 21) || '_CUBEVIEW';
    show ('. Creating view for cube ' || cubename);
    -- Validate the arguments
    begin
    SELECT *
    INTO cube_rec
    FROM all_olap2_aw_cubes
    WHERE aw_name = awname and
    aw_owner = owner and
    aw_logical_name = cubename;
    exception
    when NO_DATA_FOUND then
    show ('**');
    show ('** ERROR: View not created.');
    show ('** Invalid arguments. Ensure that the schema, AW and cube names are valid.');
    show ('** In addition, ensure that you have r/w priviliges to the AW.');
    show ('**');
    if commitLog
    then updateLogTable();
    end if;
    raise;
    end;
    -- Attach the AW
    begin
    isAttached := attachAW(owner, awname);
    exception
    when others then
    show ('**');
    show ('** ERROR: View not created.');
    show ('** Unable to attach AW r/w. Ensure no other users have the AW attached RW - then try again.');
    show ('** In addition, ensure that you have r/w priviliges to the AW.');
    show ('**');
    if commitLog
    then updateLogTable();
    end if;
    raise;
    end;
    -- Define the limitmap variable in the AW and assign the limitmap text to it
    show ('..... generating limitmap for cube');
    limitmap := getCubeLimitmap(owner, awname, cubename);
    if limitmap is null
    then
    if commitLog then
    updateLogTable();
    raise bad_limitmap;
    end if;
    end if;
    -- Define the variable
    show ('..... assigning limitmap to variable in the AW');
    begin
    dbms_aw.execute('define ' || varname || ' variable text');
    -- If the variable already exists, simply update it
    exception
    when others then
    show ('..... ' || varname || ' found. Will update the variable');
    end;
    -- Assign the limitmap. Update and commit changes
    begin
    output := dbms_aw.interpclob(varname || ' = ''' || limitmap || '''');
    dbms_aw.aw_update(owner, awname);
    commit;
    detachAW(owner, awname, isAttached);
    exception
    when others then
    show ('**');
    show ('** ERROR: View not created.');
    show ('** CAUSE: Unable to assign the limitmap variable in the AW.');
    show (SQLERRM);
    detachAW(owner, awname, isAttached);
    -- if commitLog
    -- then updateLogTable();
    -- end if;
    raise;
    end;
    -- Create the view over the AW
    -- Example:
    CREATE or REPLACE VIEW channel_dimview AS
    SELECT *
    FROM table(OLAP_TABLE('GLOBAL.GLOBAL duration session',
    '&(CHANNEL_LIMITMAP)' ))
    show ('..... defining view ' || viewname || ' over the cube');
    sql_text := 'CREATE OR REPLACE VIEW ' || viewname || ' AS ' || chr(10) ||
    ' SELECT * ' || chr(10) ||
    ' FROM table(OLAP_TABLE (''' || owner || '.' || awname || ' duration session'',' || chr(10) ||
    ''''',' || chr(10) ||
    ''''',' || chr(10) ||
    '''&(' || varname || ')''))';
    -- Add SQL Model clause
    sql_text := sql_text || chr(10) ||
    getSQLText(owner, awname, 'CUBE', cubename, 'MODEL', null);
    begin
    execute immediate sql_text;
    exception
    when others then
    show ('**');
    show ('** ERROR: View not created.');
    show ('** CAUSE: CREATE VIEW statement failed');
    show (SQLERRM);
    show ('*** DEBUG INFORMATION ***');
    show ('VIEW CREATION DDL ((truncated after 3900 characters)');
    show (substr(sql_text, 1, 3900));
    show ('LIMITMAP (truncated after 3900 characters):');
    show (substr(limitmap, 1, 3900));
    raise;
    end;
    -- Update the catalog containing the views and their contents
    begin
    -- Update the limitmap catalog
    DELETE olap_view_limitmap
    WHERE aw_owner = owner and
    aw_name = awname and
    view_name = viewname;
    INSERT INTO olap_view_limitmap(last_updated, aw_owner, aw_name,
    view_name, limitmap)
    VALUES (cachedate, owner, awname,
    viewname, limitmap);
    -- Update the object catalog with the cube
    DELETE olap_view_objects
    WHERE aw_owner = owner and
    aw_name = awname and
    view_name = viewname and
    cube_name = cubename;
    INSERT INTO olap_view_objects(last_updated, aw_owner, aw_name,
    view_name, cube_name)
    VALUES (cachedate, owner, awname,
    viewname, cubename);
    -- Update the object catalog with the dimensions for the cube
    SELECT dimension_aw_name
    BULK COLLECT
    INTO dimlist
    FROM all_olap2_aw_cube_dim_uses
    WHERE aw_owner = owner and
    aw_name = awname and
    aw_logical_name = cubename;
    for i in 1 .. dimlist.count loop
    DELETE olap_view_objects
    WHERE aw_owner = owner and
    aw_name = awname and
    view_name = viewname and
    dimension_name = dimlist(i);
    INSERT INTO olap_view_objects(last_updated, aw_owner, aw_name,
    view_name, dimension_name)
    VALUES (cachedate, owner, awname,
    viewname, dimlist(i));
    end loop;
    commit;
    exception
    when others then
    rollback;
    show ('**');
    show ('** ERROR: Unable to update the OLAP_VIEW_OBJECTS and/or OLAP_VIEW_LIMITMAP catalog tables.');
    show (SQLERRM);
    show ('** NOTE: View ' || viewname || ' was successfully created.');
    if commitLog
    then updateLogTable();
    end if;
    return;
    end;
    show ('View ' || viewname || ' successfully created');
    if commitLog
    then updateLogTable();
    end if;
    return;
    exception
    when others then
    rollback;
    show ('**');
    show ('** ERROR: Unable to create view over cube ' || cubename || '.');
    show (SQLERRM);
    if commitLog
    then updateLogTable();
    end if;
    raise;
    END createCubeView;
    PROCEDURE createCubeView (
    strOwner varchar2,
    strAWname varchar2,
    strCubename varchar2) as
    BEGIN
    createCubeView(strOwner, strAWname, strCubename, true);
    END createCubeView;
    PROCEDURE createDimensionView (
    strOwner varchar2,
    strAWname varchar2,
    strDimname varchar2,
    commitLog boolean) as
    owner varchar2(30);
    awname varchar2(30);
    dimname varchar2(30);
    limitmap clob;
    cmd varchar2(4000);
    output varchar2(4000);
    varname varchar2(100);
    sql_create varchar2(32767);
    viewname varchar2(61);
    dim_rec all_olap2_aw_dimensions%ROWTYPE;
    isAttached number;
    BEGIN
    owner := upper(strOwner);
    awname := upper(strAWname);
    dimname := upper(strDimname);
    varname := dimname || '_LIMITMAP';
    viewname := owner || '.' || substr(dimname, 1, 22) || '_DIMVIEW';
    show ('. Creating view for dimension ' || dimname);
    begin
    SELECT *
    INTO dim_rec
    FROM all_olap2_aw_dimensions
    WHERE aw_name = awname and
    aw_owner = owner and
    aw_logical_name = dimname;
    exception
    when NO_DATA_FOUND then
    show ('**');
    show ('** ERROR: View not created.');
    show ('** Invalid arguments. Ensure that the schema, AW and dimension names are valid.');
    show ('** In addition, ensure that you have r/w priviliges to the AW.');
    show ('**');
    if commitLog
    then updateLogTable();
    end if;
    raise;
    end;
    -- Attach the AW
    begin
    isAttached := attachAW(owner, awname);
    exception
    when others then
    show ('**');
    show ('** ERROR: View not created.');
    show ('** Unable to attach AW r/w. Ensure no other users have the AW attached RW - then try again.');
    show ('** In addition, ensure that you have r/w priviliges to the AW.');
    show ('**');
    if commitLog
    then updateLogTable();
    end if;
    raise;
    end;
    -- Define the limitmap variable in the AW and assign the limitmap text to it
    limitmap := getDimensionLimitmap(owner, awname, dimname);
    if limitmap is null
    then
    show ('Error defining limitmap.');
    if commitLog
    then updateLogTable();
    end if;
    raise bad_limitmap;
    end if;
    -- Define the variable
    begin
    dbms_aw.execute('define ' || varname || ' variable text');
    -- If the variable already exists, simply update it
    exception
    when others then
    show ('..... will update variable ' || varname);
    end;
    -- Assign the limitmap. Update and commit changes
    begin
    output := dbms_aw.interpclob(varna

  • Failed to create application BusinessObjects115.OLAPI.Application.1.

    Hi,
    I installed BOE ,OLAP,CR -XI, R2 version on a Windows Server 2003 Standard edition machine.
    On invoking , OLAP Intelligence, I see an error "Failed to create application BusinessObjects115.OLAPI.Application.1. Detailed error message : Unspecified Error"
    Can anyone help?
    Thanks
    Shabnam

    Turns out that I have managed to get access to the above link by other means. For the benefit of anyone else that hits this issue, the details contained in the link are as follows:
    --- Begin Details ---
    Symptom
    Cannot start OLAP Intelligence.
    Session launch fails with error(s):
    BusinessObjects115.OLAPI.Application.1 could not be created. Error Message Detail: Unspecified error.
    Failed to create application CrystalAnalysisOLAP.Application.6. Detail error message: Unspecified error.
    Reproducing the Issue
    Windows 2003 SP2
    Windows Security Update 973507
    Business Objects Enterprise XI R2
    OLAP Intelligence XI R2
    Create an OLAP Intelligence report and publish it to Enterprise environment to make sure that the products work correctly.
         1. Install the Windows Security Update 973507.
         2. After the installation of Windows Security Update 973507, which is installed by Security Bulletin MS09-037
         3. released on September 8th, 2009, OLAP Intelligence gives the error on startup and quits.
            After uninstalling this update OLAP Intelligence starts up again.
         4.
    Cause
    Dll Entry point cannot be found
    Windows Security Update 973507 is installed on Windows 2003 SP2 machine
    Resolution
    MS KB973507 patch must be removed for OLAP Intelligence to function. 
            Microsoft Security Patch KB973507 installation is not always listed in Control Panel > Add/Remove Programs.
         1. Confirm existence of file << atl.dll >>, dated 17th July 2009, under path: C:\WINDOWS\system32\
         2. Also an Uninstall directory called: C:\WINDOWS\$NtUninstallKB973507$
         3. It is recommended to use the facility: C:\WINDOWS\$NtUninstallKB973507$\spuninst\spuninst.exe to uninstall the patch.
         4. After a reboot of the server, OLAP Intelligence will work ok.
         5. The reason why the issue will not be fixed is because OLAP Intelligence has reached end-of-life as of XI R2 SP2.
            No new features or new platform support will be added for this product.
            Win 2003 SP2 is not officially supported in BOE XI R2 SP2 and this is the basis on which OLAPI is measured on.
            Upgrading to BOE XI R2 to Win2003 SP2 is fine, however, if you install OLAP Intelligence Designer on such a platform it is not supported.
    See Also
    Installation order needs to be (for a supported XIR2 SP4 environment):
    Full Server install of BO Enterprise XI R2 SP2.
                 1. Install OLAP Intelligence XI R2.
                 2. Install Service Pack 3.
                 3. Install Productivity Pack SP3.
                 4. Install Service Pack 4.
                 5.
    Keywords
    OLAPI, update, PAR
    Header Data
    Released on      05.10.2009 10:07:31
    Release Status      Released to Customer
    Component      BOJ-ERQ-OPI
    Category      Problem
    Product
    Product     Product Version
    SAP BusinessObjects Enterprise     BOBJ ENTERPRISE XI R2
    References
    Type     ID     Title
    The table does not contain any entries          
    --- End Details ---
    Hope this is useful to the wider community.
    Regards,
    Andy

Maybe you are looking for

  • Universal Spell Checker doesn't work.

    For some reason my universal spell checker wont work. I am using TextEdit, where it worked fine until recently. Is anyone else having this problem? And yes, I checked ON the appropriate function in the menu. I am on a MacBook Pro with the latest OS (

  • Calendar question re: times

    I am not sure this is the right board for this question, but I could not find one that was appropriate.  I would like to know how to make the items I list on the palm desktop calendar be in order by time of day, but they are always haphazard. Will ap

  • Debugging migo

    Hello SCN. I need your help, I am debugging trx MIGO y and I have the following Window, it says enhancement, what does it mean? is it an exit? can i find it by cmod or smod. thank you for your help.

  • Print widget makes answer box and buttons disappear when clicked

    I've tried two print widgets so far 1. the widget that comes standard with Captivate 4 and 2. the one posted here http://forums.adobe.com/message/1937195 by a community member. Issues: 1. standard print widget - once the user has typed in their answe

  • How to detect which applications that are currently running

    Hi there. Is there a way to detect which applications that are currently running on my machine? Is there a class that can get all of the running applications, you know, like the taskmanager. //peter