Video Screencast Help

SQL Script for Deletion of unmanaged resources from symantec_CMDB

Created: 04 Mar 2011 | 7 comments
Nitin.Mak's picture

Hi all,

While importing data from Active Directory, we got lots of junk/unwanted/unmanaged resources/users/subnets into symantec_CMDB. the resources count shows almost 18000+ however there are only 6000+ odd system in the network. Hence I am looking for help to remove/delete the unmanaged/unwanted information/resources from the CMDB via some SQL script from the backend. Any help would be appreciated.

Regards/Nitin

Comments 7 CommentsJump to latest comment

jharings's picture

Bulk deletion of resources

You need to provide a SQL query to effect it. In your case, unmanaged machines have a field from Vcomputer called [Ismanaged]. Fields are 1 (managed) or 0 (unmanaged). So you could try this..

select vc.guid

from vcomputer vc

where vc.[ismanaged] = 0

I cannot stress enough that you should test the query before inserting into the deletion script.

Jim Harings
HP Enterprise Services
1st Rule of Connect Club: Mark the post that helped you the most as a 'solution'. 2nd Rule of Connect Club:You must talk about Connect club.

Andrew Bosch's picture

I should get extra connect points every time someone uses that script...;-)

------------------------------------
Sr. Principal SQA Engineer
Symantec

jharings's picture

I've always said you were underpaid and unappreciated (at least as far as you know).

Jim Harings
HP Enterprise Services
1st Rule of Connect Club: Mark the post that helped you the most as a 'solution'. 2nd Rule of Connect Club:You must talk about Connect club.

ohzone - CherylPeterson's picture

A thumbs up for every download...

Cheryl

Endpoint Management,
Endpoint Virtualization
Managing Mobility
Community Manager
www.twitter.com/EMnV_symc
Need Altiris help? IRC chat #Altiris

Falquian's picture

Hi:

Just a small suggestion about this query:

I would add another clause to the where:

select vc.guid

from vcomputer vc

where vc.[ismanaged] = 0

and Server = [Server Name] and IsLocal = 1

 

where [Server Name] is the name of the server where the AD import rule was executed.

The IsLocal flag will be set to 1 if you run this query in the DB associate to the server where the AD import rule was executed.

You should delete the unmanaged discovered objects in all the NS that are used to import from AD.

 

Regards:

       Falquian

Kind regards:

     Falquian

If this post is useful to you, remember to mark it as a solution ;)

Nitin.Mak's picture

Thanks everyone :) just got a chance to check this trail.

I am trying the option given above... will post the result after I test deletion of couple resources than will try on big chunk.

Regards/Nitin