6 Replies Latest reply on Jan 28, 2019 1:30 PM by rareddy

    Changing Schema names in VDB

    thezionview

      Hi All,

      I am new to Teiid VDB JBOSS development. I have a VDB created and deployed in Dev environment, this is connecting DB2 database in underlying datasource. The DEV DB has a schema name like DEVDB01.

      This deployment is tested and confirmed to be fine. Now i would like to deploy this VDB in ST region, How do i modify the VDB to point to ST region DB2 which has schema like STDB01.

       

      Do i need to build the whole view and other fields or  is there a easier option to update the VDB to change schema name from DEVDB01 to STDB01?

       

      Please excuse if this is a basic question as i am new to it, still trying to figure things out. I tried searching the forum and big G. but nothing i saw seems to address the issue i am facing.

        • 1. Re: Changing Schema names in VDB
          rareddy

          Prabeesh,

           

          If the schema in the DEVDB01 & STDB01 is the same, then you can use the same VDB with both. VDB just captures the metadata, the connection to the source is separate. So, when you deploy this VDB into another server, you need to define a different connection for that model. If you are working with Teiid on WildFly server, look into creating a new resource-adapter (data source) that has same JNDI name but different connection properties.

           

          If you are using designer now, you need to export the VDB and take it to your UA/Test Teiid Server where the STDB01 needs to be used, create the resource-adapter and then deploy the VDB into it.

           

          Ramesh..

          • 2. Re: Changing Schema names in VDB
            thezionview

            Hi Ramesh,

            My schema names are different in both for DEVDB01 its DEV01 and STDB01 its ST01. Does this mean i have create the whole thing again in the designer for test region?

            Or can i simply unzip and edit the xml files and rezip it ?

             

            I am working on Teiid on JBoss EAP server

            • 3. Re: Changing Schema names in VDB
              rareddy

              You can import metadata in an unqualified manner such that it does not include the schema information in Teiid Designer. Then you do not need to manually edit. But know that if you do this, any other models in VDB with same-named tables will be in conflict, but if you do not have that issue it will work exactly same.

               

              Another is as you said, export into XML format of the VDB and edit the schema out with a new version and deploy. DO NOT EDIT XMI FILES.

              • 4. Re: Changing Schema names in VDB
                thezionview

                Hi Ramesh,

                How to import metadata in unqualified manner?

                 

                I am doing Datasource-->import->JDBC Database-->Db2 connection profile-->select the table-->

                in there under model object options there is a check box for Qualified names which is unchecked already in my case.

                 

                 

                is this how its done? if so i am doing same way but its still pointing to my dev schema when i get it to ST region.

                • 5. Re: Changing Schema names in VDB
                  thezionview

                  Any suggestions rareddy?

                  • 6. Re: Changing Schema names in VDB
                    rareddy

                    Have you deleted the old model and restarted with new model without qualified names or you just updated it?