Link to home
Start Free TrialLog in
Avatar of ANDREAG
ANDREAG

asked on

Problem with too many large attachments...

Hi all,

we have a database which is about 2Gb in size. Alot of the space is taken up with attachments. This database is replicated to various servers every night.

Does anyone have any ideas for reducing the size of the database to make it more manageable? We had an occassion when it would have been useful to copy the database, but didn't bother since it was so big.

We thought about putting all the attachments in a database of their own, but I'm not sure how to do it - How would a user insert the attachments? How would the first database link to them?

If anyone has had a similar problem, I would be interested in hearing any possible solutions.

Thanks,
Andrew.
Avatar of marilyng
marilyng

Andreag,

It would help to know if the attachments are compressed or zip files, or if they are full size, like word documents.
Is this an intranet application, or one that is accessed by both intranet and internet users?  What version of Notes?

Also,if the attachments are used all the time, or if you can archive out of date ones, then you can set up archiving on the database to move less active documents w/attachments to another database.

It is possible to store attachments in another Notes file, but this is done programmatically, and needs be carefully crafted so that attachments stored in one database can be managed by another (so, deletions, editing, etc. are all maintained).

Another way is to store the documents in a separate folder on the server, but this would also require a good deal of programming to maintain the links, allow the user to open the document, and maintain access control for allowing users to upload to the server.

Compacting the application on a regular basis via the server will reduce the extra white space, but not the size of the uploaded documents.

You can limit the size of the document attached..You can also program an agent to remove attachments from documents no longer in use and store these in another database.

Many possibilities, but all, I think require programming..

Perhaps someone else has a quick solution..

Marilyng
Avatar of ANDREAG

ASKER

I'm quite sure all the documents are UNzipped.
It's just an intranet application and we're using R5 servers. I doubt if all of the documents are being used.

I like the idea of putting all attachments in a folder on the server. Would it be possible to keep these files on only one server (all servers have access to the others) or would these need to be replicated in some way?

Not everyone would need to upload to the servers, only the editor in a central location.


ASKER CERTIFIED SOLUTION
Avatar of Jean Marie Geeraerts
Jean Marie Geeraerts
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ANDREAG

ASKER

jerrith,

can you tell me what type of database I would create to hold the attachments? Also, the code for the Action button - I will see how I get on from there.

Andrew.
Just create a blank database, with one form to hold the attachments.
On the form create fields to hold the following :
richtext for the attachment, text for the name of the attachment, number for the size of the attachment, text for the document unique ID of the document you got the attachment from, text for the replica ID of the database that contains the source document.

Apperently they have hidden the design of the database, so I can't access the code anymore.

An agent is used to run through all documents of the source database and remove all attachments, that I can remember. I'll see if I can unhide the design of the database.
Avatar of ANDREAG

ASKER

jerrith,

so, a user would add attachments to the source database as normal, the Notes would put them in the "attachments" database?

I'd really like to see the code for that agent...
I can't access the design of the database. Apparently they have hidden the design of the database and I don't have access to the original template.

However it should be fairly straightforward for you to create the agent (if you are kowledgeable in LotusScript).
I don't have time to write the agent at this moment. However here is the logic and a summary of classes/methods you need to look into to write the agent :

1) To run through all documents in the source database, create a handle to a view in the source database and then process all documents in this view.
->
get a handle to the source database (use the new method of the notesdatabase class) and open a view using the getview method.
get the first document using the GetFirstDocument method from the notesview class. Create a while loop to run through documents, use GetNextDocument at the end of the loop to get the next document and check for Doc Is Nothing.

2) From the source document, use methods of NotesRichtextItem to detach the attachments and remove them. Use NotesEmbeddedObject class properties and methods to check the attachments and attach them to a new document created in the repository database.

3) Put a doclink in the source document to the document holding the attachment and put a doclink in the document with the attachment to the original source document.

4) After you move the attachment, don't forget to remove it from the source document.

If you think you won't be able to write the agent, let me know how urgently you need it and I will try to find the time to write it for you.

Regards,

JM
Avatar of ANDREAG

ASKER

thanks jerrith,

I've had a look around Google Groups and found a script to search the Inbox and remove attachments from mail and put them in a folder on the hard disk. I'll try and use it along with the suggestions you gave. Hopefully I'll come up with a solution. I have a while to experiment, so I'll try it myself, thanks.
You're welcome. Keep me posted about your progress and if you get stuck I'll try to help you out.