Checking database consistency for the PCD
[consistency] [Content Catalo] [database] [PCD] [Portal Content Directory]
Symptom
There are problems in the PCD with
- creating an object
- deleting an object
- opening a folder in Content Catalog (could not load or refresh tree)
Other terms
Portal Content Directory, PCD, consistency, database, Content Catalog, inconsistency, Oracle
Reason and Prerequisites
Inconsistencies are generated sometimes during intensive write
operations to the PCD (like import or upgrade).
One reason for this could be a bug in the Oracle JDBC driver (details
please see note 1003198). If you are using Oracle DB and a JDBC driver version 10 but lower than 10.2.0.4, please apply the patches as described in note 1003198.
Note that implementation of note 1003198 will not remove existing inconsistencies from your database, so you may have to follow the cleanup procedure below afterwards.
Solution
1. Installation of the tool
Go to
https://sapmats-de.sap-ag.de/download/download.cgi?id=8O0JERCB6885H3J4TWUJGJT46G263420RWMDQ9TQ0DWZ01X72M
and download the SDA file to your installation. Start the Software
Deployment Manager (SDM) and deploy the SDA. Alternatively, you can
simply unzip the SDA to a sub-folder of your engine’s j2ee folder
(/usr/sap/<sid>/<JC??>/j2ee). We recommend to use folder “pcdTools” for
this, which is also the folder used by the SDA deployment.
Open a command line in this folder and start PcdCheckTool.bat (Windows)
or PcdCheckTool.sh (Unix)
On UNIX systems:
First add “execute” permissions in Unix to the files:
1. chmod u+x *
Second try to run the command PcdCheckTool.sh
if the script didn’t work you might have to convert the *.sh files using
dos2unix as follows:
1. dos2unix -iso -850 PcdCheckTool.sh PcdCheckTool.sh
2. dos2unix -iso -850 startWithConfig.sh startWithConfig.sh
3. dos2unix -iso -850 copyLib.sh copyLib.sh
After running those commands add the “execute” permissions again
and try to run the command PcdCheckTool.sh
2. How to check for inconsistencies
After start of the tool please wait until the console is up and the
command prompt will be displayed.
Then type
add check
and confirm with the return key, to switch to the check command group.
Now type
check
and confirm with return to run the check process. This may take a while, please be patient. A message will be displayed once the check is complete giving an overview of the number of inconsistencies found.
Each execution of the check will create a CSV file in the log directory
with the detailed results. The CSV files are also the base for a cleanup of the inconsistencies.
3. How to fix inconsistencies
It is recommended to backup the database before continuing with the cleanup procedure.
To make sure that no temporary inconsistencies are found (which could be the case for instance during an import), please run the check as described in #2 2 times with a delay of about 10 minutes between each run.
Then compare the 2 created CSV files with a text diff tool.
If they are identically you can continue with the cleanup of the
inconsistent data.
Type in
clean <name of last CSV file>
This will run the simulation mode, which will not delete anything from
the database.
Type in
clean <name of last CSV file> commit
to delete the inconsistent data from the DB. If you will get in the
output the hint that there are still locks present in the system, you
can check the locks typing
showlocks
to get more details. Please make sure that no imports running, and no
user edit objects during the cleanup.
With
clean <name of last CSV file> commit force
you can force the tool to clean the inconsistencies and to ignore
existing locks.
Be carefully with that!
With the command
man <command>
you can get the help text, as
man check
man showlocks
man clean
After this the PCD should be in a consistent state again.
For monitoring and investigation issues of this problem please open an
OSS ticket on component BC-PIN-PCD with title “PCD inconsistencies found” and provide us with the following information:
- database vendor
- database version
- JDBC driver vendor
- JDBC driver version
- version of your portal (main release/SP level/Patch level)
- the CSV file you have used for cleanup as attachement
- the result of the cleanup, whether problem is solved or still
remain