To a client application, versioned data appears much the same as unversioned data: versioned tables and feature classes look like the unversioned tables and feature
classes. A table or feature class viewed in one version will contain a certain number of rows, and the same table or feature class in another version may contain a
different number of rows, giving the impression that each version is a separate copy of the data.
However, instead of creating a new copy of, or modifying the original data, the geodatabase leaves the versioned table or feature class in its original form and
stores any changes to that data in separate geodatabase system tables. The geodatabase system tables that record version changes are referred to as the delta tables. For
each table or feature class that has been versioned, two new delta tables, an Adds and a Deletes table, are created.
These delta tables record any changes (new, modified, or deleted
records) made to that table or feature class at each state of the database. To
correctly represent each database version, these tables are queried, in
conjunction with the Versions and State_Lineages tables, to identify which
change was made at which database state. A version will then return a seamless
view of the data that takes into account the original state of the data plus any
changes.
The Adds table stores all
additions and modifications to the base table. This table has the same
schema as the base table with the addition of the SDE_state_ID column.
Thus, the Adds table maintains a copy of each row inserted into the table under a specific
state. Each column in the base table is duplicated in the addition table. The SDE_state_ID column indicates
the state the row was added for; the Row_ID (or ObjectID) column is already
defined in the base table schema and has been repeated here for emphasis.
The Row_ID column is named as defined by the TABLE_REGISTRY entry for
each versioned table.
The Adds table has the following columns:
SDE_state_ID |
The state to which the feature belongs |
row_id OR ObjectID |
The unique identifier for the row |
other columns |
Existing columns in the table |
For each versioned table
in the database, there is an associated deletion table. This table is
named D<registration_id> and is created when versioning is enabled on
the table. The Deletes table stores all
deleted and modified row references and thus maintains a list of all features that are
deleted or modified in the versioned table; SDE_state_ID and SDE_Deletes_Row_ID
form a unique key for the feature or row to be deleted. The Deleted_At
indicates the state that is requesting the modification.
The Deletes table has the following columns:
SDE_state_ID |
The state from which the row is being
deleted |
SDE_Deletes_Row_ID |
The unique ID of the row being updated
or deleted |
Deleted_At |
The state that is making the
modification |
The versioned view is optional
and reconstructs the contents of the versioned table for a specified version of
the database. This view is what applications other than ArcSDE will see as the
versioned table, and should have a descriptive name. This view is constructed
from a set a queries and SQL packages that use the base, additions, and
deletions table for data.
Applications access the versioned view by setting the desired version in
the database using the supplied SQL Stored Procedure sde_version_util.set_current_version
('version name') function in the ArcSDE client library. Once set, all
operations will be against the specified version of the database. If no
version is set using this function, the DEFAULT version will be used. See
ArcGIS Server or ArcGIS Desktop help topic
What are multiversioned views for stored procedure names and syntax for your
DBMS.
The base (business) table points
to the state 0 of the data. It is the original DBMS table that will become a multiversioned table. The Base table must
have an ArcSDE maintained row-id column. If an ArcSDE maintained row-id
column already exists in the table, no additional columns are added to
the base table. If there is no ArcSDE maintained row-id column, this column
must be created or an existing column must be registered as the row-id
column. If the table contains an integer column, this column can be used
as the row-id column as long as the values in this column are non-empty,
unique values. The sdetable -o register command is used to create a new column
or use an existing column as the ArcSDE maintained row-id column. A base
table supports versions when it is registered as a multiversioned table
in the TABLE_REGISTRY, and the associated state additions, deletions,
and multiversioned view tables have been created.
<table_columns> |
Existing columns in the table. |
|