9.12.21 generate-schema

Writes changelog XML to copy the current state of the database to files.

Syntax

Liquibase|lb generate-schema|ges {OPTIONS}

This command uses custom extension functionality. XML files are generated defining the DDL for each object in the database. A controller XML file is created or updated identifying the individual XML files generated. The files are used to deploy using UPDATE commands.

Options

Option Description Default
-contexts|-co Context string to use for filtering which changes to operate on. -
-database-changelog-table-name|-dactn Name of table to use for tracking change history DATABASECHANGELOG
-debug|-de

Enable debug output.

-
-fail-on-error|-foe

{true|false}

Set failonError attribute to true in changelog.

False
-filter|-fi The filter value is the right-hand side of a SQL comparison, that is, a SQL comparison operator (=,!=, and so on) and the value compared against. The value must contain parentheses and quotation marks where appropriate. For example: "IN ('DEPT','EMP')" The filter value is combined with the object attribute corresponding to the object name to produce a WHERE condition in the query that fetches the objects. In the preceding example, objects named DEPT and EMP are retrieved. By default, all named objects of object_type are selected. -
-grants|-gr

Export Object, System and Role grants.

-
-labels|-la Label expression to use for filtering which changes to operate on. -
-log|-lo

Enable logging.

Standard logging is INFO level (no debug flag).

Debug logging is FINEST level (both log and debug flag).

-
-overwrite-files|-ovf Overwrite any existing files in the directory. This will not affect other files. -
-perform-detail-parse|-pdp
Setting this flag will cause all functions, procedures and packages to undergo a complete parse to determine dependencies. This addistional processesing will cause the generation to take more time. This flag should only be used when there is a sorting issue in functions, procedures or packages. -
-replace|-re

Set replaceIfExists attribute to true in changelog.

-
-runalways|-ra

Set runAlways attribute to false in changelog.

-
-runonchange|-rc

Set runOnChange attribute to true in changelog.

-
-split|-sp

This makes the export split the files into directories based on the object types.

-
-sql|-sq

Generate a SQL file along with the changelog showing the DDL for the object. This SQL is not intended for anything other than review.

-
-synonyms|-sy

Export public synonymns.

-

Examples

Generate XML files into separate directories.

-- Set default output path
SQL> cd <output-files-path>
-- Generate xml files
SQL> lb generate-schema -split

Generate XML files using a filter to include specific object types.

SQL> lb generate-schema -filter "IN ('DEPARTMENTS','EMPLOYEES')"