Oracle8i Supplied Packages Reference Release 8.1.5 A68001-01 |
|
DBMS_SNAPSHOT
enables you to refresh snapshots that are not part of the same refresh group and purge logs.
Subprogram | Description |
---|---|
BEGIN_TABLE_REORGANIZATION procedure |
Performs a process to preserve snapshot data needed for refresh. |
END_TABLE_REORGANIZATION |
Ensures that the snapshot data for the master table is valid and that the master table is in the proper state. |
I_AM_A_REFRESH function |
Returns the value of the |
PURGE_DIRECT_LOAD_LOG procedure |
Purges rows from the direct loader log after they are no longer needed by any snapshots (used with data warehousing). |
PURGE_LOG procedure |
Purges rows from the snapshot log. |
PURGE_SNAPSHOT_FROM_LOG procedure |
Purges rows from the snapshot log. |
REFRESH procedure |
Refreshes a list of snapshots. |
REFRESH_ALL_MVIEWS procedure |
Refreshes all snapshots that have not been refreshed because the most recent bulk load to a dependent detail table. |
REFRESH_DEPENDENT procedure |
Refreshes all table-based snapshots that depend on a specified detail table or list of detail tables. |
REGISTER_SNAPSHOT procedure |
Enables the administration of individual snapshots. |
UNREGISTER_SNAPSHOT procedure |
Enables the administration of individual snapshots. Invoked at a master site to unregister a snapshot. |
This procedure performs a process to preserve snapshot data needed for refresh. It must be called before a master table is reorganized.
DBMS_SNAPSHOT.BEGIN_TABLE_REORGANIZATION ( tabowner IN VARCHAR2, tabname IN VARCHAR2);
Parameter | Description |
---|---|
tabowner |
Owner of the table being reorganized. |
tabname |
Name of the table being reorganized. |
This procedure must be called after a master table is reorganized. It ensures that the snapshot data for the master table is valid and that the master table is in the proper state.
DBMS_SNAPSHOT.END_TABLE_REORGANIZATION ( tabowner IN VARCHAR2, tabname IN VARCHAR2);
Parameter | Description |
---|---|
tabowner |
Owner of the table being reorganized. |
tabname |
Name of the table being reorganized. |
This function returns the value of the I_AM_REFRESH
package state.
DBMS_SNAPSHOT.I_AM_A_REFRESH RETURN BOOLEAN;
None
A return value of TRUE
indicates that all local replication triggers for snapshots are effectively disabled in this session because each replication trigger first checks this state. A return value of FALSE
indicates that these triggers are enabled.
This procedure remove entries from the direct loader log after they are no longer needed for any known snapshot (materialized view). This procedure will usually be used in environments using Oracle's Data Warehousing technology.
DBMS_SNAPSHOT.PURGE_DIRECT_LOAD_LOG;
None.
This procedure purges rows from the snapshot log.
DBMS_SNAPSHOT.PURGE_LOG ( master IN VARCHAR2, num IN BINARY_INTEGER := 1, flag IN VARCHAR2 := 'NOP');
This procedure is called on the master site to delete the rows in snapshot refresh related data dictionary tables maintained at the master site for the specified snapshot identified by its snapshot_id
or the combination of the snapowner
, snapname
, and the snapsite
. If the snapshot specified is the oldest snapshot to have refreshed from any of the master tables, then the snapshot log is also purged. This procedure does not unregister the snapshot.
In case there is an error while purging one of the snapshot logs, the successful purge operations of the previous snapshot logs are not rolled back. This is to minimize the size of the snapshot logs. In case of an error, this procedure can be invoked again until all the snapshot logs are purged.
DBMS_SNAPSHOT.PURGE_SNAPSHOT_FROM_LOG ( snapshot_id IN BINARY_INTEGER | snapowner IN VARCHAR2, snapname IN VARCHAR2, snapsite IN VARCHAR2);
This procedure refreshes a list of snapshots.
DBMS_SNAPSHOT.REFRESH ( { list IN VARCHAR2, | tab IN OUT DBMS_UTILITY.UNCL_ARRAY,} method IN VARCHAR2 := NULL, rollback_seg IN VARCHAR2 := NULL, push_deferred_rpc IN BOOLEAN := TRUE, refresh_after_errors IN BOOLEAN := FALSE, purge_option IN BINARY_INTEGER := 1, parallelism IN BINARY_INTEGER := 0, heap_size IN BINARY_INTEGER := 0, atomic_refresh IN BOOLEAN := TRUE);
This procedure refreshes all snapshots (materialized views) with the following properties:
DBA_MVIEW_ANALYSIS
.
This procedure is intended for use with data warehouses.
DBMS_SNAPSHOT.REFRESH_ALL_MVIEWS ( number_of_failures OUT BINARY_INTEGER, method IN VARCHAR2 := NULL, rollback_seg IN VARCHAR2 := NULL, refresh_after_errors IN BOOLEAN := FALSE, atomic_refresh IN BOOLEAN := TRUE);
This procedure refreshes all snapshots (materialized views) with the following properties:
DBA_MVIEW_ANALYSIS
.
This procedure is intended for use with data warehouses.
DBMS_SNAPSHOT.REFRESH_DEPENDENT ( number_of_failures OUT BINARY_INTEGER, { list IN VARCHAR2, | tab IN OUT DBMS_UTILITY.UNCL_ARRAY,} method IN VARCHAR2 := NULL, rollback_seg IN VARCHAR2 := NULL, refresh_after_errors IN BOOLEAN := FALSE, atomic_refresh IN BOOLEAN := TRUE);
This procedure enables the administration of individual snapshots.
DBMS_SNAPSHOT.REGISTER_SNAPSHOT ( snapowner IN VARCHAR2, snapname IN VARCHAR2, snapsite IN VARCHAR2, snapshot_id IN DATE | BINARY_INTEGER, flag IN BINARY_INTEGER, qry_txt IN VARCHAR2, rep_type IN BINARY_INTEGER := DBMS_SNAPSHOT.REG_UNKNOWN);
This procedure is executed at the master site, and can be done by a remote procedure call. If REGISTER_SNAPSHOT
is called multiple times with the same SNAPOWNER
, SNAPNAME
, and SNAPSITE
, then the most recent values for SNAPSHOT_ID
, FLAG
, and QUERY_TXT
are stored. If a query exceeds the maximum VARCHAR2
size, then QUERY_TXT
contains the first 32000 characters of the query and the remainder is truncated. When invoked manually, the values of SNAPSHOT_ID
and FLAG
have to be looked up in the snapshot views by the person who calls the procedure.
If you do not want the snapshot query registered at the master site, then call the SET_REGISTER_QUERY_TEXT
procedure with the option set to FALSE
. To see the most recent setting of the option, call the GET_REG_QUERY_TEXT_FLAG
function at the snapshot site before issuing the DDL.
This procedure enables the administration of individual snapshots. Invoked at a master site to unregister a snapshot.
DBMS_SNAPSHOT.UNREGISTER_SNAPSHOT ( snapowner IN VARCHAR2, snapname IN VARCHAR2, snapsite IN VARCHAR2);
Parameters | Description |
---|---|
snapowner |
Owner of the snapshot. |
snapname |
Name of the snapshot. |
snapsite |
Name of the snapshot site. |