what is a $sh table

rahul1359
Tera Contributor

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

4 REPLIES 4

Rahul Kumar17
Tera Guru
Hi, Go for this link https://community.servicenow.com/community?id=community_question&sys_id=087ac3e9db5cdbc01dcaf3231f961956
If my response helped please mark it correct and close the thread.

Thanks,
Rahul Kumar

rahul1359
Tera Contributor

@ rahul i have visited that link before but it doesn't explain what is that table and why is i created?

Dipu Joy
ServiceNow Employee
ServiceNow Employee

Shadow tables are created for Rollback contexts

https://docs.servicenow.com/bundle/orlando-platform-administration/page/administer/table-administrat...

 

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.

Amit Sontakke
ServiceNow Employee
ServiceNow Employee

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.