Deployment Solution Groups that are scraped into NS do not show correctly in the Altiris Console. They may exhibit one or more of the following symptoms: No instance of a server appears or the Deployment Server Group does not update its Groups and/or Computers.
The reason is that the Deployment Server’s database tracks any changes made to it since the last synchronization occurred. If the Notification Server never receives the data that was sent during the last synchronization or if a backup copy of the Notification Server database was restored that doesn’t have that data or if for any other reason the Notification Server does not have the data that was sent in prior synchronizations, the Deployment Server Agent will not resend that data to the Notification Server, it will only send changes that were made since the last time synchronized data was sent.
There are two steps to resolving this issue.
Step 1 is to run one SQL query against the Notification Server (Altiris) database to wipe out the corrupt data from that database.
Step 2 is to run one SQL query against the Deployment Server (eXpress) database(s) to force the Deployment Server Agent to send ALL data from the Deployment Server database to the Notification Server as if it were new data.
There are two options for Step 1. The Step 1 Option A query will remove data from the Notification Server (Altiris) database concerning the Deployment Server that was specified in the query. To wipe out data for more than one Deployment Server, run the query once for each Deployment Server. It is then necessary to run the Step 2 query against the (eXpress) database of each Deployment Server where the Step 1 Option A query was run.
The Step 1 Option B query will remove data from the Notification Server (Altiris) database concerning ALL the Deployment Servers. It will then be necessary to run the Step 2 query against the (eXpress) database of ALL the Deployment Servers.
Step 1 Option A: run this script against the Altiris database to selectively remove the Deployment Server(s) from the Altiris database. Before running this script, it is required to replace <ServerName> with the name of the Deployment Server to be removed from the Altiris database.
*****Begin Query*****
/*WARNING: This script is intended to wipe out any data in the Altiris
database pertaining to a specific Deployment Server. Replace <ServerName>
with the name of the Deployment Server you want your Notification Server
to "forget", then run the script against the Altiris database.*/
DECLARE
@servername varchar(255)
SELECT @servername = '<ServerName>'
DELETE FROM Inv_AeX_AC_Client_Agent
WHERE [Agent Name] = 'Deployment Solution Agent'
AND _ResourceGuid IN (SELECT ResourceGuid FROM CollectionIncludeResource
WHERE CollectionGuid IN (SELECT [NS Guid] FROM DSObjectMap
WHERE Server = @servername))
DELETE FROM Evt_AeX_DS_Assigned_Jobs
WHERE DBServer = @servername
DELETE FROM Inv_AeX_DS_Database
WHERE [Deployment Server] = @servername
DELETE FROM Inv_AeX_DS_Machine_Inventory
WHERE _id IN (SELECT _id FROM Inv_AeX_DS_Machine
WHERE [Deployment Server] = @servername)
DELETE FROM Inv_AeX_DS_Machine
WHERE [Deployment Server] = @servername
DELETE FROM DSComputerFolder
WHERE DatabaseID IN (SELECT DatabaseID FROM DSDatabase
WHERE DBServer = @servername)
DELETE FROM DSJobFolder
WHERE DatabaseID IN (SELECT DatabaseID FROM DSDatabase
WHERE DBServer = @servername)
DELETE FROM DSJobConditions
WHERE JobID IN (SELECT JobID FROM DSJobs
WHERE DatabaseID IN (SELECT DatabaseID FROM DSDatabase
WHERE DBServer = @servername))
DELETE FROM DSJobs
WHERE DatabaseID IN (SELECT DatabaseID FROM DSDatabase
WHERE DBServer = @servername)
DELETE FROM DSDatabase
WHERE DBServer = @servername
DELETE FROM Item
WHERE Guid IN (SELECT [NS Guid] FROM DSObjectMap
WHERE Server = @servername)
DELETE FROM Item
WHERE ClassGuid = 'F1E8956A-A158-487F-8185-4C3B492734E7'
AND ProductGuid = '74093212-3CBB-4E0E-AB79-6283D44DB5A1'
AND Name LIKE 'DS Server ' + @servername + '%'
DELETE FROM DSObjectMap
WHERE Server = @servername
DELETE FROM CollectionIncludeResource
WHERE CollectionGuid NOT IN (SELECT Guid FROM Item)
DELETE FROM ItemReference
WHERE ParentItemGuid NOT IN (SELECT Guid FROM Item)
AND ParentItemGuid != '00000000-0000-0000-0000-000000000000'
DELETE FROM ItemReference
WHERE ChildItemGuid NOT IN (SELECT Guid FROM Item)
*****End Query*****
Step 1 Option B, run this script against the Altiris database to remove ALL Deployment Server(s) from the Altiris database. Before you run the script, you must replace <ServerName> with the name of the Deployment Server you want to be removed from the Altiris database.
*****Begin Query*****
/*WARNING: This script is intended to wipe out ALL data in the
Altiris database pertaining to ANY Deployment Server.
Simply run the script against the Altiris database.*/
DELETE FROM Inv_AeX_AC_Client_Agent
WHERE [Agent Name] = 'Deployment Solution Agent'
DELETE FROM Evt_AeX_DS_Assigned_Jobs
DELETE FROM Inv_AeX_DS_Database
DELETE FROM Inv_AeX_DS_Machine_Inventory
DELETE FROM Inv_AeX_DS_Machine
DELETE FROM DSComputerFolder
DELETE FROM DSJobFolder
DELETE FROM DSJobConditions
DELETE FROM DSJobs
DELETE FROM DSDatabase
DELETE FROM Item
WHERE ClassGuid = 'B8B666E1-FED3-4482-8D5A-0895658317B2'
AND ProductGuid = '74093212-3CBB-4E0E-AB79-6283D44DB5A1'
DELETE FROM Item
WHERE ClassGuid = 'F1E8956A-A158-487F-8185-4C3B492734E7'
AND ProductGuid = '74093212-3CBB-4E0E-AB79-6283D44DB5A1'
AND Name LIKE 'DS Server %'
DELETE FROM DSObjectMap
DELETE FROM CollectionIncludeResource
WHERE CollectionGuid NOT IN (SELECT Guid FROM Item)
DELETE FROM ItemReference
WHERE ParentItemGuid NOT IN (SELECT Guid FROM Item)
AND ParentItemGuid != '00000000-0000-0000-0000-000000000000'
DELETE FROM ItemReference
WHERE ChildItemGuid NOT IN (SELECT Guid FROM Item)
*****End Query*****
Step 2, run this script against the eXpress database(s) and then allow the Deployment Server resynchronization to occur at least twice.
*****Begin Query*****
/*Update the changeitem information to tell
Notification Server to delete all information
about this Deployment Server during the
next synchronization*/
UPDATE changeitems
SET _nslastsent = NULL
UPDATE changeitems
SET [change type] = 'deleted'
UPDATE changeitems
SET ns_guid = NULL
UPDATE changeitems
SET [change date] = getdate()
UPDATE event_schedule
SET _nslastsent = NULL
UPDATE history
SET _nslastsent = NULL
INSERT changeitems
SELECT c.computer_id, 'computer', 'deleted', getdate(), c.computer_name, c.domain_name, c.ns_guid, null
FROM computer c
WHERE c.computer_id NOT IN (select id FROM changeitems)
GO
/*Create a trigger that will run once after the
first synchronization completes and recreates the
changeitem table to ensure that only accurate
data is sent to the Notification Server on the
second synchronization*/
CREATE TRIGGER temp_reload_changeitems ON [dbo].[changeitems]
FOR INSERT, UPDATE, DELETE
AS
BEGIN
/*Only run this query if the Deployment Server Agent synchronization has completed and the trigger isn't already running*/
IF NOT EXISTS (SELECT id FROM changeitems WHERE _nslastsent IS NULL) AND EXISTS (SELECT id FROM changeitems)
BEGIN
/*Wipe out the changeitems table so it can be recreated*/
DELETE FROM changeitems
/*Insert Computer Group information*/
INSERT changeitems
SELECT g.group_id, 'computer_group', 'inserted', GETDATE(), NULL, NULL, NULL, NULL
FROM computer_group g
/*Insert Event Folder information*/
INSERT changeitems
SELECT f.folder_id, 'event_folder', 'inserted', GETDATE(), NULL, NULL, NULL, NULL
FROM event_folder f
/*Insert Event information*/
INSERT changeitems
SELECT e.event_id, 'event', 'inserted', GETDATE(), NULL, NULL, NULL, NULL
FROM event e
UPDATE computer
SET _nslastsent = NULL
UPDATE computer
SET ns_guid = NULL
UPDATE event_schedule
SET _nslastsent = NULL
UPDATE history
SET _nslastsent = NULL
/*Self destruct this trigger so it is only run once*/
DROP TRIGGER temp_reload_changeitems
END
END
GO
No comments:
Post a Comment