Repositories should be cleaned up regularly as part of a maintenance schedule. Cleaning a repository involves removal of:
Orphaned content files
When users delete a document, or any object that has a content file associated with it, the system deletes the object and marks the content as an orphan. The system does not delete the actual content file. This must be done using the dmclean utility.
Unwanted document versions and renditions
Orphaned annotations and internal ACLs
An annotation is orphaned when it is detached from all documents or other objects to which it was attached.
An internal ACL is orphaned when it is no longer referenced by any object.
Aborted workflows
A workflow that has been stopped by the execution of an Abort method is an aborted workflow.
Old log files
To clean a repository:
Perform a complete backup of the repository.
Delete unwanted versions of documents.
You can delete only versions created before a certain date or by a certain author or delete all but the CURRENT version from one or more version trees.
To delete selected versions of documents, use the DELETE...OBJECT statement.
Identify the documents to delete by their creation date, modification date, or some other criteria that you choose. For example, the following statement deletes all documents that have not been changed since January 1, 2000:
DELETE "dm_document" OBJECTS WHERE "r_modify_date" < DATE(’01/01/2000’)
To delete versions from a version tree, use a IDfSysObject.prune method.
Prune deletes all unwanted versions on a specified tree or branch of a tree. An unwanted version is any version that has no symbolic label and that does not belong to a virtual document. Refer to the Javadocs for the usage of the method.
Delete unused renditions.
A rendition is represented in the repository by a content object that points to the source document and by a content file.
To delete a rendition (without deleting its source document, first update the content object for the rendition to remove its reference to the source document.
For example, the following UPDATE...OBJECT statement updates all server- and user-generated renditions created before January 1, 2000. The updates in the statement detach the affected renditions from their source documents, effectively deleting them from the repository.
UPDATE "dmr_content" OBJECTS SET "parent_count" = 0, TRUNCATE "parent_id", TRUNCATE "page" WHERE "rendition" != 0 AND "set_time" < DATE(’01/01/2000’)
Clean the temp directory by deleting the temporary files in that location.
You can determine the location of the temp directory with the following query:
SELECT "file_system_path" FROM "dm_location" WHERE "object_name" = ’temp’
Delete any unwanted dmi_queue_item objects.
Every time an object is placed in the inbox of a user, a dmi_queue_item object is created. When the object is removed, the queue item object is not destroyed, but it is marked in the repository as dequeued. Use the DELETE...OBJECT statement to remove dmi_queue_item objects.
For example, the following statement removes all queue items objects that were dequeued before January 1, 2000:
DELETE "dmi_queue_item" OBJECTS WHERE "dequeued_date" < DATE(’01/01/2000’) AND "delete_flag’=true
Run the dmclean utility to remove orphaned content files, orphaned annotations and ACLs, and aborted workflows. You can execute the Dmclean administration tool or run the dmclean utility manually. For more information abut the dmclean utility, refer to Dmclean (dm_DMClean).
Delete or archive old server logs, session logs, trace files, and old versions of the product.
Session logs are located in the %DOCUMENTUM%\dba\log\repository_id ($DOCUMENTUM/dba/log/repository_id) directory.
Content Server and connection broker log files are found in the %DOCUMENTUM%\dba\log ($DOCUMENTUM/dba/log) directory. The server log for the current server session is named repository_name.log. The log for the current instance of the connection broker is named docbroker.docbroker_hostname.log. Older versions of these files have the extension .save and the time of their creation appended to their name.
On Windows, you can use the del command or the File Manager to remove unwanted session logs, server logs, and connection broker logs. On UNIX, use the rm command.