SQL Query to get the Partition of a particular DN

Answered Question
Mar 2nd, 2017
User Badges:

Hi all, 

I am just learning about SQL queries and their power. Can you please tell me of a query that will allow me to search pattern 39987 and its partition? Also, would you be so kind as to breaking down the query for me so that I know what each part of it is doing? Thanks. 

Correct Answer by Tim Glen about 2 months 3 days ago

Glad you found what you were looking for.  However, for everyone else's sake, you can find this info with these queries. 


First, you will need to find that DN in the numplan table.

run sql select dnorpattern,description,fkroutepartition from numplan where dnorpattern='39987'

fkroutepartition in the numplan table is a link to the pkid in the routepartition table.
So lets search the routepartition table for that pkid.

run sql select name,description from routepartition where pkid='INSERT fkrouteparition GUID'

Hope this helps. 

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Jaime Valencia Thu, 03/02/2017 - 23:10
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    2011

If you want to learn about queries your primary reference is going to be the DB dictionary to understand how the CUCM DB looks like, have you looked at it?

Adan Zuniga Mon, 03/06/2017 - 07:48
User Badges:

Thanks Jaime, I did look at it. It seems a little difficult to understand specially because all tables are in a single page. 

Tim Glen Wed, 04/19/2017 - 13:56
User Badges:
  • Community Spotlight Award,

    Best Publication, May 2016

Adan, 

Is 39987 a DN or something else? 

Thanks

Tim


Adan Zuniga Fri, 04/21/2017 - 17:05
User Badges:

Hi Tim,

Yes, this is a DN, I actually figured this one out. Thanks for the reply!

Correct Answer
Tim Glen Fri, 04/21/2017 - 18:26
User Badges:
  • Community Spotlight Award,

    Best Publication, May 2016

Glad you found what you were looking for.  However, for everyone else's sake, you can find this info with these queries. 


First, you will need to find that DN in the numplan table.

run sql select dnorpattern,description,fkroutepartition from numplan where dnorpattern='39987'

fkroutepartition in the numplan table is a link to the pkid in the routepartition table.
So lets search the routepartition table for that pkid.

run sql select name,description from routepartition where pkid='INSERT fkrouteparition GUID'

Hope this helps. 

Actions

This Discussion