[cisco-voip] Orphaned User Device Profiles

Wes Sisk wsisk at cisco.com
Mon Jul 12 15:25:31 EDT 2010


It is up to you (or subsequent reader of this post) to verify on your 
specific system and version.  This is provided as-is without any implied 
warranty. User beware.

I've not done this since 4.x so I'll share a bit of thought process and 
resources.  First, there are *many* things in the database.  It is best 
to limit scope as much as possible to avoid potential side effects.  You 
are interested in user device profiles.  Looks like those can be 
identified by device.tkdeviceprofile=1:

admin:run sql select * from typedeviceprofile
enum moniker                              name                   
==== ==================================== =======================
2    DEVICE_PROFILE_AUTOGENERATED_PROFILE Autogenerated Profile  
1    DEVICE_PROFILE_USER_PROFILE          User Profile           
0    DEVICE_PROFILE_REAL_DEVICE           Real Device            
3    DEVICE_PROFILE_MODEL                 Model Profile          
4    DEVICE_PROFILE_USER_TEMPLATE         User Template Profile  
5    DEVICE_PROFILE_SYSTEM_TEMPLATE       System Template Profile

admin:run sql select count(*) from device where tkdeviceprofile=1
(count(*))
==========
8         

 From this we need the user device profiles which are not associated 
with users:
admin:run sql select count(*) from device where tkdeviceprofile=1 and 
pkid not in (select fkdevice from enduserdevicemap)
(count(*))
==========
7  

You can make a report and spot check your results with the output of 
additional queries:
admin:run sql select name,pkid from device where tkdeviceprofile=1 and 
pkid not in (select fkdevice from enduserdevicemap)
admin:run sql select distinct(fkdevice) from enduserdevicemap

/Wes



On Monday, July 12, 2010 1:35:58 PM, <James.Brown at barclayswealth.com> wrote:
>> Could I ask for advice on the best way to delete CM6 UDPs which are no longer associated with an end-user please?
>>     
>
> Sorry for the typos in my earlier post. The query I had in mind would be something like:
>
> run sql 
> SELECT a.name
> FROM device a 
>     LEFT OUTER JOIN enduserdevicemap b ON a.pkid = b.fkdevice
> WHERE b.pkid IS NULL AND a.tkdeviceprofile = 1
>
> Has anyone tried this before?
>
> Barclays Wealth is the wealth management division of Barclays Bank PLC. This email may relate to or be sent from other members of the Barclays Group.
>
> The availability of products and services may be limited by the applicable laws and regulations in certain jurisdictions. The Barclays Group does not normally accept or offer business instructions via internet email. Any action that you might take upon this message might be at your own risk.
>
> This email and any attachments are confidential and intended solely for the addressee and may also be privileged or exempt from disclosure under applicable law. If you are not the addressee, or have received this email in error, please notify the sender immediately, delete it from your system and do not copy, disclose or otherwise act upon any part of this email or its attachments.
>
> Internet communications are not guaranteed to be secure or without viruses. The Barclays Group does not accept responsibility for any loss arising from unauthorised access to, or interference with, any Internet communications by any third party, or from the transmission of any viruses. Replies to this email may be monitored by the Barclays Group for operational or business reasons.
>
> Any opinion or other information in this email or its attachments that does not relate to the business of the Barclays Group is personal to the sender and is not given or endorsed by the Barclays Group.
>
> Barclays Bank PLC. Registered in England and Wales (registered no. 1026167).
> Registered Office: 1 Churchill Place, London, E14 5HP, United Kingdom.
>
> Barclays Bank PLC is authorised and regulated by the Financial Services Authority.
>
> _______________________________________________
> cisco-voip mailing list
> cisco-voip at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-voip
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20100712/38705c24/attachment.html>


More information about the cisco-voip mailing list