How to synchronize Endura 2nd Generation Video Recorder(s) Database using nsddru.

Issue

Possible issues include the following:

  1. The customer has lost access to their video after re-imaging the operating system on their NSM5200.
  2. The customer had lost access to their video after dropping the database on their NSM5200.
  3. The recording database on the NSM5200 in question is corrupt and must be recreated.

Product Line

Pelco Video Management

Environment

  • NSM5200 Network Storage Manager, all versions
  • Endura Xpress EE500 all versions

Cause

  • Re-imaging the operating system on a recorder deletes the database, but does not delete video on the disk array.
  • Loss of power to the unit may result in files being lost, but erroneous entries in the recording database remain.

Resolution

  1. Launch Pelco Utilities.
  2. Click System Attributes.
  3. Locate the NSM5200 in question, right-click it then select SSH Into.
  4. Login with [Username: root Password: pel2899100].
  5. Type the below commands.

    cd /usr/local/Pelco/NSD/Other/Utilities/
    mv nsd_housekeeper nsd_housekeeper.old
    service pal3d stop
    service pald stop
    service nsxd stop
     
  6. Type service postgresql status then press ENTER.  If postgres is running correctly, drop the NSD database:

    /usr/local/pgsql/bin/dropdb -U pelco nsd

    OR If postgres IS running but you are getting error messages dropping the database then
    /etc/init.d/postgresql stop
    rm -rf /usr/local/Pelco/Database/data/*
    su  -  postgres  -c  '/usr/local/pgsql/bin/initdb  -D  /usr/local/Pelco/Database/data'
    /etc/init.d/postgresql  start 

    OR If postgres is NOT running at all:
    rm -rf /usr/local/Pelco/Database/data/*
    su  -  postgres  -c  '/usr/local/pgsql/bin/initdb  -D  /usr/local/Pelco/Database/data'
    /etc/init.d/postgresql  start

     
  7. Create the default NSD database.

    /usr/local/Pelco/NSD/Other/Utilities/creatensddb
     
  8. Check for errors.

    /usr/local/pgsql/bin/psql -U pelco -d nsd -c "VACUUM ANALYZE VERBOSE;"
     
  9. Disable triggers

    /usr/local/pgsql/bin/psql -Upelco nsd -c "alter table clip disable trigger checkclipc;"
    /usr/local/pgsql/bin/psql -Upelco nsd -c "alter table file disable trigger checkdeleteclipf;"
    /usr/local/pgsql/bin/psql -Upelco nsd -c "alter table file disable trigger checkupsertclipf;"
     
  10. Set the environment variable.

    source /usr/local/Pelco/NSD/Scripts/environment
     
  11. Sync the database

    /usr/local/Pelco/NSD/Scripts/nsddru -m full
     
  12. Set the priorities on the clip and file tables.

    /usr/local/pgsql/bin/psql nsd -Upelco -c "update file set priority=0;"
    /usr/local/pgsql/bin/psql nsd -Upelco -c "update clip set priority=0;"
     
  13. Enable triggers.

    /usr/local/pgsql/bin/psql -Upelco nsd -c "alter table clip enable trigger checkclipc;"
    /usr/local/pgsql/bin/psql -Upelco nsd -c "alter table file enable trigger checkdeleteclipf;"
    /usr/local/pgsql/bin/psql -Upelco nsd -c "alter table file enable trigger checkupsertclipf;"
     
  14. Reboot the system.

    reboot