Version 6

    WARNING this article is out of date - please refer to more recent documentation.

     

    A VDB is the primary means to define a Virtual Database in Teiid. A user can create a VDB using Teiid Designer or follow these instructions to create a Dynamic VDB without Designer for data integration purposes. If you do not know what a VDB is, then please start with these documents.

     

    Once you have a VDB it can be deployed in Teiid runtime in different ways.

     

    1. Copy the VDB file into the "<jboss-install>/server/<profile>/deploy" directory. Make sure that there are no other VDB files with the same name. If a VDB already exists with the same name, then this VDB will be replaced with the new VDB. This is the simplest way to deploy a VDB.
    2. The Admin API (look in org.teiid.adminpi.*) provides Java API methods that let's a user connect to a Teiid runtime and deploy a VDB. If you need to programmatically deploy a VDB use this method.
    3. Use the Admin Shell program to connect to the Teiid runtime and use "addVDB" command to deploy a VDB.
    4. Use the JOPR-based web console configuration system, which will enable users to connect to a running Teiid and provide a way to deploy a VDB. Check out the JOPR plugin at:
      http://<AS host>:8080/admin-console

     

    Option 1 can be used for local development VDB deployment or deployment in a manually controlled environment. Options 2, 3 and 4 can be used when your Teiid runtime instance is a remote instance or if you need a programmatic way to control your deployment.

     

    Deploying VDB Dependencies

     

    Apart from deploying the VDB, the user is also responsible for providing all the necessary dependent libraries, configuration changes and data files that may be needed by the Connectors defined in "META-INF/vdb.xml" file inside your VDB.  This file defines basic information about your VDB along with the sources you are integrating using Teiid.

     

    For example, if you are trying to integrate Oracle and Text sources in your VDB, then you are responsible for providing the JDBC driver for the Oracle source, and any necessary documents and configuration that are needed by the Text Connector.

     

    For a JDBC Connector using "Oracle" follow the below procedure

    • Copy the Oracle JDBC JAR file into "<jboss-install>/server/<profile>/lib" directory
    • Create a "data source" to the Oracle instance in the JBoss container. This typically done by creating "xxx-ds.xml" file and copying this file to the "<jboss-install>/server/<profile>/deploy" directory. You can also use admin-console to create this data source.

     

    <?xml version="1.0" encoding="UTF-8"?>
    <datasources>
      <xa-datasource>
        <jndi-name>OracleDS</jndi-name>
        <!-- uncomment to enable interleaving <interleaving/> -->
        <isSameRM-override-value>false</isSameRM-override-value>
        <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
        <xa-datasource-property name="URL">jdbc:oracle:oci8:@tc</xa-datasource-property>
        <xa-datasource-property name="User">scott</xa-datasource-property>
        <xa-datasource-property name="Password">tiger</xa-datasource-property>
        <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
        <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
        <!-- Checks the Oracle error codes and messages for fatal errors -->
        <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
        <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
        <no-tx-separate-pools/>
          <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
          <metadata>
             <type-mapping>Oracle9i</type-mapping>
          </metadata>
      </xa-datasource>
    </datasources>
    
    • Create connector binding factory for this Oracle data source. This also can be created by defining a "-ds.xml" file. You can also use admin-console for creating this connection factory. A sample xml looks like below.

     

    <?xml version="1.0" encoding="UTF-8"?>
    <connection-factories>
       <no-tx-connection-factory>
          <jndi-name>oracle-connector-binding</jndi-name>
          <rar-name>connector-jdbc-7.0.0-SNAPSHOT.rar</rar-name>
          <connection-definition>org.teiid.connector.api.Connector</connection-definition>
          <config-property name="XaCapable" type="java.lang.Boolean">true</config-property>
          <config-property name="ExtensionTranslationClassName" type="java.lang.String">org.teiid.connector.jdbc.oracle.OracleTranslator</config-property>
          <config-property name="SourceJNDIName" type="java.lang.String">java:OracleDS</config-property>            
          <max-pool-size>20</max-pool-size>
        </no-tx-connection-factory>
    </connection-factories>
    
    
    
    
    
    

     

     

    For Text Connector

    • Make sure that you another "-ds.xml" file defining the connection factory for Text Connector.

     

    Note that most of these configuration settings are correctly set if you used the Designer tool to build your VDB. However, you still need to deploy the dependent JAR files to Teiid's configuration along with the VDB.  If your deployment is not successful, there will be entries in the log file to explain why the VDB failed to deploy.

     

    Making changes to a deployed VDB

    If you want to just make simple connection changes like changing the Server or user for the Connector, then directly edit the "vdb.xml" file inside the VDB file. You can also use the admin-console to make changes to these settings.

     

    Migrating VDBs from 6.x

    VDBs from prior release contain an older configruation file version that is no longer supported.  You can use the migration utility (bin/migrate.sh or bin/migrate.bat) supplied with the Admin Shell download to update these VDBs for use with Teiid 7.  Note - additional manual edits may be needed to the generated {vdb}-bindings-ds.xml file if you are using custom or xml connectors.