Using Database Deployment and Cleanup Scripts

Changing an existing adapter instance typically generates legitimate changes in the database. During this change process, the adapter creates a SQL script for changing the database objects and an associated cleanup script and stores them in the TIB_ADADB_HOME\sql directory. If the legitimate database changes result in error messages, you have to run these scripts. The messages and procedure for running the scripts are given in this section.

If the scripts created for generating legitimate database changes are not successful, the error dialog with the following message is displayed. See the following figure:

Figure 179: Error Dialog When Creating the Scripts

If the scripts created for generating legitimate database changes are successful but an error occurs while these changes are being saved to the database, a message similar to the following sample might be displayed. See the following figure.

Figure 180: Error Dialog When Saving Changes to the Database

To Run the Deployment Scripts

The generated SQL script for changes to database objects is stored in the instance_ name.sql file under the TIB_ADADB_HOME\sql directory. You can modify this script to deploy changes to different databases environment. For example, if the user schema is different between the production and testing environment, you can change the schema name of the database objects in the script and deploy the changes accordingly.

To Run the Cleanup Scripts

Procedure 

1. Select each message at the top portion of the message window and read the explanation for it at the bottom portion of the message window.
2. In TIBCO Designer, close the project containing the adapter instance that you changed.
3. Fix the errors that caused the database changes to fail, as indicated by the messages.
4. If necessary, clean the old database configuration by running the scripts created by the adapter. The scripts are in the sql directory and are named instanceId.sql or instanceId.undo.sql, where instanceId is the name of the adapter instance you changed.
5. Reopen the project in TIBCO Designer, and select the adapter instance you were attempting to change when the errors occurred, and then save the project.