4 Replies Latest reply on Jul 5, 2018 7:34 AM by mtawk

    Teiid - Deploy one table into an existing model

    mtawk

      I am using embedded Teiid  9 with Oracle translator.

       

      I have an Oracle schema with a large number of tables.

       

      I have to deploy the Oracle model at each time a new table is added and the deploy is taking time.

       

      Is there a way to add/replace a table into the Oracle model without having to redeploy all the existing model tables? since i have the name of the table created or changed.

        • 1. Re: Teiid - Deploy one table into an existing model
          rareddy

          Hi Mark,

           

          There is no current way to only update a single or multiple tables during the deployment of the VDB, if you are reading metadata at deploy time from source using NATIVE metadata repository. The alternative is, after the first time deployment, you can grab all the metadata from the model as DDL, and edit the VDB to include the DDL directly. From there on any new tables, you would manually add those new tables to the VDB's Oracle model, redeploy.

           

          To grab the DDL, if you deploy the same VDB in Server based Teiid, you can use CLI to issue a "/subsystem=teiid:get-schema(...)" call, or in embedded you can issue an Admin API call "getSchema(...)" which will return the DDL.

           

          HTH

           

          Ramesh..

          • 2. Re: Teiid - Deploy one table into an existing model
            mtawk

            Hi Ramesh

             

            I was able to extract the model DDL using the method getSchemaDdl(String vdbName, String schemaName) from EmbeddedServer

             

            If I added the newly created tables and replaced the modified tables in the model DDL script, how can I assign it back into the model before redeploying?

             

            Also, when having the native DDL of those tables, is there a way to transform it to teiid model DDL format?

             

            Thanks for your help

            • 3. Re: Teiid - Deploy one table into an existing model
              rareddy

              > If I added the newly created tables and replaced the modified tables in the model DDL script, how can I assign it back into the model before redeploying?

              I suggest deploying a VDB with NATIVE only for the purposes of reading metadata with "getSchema" call. Once you have the metadata deploy a separate VDB with just DDL metadata block without the NATIVE metadata.

               

              > Also, when having the native DDL of those tables, is there a way to transform it to teiid model DDL format?

              Not directly in Teiid, but in Teiid Designer there is an option to import native DDL of the source and build Teiid models with it. If you're motivated there may be a way to use same libraries from Designer and build a custom metadata repository for Teiid that can take source specific DDL directly and build the model. This is no different than Teiid currently supporting its own slightly extended model of DDL as input to the model.

              • 4. Re: Teiid - Deploy one table into an existing model
                mtawk

                I did not get what you mean by deploying a VDB with Native only, I looked in model types and I have FUNCTION, PHYSICAL, VIRTUAL and OTHER.

                 

                Saying the getSchema got me the native metadata DDL, I would have to add to it the DDL of the new tables before deploying it into another model?