Change in ovirt-engine[master]: core : DB FK validation

emesika at redhat.com emesika at redhat.com
Sun Dec 30 10:47:23 UTC 2012


Eli Mesika has submitted this change and it was merged.

Change subject: core : DB FK validation
......................................................................


core : DB FK validation

 The purpose of this utility is to find inconsistent data that violates
 FK(Forign Keys), display it and enable to remove it
 Only support may access this utility with care
 It is mandatory to run this utility on the original database before a
 backup of the DB is taken for later
 restore purpose, since if the database is backed up with the corrupted
 data and the FK definition, the FK
 will fail creation when the database is restored.
 Use the -f flag to fix the problem by removing the data caused to the
 FK violation.
 Running this utility without the -f flag will only report the
 violations.
 Use the -f flag to fix the problem by removing the data caused to the
 FK violation.

 Sample Output:
 >fkvalidator.sh -u  postgres -d dbname
  caution, this operation should be used with care. Please contact
  support prior to running this command
  Are you sure you want to proceed? [y/n]
  y
  psql:/tmp/tmp.fmQ0Q7O6ic:1: NOTICE:  Constraint violation found in
  weather (city)  ... (2 records)

 >fkvalidator.sh -u  postgres -d dbname -f
  Caution, this operation should be used with care. Please contact
  support prior to running this command
  Are you sure you want to proceed? [y/n]
  y
  psql:/tmp/tmp.8p8BXKVObk:1: NOTICE:  Fixing weather (city)  ... (2
  records)

Change-Id: Ibe54bca7a832c1c358a5e8c7214e7825cb9e4fc3
Signed-off-by: Eli Mesika <emesika at redhat.com>
---
M backend/manager/dbscripts/common_sp.sql
M backend/manager/dbscripts/dbfunctions.sh
A backend/manager/dbscripts/fkvalidator.sh
3 files changed, 143 insertions(+), 0 deletions(-)

Approvals:
  Eli Mesika: Verified; Looks good to me, approved


--
To view, visit http://gerrit.ovirt.org/10248
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe54bca7a832c1c358a5e8c7214e7825cb9e4fc3
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Kiril Nesenko <knesenko at redhat.com>
Gerrit-Reviewer: Michael Kublin <mkublin at redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs at redhat.com>



More information about the Engine-commits mailing list