Skip navigation links

Oracle® OLAP Java API Reference
11g Release 1 (11.1)

B28128-02


oracle.olapi.metadata.deployment
Class MVCreationOptions

java.lang.Object
  extended by oracle.olapi.metadata.BaseMetadataObject
      extended by oracle.olapi.metadata.deployment.MVCreationOptions

All Implemented Interfaces:
MetadataObject

public class MVCreationOptions
extends BaseMetadataObject

A BaseMetadataObject that contains options that Oracle OLAP uses when it creates a materialized view (MV) for an analytic workspace cube or dimension. You create an MVCreationOptions with the findOrCreateMVCreationOptions method of an AWCubeOrganization or an AWPrimaryDimensionOrganization.

The setMVOption method of an AWCubeOrganization or an AWPrimaryDimensionOrganization specifies the type of MV to create. If you do not create an MVCreationOptions object, then Oracle OLAP uses default option values when it creates the MV. With an MVCreationOptions you can specify values for the options. You can specify the type of method, the mode, and the type of constraints to use for the refreshing of the MV.

You specify a refresh method type by using the setRefreshType method. The refresh method types are the following:

You specify a refresh mode with the setRefreshOnOption or the setRefreshStartWithExpression and the setRefreshNextExpression methods. If you specify a Refresh On mode, then do not specify a Refresh Starts With and Refresh Next mode. If you specify a Refresh Starts With and Refresh Next mode, then do not specify a Refresh On mode.

The refresh modes are the following:

Another aspect of creating an MV is to specify the whether or not to use enforced or trusted constraints when refreshing the MV. Trusted constraints can result in a more efficient refresh operation. However, if the trusted constraint information is invalid, then the refresh procedure may corrupt the MV. You specify the type of constraint with the setUsingConstraints method.

You can also specify whether or not to enable the creation of a materialized view for use by the database query rewrite system. The query rewrite system redirects queries for summary data from the master tables to the MV. You use the setEnableRewriteMV method to specify whether or not to create an MV that is accessible to the query rewrite system.

For more information about how these options affect the creation of an MV, see the create_mv_refresh clause of the CREATE MATERIALIZED VIEW statement in Oracle Database SQL Language Reference.


Field Summary
static java.lang.String REFRESH_ON_COMMIT
          A constant that represents the refresh on commit mode, which indicates that a refresh occurs when the database commits a transaction that affects a source table.
static java.lang.String REFRESH_ON_DEFAULT
          A constant that represents the refresh on default mode, which indicates that a refresh occurs on the default setting.
static java.lang.String REFRESH_ON_DEMAND
          A constant that represents the refresh on demand mode, which indicates that a refresh occurs on demand.
static java.lang.String REFRESH_TYPE_COMPLETE
          A constant that represents a complete refresh method type.
static java.lang.String REFRESH_TYPE_DEFAULT
          A constant that represents the default refresh method type.
static java.lang.String REFRESH_TYPE_FAST
          A constant that represents a fast refresh method type.
static java.lang.String REFRESH_TYPE_FORCE
          A constant that represents a force refresh method type.
static java.lang.String[] VALID_REFRESH_ON_OPTIONS
          A constant that indicates the valid values for the conditions that initiate a refresh.
static java.lang.String[] VALID_REFRESH_TYPES
          A constant that has the valid values for the refresh method type.

 

Method Summary
 boolean enableRewriteMV()
          Indicates whether this MVCreationOptions specifies the creation of an MV for use by the database query rewrite system.
 java.lang.String getRefreshNextExpression()
          Gets the expression that indicates when the next refresh of the MV occurs.
 java.lang.String getRefreshOnOption()
          Gets the mode that Oracle OLAP uses to determine when to refresh the data for the MV that is associated with the dimension or cube.
 java.lang.String getRefreshStartWithExpression()
          Gets the expression that indicates when the initial refresh of the MV occurs.
 java.lang.String getRefreshType()
          Gets a value that indicates the type of refresh method specified by this MVCreationOptions.
 java.lang.String getUsingConstraints()
          Gets the value of the setting that specifies whether a refresh operation uses enforced or trusted contraints.
 void setEnableRewriteMV(boolean val)
          Specifies whether or not to create an MV for use by the database query rewrite system.
 void setRefreshNextExpression(java.lang.String exp)
          Specifies an expression that determines the interval between automatic refreshes.
 void setRefreshOnOption(java.lang.String option)
          Specifies the mode that Oracle OLAP uses to determine when to refresh the MV.
 void setRefreshStartWithExpression(java.lang.String exp)
          Specifies an expression that determines when the initial automatic refresh of the MV occurs.
 void setRefreshType(java.lang.String type)
          Specifies the type of refresh method that the database uses when it refreshes the MV that is associated with the cube or dimension.
 void setUsingConstraints(java.lang.String exp)
          Specifies whether to use enforced or trusted constraints for refreshing the MV.

 

Methods inherited from class oracle.olapi.metadata.BaseMetadataObject
getID, getOwner

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

REFRESH_TYPE_FAST

public static final java.lang.String REFRESH_TYPE_FAST
A constant that represents a fast refresh method type.
See Also:
Constant Field Values

REFRESH_TYPE_COMPLETE

public static final java.lang.String REFRESH_TYPE_COMPLETE
A constant that represents a complete refresh method type.
See Also:
Constant Field Values

REFRESH_TYPE_FORCE

public static final java.lang.String REFRESH_TYPE_FORCE
A constant that represents a force refresh method type.
See Also:
Constant Field Values

REFRESH_TYPE_DEFAULT

public static final java.lang.String REFRESH_TYPE_DEFAULT
A constant that represents the default refresh method type.
See Also:
Constant Field Values

VALID_REFRESH_TYPES

public static final java.lang.String[] VALID_REFRESH_TYPES
A constant that has the valid values for the refresh method type.

VALID_REFRESH_ON_OPTIONS

public static final java.lang.String[] VALID_REFRESH_ON_OPTIONS
A constant that indicates the valid values for the conditions that initiate a refresh.

REFRESH_ON_DEFAULT

public static final java.lang.String REFRESH_ON_DEFAULT
A constant that represents the refresh on default mode, which indicates that a refresh occurs on the default setting.
See Also:
Constant Field Values

REFRESH_ON_DEMAND

public static final java.lang.String REFRESH_ON_DEMAND
A constant that represents the refresh on demand mode, which indicates that a refresh occurs on demand.
See Also:
Constant Field Values

REFRESH_ON_COMMIT

public static final java.lang.String REFRESH_ON_COMMIT
A constant that represents the refresh on commit mode, which indicates that a refresh occurs when the database commits a transaction that affects a source table.
See Also:
Constant Field Values

Method Detail

enableRewriteMV

public final boolean enableRewriteMV()
Indicates whether this MVCreationOptions specifies the creation of an MV for use by the database query rewrite system.
Returns:
A boolean that is true if the MV can be used by the query rewrite system or false otherwise.

setEnableRewriteMV

public final void setEnableRewriteMV(boolean val)
Specifies whether or not to create an MV for use by the database query rewrite system. With the setMVOption method of an AWCubeOrganization, you can specify that Oracle OLAP create a rewrite MV. However, if you then specify false with this method, Oracle OLAP does not actually make the MV available to the query rewrite system. You could later use this method to change the MVCreationOptions to specify true and then rebuild the cube. The MV would then be available to the query rewrite system.
Parameters:
val - A boolean that is true to enable the creation of a rewrite MV or false to disable the creation of one.

getRefreshType

public final java.lang.String getRefreshType()
Gets a value that indicates the type of refresh method specified by this MVCreationOptions.
Returns:
A String that contains the type of refresh method for the MV.

setRefreshType

public final void setRefreshType(java.lang.String type)
Specifies the type of refresh method that the database uses when it refreshes the MV that is associated with the cube or dimension. The following table lists the constants that represent the valid values for the type parameter.
Constant Description
REFRESH_TYPE_COMPLETE Refresh all of the data for the cube.
REFRESH_TYPE_FAST Refresh only the data for the cube that needs to change due to changes to the relational source master tables. A fast refresh is possible only if the master tables support the operation. If fast refresh is not possible, the operation does not succeed.
REFRESH_TYPE_FORCE Perform a fast refresh if possible, otherwise perform a complete refresh.
REFRESH_TYPE_DEFAULT Use the default refresh type, which is FORCE.
Parameters:
type - A String that contains a refresh method type for the MV.

getRefreshStartWithExpression

public final java.lang.String getRefreshStartWithExpression()
Gets the expression that indicates when the initial refresh of the MV occurs.
Returns:
A String that contains an expression that indicates when the initial refresh of the MV occurs.

setRefreshStartWithExpression

public final void setRefreshStartWithExpression(java.lang.String exp)
Specifies an expression that determines when the initial automatic refresh of the MV occurs. You specify a time interval for the next automatic refresh with the setRefreshNextExpression method. If you specify a time to start automatic refreshes but you do not specify time for the next refresh, then the automatic refresh occurs only once, at the time specified by this method.

If you specify a time to start automatic refreshes, then you should not specify a Refresh On mode.

Parameters:
exp - A String that contains an expression that evaluates to a future datetime value.

getRefreshNextExpression

public final java.lang.String getRefreshNextExpression()
Gets the expression that indicates when the next refresh of the MV occurs.
Returns:
A String that contains an expression that indicates when the next refresh of the MV occurs.

setRefreshNextExpression

public final void setRefreshNextExpression(java.lang.String exp)
Specifies an expression that determines the interval between automatic refreshes. If you specify a next refresh time, then you should also set the time for the initial refresh with the setRefreshStartWithExpression method. If you do not set the time for the initial refresh, then the database determines the first automatic refresh time by evaluating the expression specified by this method in relation to the creation time of the MV.

If you specify a time inteval for automatic refreshes, then you should not specify a Refresh On mode.

Parameters:
exp - A String that contains an expression that evaluates to a future datetime value.

getRefreshOnOption

public final java.lang.String getRefreshOnOption()
Gets the mode that Oracle OLAP uses to determine when to refresh the data for the MV that is associated with the dimension or cube.
Returns:
A String that contains the mode that determines when Oracle OLAP refreshes the data in the MV.

setRefreshOnOption

public final void setRefreshOnOption(java.lang.String option)
Specifies the mode that Oracle OLAP uses to determine when to refresh the MV. The following table lists the constants that represent the valid values for the option parameter.
Constant Description
REFRESH_ON_DEMAND Specifies that Oracle OLAP refreshes the MV on demand.
REFRESH_ON_COMMIT Specifies that Oracle OLAP refreshes the MV when the database commits a transaction that affects a master table.
REFRESH_ON_DEFAULT Specifies that Oracle OLAP refreshes the MV on the default setting, which is On Demand.

If you specify a Refresh On mode, then you should not specify a Starts With or Next time period for automatic refreshes.

Parameters:
option - A String that contains a refresh on option for the cube.

getUsingConstraints

public final java.lang.String getUsingConstraints()
Gets the value of the setting that specifies whether a refresh operation uses enforced or trusted contraints.
Returns:
A String that contains ENFORCED or TRUSTED.

setUsingConstraints

public final void setUsingConstraints(java.lang.String exp)
Specifies whether to use enforced or trusted constraints for refreshing the MV. Trusted constraints can result in more a efficient refresh operation. However, if the trusted constraint information is invalid, then the refresh procedure may corrupt the MV.
Parameters:
exp - A String that contains ENFORCED or TRUSTED.

Skip navigation links

Copyright © 2002, 2007, Oracle. All rights reserved.