Extracting Metadata

From InterBase
Jump to: navigation, search

Go Up to Inspecting Database Objects


You can extract a metadata script to a file by displaying the desired metadata in the Metadata tab and clicking the Save Script toolbar button.

Extracting an entire database exports metadata in a specific order, to allow the resulting script to be used as input to recreate the database.

Metadata Comments

1. Database

Extracts database with default character set and PAGE_SIZE.

2. Domains

Must be before tables that reference domains.

3. Tables

Must be after domains.

4. Indexes

Must be after tables.

5. FOREIGN KEY constraints

Must be added after tables to avoid tables being referenced before they have been created.

6. Views

Must be after tables.

7. CHECK constraints

Must be after tables.

8. Exceptions

Must be extracted before stored procedures and triggers that contain code to raise exceptions.

9. Stored procedures

Stored procedures are shown with no body in CREATE PROCEDURE and then ALTER PROCEDURE to add the text of the procedure body; this is to allow circular or recursive procedure references.

10. Triggers

Must be after tables.

Must be after stored procedures, to allow trigger code to reference procedures.

Does not extract triggers from CHECK constraints.

11. Roles

Must be before GRANT privileges.

12. GRANT privileges

Must be after tables, views, stored procedures, triggers, and roles.

Items that are not extracted include:

  • Code of external functions or filters, because that code is not part of the database. The declarations to the database (with DECLARE EXTERNAL FUNCTION and DECLARE FILTER) are extracted.
  • System tables, system views, and system triggers.
  • Because DDL statements do not contain references to object ownership, the extracted file does not show ownership. The output file includes the name of the object and the owner if one is defined. There is no way to assign an object to its original owner.