Mark Roethof
Tera Patron
Tera Patron

Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Hi there,


Keeping your instance database footprint tidy? Reducing instance database footprint? An important subject, though actually a subject that barely gets attention. Barely if you search for any content, hardly any replies when reaching out on ServiceNow Community/LinkedIn/Slack/etcetera, and to be honest: also if you look at customers in general... so much focus on Development, so little (or almost no) focus on Platform or System Administration. Also there is not a single ServiceNow course that goes in depth on this subject.


So why is this such an important subject? ServiceNow runs in the cloud, right? Sure (unless you are on-prem of course), though that doesn't mean ServiceNow does everything for you! Keeping your instance database footprint tidy and reducing the database footprint, will have several positive effects: Performance gain, slimmer and optimized tables, less future manageability or technical depth, shorter system clone time (or time to place backups back in case of emergencies!), avoiding licensing implications if your database footprint gets over 4 TB, etcetera.


In the upcoming weeks, I will share several blogs regarding reducing your instance database footprint and keeping your instance database footprint tidy. All based on experiences gained in the field, at several customers, after collaborating with ServiceNow Support, investigating myself, etcetera.


If you have any thoughts yourself on this subject, don't hesitate to share!


Topics in this series of blogs (I will update this section when publishing new blogs):
Maintain Audit Delete and Audit Relation
Maintain Attachments and Attachment Documents
Activating/adding Table cleaners
Reduce (over)auditing
Lower duration Table Rotation
- Drop syslog_trans_prejakarta* tables
Cleanup Shadow tables 

- Maintain Emails

Reclaiming Table Free Space


Shadow tables

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.

 

Database Footprint

In the past (up to about mid-2023), customers were able to get some insight in Shadow tables themselves by requesting a Database Footprint report through the ServiceNow Support website. Unfortunately the Database Footprint report structure was changed by ServiceNow and since then customers don't have any sight on possible Shadow tables anymore. In theory there is still an in platform option to see Shadow tables (Physical Table Stats), though there is a known internal issue at ServiceNow that the Physical Table Stats is not updated correctly.

 

What you could have seen on the Database Footprint report in the past, are examples like below:

 

KYIDFT07_a.png


You can still get insight in Shadow tables, by creating a ServiceNow Support Case. For example like below:

 

KYIDFT07_b.png

 

KYIDFT07_c.png


ServiceNow Support

You also need ServiceNow Support in case you want to take action on Shadow tables. Taking action on Shadow tables because as you might notice in the list of tables, they can take up quite a lot of space (it's not uncommon that this is hundreds of gigabytes or even in terrabytes), tables listed that you are not aware of, tables where rollback won't be used (or not at this moment in time), tables which temporarily got massively big, etcetera. On your request, ServiceNow Support can empty and rebuild Shadow tables (ServiceNow Supports prefers not to drop them)

 

Important note: Shadow tables are NOT automatically rebuild and you don't have an option to do so yourself. If you have ever existing Shadow tables and at some moment in time for whatever reason such a table grows to 250 gigabytes for example, it will always stay 250 gigabytes... until you take action! This is not an assumption I'm making, this has been confirmed by ServiceNow Support. So do create a Support Case to have specific Shadow tables cleaned up and rebuild.

 

Again, it's not uncommon that Shadow tables account for hundreds of gigabytes or even in terrabytes. This is something you do want to take action on when wanting to avoid licensing implications. And perhaps even take action on this regularly, since the Shadow tables mechanism isn't a one-time job to cleanup and never look at again.

 

---

 

That's it. Hope you like it. If any questions or remarks, let me know!

 

C

If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.

 

Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in?
- Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Kind regards,


Mark Roethof

Independent ServiceNow Consultant

4x ServiceNow Developer MVP

4x ServiceNow Community MVP

---

LinkedIn

10 Comments