Oracle and DropAll. Should drop all dblinks, packages, functions, types, collections ...

Dear all,

I’m starting with liquibase and Oracle data base and I have noticed that the dropAll command doesn’t drop all objects in the data base, for example in a Oracle 11r2, after a dropAll execution packages, functions, object types, collections and dblinks are not deleted in the data base.

Is that the standard behavior? Should these objects dopped also in a dropAll execution?

For packages, functions, object types, collections I can do a dropAll and after a update without problems, since all of those objects are created using create or replace. For dblinks, I need to do an additional check before update the data base after a dropAll, since create dblink in oracle has not a “replace”, for this reason I must include in the liquibase files an additional check to detect if the dblink is in the data base or not before recreate it.

Thanks in advance

Unfortunately, the way dropAll works is that it makes a database snapshot to find all the objects liquibase knows about and then drops them. Dblinks, package, functions, collections, etc get beyond the scope of what liquibase tries to handle and so it doesn’t know to drop them.

I’m not sure if there is an easy SQL command to drop everything in oracle. You could look at adding support in the liquibase-oracle extension for snapshotting and dropping the object types you are interested in, but that will take a bit of java coding.