Skip Headers

Oracle9i Discoverer Administrator Administration Guide
Version 9.0.2

Part Number A90881-02
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

14
Managing summary folders

Managing summary folders

This chapter explains summary folders and how you manage them using Discoverer Administrator, and contains the following topics:

About folders and summary folders in Discoverer

Discoverer uses two kinds of folders:

What are summary folders?

Summary folders are a representation of queried data (created in Discoverer Administrator) that has been saved for reuse. The data is stored in the database in one of the following (depending on the version of Oracle):

Summary folders improve the response time of a query because the query accesses pre-aggregated and pre-joined data rather than going against the detail database tables.

You can also direct Discoverer to summary folders based on tables containing summary data that have been created by another application. These tables are known as external summary tables. You can specify that Discoverer refreshes external summary tables.

You can create summary folders in one of two ways:

The recommended method for creating summary folders in Discoverer is to use Automated Summary Management (ASM).

What are Discoverer summary tables?

Discoverer summary tables are database tables that Discoverer Administrator creates that contain summarized data, when run against an Oracle 8.1.5 database (or earlier). Discoverer summary tables contain pre-aggregated and pre-joined data and can improve query performance in Discoverer Plus and Discoverer Viewer.

Discoverer automatically recognizes when a summary table can be used to satisfy a query request. Discoverer rewrites the query to use the summary table. For more information, see Chapter 16, "What is query rewrite?".

For example, when a query is run for the first time in Discoverer Plus it is directed against the detail tables. This may require a multiple table join and aggregation over thousands or millions of rows which could take some time to complete. Once Discoverer has created a suitable summary table, the same query run in Discoverer Plus is rewritten towards the summary table returning results in a few seconds. Both queries would produce the same results.

For more information about Discoverer and rewriting queries to summary tables with Oracle 8.1.5 databases (or earlier), see Chapter 16, "Example illustrating the advantages of rewriting a query to use a summary table".

What are materialized views?

Materialized views are snapshot views that the Oracle 8.1.7 database (or later) creates that contain summarized data. Materialized views contain pre-aggregated and pre-joined data and can improve query performance in Discoverer Plus and Discoverer Viewer.

The Oracle 8.1.7 database (or later) automatically recognizes when a materialized view can be used to satisfy a query request. The Oracle 8.1.7 database (or later) rewrites the query to use the materialized view. Queries are then directed to the materialized view and not to the underlying detail tables or views.

Materialized views have the following characteristics:

Note that you do not need to register external materialized views with Discoverer for end user queries to use them. This is because the Oracle 8.1.7 database (and later) knows whether a materialized view can satisfy an end user query. The only reason that you need to register an external materialized view with Discoverer is if you want Discoverer to maintain the refresh for you (for more information about registering external summary tables/views, see Chapter 15, "How to create summary folders based on external summary tables").

The SQL Inspector/Explain Plan in Discoverer Plus shows you whether the SQL generated to run a query used a summary table or a materialized view (for more information, see "About viewing the SQL and execution plan for query rewrite in Discoverer").

For an historical context about Discoverer's use of summary tables/materialized views, see Chapter 16, "What is the context and future for Discoverer's use of summary tables/materialized views?".

For information about some of the differences between Discoverer summary tables and materialized views, see:

What is Automated Summary Management (ASM)

Automated Summary Management (ASM) is a Discoverer facility that creates and manages summary folders for you.

ASM simplifies the process of summary folder creation and maintenance by offering you a fully automated solution to summary folder management. When run periodically, ASM can automatically refine the summary folders it creates using query statistics gathered by Discoverer from user queries. ASM also provides guidance should you wish to control the specification of default values during summary folder creation/maintenance.

How does ASM work?

ASM determines how to create summary folders by:

ASM automatically creates and maintains the best set of summary folders based on the above combination.

ASM converts your summary policy into a list of recommended summary folder definitions. You can either implement these recommendations without further intervention (the actual set of summary tables dynamically adjusts with system usage) or execution can be stalled until you have specifically sanctioned one or more of the recommendations.

ASM requires table space to create summary folders but you can adjust how much space in the Summary Wizard (for more information, see "How to run ASM using the Summary Wizard").

Note: ASM works on the EUL as a whole, not just the currently selected business areas. This means that ASM can use folders from all business areas in the current EUL.

What are the prerequisites for creating summary folders with ASM?

To create summary folders with ASM, the following requirements must be met:

Note: For more information about Oracle SET operators, see the Oracle 8i SQL Reference.

Note: A database user created in Discoverer may need additional privileges to enable them to create summary folders. The conditions that determine when this is true are detailed in the following table:

Table 14-1 Whether a database user created in Discoverer requires additional privileges to create summary folders?
The version of Discoverer and/or database version under which the database user is created?  Does the database user require further privileges to create summary folders?  What action is required? 

Discoverer 3.1. 

Yes, the database user requires further privileges to create summary folders. 

You must explicitly grant the required privileges to the database user (for more information about how to grant these privileges, see "How to grant the privileges needed to create summary folders"). 

Discoverer 4i against an Oracle 8.0 database (or earlier). 

Yes, the database user requires further privileges to create summary folders. 

Same action as above. 

Discoverer 4i against an Oracle 8.1.7 database (or later). 

No, the database user requires no further privileges to create summary folders.  

No action is required. 

What are the different ways to run ASM and when do you use them?

There are a number of ways that you can run ASM. The following table shows the different ways that you can run ASM and when to use them:

Table 14-2 The different ways to run ASM and when you use them
How to run ASM?   Why run ASM this way?  For information see 

Using the Summary Wizard. 

Discoverer leads you through the whole process. 

"How to run ASM using the Summary Wizard"

Using the Load Wizard after bulk load. 

Enables you to create summary folders during the load of a business area without having to access ASM independently. 

"How to run ASM after bulk load using the Load Wizard"

Using the command line interface. 

Enables you to create summary folders without having to start Discoverer. 

"How to run ASM using the command line interface"

Using a batch file and the Operating System scheduler. 

Automates the scheduling of ASM summary folder creation through the command line. 

"How to run ASM using a batch file and the operating system scheduler"

What is the ASM policy?

The ASM policy is a set of user defined constraints and options that enable you to control how ASM behaves and what summary folders it produces.

The ASM policy is divided into space options and advanced settings. In many cases you will only need to set the space options.

For more information about space options and advanced settings, see:

Discoverer provides default settings that ensure suitable summary folders are created and maintained without your intervention.

The minimum information required for an ASM policy is a tablespace name and an allocated amount of disc space. The tablespace defaults to the user tablespace, and a default amount of disc space is used. Both of these values can be changed if required (for more information, see "Summary Wizard (ASM): Step 3 Allocate Space dialog").

Why must you refresh summary data?

You must refresh summary data regularly to keep all of the summary tables and materialized views consistent. If the database changes often, summary tables and materialized views need to be refreshed accordingly to keep their data current with the underlying database. With a properly maintained set of summary tables or materialized views, query results are accurate, regardless of the table or materialized view being used.

For information about refreshing summary folders see:

Note: Sometimes it is useful to refresh a summary folder after some external event has completed (e.g. the loading of data into a warehouse). You can use the Discoverer command line interface facility to refresh a summary folder from a batch command file to do this (for more information, see "Discoverer command line interface").

What happens when a summary folder is refreshed?

When a summary folder is refreshed (when running against Oracle 8.1.7 databases and later), the database server's own refresh mechanism is used (this can be an incremental refresh) depending on your refresh settings.

Whenever a summary folder is refreshed, the following actions are performed by Discoverer:

How to run ASM using the Summary Wizard

You need certain database privileges to run ASM (for more information about the privileges required to run ASM, see "What are the prerequisites for creating summary folders with ASM?").

To see a list of headings that point to more information about the Summary Wizard dialogs, see "Summary Wizard (ASM): List of dialogs".

To start the summary wizard:

  1. Choose Insert | Summary to display the "Summary Wizard: Step 1 dialog".

    Figure 14-1 Summary Wizard


    Text description of swzasm1.gif follows.
    Text description of the illustration swzasm1.gif
  2. Select the Have Discoverer recommend and create the best summaries radio button and click Next to display the "Summary Wizard: Step 2 dialog".

    Figure 14-2 Summary Wizard: Step 2 dialog


    Text description of swzasm2.gif follows.
    Text description of the illustration swzasm2.gif

    Note: To determine which summary folders to create Discoverer analyzes every folder that is to be involved in the summary folder process. Depending on the number and size of folders to be analyzed this could take some time to complete. Discoverer allows you to start and stop this process at your own pace.

  1. Click the Start button to begin the analysis:

    Your progress will be displayed during the analyze process.

  2. (optional) Click the Stop button to pause the analysis.

    • You might want to pause the analysis to make changes to the default settings (using the Advanced Settings button) before resuming table analysis.

  3. (optional) Click the Continue button to resume the analysis.

    The analysis always resumes from exactly the same point in the process at which the Stop button was clicked.

    Figure 14-3 Summary Wizard: Step 2


    Text description of swasm2e.gif follows.
    Text description of the illustration swasm2e.gif

    Note: If some folders cannot be analyzed Discoverer displays the "Not Analyzed dialog".

    1. When analysis is complete click Next to allocate space for summaries.

      Figure 14-4 Summary Wizard: Step 3


      Text description of swzasm3.gif follows.
      Text description of the illustration swzasm3.gif

    The graph plots the expected performance gain from allocating a certain amount of space for summary folders.

    The information displayed here is calculated during folder analysis (see previous step). If you make changes using any of the tabs in the Change Default Settings dialog Discoverer might recalculate the graph.

    For more information about settings see "Summary Wizard (ASM): Change default settings: List of dialog tabs".

    1. Select the tablespace in which to store summary data in the Tablespace to use for summaries list box.

      Note: We recommend you place summary data in a separate tablespace specifically intended for it. If such a tablespace does not exist, we strongly recommend you do not use the SYSTEM or TEMP tablespaces. For more information, ask your database administrator.

    2. Specify the amount of space to allocate for summary data in one of the following ways:

      • click the graph area and drag the pointer/red line to select the space you want to allocate for summaries

      • specify a figure in the Create summaries to fill field

      Note: The value beneath the Tablespace to use for summaries field can be less than the value specified in the Create summaries to fill field. This does not matter if you have set your tablespace to autoextend. With your tablespace set to autoextend the extra space needed will be added automatically to the database. If your tablespace is not set to autoextend the value Space (KB) must be less than the available space.

      Figure 14-5 Summary Wizard: Step 3


      Text description of swzas3s.gif follows.
      Text description of the illustration swzas3s.gif

      1. (optional) To view the summary folders that ASM will create/remove for you, click the Recommended Summaries button.

        For more information about recommended summaries, see the "Recommended Summaries dialog".

      2. (optional) To display the Change default settings dialog, click the Advanced Settings button.

        For more information about advanced settings, see "Summary Wizard (ASM): Change default settings: List of dialog tabs".

      3. Click Finish to generate summary folders based on the current settings.

        These settings include those made at the Recommended Summaries dialog or the Change Default Settings dialog.

      Notes

      To view all the summary folders in the current EUL, display the "Workarea: Summaries tab".

      How to run ASM after bulk load using the Load Wizard

      When you use the Load Wizard to load a business area into the current EUL, you can choose whether to create a set of summary folders for this new business area. If you take this option then suitable summaries will be created after bulk load.

      To run ASM after bulk load using the Load Wizard:

      1. Choose Insert | Business Area | From Database to start the Load Wizard (for more information about using the Load Wizard, see Chapter 4, "What is the Load Wizard?").

      2. In step 4 of the Load Wizard click the option Summaries based on folders that are created.

        For more information, see "Load Wizard: Step 4 dialog"

      Notes

      • The summary folders created during bulk load of a business area are derived from analyzing the tables and using the default summary policy.

        For more information about the ASM policy, see "What is the ASM policy?"

      • When database tables have just been loaded in the bulk load process, query statistics will not be available. Where Discoverer has been in use for a while, query statistics will have been gathered by Discoverer. Where query statistics are available they will be used by ASM to create more suitable summary folders.

      • You do not need to make any changes to summary policy settings for a bulk load ASM process. The default settings which are used should be adequate. If changes are made however, these settings then become the defaults.

      How to run ASM using the command line interface

      To run ASM using the command line interface:

      1. From the Start menu choose Run.

      2. Type in the appropriate command.

        For more information about the command line interface, see Chapter 21, "What is the Discoverer command line interface?". For more information about ASM commands and command modifiers see and Chapter 21, "/asm".

      How to run ASM using a batch file and the operating system scheduler

      You can run ASM through the batch file/scheduler facility provided by your operating system. This way you specify when you want ASM to run including the scheduled intervals when you want to repeat the process.

      By using the command line syntax within a batch file the process can be run automatically overnight or on a weekend. This enables the system to maintain itself.

      Before you can run ASM from a batch file you need to do two things:

      1. Create a text file in a text editor (e.g. Notepad).

      2. Using the correct command line syntax, enter the command line details as text into the batch file.

        For more information about ASM command line syntax, see Chapter 21, "/asm".

      3. Save the file as a .bat file (e.g. asmsched.bat).

      4. Use the correct operating system commands to schedule the batch file.

        To learn how to schedule a batch file see your operating system documentation or help.

      How to configure the database for summary folders

      The summary management feature in Discoverer uses native features in the Oracle database management system (DBMS), and is therefore only available when running against the Oracle database. This feature uses the same highly scalable and reliable processing procedures as the workbook scheduling capability and the setup for both features is similar. These procedures use standard packages in the DBMS called DBMS_JOB.

      To enable the processing procedures for summary management in Discoverer you can check the following tasks:

      How to confirm that DBMS_JOB is installed for summary management

      To confirm that DBMS_JOB is installed for summary management:

      1. Log onto SQL*Plus as the database administrator and execute the following SQL statement:

        SQL> select * from all_objects where object_name='DBMS_JOB' and object_type 
        = 'PACKAGE'; 
        

        If the statement returns no rows, use your database administrator SVRMGRL (Oracle 8.0) to create the necessary packages.

      To install DBMS_JOB and create the necessary packages for summary management, for Oracle9i databases:

      1. Log on to SQL*Plus as the database administrator.

      2. Execute the following SQL statement at the command prompt:

        SQL> CONNECT username/password@database AS SYSDBA;
        
        
      3. Execute the following SQL statements:

        SQL> start <ORACLE_HOME>/rdbms/admin/dbmsjob.sql;
        SQL> start <ORACLE_HOME>/rdbms/admin/prvtjob.plb;
        
        

      To install DBMS_JOB and create the necessary packages for summary management, for Oracle databases earlier than Oracle9i:

      1. From Windows choose Start | Run.

      2. Type in one of the following:

        • SVRMGRL (for Oracle 8.0)

        • SVRMGR (for Oracle8i Personal Edition)

      3. When in the DBA facility, type connect internal

      4. Execute the following SQL statements:

        SQL> start <ORACLE_HOME>/rdbms/admin/dbmsjob.sql;
        SQL> start <ORACLE_HOME>/rdbms/admin/prvtjob.plb;
        
        

      How to grant the privileges needed to create summary folders

      You can grant the privileges needed to create summary folders in the following ways:

      Notes

      The <user> below is the userid of the person using Discoverer Administrator.

      Task to grant the privileges needed to create summary folders

      To grant the privileges needed to create summary folders, for Oracle9i databases:

      1. Log on to SQL*Plus as the database administrator.

      2. Execute the following SQL statement at the command prompt:

        SQL> CONNECT username/password@database AS SYSDBA;
        
        
      3. Execute the following SQL statements:

        SQL> grant CREATE TABLE to <user>; 
        SQL> grant CREATE VIEW to <user>; 
        SQL> grant CREATE PROCEDURE to <user>; 
        SQL> grant CREATE ANY MATERIALIZED VIEW to <user>; 
        SQL> grant DROP ANY MATERIALIZED VIEW to <user>; 
        SQL> grant ALTER ANY MATERIALIZED VIEW to <user>; 
        SQL> grant GLOBAL QUERY REWRITE to <user> with admin option; 
        SQL> grant ANALYZE ANY to <user>; 
        SQL> grant SELECT ON V_$PARAMETER to <user>; 
        
        

        Note: To grant SELECT ON V_$PARAMETER you must be logged in as the SYS user. If you are unsure about the SYS user name and password, see your database administrator.

      To grant the privileges needed to create summary folders, for Oracle databases earlier than Oracle9i:

      1. From Windows choose Start | Run (on the database server machine).

      2. Type in one of the following:

        • SVRMGRL (for Oracle 8.0)

        • SVRMGR (for Oracle8i Personal Edition)

      3. When in the DBA facility, type connect internal

      4. Execute the following SQL statements:

        SQL> grant CREATE TABLE to <user>; 
        SQL> grant CREATE VIEW to <user>; 
        SQL> grant CREATE PROCEDURE to <user>; 
        SQL> grant CREATE ANY MATERIALIZED VIEW to <user>; 
        SQL> grant DROP ANY MATERIALIZED VIEW to <user>; 
        SQL> grant ALTER ANY MATERIALIZED VIEW to <user>; 
        SQL> grant GLOBAL QUERY REWRITE to <user> with admin option; 
        SQL> grant ANALYZE ANY to <user>; 
        SQL> grant SELECT ON V_$PARAMETER to <user>; 
        
        

        Note: To grant SELECT ON V_$PARAMETER you must be logged in as the SYS user. If you are unsure about the SYS user name and password, see your database administrator.

      Script to grant the privileges needed to create summary folders against an Oracle 8.1.7 database (or later)

      A script granting privileges required to create summary folders against an Oracle 8.1.7 database (or later) can be found in:

      <ORACLE_HOME>\DISCV902\SQL\eulasm.sql.

      How to determine and reset tablespace quotas

      A database user must have enough quota in their default tablespace to create summary tables. The following tasks enable you to determine and tablespace quotas, if necessary.

      To determine tablespace quotas, for Oracle9i databases:

      1. Log on to SQL*Plus as the database administrator.

      2. Execute the following SQL statement at the command prompt:

        SQL> CONNECT username/password@database AS SYSDBA;
        
        
      3. Execute the following SQL statement:

        SQL> select * from dba_ts_quotas where username = <user>;  
        
        

        where <user> is the userid of the person using Discoverer Administrator.

      To determine tablespace quotas, for Oracle databases earlier than Oracle9i:

      1. From Windows choose Start | Run.

      2. Type in one of the following:

        • SVRMGRL (for Oracle 8.0)

        • SVRMGR (for Oracle8i Personal Edition)

      3. When in the DBA facility, type connect internal

      4. Execute the following SQL statement:

        SQL> select * from dba_ts_quotas where username = <user>;  
        
        

        where <user> is the userid of the person using Discoverer Administrator.

      To reset tablespace quotas:

      1. Reset the tablespace quotas by executing the following SQL statement:

        SQL> alter user <user> quota <n> on <tablespace>;
        
        

        where <user> is the userid of the person using Discoverer Administrator

        where <n> is the quota in K(ilobytes) or M(egabytes) or Unlimited

        where <tablespace> is the default tablespace name e.g. USERS

      How to check object/schema name

      A user must not have an object in their schema with the same name as their user name. This task shows you how to look for any objects in your schema that have the same name as your database user name.

      To check whether there are any objects in your schema with the same name as your user name, do the following:

      1. Login to SQL*Plus as the user.

      2. Execute the following SQL statement:

        SQL> select object_name from user_objects where object_name = 
        <user>;
        
        

      where <user> is the same as the login used for SQL*Plus.

      How to set the start time for summary processing

      The summary management processes run within the database on the server, and are controlled by parameters in the initialization file of the Oracle DBMS - the INIT<SID>.ORA file.

      Limiting the number of processing requests that can run simultaneously

      The parameter job_queue_processes specifies the number of concurrent processes to use to process DBMS_JOB. That is, it controls the number of processing requests that can be handled simultaneously. The default value is zero which means processing requests will NOT be created. You should set it to a minimum of 2, or more if you have any other applications that use DBMS_JOB.

      You need more than one job queue process, because if one job fails for any reason, it may keep getting re-submitted and thus prevent everything else in the queue from being completed. If you wish to have 10 simultaneous processing requests handled then you will need to set this to 10.

      The INIT<SID>.ORA parameter job_queue_interval is the time in seconds which controls how often the job processes process pending jobs. We recommend that you update the 60 second default to at least 10 minutes (a value of 600). Note that this parameter also affects workbook scheduling.

      To enable the above parameters:

      1. Locate the INIT<SID>.ORA file.

        The INIT<SID>.ORA file is held in <ORACLE_HOME>\database. The default name of the file is INITORCL.ORA, where ORCL is the <SID> name.

      2. Enter 2 lines into the file. For example:

        job_queue_processes = 2
        job_queue_interval = 600 (Note: this is equivalent to 10 minutes)
        
        

      Notes

      The summary management and workbook scheduling features both use this scheduling capability within the Oracle DBMS. The interval you specify and the number of concurrent requests affect both features.


Go to previous page Go to next page
Oracle
Copyright © 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index