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 simple 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. The process of deploying a VDB is the same in both Server and Embedded modes.
- Copy the VDB file into the "<teiid-install>/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 you are deploying must at least have a different version number in the "ConfigurationInfo.def" file. This is the simplest way to deploy a VDB.
- 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.
- Use Admin Shell program to connect to the Teiid runtime and use "addVDB" command to deploy a VDB.
- Use JOPR-based web console configuration system, which will enable users to connect to a running Teiid and provide a way to deploy a VDB. (still under development)
Option 1, can be used for local development time VDB deployment or deployment in a manually controlled environment, where you have access to the machine where the Teiid runtime is installed. Options 2, 3 and 4 can be used when your Teiid runtime instance is a remote, or shared instance with other users 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 "ConfigurationInfo.def" 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 "<teiid-install>/extensions" directory
- Make sure the JAR is defined under "ConnectorClasspath" property in the Connector definition XML fragment inside the "ConfigurationInfo.def" file. The classpath is defined as "extensionjar:oracle.jar", where "extensionjar" defines a location protocol for Teiid and "oracle.jar" defines the name of the jar file.
- Make sure the userid/password combinations to connect to Oracle sources are correct and pointing to a working instance of Oracle inside the "ConfigurationInfo.def" file
For Text Connector
- Make sure that the "metadata" definition file and data files are located at a known location that is defined under the Text Connector configuration.
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
Once the VDB is deployed, Teiid runtime will maintain a copy of the exploded form of the VDB under the "<teiid-install>/deploy" directory. Thereafter Teiid runtime will only look in the exploded directory to load the VDB between restarts of the system. So, if you copied a new VDB archive file into the "<teiid-install>/deploy" directory it will be ignored for re-deployment. If you want the new VDB to take effect then delete the exploded directory and restart the system. Please note that by deleting the exploded directory you may be rolling back any configuration changes you may have done using the Admin API. If you want to just make simple connection changes like changing the Server or user for the Connector, then directly edit the "ConfigurationInfo.def" file inside the exploded directory for the VDB. You only have to restart the system for changes to take effect.