Data management

Data in your instance is stored and managed according to a principled structure that administrators can view and configure. Data management functions include importing, exporting, and archiving database data and configuring fields and tables.

Database structure

All of the information in the instances is stored in tables, which consist of a series of records. The record in turn holds a series of fields that hold the individual bits of data and can be viewed either as a list or a form.

Tables can be related to each other in the following ways:
A table can extend another table. The table doing the extending (child class) includes all of the fields of the other table (parent class) and adds its own fields. For instance, the Incident [incident] table has all of the Task [task] table fields (because an incident is a special form of task) and has its own incident-specific tasks.
Within a table, a field can hold a reference to a record on another table. There are three types of one-to-many relationship fields:
  • Reference Field: allow a user to select a record on a table defined by the reference field. For instance, the Caller field on the Incident table allows the user to select any record on the User table.
  • Glide List: allows a user to select multiple records on a table defined by the glide list. For instance, the Watch list field on the Incident table allows the user to select records on the User table.
  • Document ID Field: allows a user to select a record on any table in the instance. These fields are much less common, but one example is the Document field on the Translated Text [sys_translated_text] table.
Two tables can have a bi-directional relationship, so that the related records are visible from both tables in a related list.
Database Views
Two tables can be joined virtually with Database Views to enable reporting on data that might be stored over more than one table.

Data management tools

There are a number of tools that can help manage data within the instance.

Schema map

The Schema Map displays the relationships between tables visually, helping to navigate through the database structure.

The Schema Map provides an interface for viewing the relationships between tables. The inter-table relationships it captures include many-to-many relationships, tables that extend other tables, and tables that reference other tables through reference fields.

Data dictionary tables

Data dictionary tables holds information that defines the database and can be accessed for information on the database schema.

These tables hold important information on the database and its structure:

  • Tables [sys_db_object]: contains a record for each table.
  • Dictionary Entries [sys_dictionary]: contains additional details for each table and the definition for every column on each table. Each row represents either a column on a table or a table.
  • Field Labels [sys_documentation]: contains the human-readable labels and language information.
The table cleaner

Table cleaner automatically deletes records on certain tables to prevent data growing exponentially.

ServiceNow automatically deletes records from specific tables after a specific time to deletion. Deleting these records automatically prevents the tables from growing to an unmanageable size. The time before a record is deleted begins on the date and time value in the tracked field.

The Table Cleaner scheduled job runs the table cleaner every hour. To view the list of tables that are auto-cleaned, in the Navigator filter, type:

All records with [MatchField < (current_time - Age in seconds)] are deleted.
  • The MatchField field represents a Date/Time column in the table that you are trying to clean up.
  • The Age in seconds field represents a value in seconds.
You can set up multiple table cleaner entries for a particular table. Performance depends on the size of the table and the conditions used. For example, if you use a custom column in a very large table that has no index on, performance is severely degraded. Performance also depends on the number of rows to be deleted.
Table 1. Cleaned tables
Table Tracked field Time to deletion
sys_poll sys_created_on 1 day
cmdb_metric sys_created_on 2 days
ecc_agent_metric sys_created_on 30 days
v_transaction sys_created_on 1 day
wf_context ended 180 days
sys_cache_flush sys_created_on 1 hour
sys_replication_queue sys_created_on 1 day
sysevent sys_created_on 7 days
ecc_queue sys_created_on 30 days
syslog sys_created_on 90 days
sys_querystat sys_created_on 30 days
plan_execution sys_created_on 30 days
sys_user_session last_accessed 1 day
sys_user_preference sys_updated_on 1 day
sys_history_set sys_updated_on 30 days
label_history sys_created_on 30 days
ts_search_summary sys_created_on 30 days
sys_cluster_message sys_created_on 1 day
cmdb_tcp_connection sys_updated_on 30 days
cmdb_running_process sys_updated_on 30 days

Data management plugins

Plugin Description
Data Archiving Provides the ability to archive records to minimize performance issues.
Database Rotations Provides tools for managing large tables to minimize performance issues.
Many to Many task relations Provides the ability to define many-to-many relationships between task tables.