Wednesday, September 24, 2014

How to navigate around the CUCM Database using run sql, show tech systables and more tips

Hi Guys

so you may already know about the run sql command, but when it comes to finding what you need... sometimes it's tricky to  work out the structure of the table, or even what table you might want to look at.

Here is how to see a list of tables:


admin:show tech systables
------------------------Show tech system tables-----------------------


SYSTEM TABLES
tabnameapplicationusercapfmapdynamic
applicationuserdevicemap
applicationuserdirgroupmap
applicationusernumplanmap
appserver
appserverapplicationusermap



Here is how to see all the entries for that table:

admin:show tech table srst
------------------------ Show tech table -------------------


 Table
Output is in /cm/trace/dbl/srst_table1411574818655.out
Use "file view activelog /cm/trace/dbl/srst_table1411574818655.out" command to see output







admin:file view activelog /cm/trace/dbl/srst_table1411574818655.out
2014-09-24 12:07:21,271 INFO  [ClassExecutionThread] cli.CliSettings - VMware = false

pkid                                 name                ipaddr1       port1 ipaddr2 port2 ipaddr3 port3 usermodifiable tksrstoption certificate issecure certificateproviderport sipipaddr1 sipipaddr2 sipipaddr3 sipport1 sipport2 sipport3 resettoggle tkreset
==================================== =================== ============= ===== ======= ===== ======= ===== ============== ============ =========== ======== ======================= ========== ========== ========== ======== ======== ======== =========== =======
c80cafe0-af65-43d6-a1f1-435ad998bd26 Use Default Gateway               2000          2000          2000  f              2                        f        2445                                                     5060     5060     5060     f           2



So now I know what the columns are, I can run sql queries:


admin:run sql select pkid, ipaddr1, name from SRST
pkid                                 ipaddr1       name
==================================== ============= ===================
c80cafe0-af65-43d6-a1f1-435ad998bd26               Use Default Gateway
cd241e11-4a58-4d3d-9661-f06c912a18a3               Disable
3bc40e86-e06f-4e4a-9679-a6ef5d7f6d05 192.168.36.1 MIKE_SRST
65cd53b4-3c1a-413f-acc9-c92f0eff9a52 192.168.44.5  DAVE_SRST
f5ad268e-7a37-8d6e-9783-f415ca3c9629 10.1.1.5 PETE SRST




1 comment:

  1. Interesting. Didn't know about 'show tech table'. I always just filter on a known entity like run sql select * from device where description/name =/like 'whatever'.

    ReplyDelete