+

Search Tips   |   Advanced Search

Delete orphaned data


Use SLCheckerTool to delete orphaned data in the database.

When portal resources are deleted, dependent resources stored in a different database domain are not deleted at the same time. These remaining resources are still available for backup scenarios or other production lines that might share the database domain.

For example, when an administrator deletes pages, the user customization to the deleted pages are not deleted. The SLCheckerTool allows us to detect orphaned data that is not needed any more by any of the production lines that share the domain. We can use the SLCheckerTool to prepare an XML script for later deletion of the orphaned data by xmlaccess.sh.

The SLCheckerTool is included in the file wp.db.slchecker.jar in the following directory:

You invoke the SLCheckerTool using the following shell scripts:

To prepare and complete deleting orphaned data you also perform some steps using xmlaccess.sh. A sample XML script for exporting orphaned data listed there allows us to prepare the orphaned data for work with the SLCheckerTool.

  1. Before deleting the orphaned data using the SLCheckerTool, secure the databases by making a backup.

  2. To delete all orphaned data, include every production line that shares the database domain. Otherwise resources that are still valid in a skipped production line might be unintentionally removed.

To delete the orphaned data....

For each step, use the target file from the previous step as the source file.

  1. Run the cleanup service to delete resources that are marked for delayed deletion. To do this, use xmlaccess.sh and the XML sample file Task.xml as the input.

  2. Create a full export including orphaned data of each production line that shares the particular domain. To do this, use xmlaccess.sh and the XML sample file ExportIncludingOrphanedData.xml.

  3. Use the SLCheckerTool to create an XML script file to delete the orphaned data. To do this, proceed by the substeps given later. Observe the following rules:

    • For each step, start the SLCheckerTool with the appropriate parameters as described under that step.

    • Replace all file name variables (given in italics) by the complete directory path location and file name.

    • For each step, use the target file(s) from the previous step as the source file(s).

    Invoke the SLCheckerTool using the following shell scripts:

      WP_PROFILE/PortalServer/bin/slcheckertool.sh

    1. Find candidates for orphaned data in each production line. Repeat this step for each production line, but specify a different output file for each iteration, otherwise the results will be overwritten. Use the following parameters:

        --find-candidates -s xml_source_file -d cand_target_file -domain domain_identifier

        Use these parameters to find the candidates for orphaned data within one production line. Replace the variables as follows:

          xml_source_file

          Specify a full XML export file that createdd in the step for creating the XML export including orphaned data.

          cand_target_file

          Target file. The orphaned data candidates will be saved to that file.

          domain_identifier

          Specify the database domain in which you want candidates to be searched. Valid values are comm for the community database domain, cust for the customization database domain or all for both database domains.

    2. Identify the orphaned data. Perform this step only once, but with all the candidate files generated by previous step at once, as this step determines the intersection of all result fileso that is, the data that are orphaned in all production lines. Use the following parameters:

        --identify-orphans -s cand_source_files_and_directories -d orph_target_file

        Use these parameters to identify the orphaned data by matching the information from all the candidate files. Replace the variables as follows:

          cand_source_files_and_directories

          Specify all file that were generated as cand_target_files by the substep for finding the candidates. If we specify one or more directories with the files, verify these directories contain only candidate files and no other files.

          orph_target_file

          Target file. The identified orphaned data will be saved to that file.

    3. Generate an XML script file. We can later use that script for deleting the orphaned data. Use the following parameters:

        --delete-orphans -s orph_source_ file -d xml_target_file

        Use these parameters to generate an XML script file for deleting the orphaned data. Replace the variables as follows:

          orph_source_ file

          Specify the file that was generated as the orph_target_file in the step for identifying the orphaned data.

          xml_target_file

          Target file. This will be the XML script file containing the information about the orphaned data. We can later use this file to delete the orphaned data.

  4. Optional: We can check whether all production lines were considered during the creation of the XML script file. To do this, review the comment in the file header. The header contains information about all full exporto that were used.

  5. Delete the orphaned data. To do this, invoke xmlaccess.sh with the XML script that you obtained as the xml_target_file with the orphaned data in the step for generating the XML script. You need to invoke xmlaccess.sh with the XML script only on one production line that shares the database domain. This will delete the orphaned data for all production lines that share that database domain.

You have removed all orphaned data from the portal database.


Parent: Configure portal behavior