Oracle® OLAP Reference 10g Release 2 (10.2) Part Number B14350-01 |
|
|
View PDF |
The following example shows how to use the CWM2_OLAP_MANAGER
package to direct a validation report to a log file.
Example 17-1 Direct a Validation Report to a File
>set linesize 135 >set pagesize 50 >execute cwm2_olap_manager.begin_log ('/users/myuser' , 'Metadata_Validation_Report'); >execute cwm2_olap_manager.log_note ('OLAP Metadata Validation Report' ); >execute cwm2_olap_validate.validate_olap_catalog ('OLAP API'); >execute cwm2_olap_manager.end_log;
The log file would look something like this.
BEGIN: CwM2_OLAP Log Date: 2004 APRIL 05 Time: 17:10:20 User: MYUSER. Log Directory: /users/myuser Log File: Metadata_Validation_Report. OLAP Metadata Validation Report .Validate Olap Catalog .Validate Dimension: GLOBAL.CHANNEL Type of Validation: OLAP API Verbose Report: YES .Validating Dimension Metadata in OLAP Catalog 1 Date: 2004 APRIL 05 Time: 17:11:45 User: MYUSER 031201 .ENTITY TYPE ENTITY NAME STATUS COMMENT Dimension GLOBAL.CHANNEL VALID Default_Display_Hierarchy: "CHANNEL_ROLLUP". . . . . . . END: CwM2_OLAP Log Date: 2004 APRIL 05 Time: 17:12:11 User: MYUSER. Log Directory: /users/myuser Log File: Metadata_Validation_Report.
Table 17-1 CWM2_OLAP_MANAGER
Subprogram | Description |
---|---|
|
Turns on logging. |
|
Turns off logging. |
|
Writes a text string in the log file. |
|
Turns on echoing to the screen. |
|
Turns off echoing to the screen. |
The BEGIN_LOG
procedure directs the output from OLAP PL/SQL packages to a log file.
Syntax
BEGIN_LOG ( output_directory IN VARCHAR2, file_name IN VARCHAR2, append_to_file IN VARCHAR2 DEFAULT 'NO');
Parameters
Table 17-2 BEGIN_LOG Procedure Parameters
Example
See "Example: Using a Log File".
The END_LOG
procedure turns off logging.
Syntax
END_LOG;
Example
See "Example: Using a Log File".
When logging is turned on, the LOG_NOTE
procedure writes the text that you specify to the log file. If logging is not turned on, this procedure has no effect.
Syntax
LOG_NOTE ( message_text IN VARCHAR2);
Parameters
Table 17-3 LOG_NOTE Procedure Parameters
Parameter | Description |
---|---|
|
Text to write to the log file. |
Example
See "Example: Using a Log File".
SET_ECHO_OFF
prevents the display of output generated by OLAP stored procedures.
Syntax
SET_ECHO_OFF;
Example
The following example illustrates how the output from an OLAP DML command is displayed when echoing is turned on, but suppressed when echoing is turned off.
The PL/SQL calls are listed to the left, and the screen output is shown indented to the right.
>execute cwm2_olap_manager.set_echo_on; PL/SQL procedure successfully completed. >execute dbms_aw.execute ('listnames'); 1 DIMENSION ------------------ MYDIM PL/SQL procedure successfully completed. >execute cwm2_olap_manager.set_echo_off; PL/SQL procedure successfully completed. >execute dbms_aw.execute ('listnames'); PL/SQL procedure successfully completed.
SET_ECHO_ON
causes the output generated by OLAP stored procedures to be displayed on the screen.
Syntax
SET_ECHO_ON;
Example
See the example in "SET_ECHO_OFF Procedure".