@@header

/*
*
*  Author     : Vishal Gupta
*  Purpose    : Display OLAP Sessions
*  Parameters : NONE
*
*  Revision History:
*  ===================
*  Date       Author        Description
*  ---------  ------------  -----------------------------------------
*  27-Nov-12  Vishal Gupta  Created
*  
*/

PROMPT **********************************
PROMPT *  Cube Logging Setttings
PROMPT **********************************

COLUMN log_type            HEADING "Log Type"                    FORMAT a20
COLUMN max_errors          HEADING "Max Errors"                  FORMAT 999999999
COLUMN flush_interval      HEADING "Flush|Interval|(sec)"        FORMAT 999999999
COLUMN log_full_record     HEADING "Log Full|Record"             FORMAT a20
COLUMN log_every_n         HEADING "Log Every|N records"         FORMAT 999999999
COLUMN allow_errors        HEADING "Allow Errors"                FORMAT 999999999

SELECT 'Build' Log_Type
     , 0    max_errors
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_build,2) flush_interval
     , CASE sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_build,3) 
            WHEN 0 THEN 'FULL_RECORD_AUTO'
            WHEN 1 THEN 'FULL_RECORD_ALWAYS'
            WHEN 2 THEN 'FULL_RECORD_NEVER'
            ELSE TO_CHAR(sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_build,3))
       END log_full_record
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_build,4) log_every_n
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_build,5) allow_errors
FROM DUAL
UNION ALL
SELECT 'Operations' Log_Type
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_operations,1) max_errors
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_operations,2) flush_interval
     , CASE sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_operations,3) 
            WHEN 0 THEN 'FULL_RECORD_AUTO'
            WHEN 1 THEN 'FULL_RECORD_ALWAYS'
            WHEN 2 THEN 'FULL_RECORD_NEVER'
            ELSE TO_CHAR(sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_operations,3))
       END log_full_record
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_operations,4) log_every_n
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_operations,5) allow_errors
FROM DUAL
UNION ALL
SELECT 'Dimension Compile' Log_Type
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_dimension_compile,1) max_errors
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_dimension_compile,2) flush_interval
     , CASE sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_dimension_compile,3) 
            WHEN 0 THEN 'FULL_RECORD_AUTO'
            WHEN 1 THEN 'FULL_RECORD_ALWAYS'
            WHEN 2 THEN 'FULL_RECORD_NEVER'
            ELSE TO_CHAR(sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_dimension_compile,3))
       END log_full_record
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_dimension_compile,4) log_every_n
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_dimension_compile,5) allow_errors
FROM DUAL
UNION ALL
SELECT 'Rejected Records' Log_Type
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_rejected_records,1) max_errors
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_rejected_records,2) flush_interval
     , CASE sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_rejected_records,3) 
            WHEN 0 THEN 'FULL_RECORD_AUTO'
            WHEN 1 THEN 'FULL_RECORD_ALWAYS'
            WHEN 2 THEN 'FULL_RECORD_NEVER'
            ELSE TO_CHAR(sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_rejected_records,3))
       END log_full_record
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_rejected_records,4) log_every_n
     , sys.dbms_cube_log.get_parameter(sys.dbms_cube_log.type_rejected_records,5) allow_errors
FROM DUAL
;


@@footer
