Question & Answer
Question
In IBM Web Content Management (WCM), you experience an exception error in the Java™ Content Repository (JCR) Portal Access Control (PAC) tables with SQLCODE: -803, SQLSTATE: 23505.
Cause
Duplicate row in the PROT_RES table.
Answer
There are occasional scenarios in which the PAC data is not completely removed from the database when content is removed from either WCM or Personalization. When this occurs to the point of stopping a current function, the data must cleaned up with the following methods:
WARNING:
The queries/process below are ok to use on Portal 6.1.x or 7.x but should NEVER be used for Portal 8.x or 8.5.x. It will wipe out ALL wcm roles for those versions, not just the stale entries.
NOTE: ALWAYS backup the database before making any SQL updates of this type.
DB2:
* SELECT COUNT(*) FROM schema.PROT_RES WHERE RES_TYPE IN (7003, 46, 51, 49, 48, 52) AND EXTERNAL_UID NOT IN (SELECT UUID FROM schema.ICMSTJCRWSNODES)
* DELETE FROM schema.PROT_RES WHERE RES_TYPE IN (7003, 46, 51, 49, 48, 52) AND EXTERNAL_UID NOT IN (SELECT UUID FROM schema.ICMSTJCRWSNODES)
Oracle:
- A utility has been provided to clean up the table when using an Oracle database in the Attachments section below. Attached is a Java application that removes the unused entries from the PROT_RES table. This application directly connects to the database and queries both the PROT_RES and the ICMSTJCRWSNODES tables, listing the differences between the two tables.
- You must have a Java 1.5 JVM installed (note that this should be available via WebSphere).
- Since this application connects directly to the database, you must stop the Portal server while running this application.
- We recommend executing the application with a maximum amount of virtual memory available. This reduces the chance of running out of memory when processing large amounts of data.
When this application is executed in update mode, it also removes the unused entries from the PROT_RES table.
Because this application runs from the command-line, it has the following requirements:
Usage:
java com.ibm.jcr.db.pac.ProtResCleaner -db icmPropertiesFile [-update]
Instructions:
1. Download the dbapplications.jar file (in the Attachments section below) to your file system.
2. Stop all Portal servers that are connected to the database.
3. Back up the database.
4. Open a command prompt and set the following classpath:
- <oracle-lib>/ojdbc14.jar;<applications-loc>/dbapplications.jar,
where <oracle-lib> is the location of the Oracle Java libraries and<applications-loc> is the location on the file system where you downloaded the dbapplications.jar file.
- jcr.database.type
jcr.database.name
jcr.database.userid
jcr.database.password
jcr.database.schema
jcr.database.driver
jcr.database.drivertype
jcr.database.hostname
jcr.database.port
- java -Xmx1500m com.ibm.jcr.db.pac.ProtResCleaner -db <PortalServer>/jcr/lib/com/ibm/icm/icm.properties
NOTE: You may change the value of "-Xmx1500m" as needed. Increase this value if you encounter an Out Of Memory error or decrease this value if you get an error that Java cannot create the virtual machine.
8. Execute the application in update mode. Save the output to a new file:
- java -Xmx1500m com.ibm.jcr.db.pac.ProtResCleaner -db <PortalServer>/jcr/lib/com/ibm/icm/icm.properties -update
9. Restart the Portal server.
Contact IBM Support if you encounter any problems in executing the above steps.
NOTE: This duplicate exception can be prevented by applying PK78517.
Was this topic helpful?
Document Information
Modified date:
03 December 2021
UID
swg21381128