Oracle8i SQL Reference
Release 2 (8.1.6)

A76989-01

Library

Product

Contents

Index

Prev Up Next

SQL Statements (continued), 9 of 17


ALTER MATERIALIZED VIEW LOG / SNAPSHOT LOG

Syntax


physical_attributes_clause::=


storage_clause: See "storage_clause".

partitioning_clauses: See "ALTER TABLE".

allocate_extent_clause::=


parallel_clause::=


Purpose

To alter the storage characteristics, refresh mode or time, or type of an existing materialized view log. A materialized view log is a table associated with the master table of a materialized view.

The terms snapshot and materialized view are synonymous. Both refer to a table that contains the results of a query of one or more tables, each of which may be located on the same or on a remote database.

See Also:

 

Prerequisites

Only the owner of the master table or a user with the SELECT privilege for the master table can alter a materialized view log.

See Also:

Oracle8i Replication for detailed information about the prerequisites for ALTER SNAPSHOT LOG

Keywords and Parameters

schema 

is the schema containing the master table. If you omit schema, Oracle assumes the materialized view log is in your own schema.  

table 

is the name of the master table associated with the materialized view log to be altered.  

physical_attributes_clause 

changes the value of PCTFREE, PCTUSED, INITRANS, and MAXTRANS parameters for the table, the partition, the overflow data segment, or the default characteristics of a partitioned table. For a description of these parameters, see "CREATE TABLE". See also the "Storage Example"

partitioning_clauses 

The syntax and general functioning of the partitioning clauses is the same as for the ALTER TABLE statement; see "ALTER TABLE".

Restrictions:

  • You cannot use the LOB_storage_clause or modify_LOB_storage_clause when modifying a materialized view log.

  • If you attempt to drop, truncate, or exchange a materialized view log partition, Oracle raises an error.

 

parallel_clause 

specifies whether parallel operations will be supported for the materialized view log. For additional information, see the Notes to the parallel_clause of "CREATE TABLE"

 

NOPARALLEL 

specifies serial execution. 

 

PARALLEL  

causes Oracle to select a degree of parallelism equal to the number of CPUs available on all participating instances times the value of the PARALLEL_THREADS_PER_CPU initialization parameter. 

 

PARALLEL integer 

specifies the degree of parallelism, which is the number of parallel threads used in the parallel operation. Each parallel thread may use one or two parallel execution processes. Normally Oracle calculates the optimum degree of parallelism, so it is not necessary for you to specify integer

LOGGING | NOLOGGING 

specifies the logging attribute. For information about specifying this attribute, see "ALTER TABLE"

allocate_extent_clause 

explicitly allocates a new extent for the materialized view log.

See Also: "ALTER TABLE"

CACHE | NOCACHE 

For data that will be accessed frequently, CACHE specifies that the blocks retrieved for this log are placed at the most recently used end of the LRU list in the buffer cache when a full table scan is performed. This attribute is useful for small lookup tables. NOCACHE specifies that the blocks are placed at the least recently used end of the LRU list.

See Also: "ALTER TABLE" for information about specifying CACHE or NOCACHE

ADD 

augments the materialized view log so that it records the primary key values or rowid values when rows in the materialized view master table are updated. This clause can also be used to record additional filter columns.

To stop recording any of this information, you must first drop the materialized view log and then re-create it. Dropping the materialized view log and then re-creating it forces each of the existing materialized views that depend on the master table to complete refresh on its next refresh. 

 

PRIMARY KEY 

specifies that the primary-key values of all rows that are updated should be recorded in the materialized view log. 

 

ROWID 

specifies that the rowid values of all rows that are updated should be recorded in the materialized view log. 

 

filter_column(s) 

specifies that the values of these columns should be recorded in the materialized view log for all rows that are updated. Filter columns are non-primary-key columns referenced by materialized views. For information about filter columns, see Oracle8i Replication.  

NEW VALUES 

specifies whether Oracle saves both old and new values in the materialized view log. 

 

INCLUDING 

saves both new and old values in the log. If this log is for a table on which you have a single-table materialized aggregate view, and if you want the materialized view to be eligible for fast refresh, you must specify INCLUDING

 

EXCLUDING 

disables the recording of new values in the log. You can use this clause to avoid the overhead of recording new values. However, do not use this clause if you have a fast-refreshable single-table materialized aggregate view defined on this table. 

Examples

Storage Example

The following statement changes the MAXEXTENTS value of a materialized view log:

ALTER MATERIALIZED VIEW LOG ON dept  
   STORAGE MAXEXTENTS 50;
PRIMARY KEY Example

The following statement alters an existing rowid materialized view log to also record primary key information:

ALTER MATERIALIZED VIEW LOG ON sales 
   ADD PRIMARY KEY;


Prev Up Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index