Add the archive class to a map
The archive class is created and maintained by the geodatabase when a dataset or class is enabled for archiving. It can be added to a map for viewing and querying.
To add an archive class to a map, complete the following steps:
- Highlight an archive-enabled layer or table in the Contents pane.
- On the contextual Feature Layer tab set, select the Data tab.
- Click the Add Archive button in the Archiving group.
If the layer selected in the Contents pane is not enabled with archiving, this button will be unavailable.
A new class is added to the Contents pane with the same name as the originally selected layer but with Archive appended to the end.
Adding the archive class to the map allows you to work directly with the archive. The archive class displays every modification since archiving was enabled. The archive class cannot be edited and is for analysis purposes only.
You can symbolize the layer to help with your analysis. For example, using the GDB_FROM_DATE field as the value field for your symbology color codes the features in the layer based on the time they were last updated.
Query the archive
There are two types of queries that satisfy most questions addressing a class's history: moment and range.
Moment queries are used to query a specific moment in time, which is the same as working with a historical version and connecting to the date and time of interest. These queries are helpful when trying to determine how the data looked at a specific moment or what was in a particular location at a given moment.
Range queries work with the data over a span of time between two moments, a starting moment and an ending moment. These queries allow you to view how a feature or location has changed through time. By looking at time ranges, you can track how an object has been updated throughout its lifetime. This shows you how the data has evolved and allows you to see and compare changes in an object.
Both moment and range queries can be constructed in the definition query builder.
To perform a query using the query builder, right-click the archive class, choose Properties, and click the Definition Query tab.
If you are interested in seeing a specific feature at a specific time, refer to its object ID and enter the appropriate date and time. The following is an example of this type of moment query:
OBJECTID is Equal to 23 AND GDB_FROM_DATE is Before '10/10/2016 9:00:00 AM' and GDB_TO_DATE is After '10/10/2016 9:00:00 AM'
The syntax of the GDB_FROM_DATE and GDB_TO_DATE fields may differ depending on how the database is storing dates. Choose one of these fields and click the combo box drop-down arrow next to the calender icon to see the values and syntax of the date field. You can then build queries using these values or provide your own dates of interest.
The archive class fields GDB_FROM_DATE and GDB_TO_DATE can also be used to construct a query for a time range. For example, to see how a geographic area changed between May 2, 2014, and May 2, 2016, you could construct the following query:
GDB_FROM_DATE > '5/2/2014 12:00:00 PM' AND GDB_FROM_DATE < '5/2/2016 12:00:00 PM'
This returns all rows inserted and updated between these dates.
It is possible to detect all insertions, updates, and deletions between two moments. Developers interested in detecting these types of changes should refer to the IVersionedTable interface in the software development kit.
Note:Directly modifying the archive class can lead to inconsistencies within the archived data. Using ArcGIS, access to the archive class is read-only.
Rename the archive class
To change the name of an archive class, complete the following steps:
- Right-click the feature class or table in the Contents pane.
- Click Properties.
- Click the General tab.
- On the Name dialog box, type a new name for the archive class.
- Click OK.