Deleting Records from ConfigMgr (Full Version)

All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager



Message


jquirk822 -> Deleting Records from ConfigMgr (6/17/2008 8:01:27 AM)

Hi All,
I'm looking for some info on deletion of records from ConfigMgr. What I want to know is how data deletion works when a record is removed from the console.

For example. If I delete the record for PC1234 with MAC Address 00:11:22:33:44:55 using the ConfigMgr admin console, then go to SQL Management Studio and execute

USE SMS_XXX
select * from SMS_XXX.dbo.Netcard_DATA where MACAddress0='00:11:22:33:44:55'

I get lots of results. I'd expect this to return 0 rows as I've deleted the resource, but that's not the case. Can anyone shed any light on how to prune the database of these entries immediately (or thereabouts).

I'm looking at this as I use the PackageMapping functionality from BDD/MDT and when re-comissioning a machine I don't always want it to put the apps that the machine had previously back onto the box, I'm fairly sure that under SMS 2003 deleting the object from the console deleted all references to it in the database, but this doesn't seem to be the case any longer...

Thanks

John
 




jnelson993 -> RE: Deleting Records from ConfigMgr (6/17/2008 10:41:52 AM)

Well, first off, my advice is that you use the view (dbo.v_GS_NETWORK_ADAPTER) instead of the base table (dbo.NETCARD_DATA)...second, just because there are records there, doesn't mean they're valid records that get used for anything.  If the records belong to decommissioned or obsolete machines, then they're not hurting anything by sitting there and the DB maintenance tasks will wipe them out eventually.  Try adding a filter to this query you whipped up to only include non-obsolete, non-decommissioned, valid clients and see if THAT shows a bunch of records.

SELECT
  *
FROM
  dbo.v_GS_NETWORK_ADAPTER
WHERE
  resourceID IN (SELECT resourceID FROM dbo.v_R_System_Valid)







jquirk822 -> RE: Deleting Records from ConfigMgr (6/17/2008 10:47:33 AM)

Hi John,
Thanks for the reply, I am using the view in my stored procedure, I was just trying to rule out a suggestion that I use the tables rather than the views...

The subselect works great, I've not used v_R_System_Valid before, is that new???

Anyway, it works great, thanks very much for your help.

John




jnelson993 -> RE: Deleting Records from ConfigMgr (6/17/2008 10:48:18 AM)

Oops, forgot to add the MAC address filter
SELECT
  *
FROM
  dbo.v_GS_NETWORK_ADAPTER
WHERE
resourceID IN (SELECT resourceID FROM dbo.v_R_System_Valid)

  AND MACAddress0 = '00:11:22:33:44:55'





jnelson993 -> RE: Deleting Records from ConfigMgr (6/17/2008 10:50:15 AM)

quote:

ORIGINAL: jquirk822

Hi John,
Thanks for the reply, I am using the view in my stored procedure, I was just trying to rule out a suggestion that I use the tables rather than the views...

The subselect works great, I've not used v_R_System_Valid before, is that new???

Anyway, it works great, thanks very much for your help.

John


Yes, that view is new with SCCM, but many of us were doing essentially the same thing in SMS by using V_R_System and putting filter criteria for DECOMMISSIONED0 = 0 and OBSOLETE0 = 0 and CLIENT0 = 1.  Now it's done for us!




jnelson993 -> RE: Deleting Records from ConfigMgr (6/17/2008 10:59:36 AM)

Oh, and if someone suggests you use tables instead of views, you tell them to go pound sand.  Querying the table directly is not good practice, and it's unsupported.  Microsoft reserves the right to change anything about them whenever they want.  However they generally wouldn't modify the output of the views so querying the views will pretty much always give you the results you want.  They also add logic to the views sometimes to make sure it's returning the proper information. (like joining V_GS_Add_Remove_Programs_DATA with V_GS_Add_Remove_Programs_64_DATA to get you both the ARP data on the 32-bit machines and the ARP data on the 64-bit machines)

My advice (as well as Microsoft's advice), never use the base tables directly.




jquirk822 -> RE: Deleting Records from ConfigMgr (6/25/2008 3:25:46 AM)

To tie up the loose ends of this, I was looking for help with this to fix a "bug" in the MDT PackageMapping functionality where obsolete data is being interrogated to evaluate which applications should be reinstalled on the new OS. Using the v_R_System_Valid view in the stored procedure logic prevents this from happening. I've added some detail to this on my blog here.

JQ




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.171875