CREATE SNAPSHOT
CREATE SNAPSHOT [schema
.]snapshot_name
[PCTFREEinteger
] [PCTUSEDinteger
] [INITRANSinteger
] [MAXTRANSinteger
] [LOGGING | NOLOGGING] [CACHE | NOCACHE] [CLUSTERcluster_name
(clustercolumnlist
) ] [TABLESPACEtablespace_name
] [STORAGE ( [INITIALinteger
[K | M] ] [NEXTinteger
[K | M] ] [MINEXTENTSinteger
[K | M] ] [MAXEXTENTS {integer
| UNLIMITED} ] [PCTINCREASEinteger
] [FREELISTSinteger
] [FREELIST GROUPSinteger
] ) ] [NOPARALLEL] [PARALLEL ( {DEGREE {integer
| DEFAULT} | INSTANCES {integer
| DEFAULT} } ) ] [USING INDEX [TABLESPACEtablespace_name
] [PCTFREEinteger
] [INITRANSinteger
] [MAXTRANSinteger
] [STORAGE ( [INITIALinteger
[K | M] ] [NEXTinteger
[K | M] ] [MINEXTENTSinteger
] [MAXEXTENTS {integer
| UNLIMITED} ] [PCTINCREASEinteger
] [FREELISTSinteger
] [FREELIST GROUPSinteger
] ) ] ] [REFRESH [FAST | COMPLETE | FORCE] [START WITHdate
] [NEXTdate
] [WITH PRIMARY KEY] [WITH ROWID] [USING DEFAULT [MASTER | LOCAL ] ROLLBACK SEGMENT] [USING [MASTER | LOCAL] ROLLBACK SEGMENTrollback_segment
] ] [FOR UPDATE ] AS snapshot_query
Creates a snapshot (snapshot_name), which is the result of a query run against one or more tables or views.
Specifies the percentage of space to be reserved in each data block for future updates to rows contained in that block. Valid values are - 99, and the default value is 10.
Specifies the minimum percentage of space that will be maintained as used in each data block. The value may be in the range 1- 99, and the default value is 40.
Specifies the initial number of transaction entries allocated to each block.
Specifies the maximum number of transaction entries allocated to each block.
Specifies that all changes to the snapshot are logged in the redo logs. This is the default.
Specifies that changes to the snapshot are not logged. This improves performance, but requires that the snapshot be recreated from the base tables in the event that the database must be rebuilt.
Specifies that full table scans of the snapshot will be placed at the front of the LRU list. This is useful for small lookup or dimension tables.
Specifies that full table scans of the snapshot will not place data blocks at the start of the LRU list. This is the default.
Specifies that the snapshot is to be created in the specified cluster (cluster_name). Since the cluster has its own storage specifications, do not use the STORAGE clauses with the CLUSTER clause.
Specifies the name of the tablespace in which this snapshot will be created. The default is the default tablespace for the schema owner.
Specifies the physical characteristics of the snapshot as follows:
Specifies the size of the first extent for this snapshot in bytes, kilobytes, or megabytes. If this value is not a multiple of the database blocksize, it will be rounded up to a multiple of the database blocksize.
Specifies the size of the next extent in bytes, kilobytes, or megabytes. If this value is not a multiple of the database blocksize, it will be rounded up to a multiple of the database blocksize.
Specifies the number of extents to be allocated when this snapshot is created. The minimum and default value is 1.
Specifies the maximum number of extents that may be allocated for this snapshot. The default will vary according to the database blocksize. Specify UNLIMITED for unlimited expansion.
Specifies the percentage by which each extent will grow over the previous extent. The default is 50, which means that each extent will be one-and-one-half times larger than the previous extent.
Specifies the number of free lists contained in each freelist group in this snapshot. The default is 1 and the maximum depends on the database blocksize.
Specifies the number of groups of free lists for this snapshot. The default is 1. This parameter should be used only with the Parallel Server option running in parallel mode.
Specifies that no parallel processing will be supported for the snapshot.
Specifies the level of parallelism to be supported, based on the following parameters:
Specifies the degree of parallelism. An integer value specifies how many slave processes can be used. Specify DEFAULT to use the default value for the tablespace.
Specifies the number of instances that can be used to execute slave processes. Specify DEFAULT to use the default value specified for the tablespace.
Specifies the storage parameters for the index that Oracle uses to maintain the snapshot. The TABLESPACE (TABLESPACE tablespace_name) and STORAGE parameters have the meanings shown earlier in the keyword list for the snapshot.
Specifies the mode and times for automatic refreshes. FAST uses the snapshot log associated with the master table; COMPLETE refreshes by reexecuting the snapshot’s query; FORCE is the default, and means that Oracle will either decide that a FAST refresh is possible or do a COMPLETE refresh.
Specifies a date for the next automatic refresh time, using a standard Oracle date expression.
Specifies a new date expression for calculating the interval between automatic refreshes.
Specifies that the snapshot is created as a primary key snapshot. That is, Oracle keeps track of the changes by using the primary key rather than ROWID. This allows the master table to be reorganized without impacting the ability to perform a fast refresh.
Specifies that the snapshot is created as a ROWID snapshot. This is for compatibility with Oracle 7.3.
Specifies the rollback segment to be used as a default if a rollback segment is not explicitly supplied. Select either MASTER (use the default rollback segment at the remote master for the individual snapshot) or LOCAL (use the default rollback segment for the local refresh group that contains the snapshot).
Specifies the rollback segment to use when refreshing the snapshot. Specify either MASTER (the rollback segment to be used at the remote master for the individual snapshot) or LOCAL (the rollback segment to be used for the local refresh group that contains the snapshot).
Allows the simple snapshot to be updated. If used with Oracle8 replication, the changes will be propagated back to the master database.
Provides the actual SQL query used to populate the snapshot, and is subject to the same restrictions as a view.
You must have the CREATE SNAPSHOT privilege to create a snapshot in your own schema, or the CREATE ANY SNAPSHOT privilege to create a snapshot in another schema. In addition, you must have sufficient privileges to create a table, view, and index, since these are created as part of the snapshot creation process, and the owner of the schema containing the snapshot must have appropriate privileges to execute the snapshot’s query.
The script dbmssnap.sql must have been run by SYS to create the SNAPSHOT package before attempting to create a snapshot.
Since Oracle appends 7-character identifiers to the snapshot name when creating snapshot objects in the schema, you should limit the snapshot name to 27 characters or less.