Using Database Deployment and Cleanup Scripts

Changing an existing adapter configuration typically generates legitimate changes in a connected 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 execute these scripts.

If one of the following conditions is met, an error message is displayed:
  • The scripts created for generating legitimate database changes are not executed successfully.
  • The scripts created for generating legitimate database changes are executed successfully, but an error occurs when these changes are being saved to the database.

The following figure shows an error message.

Running the Deployment Scripts

The generated SQL script for changes to database objects is stored in the instance_name.sql file in the TIB_ADADB_HOME\sql directory. You can modify this script to deploy changes to different database environments. For example, if the user schemas are different between the production and testing environments, you can change the schema names of the database objects in the script and deploy the changes accordingly.

Running the Cleanup Scripts

If an error occurs when you execute a deployment script, you can execute the associated cleanup script to delete the operation.

Procedure

  1. In TIBCO Business Studio, close the project containing the adapter configuration that you changed.
  2. Fix the errors that caused the database changes to fail.
  3. If necessary, clean the old database configuration by executing the scripts created by the adapter.
    The scripts are in the TIB_ADADB_HOME\sql directory and are named instanceId.sql or instanceId.undo.sql, where instanceId is the instance ID of the adapter configuration you changed.
  4. Reopen the project in TIBCO Business Studio, select the adapter configuration you were attempting to change when the errors occurred, and then save the project.