Pivotal Knowledge Base

Follow

How to run gpcheckcat on Pivotal Greenplum Database

Environment

Product Version
Pivotal Greenplum (GPDB) All versions

Purpose

This article will explain how to run gpcheckcat both online and in restricted mode.

The procedure below will generate two log files:

  • /home/gpadmin/gpcheckcat_YYYMMDD_summary.log
    • Contains summary information.
  • /home/gpadmin/gpAdminLogs/gpcheckcat_YYYMMDD.log
    • Contains detailed information.

Both files must be provided to Pivotal Support in order to investigate catalog issues.

Procedure to run gpcheckcat in restricted mode

  1. Stop the database:
    gpstop -M fast
  2. Start in restricted mode:
    gpstart -aR
    Note: This will prevent normal users from accessing the system. If there are scripts or tools which connect to the database using superuser accounts, then they should also be disabled until gpcheckcat is completed.
  3.  If GPDB version is < 4.3.8.1 then Remove orphaned temp schemas.
  4. Run gpcheckcat. For versions < 4.3.8.1 use the following step :
    cd /home/gpadmin
    export PGDATABASE="DATABASE_NAME"
    nohup $GPHOME/bin/lib/gpcheckcat -v > /home/gpadmin/gpcheckcat_$(date +%Y%m%d)_summary.log 2>&1 &

    For versions >= 4.3.8.1 use the following step :

    cd /home/gpadmin
    export PGDATABASE="DATABASE_NAME"
    nohup gpcheckcat -v > /home/gpadmin/gpcheckcat_$(date +%Y%m%d)_summary.log 2>&1 &

    To run for all databases use -A . Refer gpcheckcat --help for list of all available options.

  5. Review the summary log to see if a repair script was generated:
    repair scripts generated in directory gpcheckcat.repair.YYYY-MM-DD.hh.mm.ss
    If one was generated, enter the directory, and execute the repair script:
    cd gpcheckcat.repair.YYYY-MM-DD.hh.mm.ss
    ./runsql.sh
    Once the repair script completes, re-run gpcheckcat again to capture any remaining issues.
  6. Repeat steps 4 and 5 for all other databases.
  7. Create an archive containing both logs:
    cd /home/gpadmin
    tar -zcvf gpcheckcat_$(date +%Y%m%d).tar.gz gpcheckcat_YYYMMDD_summary.log gpAdminLogs/gpcheckcat_YYYMMDD.log
  8. Restart database in normal mode and release it to users.
  9. Provide the log archive to Pivotal Support.

Procedure to run gpcheckcat in online mode

Online version of gpcheckcat is safe to run catalog checks on a production cluster and does not require a maintenance window. It runs all the checks except for persistent table checks, that needs database in maintenance mode.

  1. Run online gpcheckcat. For versions < 4.3.8.1 use the following step :
    cd /home/gpadmin
    nohup $GPHOME/bin/lib/gpcheckcat -O > /home/gpadmin/gpcheckcat_$(date +%Y%m%d)_summary.log 2>&1 &

    For versions >= 4.3.8.1 use the following step :

    cd /home/gpadmin
    nohup gpcheckcat -O > /home/gpadmin/gpcheckcat_$(date +%Y%m%d)_summary.log 2>&1 &

    To run for all databases use -A . Refer gpcheckcat --help for list of all available options.

  2. Review the summary log to see if a repair script was generated:
    repair scripts generated in directory gpcheckcat.repair.YYYY-MM-DD.hh.mm.ss
    If one was generated, enter the directory, and execute the repair script:
    cd gpcheckcat.repair.YYYY-MM-DD.hh.mm.ss
    ./runsql.sh
    Once the repair script completes, re-run gpcheckcat again to capture any remaining issues.
  3. Repeat steps 4 and 5 for all other databases.
  4. Create an archive containing both logs:
    cd /home/gpadmin
    tar -zcvf gpcheckcat_$(date +%Y%m%d).tar.gz gpcheckcat_YYYMMDD_summary.log gpAdminLogs/gpcheckcat_YYYMMDD.log
  5. Provide the log archive to Pivotal Support.

 

Comments

  • Avatar
    Rizwan M Mirdhe

    Thanks buddy! :)

  • Avatar
    Krzysztof Byszewski

    worked, needed to modify mdw name as well

Powered by Zendesk