NetIQ License Audit DQB SQL Job/Task fails (NETIQKB50210)

  • 7750210
  • 02-Feb-2007
  • 28-Feb-2012

Environment

NetIQ AppManager 6.x
NetIQ AppManager 7.0.x

Situation

The NetIQ License Audit QDB SQL Job fails with the following error message:

GetLicenseIDForRootServerView: error while getting string info for existing objects for rootserverobjid : 6059 [SQLSTATE 42000] (Error 50000) Associated statement is not prepared [SQLSTATE HY007] (Error 0) LicenseAudit: error executing GetLicenseIDFromRootServerObjID for rootserverobjid : 6059 [SQLSTATE 42000] (Error 50000).

Server: Msg 50000, Level 18, State 1, Procedure GetLicenseIDForRootServerView, Line 75GetLicenseIDForRootServerView: error while getting string info for existing objects for rootserverobjid : 6059Server: Msg 50000, Level 18, State 1, Procedure LicenseAudit, Line 214LicenseAudit: error executing GetLicenseIDFromRootServerObjID for rootserverobjid : 6059

Resolution

We should have a little detail explaining what this fix will do and the required steps.

Running :

EXEC dbo.LicenseAudit

in SQL Query Analyzer will display the error detail of the job.

Note the RootServerObjid that is returned.  This is the machine object which is preventing the licence job to succeed - example 1234

*** Its a good idea to performa database backup before making any changes below ***

  1. Verify the existance of the machine with objid = 1234

    select * from object where objid = 1234

    -- in this case, the object does not exist - it has been deleted.
  2. Verify the existence of any orphan objects associated with the original machine object

    select * from object where rootsrvobjid = 1234

    -- in this case you could see many objects avaialble for deletion.

  3. Before the orphan objects can be deleted, you need to verify they are not still in any other views - for example an IIS object may still be in the IIS view, eventhough its parent machine has been deleted.  Trying to manually delete the object will fail due to a contraint error such as this:

    DELETE statement conflicted with COLUMN REFERENCE constraint 'ViewHierarchy_ObjID_fk'. The conflict occurred in database 'QDB', table 'ViewHierarchy', column 'ObjID'.

    To identify any object remaining in other views, run the following command:

    select * from viewhierarchy where objid in (select objid from object where rootsrvobjid = 1234)

    The objid's listed in the output should be cross referenced with the objid's listed in step 2. 
    This will help identify objects which can be deleted from the console - i.e an identified IIS object can be removed from the IIS view.

    Note: It may be necessary to manually delete these entries from this table (this step has not been tested)
  4. To mark these items for deletion, run the following query:

    delete from object where rootsrvobjid = 1234

  5. Repeat step 3 to verify no other items appear.
  6. Once step 5 yield no results, it is safe to delete the objects as follows:

    Run the SQL Agent Job : NetIQ daily QDB - this will clean up any objects removed in step 4 which have a status of marked for deletion with the following this query

  7. Re-run the NetIQ License Audit DQB

Cause

A machine object was deleted but not all the sub-objects were removed. This is possibly caused by a manual deletion.

Additional Information

Formerly known as NETIQKB50210

Please perform a database backup before making any changes described in this knowledge base article.