Friday, November 25, 2011

How to change a single attribute to repeating

There's no direct way to change a single attribute to repeating in your custom types, so this task is not trivial if you already have objects with metadata that should be preserved: a temporary attribute must be used.
The safe way is to perform the following steps:


1. Ensure no objects of your type are locked: select * from my_type where r_lock_owner <> ' ' (if you have locked objects, you should unlock them - see how to unlock).
2. Create a temporary single attribute fake_attr: alter type my_type add fake_attr char(100) publish
3. Copy all the values from your single attribute to the temporary one: update my_type objects set fake_attr=my_attr
4. Remove the single attribute: alter type my_type drop my_attr publish
5. Add the repeating attribute: alter type my_type add my_attr char(100) repeating publish
6. Copy back the metadata: update my_type objects append my_attr=fake_attr

Wednesday, November 23, 2011

How to restart correctly the repository (Content Server services)

A typical Content Server contains 3 types of services: Docbroker, Docbase and JavaMethodServer. The correct restart procedure is:

Change the startup type to 'Disabled' and stop the services:
1. JMS service
1a Check for java.exe process (use ProcessExplorer): if found, ensure it's related to JMS and kill it (sometimes it hangs and doesn't terminate when you stop JMS).
2. Docbase(s) service(s) (if there are more than 1 Docbase, stop them one by one, the global repository must be the last).
3. Docbroker(s) service(s).
4. Clean the JMS cache ([JBOSS]\server\DctmServer_MethodServer\work\) and DFC(BOF) cache (DM_HOME\dfcdata\cache)


Change startyp type to 'Auto' (or Manual) and start the services:
5. Docbroker(s)
6. Docbases (if you have more, start the global repository first, then the others)
6a Check each started docbase log for errors
7. JMS
7a Check JMS logs ([JBOSS]server\DctmServer_MethodServer\log): boot.log and server.log

Tuesday, November 22, 2011

How to create and modify an ACL with API

An ACL can be created using Composer, DFC code, or an API command. Here's a sample of creating and modifying an ACL with API:

create,c,dm_acl
set,c,l,object_name
sample_name
set,c,l,owner_name
dm_dbo
set,c,l,description
Sample ACL
grant,c,l,dm_world,6
grant,c,l,dm_owner,7
grant,c,l,sample_groupA,3
save,c,l


If you wand to modify an existing ACL, you can use:
retrieve,c,dm_acl where object_name = 'sample_name'
revoke,c,l,sample_groupA
grant,c,l,sample_groupB,3
grant,c,l,sample_groupC,7
save,c,l

Sunday, November 20, 2011

How to unlock an object in Documentum

When a user makes a checkout on a sysobject (opens to edit), Documentum automatically applies a lock on the object, preventing other users from modifying it. Only the lock owner or a superuser can unlock the object by making a checkin or cancel the checkout. As sometimes users forget to unlock documents, you might need to do this as a superuser.
You can unlock an object in 2 ways:

DQL:
update dm_document object set r_lock_owner='', set r_lock_machine='', set r_lock_date=date('nulldate') where r_object_id='[OBJECT_ID]'
API:
unlock,c,[OBJECT_ID],F
The last argument is a boolean flag specifying if a mail notification will be sent to the lock owner.

Saturday, November 19, 2011

xPlore Index Agent login failure

If you are using Documentum xPlore for fulltext search, you might face the following issue: after starting the Index Agent process, you have to start the Index Agent from the Administration page (http://URL:port/IndexAgent/login_dss.jsp), but the login fails with the message:
User is not an Admin User!
even if your user is a superuser

The cause is a bug in the login_dss.jsp code:
IDfUser userObject = doc_session.getUserByOSName(uname, domain_name);

if (userObject != null)
isSysAdmin = userObject.isSysAdmin();

The bug here is that if the userObject is null (was not found), the flag isSysAdmin remains false, so the error message doesn’t say that the user was not found, instead you have the message above telling it’s not an Admin user.

Now why the userObject can happen to be null? (Note: at this point of code the user is already logged in against the repository). It’s because the user is searched using getUserByOSName(uname, domain_name) method. So if the user_os_domain is not set in the dm_user object and the Documentum repository runs in domain required mode (dm_docbase_config.auth_protocol='domain_required') : if you don’t specify the domain on login page – login doesn’t succeed, if you specify it – the userObject is not found – thus null.

To solve this issue it's enough to modify the login_dss.jsp page substituting the getUserByOSName(uname, domain_name) method with getUserByLoginName(uname, domain_name) or getUser(uname), or you could just set the user_os_domain in the dm_user object (however first option is preferred).

Monday, November 14, 2011

Change repository owner password in Documentum

If the Database user password used for the Documentum repository is modified, you can update it accordingly in Content Server by following the steps:

1) Stop the repository service(s) (and all dependant services, ie: app servers)
2) Go to $DM_HOME/dba/config/
3) Create a copy of the file dbpasswd.txt
4) Edit the dbpasswd.txt and replace the old (encrypted) password with the new password, as plain text (not encrypted)
5) Save dbpasswd.txt
6) Go to $DM_HOME/bin and run the following command: dm_encrypt_password -docbase -rdbms -encrypt
7) Open the dbpassword.txt file (created at step 4-5) and check if the password has been encrypted
8) Restart repository service(s) (and other dependant services)
9) Check the repository log if it started successfully

Tuesday, June 28, 2011

Configure the second Content Server for the repository

If you have a multiple-Content Server Documentum Infrastructure, you should install and configure manually the second Content Server instance. Assuming the first (main) CS is already installed and configured, below are the steps to install manually the second one (no wizzard). Ensure it will be on a different host machine (you can use a virtual one if you don’t want to buy a new box ;) ).

1) Connect to the repository as the installation owner by using Documentum Administrator and create a new server config object (below sample values):
Name: CS_NAME_LB1
Web server location: [server name of the CS Workstation]
Web server port: 80
Locale name: en
Default client codepage: ISO_8859-1
Server OS codepage ISO_8859-1
SMTP server [smtp_dns]
Workflow Content
Migration Threads: 10
Maximum Login Ticket 43200
Default Login Ticket 5

* Set other settings to fit the first config object.

Update the owner name for the new created object using the DQL
update dm_server_config objects set owner_name = '[docbase_owner]' where bject_name='[object_name]'

Disconnect from the repository

2) Create a server.ini file for the new Content Server
Create the folder [docbase_name] in the following path on the new Content Server:
…\Documentum\dba\config

Copy in this folder ([docbase_name]) the server.ini file from the first Content Server, for this repository.

Change the server_config name
server_config_name = CS_NAME_LB1

and the docbroker configurations
[DOCBROKER_PROJECTION_TARGET]
host = [docbroker2]
port = 1489

[DOCBROKER_PROJECTION_TARGET_1]
host = [docbroker1]
port = 1489
proximity = 100

* if additional projections required (add as many as required):
[DOCBROKER_PROJECTION_TARGET_2]
host = [docbroker3]
port = [port]

3) Create the repository Windows service by running the following command file:
@echo off
setlocal

set docbase=[docbase_name]
set instowner=[installation_owner_user]
set iodomain=[domain]
set iopass=[password]

set binPath=E:\Documentum\product\6.5\bin\documentum.exe -docbase_name %docbase% -security acl -init_file E:\Documentum\dba\config\%docbase%\server.ini -run_as_service -install_owner %instowner% -logfile E:\Documentum\dba\log\%docbase%.log

sc create DmServer%docbase% binPath= "%binPath%" start= demand DisplayName= "Documentum Docbase Service %docbase%" obj= %iodomain%\%instowner% password= %iopass%

sc description DmServer%docbase% %docbase%_clone
endlocal

5) Configure port numbers

Edit C:\WINDOWS\system32\drivers\etc\Services file and add the following entries at the end of the file:
dm_[docbase_name] [prev+1]/tcp #Documentum Docbase Service [docbase_name]
dm_[docbase_name]_s [prev+1]/tcp #Documentum Docbase Service [docbase_name] (secure service)

6) Update the windows registry
* sample values used, set the ones from your system
[HKEY_LOCAL_MACHINE\SOFTWARE\Documentum\DOCBASES\[docbase_name]]
"DM_CONFIGURE_STATUS"=hex(2):43,00,6f,00,6d,00,70,00,6c,00,65,00,74,00,65,00,\ 00,00
"DM_AUTH_LOCATION"="[domain]"
"DM_DATABASE_NAME"=""
"DM_DOCBASE_CONNECTION"="[DB_TNS]"
"DM_DATABASE_USER"="[docbase_name]"
"DM_DATABASE_ID"="db_id"
"DM_SERVER_VERSION"="6.5 SP2"
"DM_HOME"="E:\\Documentum\\product\\6.5"
"DM_CONFIGURE_TIME"="Fri Jan 14 12:34:00 CET 2011"
"DM_SERVICE_NAME"="[service_name]"
"DM_RDBMS"="Oracle"
"DOCUMENTUM"="E:\\Documentum"

7) Copy the dbpasswd.txt and webcache.ini file from first CS to second CS, in following path:
…\Documentum\dba\config\[docbase_name]

8) Create the folder for the session log files
…\Documentum\dba\log\[docbase_name]

9) Start the docbase services on both content servers

10) Using DA create the dm_LogPurge_LB1 job, as a clone of dm_LogPurge. Set as designated server the second CS (the one installed now). Set other settings similar to original LogPurge job (method, arguments, etc.).

11) Advice: in a multiple-CS environment, it is recommended to set a designated server for each job (otherwise it can happen a job is started simultaneously on 2 CS). User job sequences, if necessary.

12) Create the ACS object for the second Content Server

dmbasic -fE:\Documentum\product\6.5\install\admin\dm_acs_install.ebs -eInstall – [docbase_name].[CS_name] [install_owner] [password] [server_host_name]ACS1 [CS_name] 9080 http F "" ]dm_acs_install.log

Update the acs.properties file with the newly created ACS object by adding in the properties file
…\[method_server_path]\deploy\acs.ear\APP-INF\classes\config\acs.properties
the entries for the new created object:
repository.name.i=[docbase_name].[CS_name]
repository.login.i=[install_owner]
repository.password.i=[password]
repository.acsconfig.i=[acs_config_object_name]
* i – number not used yet in this file settings

13) Start the JMS.

Test and enjoy!