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.
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. Stardust supports Sybase ASE (Adaptive Server Enterprise) version 15.0. 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%.
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.
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 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 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 <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 a user with the name <username>:
use <dbname> go exec sp_adduser <username> ,'<dbname>' ,'public' go
Grant the user to the database:
Grant Create Table to <username> go
To run Stardust 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:
sp_configure 'enable DTM', 1
sp_configure 'enable xact coordination', 1
sp_role "grant", dtm_tm_role, carnot
sp_configure "user log cache size", 8096
sp_configure "session tempdb log cache size", 8096
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:
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 Stardust 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:
Stardust (TM) Administration Console, Version 4.x Copyright (C) SunGard CSA LLC, 2000-2011. All rights reserved. Create Stardust 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.
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>
The following sections discuss the datasource / database connection pool setup of the audit trail database based on the deployment mode.
If you use Stardust in Spring local mode, you have to perform the following steps:
AuditTrail.Type = SYBASESet the type of the audit trail database to SYBASE and use the database driver class com.sybase.jdbc3.jdbc.SybDriver.
AuditTrail.DriverClass = com.sybase.jdbc3.jdbc.SybDriver
AuditTrail.URL = jdbc:sybase:Tds:<host>:<port>?ServiceName=<dbname>
AuditTrail.User = <yourDBUserName>
AuditTrail.Password = <yourDBUserPassword>
AuditTrail.Instance =
AuditTrail.Port =
AuditTrail.Host =
<bean id="carnotXaAuditTrailDataSourceLocalSybase" class="com.sybase.jdbc3.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>
The audit trail database datasource and connection pool setup is configured based on the application server/container utilized for the Stardust deployment. Please refer to Application Server Setup for more information regarding datasource and connection pool setup for an audit trail database.