[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference utrop1::linkworks_v3

Title:LinkWorks V3.0 Notes Conference
Notice:LNX_APO = APO issues, LINKWORKS_V3 = V3.0 issues
Moderator:tacklr.apd.dec.com::TACK_Lm::TACK_L
Created:Tue Jun 28 1994
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2269
Total number of notes:8338

2180.0. "Mail message REALLY deleted?" by OASS::BURNAMAN_B (And now, live, from Atlanta . . . ) Thu Apr 03 1997 04:21

    Greetings,
    
    I have a question concerning LinkWorks mail that I cannot seem to find
    the answer to in either the documentation or this notes conference.
    
    I have a customer that has been running LinkWorks on AXP/VMS for some
    time now.  He is currently running 3.08 and has noticed that it is
    starting to take some time when users open new mail envelopes.  He
    has done some research and has discovered the the ORACLE tablespaces
    for the mail inbox now contains several hundred thousand rows of data.
    He knows that he does not have anywhere near this number of unread
    mail messages on the system, and since users have been deleting their
    mail messages, the logical conclusion is that the delete is not com-
    plete.  The customer wants to know if there is a way to compress the
    tablespace to remove the deleted mail messages.
    
    I saw an entry in this conference (# 1427), but it did not appear to
    be complete and I am reluctant to give this out to the customer with-
    out engineerings "blessing".
    
    Several questions:
    
    1)  Is this a known problem and if so, is there a solution that can
        be provided?
    
    2)  Is this problem server platform specific (i.e. it will occur on
        a VMS system, but won't on a UNIX system)?
    
    3)  Is there possibly some step the user is not doing that could be
        causing the problem?  Is simply doing the steps shown on page 92
        and 93 in the Users Guide enough or is some other step also re-
        quired?
    
    Thanks, in advance,
    
    Bruce in Atlanta
T.RTitleUserPersonal
Name
DateLines
2180.1Is standard behaviourUTROP1::16.197.208.129::VISSER_JJoop Visser @ UTOMon Apr 07 1997 18:1710
It is a known situation. The subject and message text are 
not deleted when the envelope is deleted. It still is 
possible to view the mailInBox log with subject and message 
text. The same is valid for Events. These are never removed 
from the database. I will post SQL statements in order to 
show/remove events , subject text and message text.

regards,

Joop Visser
2180.2mail cleanup descriptionUTROP1::16.197.208.129::VISSER_JJoop Visser @ UTOMon Apr 07 1997 18:2375
Mail cleanup description based on LNX Release 3.08	
Written by Joop Visser in april 1997.

What happens when a user sends mail?

The envelope(s) are created in the cell for new objects. 
(1 envelop per recipient)
Per attached object is 1 related entry in the mailinBox log.
(1 per envelop)
(1 object send to 11 recipients generates 11 envelopes and 11 entries)
Per envelop a subject text is stored in mailinfo (created in senders cell 
for new objects) and optional mailtext (created in senders cell for new 
objects) to store the message text. (1 row per message text line).

If the recipient deletes the envelop, the related mailtext and mailinfo 
remains because the MailInbox and MailOutbox logs use these to display the 
subject and message text.

There is no possibility via GUI to remove MailInbox or MailOutbox log 
entries. 

Via SQL statements it is possible to remove mail log entries by deleting 
those entries which exist longer than a given date.

When the recipient deletes the envelop the mailtext and mailinfo remain 
because these can still be shown in the mailinbox log..
The mailtext and mailinfo do not have a datestamp and have only a reference 
to the envelop. One can do a delete for those entries where there does not 
exist an envelop and a MailInbox or MailOutbox log entry. To test the last 
part most likely two cells are needed to be referenced which is not 
possible in one go. The effect is that in the log you can see an entry not 
having a
subject and message text.

What can be achieved with SQL statements is following. The example scripts 
are based on ORACLE. (Use of spool command for result log purpose)
Delete entries which are older than a given date. 
This can be used for events (ereigbuch), mailinbox log (eingangsbuch) and 
mailoutbox log (ausgangsbuch).
Delete the mailtext and mailinfo entries for which no envelop exist.

The problem with the last action is that references to mails which are 
deleted by the recipient no longer shows the message text and the subject.

Planned by development is to introduce a date stamp in mailinfo and 
mailtext so the update can be done in combination with the mail log remove 
action although these can be located on another cell. (Implemented in 3.2.2 
release)


SQL scripts:
showupdate	shows the selected rows which could be deleted
cleanup		deletes the rows.

Actions to do:
1. change the date in both scripts. (21-JAN-97 to the expirydate of events 
and mail logs.)

2. run  script showupdate and inspect the output to get an overview of the 
amount of data to be removed.
Remark: for oracle login as omdba and set the ORACLE_SID.
Note: Check the spool files
Note: The events (ereigbuch) are not related to the mail tables.
So you can treat events in another update scheme. The sequence of the mail 
table updates should remain.

Warning:
If you have a lot of mails to be deleted you can have problems in deleting 
them al in one transaction. The rollback space can be completely filled.
Always do the change during idle linkworks periods. 
And check that you have a good backup before doing this removal action.


3. run cleanup

2180.3showupdateUTROP1::16.197.208.129::VISSER_JJoop Visser @ UTOMon Apr 07 1997 18:2450
connect /

spool /tmp/ausgang.out
select * from ausgangsbuch where
	abgegangen < '01-APR-97'
AND
	obj_id NOT IN
		(select obj_id from objekt where
			obj_id = ausgangsbuch.obj_id 
		AND
			om_id = ausgangsbuch.om_id);
spool off

spool /tmp/eingang.out
select * from eingangsbuch where
	eingelangt < '01-APR-97'
AND
	obj_id NOT IN
		(select obj_id from objekt where
			obj_id = eingangsbuch.obj_id 
		AND
			om_id = eingangsbuch.om_id);
spool off

spool /tmp/events.out
select * from ereigbuch where
	geschickt < '01-APR-97';
spool off

spool /tmp/mailtext.txt
select * from mailtext where
	obj_id NOT IN
	(SELECT obj_id FROM objekt WHERE
		obj_id = mailtext.obj_id AND
		om_id  = mailtext.om_id);
spool off

spool /tmp/mailinfo.txt
select * from mailinfo where
	obj_id NOT IN
	(SELECT obj_id FROM objekt WHERE
		obj_id = mailinfo.obj_id AND
		om_id  = mailinfo.om_id);
spool off


disconnect
exit


2180.4cleanupUTROP1::16.197.208.129::VISSER_JJoop Visser @ UTOMon Apr 07 1997 18:2546
connect /

spool /tmp/cleanup.txt
delete  from ausgangsbuch where
	abgegangen < '31-JAN-97'
AND
	obj_id NOT IN
		(select obj_id from objekt where
			obj_id = ausgangsbuch.obj_id 
		AND
			om_id = ausgangsbuch.om_id);
commit work;

delete  from eingangsbuch where
	eingelangt < '31-JAN-97'
AND
	obj_id NOT IN
		(select obj_id from objekt where
			obj_id = eingangsbuch.obj_id 
		AND
			om_id = eingangsbuch.om_id);
commit work;

delete  from ereigbuch where
	geschickt < '31-JAN-97';
commit work;

delete  from mailtext where
	obj_id NOT IN
	(SELECT obj_id FROM objekt WHERE
		obj_id = mailtext.obj_id AND
		om_id  = mailtext.om_id);
commit work;

delete  from mailinfo where
	obj_id NOT IN
	(SELECT obj_id FROM objekt WHERE
		obj_id = mailinfo.obj_id AND
		om_id  = mailinfo.om_id);
commit work;
spool off

disconnect
exit