Categories
Knowledge Support Support exacqVision Enterprise Categories Products

How to delete a large amount of camera events from ESM

Description

Perform the following steps to remove a large amount of camera events from the ESM Postgre database:

<br>

Removing Events:

  1. Shutdown all ESM services
  2. Start command prompt as admininistrator (do not use powershell)

    Change directories to exacqVisionEsm\PostgreSQL\9.2\bin and run the following:

    pg_dump -U postgres –schema-only ESM > ESM.sql#
    psql -U postgres -d ESM
    DROP TABLE camera_cameraevent CASCADE;
    DROP TABLE report_eventid CASCADE;
    DROP TABLE event_alertid CASCADE;
    \q
    psql -U postgres -d ESM -f ESM.sql

    Note: There maybe many errors that some things already exist, which is okay
  3. Start all services

<br>

Recover the Schema (assumes current schema not intact):

  1. Shutdown all services
  2. Open pgAdmin
  3. Go to localhost > Databases
  4. Right click on “Databases” and select “New Database”
  5. Enter the name ESM2
  6. Open command prompt as admin
  7. Change directory to C:\exacqVisionEsm\EnterpriseSystemManager
  8. Enter the following commands:
    a. Installer.exe decrypt
    b. notepad EnterpriseSystemManager.tmp
    c. Change DefaultName to ESM2
    d. installer.exe encrypt
    e. installer.exe new_migrations
  9. Change directories to exacqVisionEsm\PostgreSQL\9.2\bin and run the following:
    a. pg_dump -U postgres –schema-only ESM2 > ESM.sql
    b. psql -U postgres -d ESM
    – 1. DROP TABLE camera_cameraevent CASCADE;
    c.psql -U postgres -d ESM -f ESM.sql

    Note: There may be many errors that something already exists which is okay
  10. Change directory to C:\exacqVisionEsm\EnterpriseSystemManager
    • Enter the following commands:
    • installer.exe decrypt
    • notepad EnterpriseSystemManager.tmp
    • Change DefaultName to ESM
    • installer.exe encrypt
    • Start all services