It's all about the answers!

Ask a question

RTC Is it advisable to delete attachment from MODEL.ATTACHMENTS table RTCMasterDB

Dave Decker (331516) | asked Mar 24 '14, 7:51 a.m.
 RTC Is it advisable to delete attachment from MODEL.ATTACHMENTS table RTCMasterDB

a user inadvertantly attached a file with extremely sensitive information and would like it deleted from our RTC system; removing it, and removing it from comment still leaves it available in HISTORY tab. I can see it in the master database and COULD delete it if this wouldn't cause any system instability or referential integrity issues. Is this a safe operation?

RTC on Microsoft SQL Server 2008

Accepted answer

permanent link
Sumant Renukarya (1.1k23339) | answered Apr 03 '14, 7:03 a.m.
Hi Dave

--> From RTC 3.0 and onwards, there is an option to permanently delete attachment by using the delete menu item.  
But not in RTC  

--> For RTC, one needs to go through the following article on discarding the work item and the Attachment history. This might suffice for the requirement.  
--> If there is a dire need to delete from the database using the SQL queries, IBM does not support running the queries at the database level, to delete the attachment. Even if tried, it's highly recommended an offline Database backup is taken before each change.   

--> For an attachment, there is not just a single entry in the Database for an item.  
1) There is an entry for querying (the model.attachment table)  
2) There are separate entries for the current state and historic states that contain the serialized EMF XML.  
Essentially all these entries will need to be deleted.  
--> In a couple of instances for RTC version, following were the guidelines used to remove the attachment, using the SQL queries.   

delete from MODEL.ATTACHMENT where ITEM_ID = '_6lIm0Qj_EeC-Q9fTUVcnpA';  
delete from REPOSITORY.ITEM_CURRENTS where ITEM_UUID = '_6lIm0Qj_EeC-Q9fTUVcnpA';  
delete from REPOSITORY.ITEM_STATES where ITEM_UUID = '_6lIm0Qj_EeC-Q9fTUVcnpA';  
This should remove all traces and content for the attachment.  

The server needs to be restarted after executing the SQL statements, as the transactional cache may still hold on to the attachment information.  

b. To find ITEM_ID from an attachment:  
select * from MODEL.ATTACHMENT where ID = 3424;  
c. The above commands were for Derby database though and needs to be varied based on the specific database in use.

Dave Decker selected this answer as the correct answer

One other answer

permanent link
Dave Decker (331516) | answered Apr 03 '14, 7:06 a.m.
thanks Sumant; IBM support got me the same solution and it worked perfectly...REgards

Your answer

Register or to post your answer.