JBoss.orgCommunity Documentation

Chapter 8. Managing VDBs

8.1. Creating a VDB
8.2. Editing a VDB
8.3. Test a VDB
8.4. Reusing VDBs

As stated in the introduction, the critical artifact for Teiid Designer the VDB, or Virtual DataBase. This section describes the details of how to create, edit, deploy and test your VDBs.

To create an empty VDB launch Eclipse's New wizard, open the Teiid Designer category folder and select Teiid VDB. You can also select one or more models in a model project, right-click and select New > Teiid VDB action.>

Launching this wizard will open the New VDB dialog. If you launched with one or more models selected the dialog will contain the pre-selected models for inclusion in the new VDB.


Note that a VDB is scoped to be aware of models and files within the same model project as the VDB. You will not be allowed to add models to a VDB that exist in a different project.

To Edit an existing VDB, select the VDB in the explorer and right-click select Open action or simply double-click the VDB. The VDB will be opened in a VDB Editor. (See the Section C.3.2, “VDB Editor” section)

For details on how to test your VDB, see Section 9.3, “Testing With Your VDB” section

Teiid 8.1 introduced the ability to treat your deployed VDB as just another database where the database category is your VDB name and each visible model in your VDB is treated as a schema. This is accomplished via a new <import-vdb> element in the vdb.xml definition. (see Teiid 8.2 VDB Reuse section). By allowing VDB's to referenced other VDBs, users can create reusable database components and reduce the amount of modeling required to create complex transformations.

The sample vdb.xml file below highlights the <import-vdb> element and the corresponding import-vdb-reference within the view model's <model> element.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<vdb version="1" name="PartssupplierViewsVDB">
    <property value="false" name="preview"/>
    <import-vdb import-data-policies="false" version="1" name="PartssupplierSourcesVDB"/>
    <model visible="true" type="VIRTUAL" name="PartsViewModel" path="/PartssupplierProject/PartsViewModel.xmi">
        <property value="1623826484" name="checksum"/>
        <property value="Relational" name="modelClass"/>
        <property value="false" name="builtIn"/>
        <property value="655076658.INDEX" name="indexName"/>
        <property value="PartssupplierSourcesVDB" name="import-vdb-reference"/>
    </model>
</vdb>

Teiid Designer exposes this capability by allowing users to import metadata from deployed VDBs via the JDBC Import option. Through this import, relational VDB source models are created which structurally represent the Catalog (VDB), Schema (Model) and Tables in Virtual DataBase.

When dealing with the these VDB source models there are some limitations or rules, namely:

  • VDB source models are read-only

  • VDB source model name is determined by the deployed model name (schema) from the VDB it was imported from

  • Model names have to be unique within a model project

    • VDB source models have to be imported/created in a project different than the project used to create and deploy the Reuse VDB

  • The JDBC Import Wizard will restrict your options to comply with these rules

To create a VDB source model:

  • Step 1 - Deploy your VDB

  • Step 2 - Launch the JDBC Import Wizard via the "Import > Teiid Designer > JDBC Database >> Source Model" action

  • Step 3 - On the first page of the wizard create/select a valid connection profile for your deployed VDB.

    • The wizard will detect that the connection profile is a Teiid VDB connection and a section will be displayed on the wizard page titled Teiid VDB Source Options

    • If Import as VDB source model is NOT checked, then the wizard will continue importing as a normal JDBC import

  • Step 4 - On the 3rd page, titled Select Database Objects, select a single schema to use to create as VDB source model.

    • Note the schema names are the names of the visible models in your deployed VDB.

  • Step 5 - The final page shows the name of the resulting VDB source model and the name is NOT editable.

    • All other options are disabled

    • The target Into Folder must NOT contain a model with the same name or the Finish button will be disabled

You can use your VDB source model like any other source model in your project. VDB source model tables can be used in your transformation queries and the view models will contain model imports to your VDB source models. However, when your view model is added to a VDB, any referenced VDB source models do NOT get added to your VDB. Instead, an <import-vdb> element (described above) reference is added in it's place.

If VDB imports exist for a VDB, the Show Import VDBs button will be enabled and allow viewing the names of the imported VDBs as shown below.