CUCM SQL Magic (well really just queries) – Part 2

So last time we figured out how to read from the CUCM DB directly using SQL statements. This time we’re going to start changing things. So like last time I recommend you take a backup and don’t do anything you think could end in creating a fissure in the space time continuum.

We learned that DN 1234 had a voice mail profile of 16c584ea-6a81-4138-9ea1-af452de8f75a. But maybe we want to change this, to say no voice mail. We learned that this had a PKID of NoVoiceMail 00000000-1111-0000-0000-000000000000. So we just need to update the DN to reflect this. With an easy SQL statement.

run sql update numplan set fkvoicemessagingprofile = ‘00000000-1111-0000-0000-000000000000’ where dnorpattern = ‘1234’

What we’ve said above is update the numplan table and set the fkvoicemessagingprofile field to the value 00000000-1111-0000-0000-000000000000 where the DN is 1234. If all is well you should get the following output:

Rows: 1

Meaning that 1 row in the table was updated. If you go and check in the GUI your new voice mail profile change is reflected. Now it would be easy to break this into a nice long excel document output that in plane text and you’re a copy paste away from easy DB updates that you otherwise couldn’t do in the GUI.

Permanent link to this article:

Leave a Reply