Generating Deployment Scripts for a Store

You can generate store deployment scripts for your projects that use a persistence store. Use one of the following procedures to generate project-schema-specific and migration SQL scripts using TIBCO BusinessEvents Studio or the CLI.

Before you begin

(For ActiveSpaces store only) For generating deployment scripts for the ActiveSpaces store, configure the tibco.env.ACTIVESPACES_HOME variable in the be-storedeploy.tra file.

Note:
  • Ensure that you copied your JDBC drivers file to BE_HOME/lib/ext/tpcl (or other location in your class path).
  • Ensure the database server is started.

Generating Deployment Scripts Using the TIBCO BusinessEvents Studio

    Procedure
  1. In the TIBCO BusinessEvents Studio, right-click the project name and select Studio Explorer > Export.
  2. In the Export window, select TIBCO BusinessEvents > Backingstore Deployment and click Next.
  3. In the Deploy wizard, from the Backingstore Type dropdown, select the required store option and click Next.

    Store Types
    Store Type Description
    Relational Database (JDBC) Select this option if your project has a JDBC backing store setup, such as MySQL, Oracle, SQL Server, and DB2.
    ActiveSpaces Select this option if your project has ActiveSpaces as a persistence store.
    Apache Cassandra Select this option if your project has Apache Cassandra as a persistence store.
  4. Provide the values for the displayed fields. For the list of fields, see Project Schema Specific SQL Script Fields.

  5. You can click either of these buttons:

    • Finish - To exit the wizard and generate the project-schema specific SQL scripts.
    • Next - To go to migration scripts generation page (Step 6).
  6. On the Generate Migration SQL Scripts page, select the Generate Migration Scripts check box to enable rest of the fields.

    Provide the values for the store connection fields. For list of fields, see Migration SQL Scripts Fields.

  7. (Optional) Click Test Connection to test if connection to the store is successful.
  8. Click Finish to generate the migration SQL scripts.

Generating Deployment Scripts Using the CLI

You can use the be-storedeploy utility (available at BE_HOME/bin/) to generate project-schema and migration SQL scripts from CLI.

Before you beginIf you are using the relational database, then before you execute be-storedeploy, open the file BE_HOME/bin/be-storedeploy.tra for editing. Specify the JDBC database type by using the java.property.jdbcdeploy.database.type property:
java.property.jdbcdeploy.database.type [oracle | db2 | sqlserver | mysql | postgres]

For ActiveSpaces, you can set the rows expiration scan period (be.as.store.expiration.scan.period) and default TTL value (be.as.store.default.ttl) in be-storedeploy.tra. For more details on expiration scan period and default TTL value in ActiveSpaces, see TIBCO ActiveSpaces documentation.

Note: The expiration scan period value and default TTL values in the be-storedeploy.tra file is applicable for the generated schemas only. For object table, update the value in the create_tables_as.tibdg.
    Procedure
  1. Open the CLI and navigate to the bin folder in BE_HOME.
  2. Use the following command to generate backing store deployment scripts for the project:
    be-storedeploy [-p <property file>] [-c <cdd file>] [-o <Schema output file>] [-op <schemagen | migration>] [-s <JDBC | ACTIVESPACES | CASSANDRA>] [-a <true|false>] [-u <PU Name>] [-h] [EAR file path] 
    For details on the parameters, see Store Deployment CLI Utility Options.
ResultThe scripts are generated in the location you specified. Information about script generation is also printed to the Console tab. For list of the generated scripts, see Generated SQL Scripts.