# can I compare db. schema against export or ddl file

**URL:** <https://forums.toadworld.com/t/can-i-compare-db-schema-against-export-or-ddl-file/34188>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [September 29, 2015, 10:53am UTC](https://forums.toadworld.com/t/can-i-compare-db-schema-against-export-or-ddl-file/34188 "2015-09-29T10:53:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gene\_golub](https://avatars.discourse-cdn.com/v4/letter/g/7ba0ec/32.png) [@gene\_golub](https://forums.toadworld.com/u/gene_golub)\
**Post date:** [September 29, 2015, 10:53am UTC](https://forums.toadworld.com/t/can-i-compare-db-schema-against-export-or-ddl-file/34188/1 "2015-09-29T10:53:53Z")

</div>

Hello forum,

I need to be able to compare db. ddl schema with some kind of ddl file

I was wondering if Toad allows to create ddl schema file and use it later to compare with the current schema in the database.

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [September 29, 2015, 11:04am UTC](https://forums.toadworld.com/t/can-i-compare-db-schema-against-export-or-ddl-file/34188/2 "2015-09-29T11:04:31Z")

</div>

There are two windows in Toad that can do this. We have “Compare Schemas” which compares schema-related objects (tables, views, sequences, procedures, etc), and “Compare Databases” which compares non-schema-related objects (roles, tablespaces, profiles, etc).

Both of them support the use of a “snapshot file” which is an XML file that Toad can generate from the schema (or database). You can later compare the database or schema to this file. Files can be generated in schema/database compare or another set of windows “Generate Schema Script” or “Generate Database Script”.

---

<div class="post-metadata">

**Author:** ![gene\_golub](https://avatars.discourse-cdn.com/v4/letter/g/7ba0ec/32.png) [@gene\_golub](https://forums.toadworld.com/u/gene_golub)\
**Post date:** [September 29, 2015, 11:42am UTC](https://forums.toadworld.com/t/can-i-compare-db-schema-against-export-or-ddl-file/34188/3 "2015-09-29T11:42:37Z")

</div>

Hello John, thank you for your advice.

It works for the most part.

For instance, difference in column length definition : multiplier VARCHAR2(18 BYTE) - is not getting noticed.

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [September 29, 2015, 11:50am UTC](https://forums.toadworld.com/t/can-i-compare-db-schema-against-export-or-ddl-file/34188/4 "2015-09-29T11:50:02Z")

</div>

What do you mean “Not getting noticed”? Do you have BYTE in one DB (or the file) and CHAR in the other, and the Schema Compare isn’t picking up that difference? Or something else?

---

<div class="post-metadata">

**Author:** ![gene\_golub](https://avatars.discourse-cdn.com/v4/letter/g/7ba0ec/32.png) [@gene\_golub](https://forums.toadworld.com/u/gene_golub)\
**Post date:** [September 29, 2015, 12:26pm UTC](https://forums.toadworld.com/t/can-i-compare-db-schema-against-export-or-ddl-file/34188/5 "2015-09-29T12:26:13Z")

</div>

John, when I run comparison between xml file and live db. schema, it does not show the differences in column definition. I had about 10 tables which have the same column defined differently.

In ddl snapshot, it has multiplier VARCHAR2(10 BYTE) , in database - VARCHAR2(18 BYTE) .

So it does not ‘notice’ this difference.

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [September 29, 2015, 12:43pm UTC](https://forums.toadworld.com/t/can-i-compare-db-schema-against-export-or-ddl-file/34188/6 "2015-09-29T12:43:06Z")

</div>

What version of Toad are you using? I just tested this and it works OK for me. Here’s what I did:

create user compare identified by compare;

grant dba to compare;

create table compare.comp\_tbl(col1 number,

multiplier varchar2(10 byte));

then opened generate schema script and created a schema snapshot file for the COMPARE schema.

after that, I ran this command:

alter table compare.comp\_tbl modify

(multiplier varchar2(18 byte));

Finally, I ran the schema compare and compared the COMPARE schema to the XML file that I created, and the difference was found. It was noted in the “Objects which differ” section, under “Columns”. Sometimes people don’t notice it there because they are looking for “Tables”.
