Skip to main content

DDL/schema comparison tool

  • June 27, 2018
  • 1 reply
  • 2 views

Bernard92
Forum|alt.badge.img+2

Hello ,

Does someone has in his toolbox a database ddl/schema comparison tool ?
The objective is to duplicate the database structure (and not the data) to another cluster.
If no such tool exists , I'm trying to figure out what's the best way to achieve this

  • extract all DDL from query_requests
  • find the newly created objects (tables, projections , views ...) or modified/altered objects (but I don't know where to get the modification/alter date if there's one)

Regards
Bernard

1 reply

s_crossman
Forum|alt.badge.img
  • Participating Frequently
  • June 27, 2018

You could possibly use the Vertica export_catalog function to export the design from the source and target systems:

select export_catalog('/tmp/myschema.sql','DESIGN');

then use Linux DIFF or a programmer tool to find the diffs.

[dbadmin@intrhel73-116-9 tmp]$ diff mydesign mydesignall
0a1,2

CREATE SCHEMA v_idol;
CREATE SCHEMA v_txtindex;

1604a1607,1624

END;

>

CREATE FUNCTION v_txtindex.caseInsensitiveNoStemming(x Long Varchar)
RETURN long varchar AS
BEGIN
RETURN lower(x);
END;

>

CREATE FUNCTION v_txtindex.StemmerCaseInsensitive(v Long Varchar)
RETURN long varchar AS
BEGIN
RETURN v_txtindex.StemmerCaseSensitive(lower(v));
END;

>

CREATE FUNCTION v_txtindex.Stemmer(v Long Varchar)
RETURN long varchar AS
BEGIN
RETURN v_txtindex.StemmerCaseSensitive(lower(v));