what is a $sh table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2019 01:14 PM
what is a $sh table which i can see them in our dev and prod instance, can any anyone out some light on what they are and what is the purpose of it, they are all created automatically by admin or system

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2019 01:26 PM
Thanks,
Rahul Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2019 05:24 PM
@ rahul i have visited that link before but it doesn't explain what is that table and why is i created?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2020 03:58 PM
Shadow tables are created for Rollback contexts
When the records are deleted from task table, sh$task table will be created and all the records will be saved there to be used; if you hit Rollback.
There is a rollback expiration property which will cleanse the table by creating a scheduled job.
If your instance have frequent task record deletion's, sh$task table will stay there forever as new data will be coming in before reaching its expiration and that info will be appended to the same sh$table.
Deletion of that table is not a good idea if you are looking to Rollback the deleted data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2025 03:24 AM
When records are deleted, (in general) a Shadow table will be created (a table with prefix "sh$", for example "sh$cmdb_ci_computer") and all the records will be saved there. Records which can be used in case of a rollback. In normal circumstances, these records will be cleaned up after several days. If your instance has frequent record deletions to the same table though, the Shadow table will stay there forever as new data will be coming in before reaching its expiration and that info will be appended to the same Shadow table.
In case you are looking to Rollback data, ServiceNow states that deletion of the Shadow table concerned is not a good idea.