Sybase ASE Setup

This section addresses the setup and installation of a Sybase audit trail database. The section includes setup of Sybase, creation of the Sybase audit trail database and schema.

Prerequisites

The following sections assume as basic understanding of Sybase database server installation, configuration and the SQL/PLUS utility.

Before an audit trail database can be created, a properly installed and configured instance of a Sybase database server must exist. Please refer to the Infinity Release Notes for the Sybase version, which is currently supported by Infinity.

Sybase ASE can be downloaded from the following Sybase Adaptive Server Enterprise Website. After downloading Sybase ASE, install Sybase ASE onto the database server. The server installation directory is referred to as %SYBASE_HOME%.

Note

To avoid problems during the invocation of parallel activities in a process definition, set the property AuditTrail.UseLockTables in your carnot.properties file to true. Please refer to the entry AuditTrail.UseLockTables in the chapter Client Side Properties, residing in the developers operation guide, for information on this property.

To avoid deadlock situations, set the property AuditTrail.InterceptJdbcCalls in your carnot.properties file to true. Please refer to the entry AuditTrail.InterceptJdbcCalls in the chapter Client Side Properties, residing in the developers operation guide, for information on this property.

Database Creation

To create the Sybase database and its underlying database devices you can either use ISQL or a graphical tool such as Sybase Central. Please refer to the Sybase website for detailed information. The following procedure describes how to use the isql> prompt to create the objects.

Create Database Device for Data

Create the database device <dbname>_data:

use master
go
disk init name = '<dbname>_data',
physname = '%SYBASE_HOME%/data/<dbname>_data',
size = '160M', dsync = true, skip_alloc = true
go 

Create Database Device for Logging

Create the database device <dbname>_log:

use master
go
disk init name = '<dbname>_log',
physname = '%SYBASE_HOME%/data/<dbname>_log',
size = '100M', dsync = true, skip_alloc = true
go 

Create the Database

Create the database <dbname>. Note that it is important to set the database option "ddl in tran" to true:

use master
go
create database <dbname>
    on <dbname>_data = '80M'
    log on <dbname>_log = '50M' 
go
exec sp_dboption '<dbname>',"ddl in tran", true
go

Create User

Create a user with the name <username>:

use <dbname>
go 
exec sp_adduser <username> ,'<dbname>' ,'public'
go 

Grant Table

Grant the user to the database:

Grant Create Table to <username>
go

Enabling XA Support

To run Infinity Process Platform it is required to set up Sybase for XA support. Sybase XA support is handled by the Distributed Transaction Manager (DTM) which must be manually enabled in the database before it can be used. Perform the following steps to enable XA support:

  1. Enable DTM:
    sp_configure 'enable DTM', 1
  2. Enable transaction coordination services:
    sp_configure 'enable xact coordination', 1
  3. Restart the server.
  4. Grant the dtm_tm_role role to the user:
    sp_role "grant", dtm_tm_role, carnot
  5. Explicitly set the property AuditTrail.FixAutoCommit in your carnot.properties file to false.
  6. Set the user log cache size to 8096:
    sp_configure "user log cache size", 8096
  7. Set the session tempdb log cache size to 8096:
    sp_configure "session tempdb log cache size", 8096

Setting Row Lock Promotion Thresholds

Depending on how many locks on a particular table are requested, Sybase decides per default to do a table lock instead of a row lock. To avoid this, you can specify the threshold of locks that can be acquired before Sybase switches from row level to table level locking. Set the following values:

Schema Setup

Once the database has been created, the audit trail database schema must be created within Sybase ASE. This process utilizes the System Console utility provided with the Infinity Process Platform installation. Execute the System Console with the following arguments:

sysconsole -v -r <jdbcDriver> -dbtype SYBASE -dbschema <dbschema> -l jdbc:sybase:Tds:<host>:<port>?ServiceName=<dbname> -d <user> -s <password> createschema

The following is displayed after the command is invoked:

Infinity Process Platform (TM) Administration Console, Version 4.x
Copyright (C) SunGard CSA LLC, 2000-2011. All rights reserved.

Create Infinity Process Platform schema:

Database type   : SYBASE
Database URL    : jdbc:sybase:Tds:<host>:<port>?ServiceName=<dbname>
Database user   : <user>
Database driver : <jdbcDriver>

Do you want to proceed? (Y/N):

Answer Y to proceed. The following is displayed after successful creation of the audit trail database schema.

Schema created.

Alternative Schema Setup

If you do not have the ability to directly create the database schema because of privileges within your database environment or desire to create a file with the appropriate SQL commands, the following procedures can be followed to create a file containing the appropriate DDL and DML statements that can be executed within the database as a SQL script.

sysconsole -v -dbtype SYBASE ddl -file <fileName> -schemaName <schemaName>

Once the DDL/DML file has been created by the previous command, follow the Database setup instructions from the previous sections if not already completed, and then have a user with appropriate privileges execute the created DDL/DML script file as such:

isql> source <fileName>

Local and Remote Mode Setup

The following sections discuss the datasource / database connection pool setup of the audit trail database based on the deployment mode.

Spring Local Mode Setup

If you use Infinity Process Platform in Spring local mode, you have to perform the following steps:

  1. In your carnot.properties file add the following properties:
    AuditTrail.Type = SYBASE
    AuditTrail.DriverClass = com.sybase.jdbc4.jdbc.SybDriver
    AuditTrail.URL = jdbc:sybase:Tds:<host>:<port>?ServiceName=<dbname>
    AuditTrail.User = <yourDBUserName>
    AuditTrail.Password = <yourDBUserPassword>
    AuditTrail.Instance =
    AuditTrail.Port =
    AuditTrail.Host =
    Set the type of the audit trail database to SYBASE and use the database driver class com.sybase.jdbc4.jdbc.SybDriver .
  2. In your carnot-spring-ds-jndi-context.xml replace the parameter ${AuditTrail.XaDataSourceClass} in the carnotXaAuditTrailDataSourceLocalSybase bean part with class com.sybase.jdbc4.jdbc.SybXADataSource:
    <bean id="carnotXaAuditTrailDataSourceLocalSybase" class="com.sybase.jdbc4.jdbc.SybXADataSource" lazy-init="true">
        <property name="networkProtocol" value="Tds" />
        <property name="serverName" value="${AuditTrail.Host}" />
        <property name="portNumber" value="${AuditTrail.Port}" />
        <property name="databaseName" value="${AuditTrail.Instance}" />
        <property name="user" value="${AuditTrail.User}" />
        <property name="password" value="${AuditTrail.Password}" />
    </bean>
        

Remote Mode Setup

The audit trail database datasource and connection pool setup is configured based on the application server/container utilized for the Infinity Process Platform deployment. Please refer to Application Server Setup for more information regarding datasource and connection pool setup for an audit trail database.