Environment
Novell
ZENworks TS.Census 3.2
Situation
Purge Task
ends with 'failed' status.
Unable to
remove items from the database using the Purge Task.
Error:Database Persistence Layer Info in
DBOracleErrorHandler::serverError at
Referential Integrity Error[2.5.604] Object could not be removed.
Referential Integrity Error[2.5.604] Object could not be removed.
Resolution
Fixed in
module DBP.DLL dated 21 June 2006 or newer in census320ir11.exe or
newer located at
Status
Reported to EngineeringAdditional Information
Message located
in the TaskServerCoreEvent.log.
This patch is to prevent this issue from happening in the future. You must run the associated Database script listed below to repair the data currently in the database in order for the purge to work properly.
For Oracle:
-- It is set up for purging data greater than 1 year old. Change the 365 as necessary to match your purge time.
create or replace procedure updatedeldates
is
v_ProductOID NC_Product.ProductOID%type;
v_ProductDelDate NC_Product.IsDeleted%type;
cursor delprods is
select ProductOID, IsDeleted from nc_product p
where (not p.isDeleted is null) and (p.isdeleted <= (CURRENT_DATE - 365));
begin
open delprods;
loop
fetch delprods into v_ProductOID, v_ProductDelDate;
exit when delprods%NOTFOUND;
update nc_component
set nc_component.IsDeleted = v_ProductDelDate where productalias=v_ProductOID;
end loop;
close delprods;
end;
/
begin
updatedeldates;
end;
/
This patch is to prevent this issue from happening in the future. You must run the associated Database script listed below to repair the data currently in the database in order for the purge to work properly.
For Oracle:
-- It is set up for purging data greater than 1 year old. Change the 365 as necessary to match your purge time.
create or replace procedure updatedeldates
is
v_ProductOID NC_Product.ProductOID%type;
v_ProductDelDate NC_Product.IsDeleted%type;
cursor delprods is
select ProductOID, IsDeleted from nc_product p
where (not p.isDeleted is null) and (p.isdeleted <= (CURRENT_DATE - 365));
begin
open delprods;
loop
fetch delprods into v_ProductOID, v_ProductDelDate;
exit when delprods%NOTFOUND;
update nc_component
set nc_component.IsDeleted = v_ProductDelDate where productalias=v_ProductOID;
end loop;
close delprods;
end;
/
begin
updatedeldates;
end;
/