How to delete large number of objects using iDQL and iAPI on Documentum Server?

Category: , , , , ,

Deleting bulk number of objects is a daily task in administrating the Documentum Server and its not possible to delete more than couple of thousands objects using DA or even iDQL because it takes lot of time or sometimes it hangs the server. So best way to do it is through create a text file of API commands for those objects which need to be deleted and i have compiled some steps to do that in easy way . It can be automated by using writting some job but if you need to delete instantenously by running script . Here is the solution.

1:- Create a dql file to extract object_ids of the objects which you want to delete

example

Name this file something like "extract_objectIds.dql"
---------------------------------------
select 'destroy,c,'as destroy,r_object_id from dm_document
go
quit

---------------------------------------
2:- Create a batch file to run this dql command created in above file named like

extract_objectId.bat

----------------------------------------
@echo off
setlocal & pushd


rem -=-=-=-=-=-=-=-=-=--
rem - Set these values -
rem -=-=-=-=-=-=-=-=-=--
set DOCBASE_NAME=xxxx
set DCMT_SUPERUSER=yyyy
set DCMT_SUPERUSER_PW=zzzzz

echo
"%DM_HOME%\bin\idql32" %DOCBASE_NAME% -U%DCMT_SUPERUSER% -P%DCMT_SUPERUSER_PW% -Rextract_objectIds.dql >object_Ids.log
:EOF
endlocal & popd

-----------------------------------

3:- Extract all the API commands from the log you got in previous step in your objectid.log into a new file called "destroy_objects.api"
for example , your object_Ids.log must be containing data like

destroy,c, 09xxxxxxxxxxxxxx
destroy,c, 09xxxxxxxxxxxxxx
destroy,c, 09xxxxxxxxxxxxxx
destroy,c, 09xxxxxxxxxxxxxx

4: Create a new batch file or update the above batch file and run iapi command file using the batch file.

New Batch file example (destroy_objects.bat)

----------------------------------------------
@echo off
setlocal & pushd

rem // $Id$
rem -=-=-=-=-=-=-=-=-=--
rem - Set these values -
rem -=-=-=-=-=-=-=-=-=--
set DOCBASE_NAME=xxxx
set DCMT_SUPERUSER=yyyy
set DCMT_SUPERUSER_PW=zzzzz


rem Destroying Objects
echo
echo.
""%DM_HOME%\bin\iapi32" %DOCBASE_NAME% -U%DCMT_SUPERUSER% -P%DCMT_SUPERUSER_PW% -Rdestroy_objects.api -lobjectsDeleted.log

:EOF
endlocal & popd
------------------------------------------------

Run this batch file by setting your Docbase Name , UserId, Password.

Thats it.

Happy Destroying Objects.

Note:

Comments (3)

Thanks for this post, it really helped solve my problems. I had to delete over 500k files from a Documentum server that we used for a load test, and there was no way to do it using other methods.

I had however to break down the file with all the destroy commands into smaller 10k lines chunks and surround each chunk with a "begintran,c" and "commit,c" lines for it to work properly. Without them it would hang on the first destroy command and do nothing.

Glad it helped you .

we can also make ms excel based utility for this kind of work.

Post a Comment