Using SQL to clean up Call Manager pt2

See Part1:

Previously we had around 700 dependencies on a CSS that no longer fits our standard. This CSS was in use by lines, devices, and users throughout the system. In part 1 we removed this css from the users, now we need to do the same for the devices.

As before, we’ll start with a count.
dependency record count
Next, we will check for the pkid of the callingsearchspace to be removed
css pkid
Now, let’s check one of our devices from the 22 and see WHERE the css is being used.
gui device check for css in use
We see our selected device is using it as the rerouting CSS, we will want to see if it’s being used in the same spot once we know the column name. We’ll need to check our datadictionary to see what the column name for the rerouting calling search space is on a device. Since we’re working with a device, we know to look under the device table.
data dictionary entry under table: device
We found something promising, let’s verify this is the correct column.
verifying the column
Luckily, it is being used on all 22 devices in the same place, this makes the clean up extremely easy. We’ll grab the PKID for the CSS we are changing too and then apply to a single phone.
pkid for new css
and applying
apply change to single device
We see that, as expected, our change applied to one device, let’s verify our work now.
verifying our work in gui
Look’s good! Let’s apply to the rest of the 21 remaining devices now!
applying change to the remaining devices
We applied the change to 21 devices, as expected, let’s refresh our dependency record window.
gui verification
SQL verification
All of our devices are now changed, as you can see both via GUI and SQL.

Since we had the PKIDs from our previous entry, this took approximately 1.5 minutes to get fixed. Doing this manually would have taken at least 1minute per device manually or around 10 minutes to export the phones, modify the bat file and reimport. SQL is dangerous, certainly, but by taking small steps, we can do it safely and quickly.

Here is the data dictionary for 10.5

I used the device and callingsearchspace tables today.

Author: Will

I'm a Cisco Unified Communications consultant who dabbles in everything. I've been a Linux user since '96, an Asterisk user since '02, a Cisco route/switch guy since 2000 and various other things along the way. I have various degrees and certifications.

2 thoughts on “Using SQL to clean up Call Manager pt2”

Leave a Reply

Your email address will not be published. Required fields are marked *