+ All Categories
Home > Documents > Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf ·...

Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf ·...

Date post: 14-Feb-2018
Category:
Upload: vuongkiet
View: 228 times
Download: 0 times
Share this document with a friend
102
BAAN IVc Installation and Administration Guide for Sybase
Transcript
Page 1: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IVcInstallation and Administration Guide forSybase

Page 2: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

A publication of:

Baan Development B.V.P.O.Box 1433770 AC BarneveldThe Netherlands

Printed in the Netherlands

© Baan Development B.V. 1998.All rights reserved.

The information in this documentis subject to change withoutnotice. No part of this documentmay be reproduced, stored ortransmitted in any form or by anymeans, electronic or mechanical,for any purpose, without theexpress written permission ofBaan Development B.V.

Baan Development B.V.assumes no liability for anydamages incurred, directly orindirectly, from any errors,omissions or discrepanciesbetween the software and theinformation contained in thisdocument.

Document Information

Code: U7019D USGroup: User DocumentationEdition: DDate: October 1998

Page 3: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

i

Installation and Administration Guide for Sybase

1 BAAN IV Sybase database driver overview 1-1BAAN SQL processing 1-2BAAN IV database driver features 1-2BAAN data dictionary (DD) 1-2Security 1-3Referential integrity 1-3Data buffering, reduction, and compression 1-3Tuning aspects: profiling and statistics 1-3BAAN IV database driver interface 1-4Data dictionary mapping 1-5Mapping the BAAN data dictionary to the Sybase format 1-5Stored procedure name convention 1-7Data types 1-7Constraints 1-8Hash column size 1-9Index ordering 1-9Index uniqueness 1-10Isolation level usage 1-10Transaction management 1-11Locking 1-11Optimization 1-12Fetch optimization 1-12Effect of fetch optimization 1-13Refresh time 1-13Hash optimization 1-14Cache 1-15Stored procedures 1-15Error reporting 1-16Steps for analyzing errors 1-17BAAN IV database driver trace information 1-18

2 Installing BAAN IV for Sybase 2-1Installation preparations 2-1Tuning the kernel 2-1Creating database devices 2-4Creating the required UNIX directories, groups, and users 2-4Setting environment variables 2-6

Table of contents

Page 4: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Table of contents

Installation and Administration Guide for Sybase

ii

Installing Sybase 2-8Unloading the software 2-8Creating the Sybase servers 2-10Preparing Sybase for BAAN IV 2-11Installing BAAN IV 2-12Files required for the BAAN IV database driver 2-16Tuning aspects 2-17BAAN IV database driver statistics 2-17BAAN IV database driver profiling 2-19Profile output file format 2-20Effect of optimization 2-20Location of management file 2-22

3 BAAN IV Sybase database driver administration 3-1Group management 3-1Create a group 3-1Drop a group 3-2Change the group user password 3-3BAAN user management 3-3Add a BAAN user to a group 3-3Drop a BAAN user from a group 3-4Change a Sybase user password 3-4Maintenance tool 3-4User administration 3-4User information 3-5Main menu 3-5User administration 3-5Add user 3-6Drop user 3-6Change user password 3-7Add group 3-7Drop group 3-8Change group password 3-8User information 3-8List users 3-8List groups 3-8List storage 3-9Edit storage 3-9Escape to shell 3-10Storage file management 3-10The syb_maint6.1 tool 3-11

Page 5: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Table of contents

Installation and Administration Guide for Sybase

iii

4 BAAN IV Sybase database driver configuration and tuning aspects 4-1Configuration and tuning aspects 4-1High-level lock retries 4-1Optimistic and pessimistic reference checks 4-2File formats 4-2File $BSE/lib/sybase/syb_users 4-2BAAN user 4-2Sybase user 4-2Sybase user password 4-3User group 4-3File $BSE/lib/sybase/syb_groups 4-3Group name 4-4Group password 4-4File $BSE/lib/sybase/syb_storage 4-4

5 Appendix A: Setting database driver behavior 5-1Driver resources 5-1Environment variables 5-2Server environment variables 5-3Client environment variables 5-4Storage file 5-4

6 Appendix B: Database driver resources and environment variables 6-1Summary of Sybase resources and environment variables 6-1Detailed description of Sybase resources and environment variables 6-3Generic driver resources 6-4Sybase driver specific resources 6-11Sybase environment variables 6-17

7 Appendix C: Storage file format and configuration options 7-1Storage file format 7-1Storage file field descriptions 7-2

8 Appendix D: BAAN IV Sybase database driver SQL queries 8-1No hash optimization, 8-1Unique index 8-1Duplicate Index 8-2Single hash optimization 8-3Unique index 8-3Duplicate index 8-4

Page 6: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Table of contents

Installation and Administration Guide for Sybase

iv

Page 7: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installation and Administration Guide for Sybase

v

This document addresses the BAAN IV Sybase database driver, which allowsBAAN application tables to be created and manipulated in the Sybase AdaptiveServer Enterprise (Sybase ASE) environment.

BAAN IVc4 and earlier releases support Sybase ASE 11.5. Later BAAN IVreleases support both Sybase ASE 11.5 and 11.9. This document describesprocedures required for both Sybase releases. This document flags those placesin the text where the Sybase version is significant to the context.

It describes how to install the BAAN IV Sybase database driver to be used withthe BAAN application software using Sybase as the database. This document isfor all persons who want to use Sybase as a database management systemworking with the BAAN application software in a UNIX server environment.However, an elementary knowledge of UNIX and Sybase is required.

The procedure for installing the BAAN software is described in the BAANInstallation Guide (U7016 US). This guide also contains a set of flow chartswhich depicts the place of the Sybase installation in the whole installationprocess.

The guide is divided into four chapters and four appendixes:

Chapter 1 is a general overview of the BAAN database driver architecture.

Chapter 2 describes the installation of the BAAN IV Sybase database driver.

Chapter 3 describes the administration of the BAAN IV Sybase database driver.

Chapter 4 offers configuration and tuning aspects regarding the BAAN IVSybase database driver.

Appendix A describes how to set the database drives behavior.

Appendix B lists the the database driver resources and environment variables.

Appendix C describes the file format of the storage file and the configurationoptions.

Appendix D lists the BAAN IV Sybase database driver SQL queries.

About this document

Page 8: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

About this document

Installation and Administration Guide for Sybase

vi

Page 9: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installation and Administration Guide for Sybase

1-1

This chapter describes the general architecture of the BAAN IV database driver.It supplies background information about the BAAN IV Sybase databaseinterface to the Sybase Adaptive Server Enterprise ( Sybase ASE ) relationaldatabase management system (RDBMS). This chapter also describes where theBAAN IV database driver files are located.

BAAN supports a wide range of databases by implementing an interface, calledthe BAAN database driver. The interface to the Sybase ASE RDBMS is theBAAN IV database driver.

As part of the BAAN Tools client/server architecture the BAAN IV databasedriver acts as an interface between the BAAN Tools and the active RDBMS. TheBAAN IV database driver acts as a server to the BAAN application andcommunicates with the Sybase RDBMS. The BAAN application being executedby the bshell program, sends database requests to the BAAN IV database driverand the BAAN IV database driver transfers the request to the Sybase RDBMS.The BAAN IV database driver sends data returned by the Sybase RDBMS backto the BAAN application.

An overview of the architecture is shown in the picture below.

Bshell

Client

BAAN/SYBASEDriver

Server

SYBASESQL Server

RDBMS

BAAN Query SYBASE Query

Figure 1-1, BAAN IV database driver architecture

1 BAAN IV Sybase database driveroverview

Page 10: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-2

BAAN SQL processingWhen the application server (indicated by the bshell in Figure 1-1) encounters adatabase query in the application that is being executed, it parses the query andsends an internal representation to the BAAN IV database driver. The BAAN IVdatabase driver translates this representation into one or more single-table Sybasequeries. The BAAN IV database driver connects to the Sybase RDBMS by usingthe Sybase client-library API. The queries are then handed over to the RDBMSfor processing. The rows returned by the RDBMS as a result of the queries arecollected by the BAAN IV database driver and sent back to the BAANapplication. The BAAN IV database driver handles the error conditions.

For BAAN query processing, the BAAN IV database driver receives database-independent representations of queries that are processed further to generateSybase RDBMS compatible queries. The BAAN IV database driver consists ofan RDBMS independent section and an RDBMS dependent section. When itcomes to evaluating the SQL expressions, it can occur that the Sybase RDBMScannot handle some expression. For example, the Sybase RDBMS may notsupport some operators such as the BAAN LIKE operator because the BAANdefinition of the operator is different from that of the Sybase RDBMS.Disparately defined expressions are translated by the BAAN IV database driverinto a Sybase equivalent statement that is supported by the Sybase RDBMS. Allexpressions that can be supported by the Sybase RDBMS are combined and thedatabase-dependent layer within the BAAN IV database driver generates adatabase expression.

BAAN IV database driver featuresThe following is a description of the main features of the BAAN database driverarchitecture.

BAAN data dictionary (DD)

BAAN has an internal data dictionary (DD) environment that is separate from theSybase RDBMS data dictionary. The BAAN data dictionary for a table containscolumn names, column types, and coulmn sizes, as defined and seen in theBAAN application. This could be different from same table representation inSybase.

Page 11: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-3

Security

The authorized BAAN users are registered in the administration files kept in$BSE/lib/sybase directory. The $BSE/lib/sybase/syb_users file contains theuser name and password in encrypted form. The BAAN IV database driverestablishes a connection to the database for the user using this password. Theadministration of these files is performed by user ‘root’ or by the ‘sybase’(database administrator) account. For every BAAN session there is acorresponding Sybase connection established by the BAAN IV database driver.

Referential integrity

Baan drivers do not depend on the underlying RDBMS for maintainingreferential integrity. This means that the BAAN Sybase database driver does notuses any of the Sybase features like references, foreign key, or triggers tomaintain referential integrity of the BAAN tables. All BAAN drivers have abuilt-in mechanism to take care of references.

Data buffering, reduction, and compression

When multiple rows are returned from a query, the rows are buffered, then sentback to the client as one block. Also, data reduction and compression are appliedto minimize the amount of data transferred between the application server(bshell) and the BAAN IV database driver.

Update actions, such as insert, update and delete, are buffered at the client sideand flushed at the time of transaction commit, or earlier when necessary. Thisreduces the number of network round-trips and data volumes.

Tuning aspects: profiling and statistics

The BAAN IV database driver also enables users to log timing aspects andstatistics. This is useful for tuning purposes, because the information may help toidentify performance bottlenecks. The BAAN IV database driver offers bothprofiling and statistics options which are described below.

Profiling

The profiling option of the BAAN IV database driver provides a way of lookingat SQL statements from the point of view of how long it takes for them toexecute. By using an environment variable to define a logging threshold based ona predefined number of seconds, you can create a list of all SQL statements thattake longer than that specified threshold to execute. This list is logged to a file,named sybprof, in the directory where the BAAN server database driver isstarted.

Page 12: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-4

Suppose the profiling environment variable is set to 5 sec, then each statementthat takes longer than 5.0 seconds (real time) is logged to the log file. Theinformation that is logged in the file is the SQL statement, with the elapsed timeand user, date/time. The maximum precision that can be specified with theenvironment variable is 0.01 seconds.

Two statement types are timed and can appear in the log file:

1 The execute eventThis event represents the amount of time the RDBMS engine took to executea SQL statement.

2 The fetch eventThis event represents the amount of time data is retrieved from the buffer.

Statistics

The BAAN IV database driver also provides an option to gather BAAN IVdatabase driver-wide statistics of actions being performed, such as:

n Number of cursors (opened, closed, current open)n Number of parses, binds, executes, fetchesn Number of logons (sessions)n Number of inserts, updates, deletesn Number of commits, rollbacks

For each action, the cumulative (real) time spent by the action and average timeis also logged. The statistics can be enabled with an environment variable. Whenthe variable is set to 0, a statistics report is generated when the BAAN IVdatabase driver terminates (exits from BAAN Tools or session). When a valuegreater than 0 is specified, the BAAN IV database driver logs an incrementalreport each [n] seconds (BAAN IV database driver must be active). The statisticsreport is written to a file in the directory where the BAAN database driver isstarted.

Further sections below on the BAAN IV database driver profiling and statisticsdescribe how the environment variable must be set to enable profiling andstatistics.

BAAN IV database driver interface

This section describes aspects of the BAAN IV database driver interface, such asmapping conventions, data types, constraints, column size, indexing, isolationlevel usage, transaction management, locking and optimization.

Page 13: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-5

Data dictionary mapping

Because the data dictionary (DD) of BAAN cannot be used directly by theBAAN IV database driver to create Sybase tables, the BAAN IV database driverperforms some mapping or translation to create the tables.

The conventions listed below play an important part in this process.

Mapping the BAAN data dictionary to the Sybase format

The BAAN environment keeps the table columns and index information in itsdata dictionary. The BAAN IV database driver uses this information for variousdatabase actions. But the BAAN IV Sybase driver for several reasons cannotdirectly use the information that is stored in the BAAN data dictionary.Supported data types and their meanings are defined differently by the BAANapplication and the Sybase RDBMS. Some of the characters used for columnnames in the BAAN data dictionary may not be used for column names in theSybase RDBMS. Therefore, after reading the BAAN data dictionary, theBAAN IV database driver maps that information into a format suitable for theSybase RDBMS.

Table name convention

A BAAN table, such as tfgld006, can be created for more than one company.These same tables for different companies may be created in same database. So atable name has to be made unique. The BAAN IV database driver makes thetable name unique by adding the company number as part of the table name. Ituses the following format for the table name:

t<Package>< Table name >< Company Number ( 3 digit ) >

For example, in package tf, table name gld006 with company number 505, hasthe corresponding Sybase table ttfgld006505. Note that the company number isalways defined with three digits, with leading zeros if necessary.

The BAAN IV database driver always accesses the table using theowner.tablename convention. So table ttfgld006505, created by user root, isaccessed as root.ttfgld006505 and the same table, created by bsp, is accessed asbsp.ttfgld006505.

Page 14: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-6

Column name convention

The BAAN IV database driver forms a Sybase column name by preceding theBAAN column name with the string “t_”. For example, a BAAN column namedcode, would have the corresponding Sybase column name t_code.

If the BAAN column is defined as an array of columns, each member of the arrayis treated by the BAAN IV database driver as a separate Sybase column and eachSybase column is named using the depth level to which it corresponds. Forexample, if a BAAN column ctod has depth 7, there are 7 Sybase columns namedt_ctod_1, t_ctod_2...in sequence to t_clod_7.

In Sybase, the maximum size of a character column is 255 bytes. If a BAANcharacter column is larger than 255 bytes, the BAAN IV database driver createsmultiple Sybase columns. So, if the BAAN column info is 600 bytes, then theBAAN IV database driver creates 3 columns, named t_info_1, t_info_2 andt_info_3. The first two columns are 255 bytes and the last column is 90 bytes, insize.

Because Sybase does not allow the period character [ . ] as a part of columnname, if a BAAN column name contains a period, it is replaced by theunderscore character [ _ ] when forming the Sybase column name.

Hash column name convention

The hash column is created for an index when the index has hash optimization.For more information on hash optimization, see the section in this manual onoptimization.

For each index with hash optimization, an extra column is created in the table.The name of this column is “hash” + Index Number. For example, the hashcolumn for index 1 will be named “hash1”, the hash column for index 2 will benamed “hash2”.

Index name convention

In Sybase the index name has to be unique per table. The BAAN IV databasedriver uses the index number to create the index name. For example, Index 1 on atable is named as I1a Similarly Index 2 would be named I2a.

Page 15: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-7

Stored procedure name convention

The BAAN IV database driver can optionally create and use stored proceduresfor singleton selects on unique indexes of a table. These stored procedure dosingleton selects on corresponding indexes at dirty read isolation.

For each unique index of a table, a stored procedure is created. The name of thestored procedure is formed as follows.

s<Package>< Table Name >< Company Number >< Index Number >

For example, in Table tiitm001, company 812, for index 1, the procedure nameis:

stiitm0018121

There is a variation of singleton selectthat is used to lock the record. This selectalways occurs on the primary index of the table. There is an extra storedprocedure created for doing a select with lock on the primary index. Thisprocedure does a select for update at isolation repeatable read (isolation 2).

The name of the stored procedure is formed as

s<Package><Table Name><Company Number>1L

Note that this name hasa similar format to the name of prodedures created fordirty read isolation. Since this procedure is always created on index 1 (only), andit is used to lock the row, the suffix is always “1L”, where “L” indicates thelocking variation.

Data types

The BAAN IV database driver uses the CHAR data type that conforms to theANSI standards, because the BAAN STRING data type has characteristics thatconform to the ANSI specifications. Operations such as comparison andconcatenation can be performed in an ANSI-compliant way when the CHARdata type is used. The table below shows the mapping between BAAN data typesand Sybase data types being used.

Page 16: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-8

The mapping between BAAN and Sybase data types is listed in the table below:

Mapping between BAAN and Sybase data types

BAAN data type Sybase data type

CHAR TINYINT

ENUM TINYINT

SHORT SMALLINT

LONG INTEGER

MAIL INTEGER

TIME INTEGER

TEXT INTEGER

BITSET INTEGER

FLOAT REAL

DOUBLE FLOAT

STRING CHAR

MULTIBYTE STRING CHAR

DATE DATETIME

Constraints

All the columns created by the BAAN IV database driver have the NOT NULLconstraint. BAAN does not use NULLS in the RDBMS. BAAN applicationshave internal representations to identify “undefined” values.

For hash columns, the Sybase data type BINARY is used.

When using the Sybase datatype DATETIME the minimum date that can bestored is 1/1/1753 and the maximum date is 31/12/9999. The BAAN IV databasedriver reserves the Sybase minimum date (1/1/1753) to indicate an unspecifieddate in BAAN (Date 0). Hence the date 1/1/1753 or earlier dates cannot be storedin the BAAN Sybase database. The BAAN IV database driver returns an errormessage NOT_IN_RANGE if such a date is specified.

For more information about Sybase datatypes and their minimum and maximumvalues, see the Sybase ASE Reference Manual.

Page 17: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-9

Hash column size

If an index is created with hash column optimization, additional column(s) arecreated in the table at the time of creation. The size of the hash column that iscreated depends on the type of the index column. The following table gives sizesof hash columns for various data types.

Field types and their hash column size

Field type Hash column size

Char 1

char(n) N

Short 3

Data 4

Long 5

Float (digv+diga+2)/2

Double (digv+diga+2)/2

digv = digits before, diga = digits after

If the index is a composite, the size of the hash column is the total of the sizerequired for each column in the index. For example, if the index consists of aLONG column and a CHAR column, then the hash column size is 6 (5 + 1).

If the index has single hash optimization, then the index has one such column. Ifthe index has double hash optimization, two such columns are created.

Index ordering

Starting with ASE 11.5, Sybase allows descending scans on index. This meansthat the same index can be used for ascending order by query as is used fordescending order by query.

NOTE

Page 18: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-10

Index uniqueness

All indexes built by the BAAN IV database driver are unique. If an index isdefined as duplicate in BAAN, it is still made unique by the BAAN IV databasedriver using one of the techniques described below.

1 If the index has the hash optimization option, using parts of that indexcombined with parts of the primary index (which is always unique) makes thehash column for that index. Thus each hash column value is unique in thetable because of primary key parts even though duplicate values are specifiedfor that index, and a unique index is created on this column.

2 If the hash optimization technique is not used, then a unique composite indexis created on columns of that index and columns of the primary index, whichare not parts of that index. For example, if the primary index is on bothcolumns c1, c2 and the duplicate index is defined on columns c8, c9, c10, theBAAN IV database driver actually creates an unique composite index on c8,c9, c10, c1, c2. If another duplicate index is defined on c1, c5, c6 then thatindex is created on c1, c5, c6, and c2. Here, because column c1 is also part ofa duplicate index, it is used only once, in the order sequence of that index andnot as part of the primary index.

Isolation level usage

The Sybase ASE 11.9 provides four isolation levels for select actions. Theseisolations are dirty read, commited read, repeatable read, and holdlock. For moreinformation about the isolation levels, refer to the Sybase ASE 11.9documentation .The BAAN driver does “select without lock” queries at isolationdirty read. For selects with lock, the repeatable read isolation level of is used.

The isolation levels do not apply to Sybase ASE 11.5.

The driver also uses the “for update” clause to obtain an update lock on theobject. If the “for update” clause is not used, a shared lock results. In that case,multiple users can lock the same row with selects, and later can deadlock eachother when trying to perform updates or deletes. Such deadlocks roll back thetransaction of of the users involved in the deadlock, reducing the throughput.When the “for update” clause is used, an update lock is obtained by one usersand other users are blocked until the first user releases the lock. This avoids thedeadlock condition.

WARNING

Page 19: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-11

Transaction management

The BAAN IV database driver does not use the ANSI-styled chained transactionmode of Sybase ASE.

The driver starts a explicit transaction when any of following actions arerequested:

n Select with lockn Lock tablen Insert rown Update rown Delete rown Clear table (delete all rows)

Once a transaction is started, it continues until either the application commits oraborts the transaction or an error forces Sybase ASE to abort the transaction. Ifan action fails, ASE aborts the transaction. When this occurs, the database drivernotifies the application of the problem.or an

Locking

Sybase ASE 11.9 provides the following lock granularities for tables:

This information does not apply to Sybase ASE 11.5.

n All Page LockingPage locks are used for data and index pages. This is the default mode when atable is created unless a different lock mode is specified. This lock mode isthe same as is used in earlier versions of Sybase.

n Data Page LockingPage locks are used for data pages. Index pages are not locked.

n Data Row LockingRow locks are used for data rows. Indexes are not locked.

In the BAAN environment, the lock mode for a table can be specified in thestorage file located in $BSE/lib/sybase/syb_storage. The storage file isdescribed in appendix C. Different lock modes can be specified for differenttables. If a lock mode is not specified for a table, the driver creates the table withdata row locking.

WARNING

Page 20: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-12

Sybase ASE 11.9 also provides a lock timeout feature. A user, blocked on a lock,can wait for a contolled interval to obtain the lock. If the blocking lock is notreleased before the end of the lock time-out period, Sybase ASE 11.9 fails therequest and aborts the transaction containing the failed request. This is differentfrom databases such as Oracle and Informix, where the transaction containing thefailed request is not aborted.

The lock timeout feature is not available to Sybase ASE 11.5.

Optimization

For every database action, the BAAN IV database driver, in principle, canconstruct a SQL statement, send it to the SQL server, parse it, execute it and getthe result. When the next request arrives, this cycle is repeated. But it representsan enormous overhead to execute all these steps for each command and theperformance will be very slow. The BAAN IV database driver uses varioustechniques to speed up performance. These techniques are based on theobservations of the client applications described below.

1 Selects are the most common actions on a table, followed by updates, inserts,and deletes. Further there are a fixed number of types of select, such as first,last, great, less, gteq, eqle, next, prev, equal, curr and their counterparts withlock option. Table level actions, such as create table, drop table, or cleartable, are infrequent. So, the Sybase RDBMS database administrator shouldattempt to optimize the select commands.

2 Generally when a table is accessed, more than one row from a set in that tableis read. There are exceptions such as checking a reference where only onedb.equal is performed. Another example is after performing db.first ordb.great many times, the BAAN application performs db.next until somecondition occurs. Similarly after performing db.last or db.eqle, frequentlydb.prev is executed.

Fetch optimization

Once a select query is executed, the result is a set of row(s) satisfying the whereclause. After the execution, just performing a fetch command on that cursor canretrieve all the rows in the set. This does not involve any execution and results ina quick retrieval.

The following are useful example cases:

1 When a db.first, db.great, db.gteq or db.next is executed, the resulting row setis in ascending order of the index. Now, if the command following this isdb.next, the cursor already has the suitable set and instead of performing aselect again, a fetch on the same cursor is sufficient.

WARNING

Page 21: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-13

2 When a db.last, db.less, db.eqle or db.prev is executed, the resulting row setis in descending order of the index. Now, if the command following this isdb.prev, the cursor already has the suitable set and instead of performing aselect again, a fetch on the same cursor is sufficient.

Thus execution of db.next or db.prev can be avoided if the last executedcommand on the table was a sequence command. In this case, a fetch is sufficientto move through the record. This technique is called fetch optimization.

Note that the command db.equal does not result in a set, so fetch optimizationcannot be performed if the next command is db.next or db.prev.

Effect of fetch optimization

The data set for a select is marked on the first fetch on the cursor. Afterperforming the first fetch, if a row in the set is modified by some other process,the first process still gets the old values on subsequent fetches because thosevalues were marked on the first fetch; it does not get the latest values. To addressthis problem, the concept of refresh time is used.

Refresh time

Refresh time is the number of seconds the data set remains valid after the firstfetch by a cursor. During this time, it is assumed that no insert, update, or deleteoperation is performed on table and the data set remains unchanged.

If refresh time is set for 5 seconds, then 5 seconds after the first fetch (forexample, fetch performed after executing the query), the data set for that cursoris assumed to be valid. With this assumption, the next record in the data set canbe accessed using fetch optimization (for example, by performing fetch on thecursor). If a fetch is to be performed after this time, the data set is treated asinvalid and a select has to be performed again.

The refresh time for a table is specified in the storage file. Since the frequency ofdata modification can vary from table to table, you should carefully define therefresh time. With a large refresh time, the BAAN IV database driverperformance improves but you may not get the latest data. With a smaller refreshtime, the performance degrades but chances of getting the latest data are good.

If the process locks the table, then other processes cannot modify the table data.

To update or delete a record, the latest row is needed for consistency, so when arecord is read for update, fetch optimization is disabled.

When an insert, update, or delete is performed on a table, the fetch optimizationis disabled for the next action on that table because the current data set is old.

Page 22: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-14

Hash optimization

Consider table1 with columns c1, c2, c3, c4, c5 having a composite index 1 onc2, c4, c5. The index is created as:

create unique index I1a on table1( c2, c4, c5 )

When a user wants to execute a db.first on this table, the required query lookslike:

select * from table1where c2 > ? or ( c2 = ? and ( c4 > ? or c4 = ? and ( c5 > ? ) ) )order by c2, c4, c5

When an “or” clause or a “where” clause is used as above, the RDBMSqueryoptimizer may decide to perform a sort, which degrades the performance.However, the sort can be avoided if the index is made on a single column. Forthis purpose, a hash column is used. The hash column is an additional column inthe table. It has a value that is obtained by concatenating all the key columnvalues using an algorithm. The index is created on this column (instead of theoriginal key columns). Thus the index consists of single column and the searchtime is reduced.

When a hash column is used, the index is created as follows:

create index I1a on ... ( hash1 ).

Then our query looks like:

“select ... where hash1 >= ? order by hash1 asc”.

This eliminates the sort and results in a faster query. This optimization is calledhash optimization

If a hash column is made unique, the index is also unique, further improvingqueries. The BAAN application always enforces the unique primary key. If anon-primary key is duplicated, the BAAN IV database driver still makes its hashcolumn values unique by computing the hash column values with the primarykey and the current key columns. Every hash column and every index is madeunique, irrespective of its definition in the BAAN data dictionary.

Page 23: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-15

Cache

The BAAN IV database driver maintains a single record cache for each table. Formany database commands, it is possible that the same command performed twicein succession on the same table with same key values fetches the same record.

For example, the command “Select * from table1 where X > ?” fetches the samerecord if executed twice in succession with same value of X, provided the table isnot modified between fetches. For such actions, if the record is saved in cache onthe first fetch, the same record can be returned during the next fetch thusavoiding a second fetch. To avoid duplicate fetches, use the refresh time (see thesection on fetch optimization). While the refresh time interval has not expired,both the cache and data in the cache is valid. If the same request comes after therefresh time interval, the catch is treated as invalid and data in it is not used.

This fact is true for error messages as well. If a duplicate fetch is attempted on acached database action that has resulted in an error, the error from the cache isreturned thus saving a statement execution. An exception to this is the recordlocked error. It is possible that first access got a record locked error and beforethe command was repeated, the lock was released by another process. In such acase the record-locked error is not cached and the record is marked as not foundin the cache, so an actual fetch has to be performed.

For some database actions, like db.next or db.prev it is not possible to use thecache due to the nature of these commands.

When an insert, update or delete is performed on a table, the cache becomesinvalid and is not used during the next database action.

At the end of transaction the cache is disabled so that a new transaction does notuse the cache data of the previous transaction.

Stored procedures

The Sybase database driver uses client library cursors to do selects. Each sessionuses several cursors to perform selects. A cursor cannot be shared acrosssessions. When a cursor is declared, several commands need to be sent from theSybase driver to ASE. ASE must parse and compile the select statement. Thisincreases network traffic as well as CPU requirements for ASE

The BAAN IV database driver provides the option of using stored proceduresinstead of cursors for the most frequent type of selects. In the BAANenvironment, singleton selects such as db.equal() are the best candidates forstored procedure usage. The stored procedures are used for unique indexes of atable.

Page 24: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-16

For a table, stored procedures are specified by OR’ing the flag 010 to the indexoptimization flag in the storage file $BSE/lib/sybase/syb_storage. For example,for hash column (001), 011 can specify stored procedures. See appendix C formore information on the storage file.

Stored procedures are created when the table is created. After creating the table,the BAAN IV database driver creates procedures for all the indexes on that table,which are defined as unique in BAAN. The BAAN IV database driver does notcreate procedures on duplicate indexes as defined in BAAN. The reason is thatduplicate indexes performed by the client does not result in db.equal() in theBAAN IV database driver. Hence the BAAN IV database driver never makesdb.equal() on a duplicate index and the stored procedure for that index is notrequired.

When the table is dropped, all stored procedures for that table are dropped.

If a user decides to use stored procedures for existing tables, the user shouldupdate the file $BSE/lib/sybase/syb_storage to indicate stored procedure usageand continue using the applications. When the driver tries to use a storedprocedure on a table and finds the stored procedure is missing, it will create thestored procedures. There will be no error returned to the application, which willkeep on working, now using the stored procedures.

A sample procedure is listed below:

create procedure dbo.saabdb9990001 @khash1 binary(3) asselect t_byte, t_int, t_date, t_long, t_string,t_refcntd, t_refcntu, hash1from dbo.taabdb999000 ( Index I1a )where hash1 = @khash1at isolation 0

Error reporting

The Sybase RDBMS performs error detection and reporting at two levels:

n Sybase ASE Errorsn Sybase Client-Library Errors

These two error-handling mechanisms operate independently of each other andhave their own error reporting mechanisms via callback routines, which can beuser supplied. The BAAN IV database driver installs callback routines for theSQL server messages and the client library messages.

Page 25: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-17

When a SQL command is executed, the following combinations can occur:

n No ASE error. No client-library error. This means that the command wassuccessfully executed. See the section on “Limitations” for exceptions.

n ASE error. No client-library error. This means that the command executionfailed.

n Client-library error. No ASE error. This means that the command executionfailed.

When an error is reported at any level, the BAAN IV database driver tries to mapit into one of the BAAN error code such as NOREC or ENDFILE. If a selectquery does not fetch any row, the BAAN IV database driver sets the error toNOREC, if the query was db.great, or to ENDFILE if the query was db.first.Similarly, if the SQL server error indicates that a select failed because there wasno table, the error is set to NOTABLE.

If the BAAN IV database driver encounters a ASE error code or client-libraryerror code that can not be mapped to application-defined errors, the error isreported to the application by adding 1000 to it. For example, if the BAAN IVdatabase driver encounters SQL server error 2812, which can not be mapped toany application-defined errors ( NOREC, ENDFILE ), this error code is reportedas 2812 + 1000, or 3812. The application sees the error code 3812.

The BAAN IV database driver logs all errors which could not be mapped toapplication errors into the log file $BSE/log/log.<driver name in tabledef>. If adatabase driver is defined as sybase in tabledef, all related errors are logged infile $BSE/log/log.sybase. The log entry consists of error number and errormessage text. Such errors are called generic errors.

Steps for analyzing errors

The Client-Library error entries in the log file are identified by the keywordCTLIB_ERROR. The SQL server error entries in the log file are identified by thekeyword SQL_ERROR.

If you receive a generic error (one not defined in the BAAN environment), suchas 3812, then subtract 1000 from this error code to get the actual error number.Then check the error log for the entry with the actual error code. The errormessage text can help to locate the problem.

Page 26: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver overview

Installation and Administration Guide for Sybase

1-18

BAAN IV database driver trace information

The BAAN IV database driver provides an option to log on-line informationabout the actions that are being performed by the BAAN IV database driver. Theresulting log file contains information that can help debug problems. Listedbelow is some of the information stored in log files.

n Table/index information (data dictionary)n The SQL statements being executedn Values of the input and output bind variablesn Other function-level debug statements

Several tracing categories are defined so that tracing can be enabled for onlythose categories that are of interest. Tracing can be enabled using theenvironment variable DBSLOG. See Appendix B for more information aboutDBSLOG.

Page 27: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installation and Administration Guide for Sybase

2-1

This chapter describes the following topics:

n Installation preparationsn Installing Sybasen Installing BAAN IVn Files required for the BAAN IV database drivern Tuning aspects

Installation preparationsThis section discusses the steps that must be performed before installing theSybase and BAAN software. The following sections describe the steps that mustbe performed:

n Tuning the kerneln Creating database devicesn Creating the required UNIX directories, groups, and usersn Setting environment variables

Tuning the kernel

Several kernel parameters must be adjusted before you can install the Sybase andBAAN software. The following parameters must be verified and changed ifnecessary:

n Shared memoryn Asynchronous disk I/On Number of users

The following sections give basic information on tuning requirements. If youneed more information, please refer to Chapter 1 of the Sybase manual InstallingAdaptive Server and OmniConnect on UNIX Platforms or your systemdocumentation.

2 Installing BAAN IV for Sybase

Page 28: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-2

Shared memory

For Sybase Adaptive Server to run, the operating system kernel must be set toallow a shared memory segment to be allocated. Although the shared memorysegment requirements that Sybase recommends vary by platform and are around24 MB, Baan recommends that you allocate at least 256 MB.

After you install Sybase Adaptive Server, you can increase the total memoryparameter by using the Sybase procedure sp_configure. When you increasememory for Sybase Adaptive Server, increase the operating system kernalparameters by a similar amount.

The procedure you must use to set shared memory depends on the platform youare using.

Setting shared memory

Platform OS configuration file Shared memory paramter

HP/UX Use the system administration manager (SAM).

Sun Solaris /etc/system shminfo_shmmax

IBM AIX N/A N/A

Digital UNIX /etc/sysconfigtab shm-max

For more information, refer to Chapter 1 of the Sybase manual InstallingAdaptive Server and OmniConnect on UNIX Platforms.

Asynchronous disk I/O

Depending on the system you are using, asynchronous disk I/O may need to beenabled. If you are using IBM AIX, you must enable asynchronous disk I/O. Ifyou are using an HP or Digital UNIX system you are recommended to enableasynchronous disk I/O. If you are using a Sun system, it is not required.

NOTE

Page 29: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-3

Enable Asynchronous Disk I/O

Platform Procedure

HP/UX 1) From the SAM Kernel Configuration menu, select Drivers

2) Set the Pending State for asyncdisk to IN

3) From the Actions menu option, rebuild the kernel andreboot the system

4) Execute the following statements as root at the UNIXcommand line:

% /etc/mknot /dev/async c 101 4

% chmod 0660 /dev/async

% chown sybase /dev/async

Sun Solaris Not required.

IBM AIX 1) Enter smit at the UNX command line.

2) From the Devices menu, select Asynchromous I/O.

3) Select the Change/Show Characteristics of AsynchronousI/O option.

4) Enter the following values for the SMIT parameter and entryboxes for AIX 4.1.2:

MINIMUM number of servers: 1

MAXIMUM number of servers: 10

MAXIMUM number of REQUESTS I/O: 4096

Server priority: 39

ASYNC I/O STATE to be configured at system restart: available.

If your system uses more than 7 disks at the same time for AIO,increase the MAXIMUM number of servers parameter by 1 forevery active device.

Digital UNIX Digital UNIX automatically enables asynchronous I/O but, bydefault, limits the number of concurrent I/O requests to 64. Ifyou expect to need additional requests for your Adaptive Serverinstallation, add the following lines to the /etc/sysconfigtab file:

rt:

aio-maximum=1024

For more information, please refer to Chapter 1 of the Sybase manual InstallingAdaptive Server and OmniConnect on UNIX Platforms.

Page 30: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-4

Number of users

The kernel of the UNIX machine must be tuned to accommodate the projectednumber of BAAN users. Please refer to your system administrationdocumentation to adjust this value.

Creating database devices

Several database devices must be created prior to installing the Sybase andBAAN software. Database devices are operating system files or raw portions of adisk used to store databases and database objects. Whenever possible, create thedevices on different disks. The following table specifies the database devices thatmust be created.

Required database devices

Device Purpose Recommendedsize

Recommendedtype

Master Stores Sybase systemdatabases

30 MB Raw partition

Sysprocsdev Stores Sybase storedprocedures

60 MB File system

baandata01 Stores BAAN IV data 2 GB Raw partition

baanindex01 Stores BAAN IV indexes 2 GB Raw partition

baanlog01 Stores BAAN IV logginginformation

100 MB Raw partition

baandbs01 Stores BAAN IV metainformation

100 MB Raw partition

Tempdbs Stores the Sybasetempdb database

100 MB File system

Creating the required UNIX directories, groups, andusers

Before installing the Sybase and BAAN software, the directories where they willbe installed should be created. In addition, for a first-time installation, severalUNIX users and groups must be created both for Sybase and for BAAN. Thefollowing sections specify the directories, users and groups that you need tocreate.

Page 31: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-5

Creating UNIX directories

You will need to create a home directory both for the Sybase products and forBAAN IV. To create these directories, do the following:

1 Create a directory for the Sybase product. Later, you will set an environmentvariable called SYBASE that will contain the path to this directory.

If you are upgrading from an earlier version of Sybase, be sure to create anew installation directory. Do not install the new version in the samedirectory as the earlier version.

2 Set the permissions of the SYBASE directory to read, write, and execute.

3 Create a directory for BAAN IV. Later, you will create an environmentvariable called BSE (BAAN Software Environment) that will contain thepath to this directory.

4 Set the permissions for the BSE directory to read, write, and execute.

Creating UNIX groups

You will need the UNIX group accounts sybase, bsp, and baan before you caninstall Sybase and BAAN IV. You can use a standard system administrationutility to add these groups. The following describes each of these groups.

n sybaseThe group sybase includes the users who are given system administrationprivileges for the Sybase database.

n bspThe group bsp includes the users who are given system administrationprivileges for the BAAN database. The group bsp must be given the UNIXgroup id 125.

n baanThe group baan includes all users who are given user access to the BAANdatabase.

WARNING

Page 32: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-6

Creating UNIX users

Several UNIX users are required for both the Sybase and the BAANinstallations. You can use a standard system administration tool to create therequired users. The following table gives details on these users.

UNIX users and groups

Logon id Primary group

sybase sybase

baan baan

bsp bsp

demo bsp

tools bsp

applic bsp

Be sure to assign the user bsp a user id of 125.

Setting environment variables

Several environment variables must be set for both Sybase and for BAAN IV.This section describes the variables that must be set before the software isinstalled.

Sybase environment variables

Four environment variables must be set in the .profile of the user sybase beforeSybase can be installed. Three of these variables are the same for all hardwareplatforms, but the fourth is platform dependent. The following are the threeplatform independent variables and the values they should be set to.

Platform independent environment variables

Environment variable Setting

SYBASE The complete path to the Sybase installationdirectory

DSQUERY The name of the Sybase instance that will be createdduring the BAAN installation, for example, baanIV

PATH Must include $SYBASE/bin

Page 33: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-7

The fourth environment variable that must be set in the .profile of the usersybase has different names for different platforms. This variable defines thelibrary path. How you set this variable depends on whether or not a previouslibrary path has been defined. The following table gives the names and settingsfor the library path for the different platforms.

Platform dependent environment variable

Platform Environment variable Setting

Sun Solaris

Digial UNIX

LD_LIBRARY_PATH If not set previously:

$SYBASE/lib

If set previously:

$SYBASE/lib:$LD_LIBRARY_PATH

HP-UX SHLIB_PATH If not set previously:

$SYBASE/lib

If set previously:

$SYBASE/lib:$SHLIB_PATH

IBM AIX LIBPATH If not set previously:

$SYBASE/lib

If set previously:

$SYBASE/lib:$LIBPATH

If the library path variable was set previously, be sure to add $SYBASE/lib firstin the path as listed in the table, otherwise you may encounter unresolvablesymbol errors.

BAAN environment variables

After installing BAAN IV, you can define the $BSE variables in the .profile filesof the users instead of in the system-wide /etc/profile. If you plan to installBAAN IV in a directory that previously existed, there may already be directoriesin the $BSE/home directory. If so, remove any .profile files from thesedirectories. The BAAN IV installation script creates .profile files for thedirectories of $BSE/home, but will not overwrite any files that already exist.

NOTE

Page 34: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-8

Installing SybaseThere are two steps to installing Sybase Adaptive Server: unloading the softwareand creating the Sybase servers. After Sybase is installed, several parametersmust be configured for BAAN IV. This section describes the following requiredsteps:

n Unloading the softwaren Creating the Sybase serversn Preparing Sybase for BAAN IV

Unloading the software

The Sybase Adaptive Server is distributed both on CD-ROM and on tape. Themost common distribution medium is CD-ROM, so the instructions belowassume a CD-ROM distribution. If you have a tape, please refer to Chapter 2 ofthe Sybase manual Installing Adaptive Server and OmniConnect on UNIXPlatforms.

The instructions below also assume that the machine you are using hasX Windows. If not, you must use the sybload utility to unload the CD-ROM intext mode instead of the sybsetup utility that is described below. If you do nothave X Windows, please refer to Chapter 2 of the Sybase manual InstallingAdaptive Server and OmniConnect on UNIX Platforms.

To install Sybase Adaptive Server from CD-ROM on a machine runningX Windows, do the following:

1 Place the Sybase CD-ROM in the CD-ROM drive. The next step is to mountthe CD-ROM. If you are installing on a Sun system, skip to Step 4. Solarismachines mount the CD automatically.

2 Log in as user root to a UNIX system attached to the CD-ROM drive. If youare installing Sybase on a machine that is not attached to the CD-ROM, youmust log in remotely.

Page 35: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-9

3 Mount the CD by entering the following platform specific command:

Platform Command

Sun Solaris Not applicable. Sun provides auto mount.

HP % /etc/mount -F cdfs -o ro device_name /cdrom

IBM AIX % /etc/mount -v cdrfs -r device_name /cdrom

Digital UNIX % /usr/sbin/mount -r -t cdfs -o noversion –o rripdevice_name /cdrom

Where device_name is the device name of the CD-ROM and /cdrom is thename of the directory where the CD is to be mounted.

4 Log in as sybase to the UNIX system attached to the CD-ROM drive.

5 Run the sybsetup utility to unload Sybase products from the CD-ROM usingthe following platform dependent command:

Platform Command

Sun Solaris % /cdrom/cdrom0/sybsetup

HP/UX

IBM AIX

Digital UNIX

% /cdrom/sybsetup

% /cdrom/sybsetup

% /cdrom/sybsetup

6 Select Unload Sybase Products from the sybsetup menu and follow thedirections on the screen.

7 Copy the sybsetup executable to your $SYBASE/bin directory. This allowsyou to run sybsetup to invoke the configuration utilities from the sybsetupgraphical interface.

8 Log in as root and enter the following platform dependent command tounmount the CD-ROM:

Platform Command

Sun Solaris % /usr/bin/eject cd

HP/UX

Digital Unix

% /etc/umount /cdrom

% /etc/umount /cdrom

IBM AIX % /etc/unmount /cdrom

9 When unloading is complete, remove the Sybase CD from the drive andcontinue with the following section, Creating the Sybase servers.

Page 36: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-10

Creating the Sybase servers

After you have unloaded the Sybase software, you are ready to create the Sybaseservers. You will need to create an Adaptive Server. In addition, you arerecommended to create a Backup Server. To create these servers, do thefollowing:

1 Start srvbuild, the Sybase server creation utility, either by clicking BuildNew Servers on the sybsetup main menu, or by typing the followingcommand at the UNIX command prompt:

% $SYBASE/bin/srvbuild

2 From the srvbuild menu, select Adaptive Server and Backup Server.

3 The Server Attribute Editor screen is displayed for the Adaptive Server. Enterthe following information:

server name The value of the DSQUERY variable

master device path name Enter the path to the master device

master device size 50

master database size 30

sysprocsdev device pathname

Enter the path to the sysprocsdev devicecreated in Chapter 1

sysprocsdev device size 60

sysprocsdev database size 60

error log path Accept the default path for the error log orenter a new path

4 Verify the connection information and set the Transport type, Host name,and Port number to values appropriate for your system.

5 The Server Attribute Editor is displayed for the Backup Server. Set theattributes as required.

6 Click Build Servers. You are asked if you would like to add a language otherthan U.S. English or a character set other than iso-1.

7 If you click Yes, the Add and Remove Languages screen is displayed.Choose the desired languages and character sets.

Page 37: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-11

Preparing Sybase for BAAN IV

Take the following steps to adjust the Sybase installation for BAAN IV:

1 Change directories to the Sybase installation directory defined by $SYBASE.

2 Use vi to modify the following entries in the DSQUERY.cfg file (in ourexample, baanIV.cfg) to the values listed below:

procedure cache percent = 50number of devices = 20default network packet size = 4096max network packet size = 4096tcp no delay = 1number of open indexes = 10000number of open objects = 10000total memory = 30000number of locks = 50000

3 Stop Sybase by entering the following commands:

$ isql -Usa -p””1> shutdown2> go

4 Start Sybase by entering the following commands:

$ cd $SYBASE/install$ ./startserver -f ./RUN_DSQUERY

5 After the output of the startserver command has stopped, press ENTER toreturn to command prompt.

6 Enter the following commands to define a password for the Sybase databaseadministrator sa. This password must be a minimum of six characters. In theexample below, the password is manager.

$ isql -U sa -P “”1> sp_password NULL, manager2> go

Page 38: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-12

7 Enter the following commands to enlarge the existing temporary database:

$ isql -U sa -P manager1> disk init2> name = “temp01”,3> physname = “pathname to raw device for temporary database”,4> vdevno = 2, (or whatever number is free)*5> size = 512006> go1> alter database tempdb on temp01 = 1002> go1> use temdb2> go1> create procedure sp_thresholdaction2> @dbname varchar(30),3> @segmentname varchar(30),4. @space_left int,5> @status int6> as7> dump transaction @dbname with truncate_only8> print “LOG DUMP ‘%1!’ for ‘%2!’ dumped”, @segmentname, @dbname9> go1> grant exec on sp_thresholdaction to dbo2> go1> sp_addthreshold tempdb, “logsegment”, 5120, sp_thresholdaction2> go1> exit

* The value for “vdevno” is 2 here. During installation, however, you mustuse sp_helpdevice to pick a free device number because the virtual devicenumber 2 may already be in use.

Installing BAAN IVTake the following steps to install BAAN IV:

1 Take the steps as described in the \* (U7016 US).

2 After you selected the Sybase database driver, you are asked to define thefollowing Sybase environment variables:

− SYBASE− DSQUERY

3 At a certain stage of the installation, you are asked if you want to go to thesystem prompt to perform Sybase specific actions. Enter Y.

Page 39: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-13

4 Enter the following command:

bshell6.1> syb_install6.1

5 Supply the information listed below:

S.A Login saS.A Password password for sa loginWant to create initial group? YInitial group baanGroup Passwd password for initial group (6 characters at minimum)Add group ‘baan’ YDo you want to create a device YWant to see list of devices N

6 At this point you must supply the names of and the pathnames to the rawdevices you created in the section Installation prerequisites, earlier in thischapter. You must, for example, supply the following information:

For each device you must supply an unused device number as well as the sizeof the device (must be the same as the size you specified in the sectionInstallation prerequisites). You can obtain a list of device numbers withsp_helpdevice. Do not mirror the devices.

− baandbs01This is the device name of the device to be used to store the BAAN IVmeta information. As the pathname you must insert the pathname of theraw device of 100 MB you created in the section Installationprerequisites, earlier in this chapter.

− baanlog01This is the device name of the device to be used to store the BAAN IVlogging information. As the pathname you must insert the pathname ofthe raw device of 100 MB you created in the section Installationprerequisites, earlier in this chapter.

− baandata01This is the device name of the device to be used to store the BAAN IVdata. As the pathname you must insert the pathname of the raw device of2 GB you created in the section Installation prerequisites, earlier in thischapter.

− baanindex01This is the device name of the device to be used to store the BAAN IVindexes. As the pathname you must insert the pathname of the raw deviceof 2 GB you created in the section Installation prerequisites, earlier in thischapter.

NOTE

Page 40: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-14

7 After you created the devices, you must supply the information listed below:

O.K. to create the database baan YSpecify device for database YDevice Name baandbs01Specify size for database YSize of Part (MB) 100 (same size as physical device)Specify device for database YDevice Name baandata01Specify size for database YSize of Part (MB) 2000 (same size as physical device)Specify device for database YDevice Name baanindex01Specify size for database YSize of Part (MB) 2000 (same size as physical device)Specify device for database NSpecify device for log YDevice Name baanlog01Specify size for log YSize of Part (MB) 100 (same size as physical device)Specify device for log NOK to continue YDo you want to create segments YSegment Name baandataDevice Name baandata01Do you want to create segments YSegment Name baanindexDevice Name baanindex01O.K. To continue YDo you want to create segments NWant to dump database/transaction Y

8 At this point a prompt is displayed. Enter the following commands:

1> use baan (same name as the name of the Initial group entered in step 5)2> go1> dump tran baan with truncate_only2> go1> exit

Page 41: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-15

9 You are returned to the syb_install6.1 script. You must supply theinformation listed below:

O.K. to create Group File YAdd Triton user ‘root’ YDB User rootDB Password passwordAdd Triton user ‘bsp’ YDB User bspDB Password passwordCreate Default Storage Entries Y

The passwords must be six characters at minimum.

10 Use vi to edit the $BSE/lib/sybase/syb_storage. This file should look likethe one given below (in the example below the segments for the BAANtables and indexes are called baandata and baanindex respectively)

*:*:T:group:011:5:SEGMENT baandata*:*:I::011::SEGMENT baanindex

The values in the example above (011) only apply to Sybase version 11.9. Ifyou use an older version of Sybase, you must replace these values by 001.

11 Enter the following commands to enable automatic flushing of the log devicefor the database (in our example database baan):

bshell6.1> isql -U sa -P sa password1> use baan2> go1> create procedure sp_thresholdaction2> @dbname varchar(30),3> @segmentname varchar(30),4> @space_left int,5> @status int6> as7> dump transaction @dbname with truncate_only8> print “LOG DUMP ‘%1!’ for ‘%2!’ dumped”, @segmentname, @dbname9> go1> grant exec on sp_thresholdaction to dbo2> go1> sp_addthreshold baan, “logsegment”, 5120, sp_thresholdaction2> go1> exit

NOTE

NOTE

Page 42: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-16

12 If you use Sybase 11.9, exchange the parameter syb_init. To change theparameter, create or edit the db_resource file with the vi editor. Thedb_resource file is in the directory $BSE/lib/defaults. At the end of thedb_resource file, add the following lines:

syb_init:01syb_lock_timeout:01

syb_init does not apply when you use Sybase ASE 11.5.

13 Exit the UNIX shell to return to the BAAN IV installation procedure.

Files required for the BAAN IV databasedriverThe table below lists the various files required for BAAN IV database driver (inthe directory $BSE/bin). These files will be moved to $BSE/bin by install.

Files in $BSE/bin

File File type Usage

syb_srv6.1 Unix executable BAAN IV database driver

syb_admin6.1 Shell script Sybase Driver Maintenance

syb_maint6.1 Unix executable Sybase Driver Maintenance

syb_install6.1 Shell script Sybase Driver installation

The table below lists the various files required for BAAN IV database driver (inthe directory $BSE/lib/sybase).

Files in $BSE/lib/sybase

File File type Usage

syb_users Ascii file Driver users

syb_groups Ascii file Driver groups

syb_storage Ascii file Driver specifications

syb_instmsg Ascii file Driver installation message

Files syb_users, syb_groups, syb_storage are created during installation bysyb_install6.1. File syb_instmsg is moved to the proper directory by install.

WARNING

Page 43: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-17

Tuning aspectsThis section describes facilities built in the BAAN IV database driver that can beused to tune its performance. This is different from tuning the Sybase ASE,which is described in the Sybase DBMS documents.

BAAN IV database driver statistics

The BAAN IV database driver has a built-in facility to keep detailed statisticsabout various events that occur. This statistics can be accumulated and printedfor a specified time interval. The following setup is required to print statistics:

Set the value of the sybstat variable, either through the shell variable or,preferably, in the $BSE/lib/tabledef{VERSION} file. The tabledef entry canlook like:

.:sybase(SYBASE=/dbms/sybase,SYBSTAT=45)

The value of the SYBSTAT variable is the time interval in seconds during whichstatistics are accumulated. A fractional value can not be specified.

For tables that require statistics, there should be a STATISTICS variabledefined in their storage file entry. If statistics is to be enabled for all itm tables,then the storage file can look like:

tiitm:*:T:group:011:10:STATISTICS

Now statistics are enabled for all itm tables. Also, it is accumulated for each 45-second period as specified in the tabledef file and at the end of each period,written into a text file. This file is called sybstat and is created in the directorywhere the BAAN IV database driver was started.

Page 44: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-18

Below is sample sybstat file.

<12900> 97-10-10[13:51:39]: Statistics [interval = 5]

CURSORS

Title Opened Closed Parse Bind Define Execute FetchCount 19 18 19 504 19 19 35Time(s) 0.12 0.00 0.13 0.03 0.06 0.12 2.43Average 0.01 0.00 0.01 0.00 0.00 0.01 0.07

DATABASE

Title First Last Next Prev Curr Great Gteq Equal Less EqleCount Read 1 1 7 6.0 0 0 1 0 0Cached Read 0 0 0 0 0 0 0 0 0 0Fetched Read 0 0 6 5 0 0 0 1 0 0Executed Read 1 1 1 1 0 0 0 0 0 0Time(s) Read 0.37 0.20 1.38 1.20 0.00 0.00 0.00 0.01 0.00 0.00Average Read 0.37 0.20 0.20 0.20 0.00 0.00 0.00 0.01 0.01 0.00Count Lock 0 0 0 0 0 0 0 0 0 0Time Locked 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00Average Lock 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

Title Insert Delete UpdateCount Exe 0 0 0Time(s) Exe 0.00 0.00 0.00Avg Exe 0.00 0.00 0.00

Title Commit RollbackCount Exe 0 0

SUMMARY

Total asc read(s) 0.22Total desc read(s) 0.20Total exact read(s) 0.20Total all read(s) 0.20Total cache hit (%) 0.00Total fetch opt (%) 0.00Total updates (s) 0.00Forced close 0Current open cursors 1

Page 45: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-19

CURSORS gives statistics about cursor actions. This includes the total numberof times an action is performed, the total time required for those actions andaverage time required per action.

DATABASE gives statistics about all read actions, all read-with-lock actions, allinsert, delete, update and transaction actions. For SELECT actions, theoptimization (fetch optimization or fetched from cache) is also counted.

BAAN IV database driver profiling

In order to determine which table actions are time-consuming you can set theSYBPROF environment variable to a number of seconds. All SELECT actionswhich take longer than the number of seconds that you have defined are writtento a file. The file includes information such the time for executing the query andthe retrieval of the result. This file is called sybprof and is stored in the directorywhere the server was started.

The profile value can be set as an environmental variable such as for the Bourneshell

$ SYBPROF=0.4$ export SYBPROF

An alternate way to set SYBPROF is to set it in $BSE/lib/tabledef file asfollows:

*:*:sybase(SYBASE=/usr1/sybase,SYBPROF=0.4)

This sets the value of the SYBPROF variable to 0.4 seconds. Actual profiling isperformed for selective tables. Tables for which profiling is required, shouldhave the PROFILE variable in their corresponding storage file entry. Forexample, after setting the above value in the tabledef file, if profiling is requiredfor all BAAN finance tables, then for these tables, the storage file entry can be asfollows.

tf:*:T:group:011:10:PROFILE*:*:T:group:011::

In this case, profiling is performed only on the finance tables. For any financetable, if a select takes more than 0.4 seconds, an entry is generated.

Note that if two tables have different SYBPROF values a separate BAAN IVdatabase driver will be started when the second table is accessed. Differentprofile values can be specified in tabledef file, such as:

tfgld005:*:sybase(SYBASE=/usr1/sybase,SYBPROF=0.1)tfgld006:*:sybase(SYBASE=/usr1/sybase,SYBPROF=0.2)*:*:sybase(SYBASE=/usr1/sybase)

Page 46: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-20

Profile output file format

The following is a sample sybprof file.

97-10-10[17:26:25]: Profiling value = 0.01 sec

Pid Table Owner I Mode Cache Exe Fetch Exe Fetch Total<12912> ttfgld006000 tools 1 FIRST - 0.36 0.01 - - 0.37<12912> ttgld006000 tools 1 NEXT - - 0.01 - - 0.01<12912> ttfgld005000 tools 1 LAST - 0.08 0.01 - - 0.09<12912> ttfgld005000 tools 1 PREV - - 0.01 - - 0.01

The first line is the header, indicating the start time and the value of theSYBPROF variable. The remaining lines are for various commands executed.

n Pid is the UNIX process id of the BAAN IV database driver.

n Table name is the table on which the action was performed.

n Owner indicates the owner of the table.

n I lists the number of the index used for query.

n Mode is the 4gl command executed such as db.first, db.next.

n Cache entry shows that a record was fetched from BAAN IV database drivercache.

n Profile timings are shown for two steps of a query, first for the execution ofthe query Exe and second for fetching data Fetch. Each entry in sybprofshows two Exe and two Fetches.

Effect of optimization

The BAAN IV database driver has a single record cache. If the row is fetchedfrom the cache, no query is executed. In the following example, both db.equalswere performed with the same key value. For the first command, a query wasexecuted and result fetched. For the next command, since the record was incache, it was used from the cache and no execute and fetch was required.

The record id the cache is indicated by the entry in the Cache column and noentries in any Exe or Fetch columns.

97-10-10[11:20:54]: Profiling value = 0.00 sec

Pid Table Owner I Mode Cache Exe Fetch Exe Fetch Total<11008> taabdb999000 tools 1 EQUAL - 0.18 0.17 - - 0.35<11008> taabdb999000 tools 1 EQUAL 0.00 - - - - -

Page 47: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-21

After executing an ascending sequence query such as db.first or db.great, if thenext query is db.next, the query is fetch optimized. There is no execute stage,only a fetch stage. Similarly after a descending sequence query such as db.last ordb.less, if the next query is db.prev, the query is fetch optimized. Below is asample output of such a case.

97-10-10[17:26:25]: Profiling value = 0.01 sec

Pid Table Owner I Mode Cache Exe Fetch Exe Fetch Total<12912> taabdb999000 tools 1 FIRST - 0.36 0.01 - - 0.37<12912> taabdb999000 tools 1 NEXT - - 0.01 - - 0.01<12912> taabdb999000 tools 1 NEXT - - 0.01 - - 0.01<12912> taabdb999000 tools 1 NEXT - - 0.01 - - 0.01<12912> taabdb999000 tools 1 NEXT - - 0.01 - - 0.01<12912> taabdb999000 tools 1 NEXT - - 0.01 - - 0.01<12912> taabdb999000 tools 1 LAST - 0.08 0.01 - - 0.09<12912> taabdb999000 tools 1 PREV - - 0.01 - - 0.01<12912> taabdb999000 tools 1 PREV - - 0.01 - - 0.01<12912> taabdb999000 tools 1 PREV - - 0.01 - - 0.01<12912> taabdb999000 tools 1 PREV - - 0.01 - - 0.01<12912> taabdb999000 tools 1 PREV - - 0.01 - - 0.01

In the above case, initially a db.first was performed followed by multiple db.next.The db.first is executed and fetched. The subsequent db.next are just fetched andnot executed. After the fifth db.next, a db.last is performed, which cannot beoptimized. So it is executed and fetched. The subsequent db.prev are againfetched without being executed.

Page 48: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installing BAAN IV for Sybase

Installation and Administration Guide for Sybase

2-22

Location of management file

The BAAN IV database driver uses the files in the directory $BSE/lib/sybase formanaging users and groups.

n syb_usersThis file has the lists of BAAN users with their Sybase user name, Sybasepassword and group name. The BAAN IV database driver uses syb_users tologin as a specific user.

n syb_groupsThis file has the lists of groups and their encrypted passwords. The passwordis used when performing logging as a group.

n syb_storageThis file contains specifications for the various tables. See the section on“Storage parameters” for more information.

n Sybase Error ReportsWhen the BAAN IV database driver encounters an error, an error message islogged in the file log.sybase, in $BSE/log directory.

Page 49: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installation and Administration Guide for Sybase

3-1

This chapter describes the administration procedures required for the setup of theBAAN IV database driver. All BAAN users have corresponding Sybase useraccounts and are grouped into Sybase groups. This chapter describes themanagement of these groups and users.

The BAAN group information is kept in a file $BSE/lib/sybase/syb_groups andis referred to as the group file. The BAAN user information is kept in a file$BSE/lib/sybase/syb_users and is referred to as the “user file”.

Group managementA group represents a login to Sybase, which is also the owner of the database ofthe same name as the group. A group named BAAN means there is a Sybaselogin name BAAN, with a non-null password, which is the owner of the databasename, BAAN. Also, in the database BAAN, there is a Sybase group created withsp_addgroup, which has the name BAAN. Multiple BAAN users can bemembers of this group.

Create a group

To create a group such as BAAN, use the Sybase system administrator accountsa. Create the Sybase login for BAAN, using the procedure sp_addlogin. Thenull password should never be used for any Sybase login.

The Group name cannot be the same as any existing group or Sybase user. It cannot be sa or dbo. The Sybase RDBMS has default databases named master,model, sybsystemprocs and tempdb. These names are reserve names and cannotbe used for group names.

3 BAAN IV Sybase database driveradministration

Page 50: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver administration

Installation and Administration Guide for Sybase

3-2

To add a login for group test, with the password testpwd, type the following:

Sybase passwords must be six characters at minimum.

$ isql –U sa –P password1> use master2> go1> sp_addlogin test, testpwd2> go1> create database test . . .2> go1> use test2> go1> sp_changedbowner test, true2> go

Now run the syb_admin tool to add the group to the BAAN group file. Use theAdd Group option in the User Administration menu of the tool.

Drop a group

To drop a group, several steps are required:

1 Drop the group from the group file, using the syb_admin tool.

2 If there are any BAAN users in the group to be dropped, as a precaution youcan not drop the group from the group file. In such a case you must first dropall the BAAN users from the group, then drop the group using the DropGroup option.

3 There is a database created for each group. It contains group tables as well asprivate tables for all the BAAN users in the group. If none of the tables in thisdatabase are required, this database can be dropped.

4 There is a Sybase login created for each group. If the Sybase login is nolonger required, drop it as follows.

$ isql –U sa –P password1> use master2> go1> sp_droplogin <groupname>2> go

The decision to drop a database must be made carefully. If any of the tables indatabase is required, the database should not be dropped. Once a database isdropped, the data in it is lost unless there is a backup.

NOTE

NOTE

Page 51: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver administration

Installation and Administration Guide for Sybase

3-3

Change the group user password

When a group is created, it is assigned a password, for the login procedure to thedatabase. After a group is created, this password can be changed any time.

Type the following to change the group password:

Sybase passwords must be six characters at minimum.

$ isql –U sa –P password1> use master2> go1> sp_password <sa password>, <new group password>, <group name>2> go

The group password is also stored in the group file. Use the maintenance toolsyb_admin to update the group file for a new password. Use the Change GroupPassword option in the User Administration menu of the tool.

BAAN user managementA BAAN user is represented by the environmental variable $USER. BAAN;setup is based on this variable. For logging to the Sybase ASE, the BAAN IVdatabase driver requires a Sybase user account and its password. Thus everyBAAN user is assigned a Sybase user account and password. BAAN users aregrouped to facilitate shared access to a table. A Sybase user represents a Sybaselogin, which is a non-dbo user in a database, such as a group database, and haspermissions to create tables and procedures in that database. The Sybase user is amember of a sybase group in the database. The group name is same as thedatabase name.

Add a BAAN user to a group

Before adding a BAAN user to a group, the group should exist. If the group doesnot exist, first create the group. Type the following to add a BAAN user to agroup.

The Sybase passwords must be six characters at minimum. A BAAN user canuse one Sybase user account only. The Sybase user name can not be the same asany of the existing group names. The Sybase user name can not be “sa” or “dbo.”

$ isql –U sa –P password1> use master2> go1> sp_addlogin <user name>, <user password>2> go

NOTE

NOTE

Page 52: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver administration

Installation and Administration Guide for Sybase

3-4

Add the user to the user file, using maintenance tool syb_admin. Use the Adduser option in the User Administration menu of the tool.

See the section on “Storage File Management” for issues regarding consistencyof storage files for group objects.

Drop a BAAN user from a group

To drop a BAAN user from a group, first drop the BAAN user from the user filewith the maintenance tool syb_admin. Type the following to drop the Sybaseuser:

$ isql –U sa –P password1> use master2> go1> sp_droplogin <user name>2> go

Change a Sybase user password

Every BAAN user has a Sybase login. The password for the Sybase login isassigned when creating the Sybase login. This password can be changed any timeafter the login is created.

To change the password, type the following:

The Sybase passwords must be six characters at minimum.

$ isql –U sa –P password1> use master2> go1> sp_password <sa password>, <new user password>, <user name>2> go

Run the maintenance tool syb_admin to change a user file. Use the Change Userpassword option in the User Administration menu of the tool to update the userfile with a new password.

Maintenance toolThe maintenance tool syb_admin is a shell script that runs on the Bourne shelland Korn shell. Listed below are major functionalities of this maintenance tool.

User administration

This option provides a facility for adding or dropping groups and adding ordropping users from a group.

NOTE

Page 53: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver administration

Installation and Administration Guide for Sybase

3-5

User information

This option can be used to list contents of the user file, group file or storage filein a formatted manner.

The script uses another program syb_maint, which actually performs all actions.But this is transparent to user.

Main menu

When syb_admin is run, the following menu is displayed:

M A I N M E N U

1 User Administration.2 User Information.3 Escape to shell.

e Exit.

Choice: 1The sections below describe each menu option in detail.

User administration

The BAAN user management is performed under user administration. Forsecurity reasons, only the Sybase system administrator ( UNIX login sybase )and root are allowed to perform user administration. To add and drop users orgroups, login as sybase or root. Any attempt to perform user administration withany other UNIX login fails.

Note that the procedure for adding and dropping a user or a group involves manysteps, as explained in the Group Management and BAAN User Managementsections above. The syb_admin tool only manipulates the user and group files, asa part of those procedures.

Here is the description of each screen that appears in the user administration tool.USER ADMINISTRATION

1 Add User.2 Drop User.3 Change User Password.4 Add Group.5 Drop Group.6 Change Group Password.

e Exit.

Choice: 1

Page 54: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver administration

Installation and Administration Guide for Sybase

3-6

Add user

Use this option to add a BAAN user to a user file. Required inputs are the BAANuser name, the Sybase user name, the Sybase user password, the Sybase group towhich the BAAN user is to be added, and the group password. This is the laststep to be performed when adding a BAAN user, as explained in the BAAN UserManagement section above.

The following verifications are performed before the user entry is added to thesyb_users file.

1 The user login, which is running the syb_admin is either sybase or root.

2 The group should exist in the syb_group file.

3 The BAAN user should not exist in the syb_users file.

4 The Sybase user should not be already in use by other BAAN users. If anexisting BAAN user named trade is using the Sybase user bsp, no otherBAAN users can use that Sybase user account. Also the Sybase user namecan not be sa, since this represents the system administrator. The Sybase username should not be an existing group name.

5 Using the given Sybase user password, it should be possible to login toSybase and access the group database. The password specified should besame as the one specified when creating the login for the Sybase user.

Multiple BAAN users can not share a Sybase user account. Thus there is a one-to-one relationship between a BAAN user and a Sybase user.

If any of the above checks fail, the operation fails with an appropriate errormessage. Otherwise, an entry is added for the user in the user file. The user isalso added to the database group using sp_adduser.

Drop user

This is the first step in the procedure for dropping a BAAN user, as explained inthe section BAAN User Management above.

This option is used to drop a BAAN user from the user file. The BAAN username, the group name to which the user belongs, and the group password arerequired inputs.

The user login that is running the syb_admin must be sybase or root. If thiscondition is not satisfied, the BAAN user is not dropped from the user file. Also,the user can be dropped from the database group using sp_dropgroup.

Note that if the user owns some objects in the database, sp_dropuser fails and theuser can not be dropped.

NOTE

Page 55: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver administration

Installation and Administration Guide for Sybase

3-7

Change user password

This is used to change the password for the Sybase user (corresponding to aBAAN user in the user file. This is the last step in the procedure for changing theuser password.

The BAAN user name, corresponding Sybase user name and the new passwordare required input. The user file is updated with new password. If logging intoSybase with the new password fails, the user file is not updated.

Note that this option should not be used to change the group password, for whichthere is a separate option.

Add group

This is used to add a Sybase group entry to a group file. This is the last step inthe procedure for creating a group, as explained in the Group Managementsection above.

The name of the group to be created and the group password (which is used tolog into Sybase as group) are required.

1 The following verifications are performed before the group entry is added tothe group file.

2 The user login, running the syb_admin is either sybase or root.

3 The group name should not be sa, which represents the Sybase systemadministrator. Sybase DBMS creates three databases during installation:master, model and tempdb. The group name can not be the same as any ofthese names.

4 No group or Sybase user should exist with the same name as the group name.

If any of the above checks fail, the operation fails with an appropriate errormessage. Otherwise an entry is added in the group file. A group is created in thedatabase by using sp_addgroup. The group is granted permissions to create tablesand procedures in the database.

Page 56: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver administration

Installation and Administration Guide for Sybase

3-8

Drop group

In the first step of the procedure for dropping a group, the user is prompted forthe name of the group to be dropped and its password. The followingverifications are performed before the group entry is dropped from group file.

1 The user login, running the syb_admin is either sybase or root.

2 The group should be empty; there should be no users in the group. This checkis provided as a safety measure against mistakenly removing a group in use.

If any of the above checks fail, the operation fails with an appropriate errormessage. Otherwise the entry is deleted from the group file. The group isdropped from the database by using sp_dropgroup.

If the database group is not empty, sp_dropgroup fails and the group can not bedropped.

Change group password

This is the last step in procedure of changing group password. The group nameand new password are required input. If logging into Sybase with the newpassword fails, the group file is not updated. Otherwise the group file is updatedwith the new password.

User information

This option is used to list the contents of the user file, group file and storage file.It also provides an option to edit the storage file.

User Information

1 List Users.2 List Groups.3 List Storage.4 Edit Storage.e Exit from this menu.

Choice: 1

List users

This option lists all the BAAN users in the user file with the correspondingSybase users and their respective group.

List groups

This option lists all the groups in the group file, listing the users in each group.

NOTE

Page 57: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver administration

Installation and Administration Guide for Sybase

3-9

List storage

The storage file contains information about tables and indexes. This option canbe used to selectively display the information about a table or index. An object isidentified in a variety of ways, such as the owner’s BAAN user name, the tablename, or the customer number. A BAAN user name could be trade, a table namecould be tfgld006 and a customer number could be 005. The object can be T, I orIn where n is the index number such as I4. If object is T, then the tableinformation as well as the information of all the indexes on those tables isdisplayed. If the object is I, the information of all the indexes on that table isdisplayed. If the object is a specific index such as I4, then the information forthat index only is displayed.

The owner name, the table name and the company number qualify an objectentry in the storage file. If an exact entry is not found in the storage file for anobject, then the default entries are used if they exist. For example, assume thatthe storage file is as follows:

{fin1}tfgld006:*:T:private:001:5:{fin2}tfgld006:*:I1,I2,I3::001::SEGMENT seg2::T:group:001:5:{fin2}*:*:I::001::SEGMENT seg2*:*:I::001::SEGMENT seg1

In the above file, for user fin1, the table specification entry exists for tfgld006.But there is no specific index specification entry for fin1 so the default indexentry ( the last line ) is used for all the indexes. For user fin2, there is no specifictable entry for tfgld006 so the default table entry is used ( third line ). But anentry exists for indexes I1, I2, and I3. So for these indexes, the specifications inline 2 are used. For other indexes the default index entry for fin2 is used ( fourthline ). If index optimization is not specified in an index entry, the one in the tableentry is used as the default. Refresh time is meaningless in case of indexes.

If for a table, some indexes have a specific entry and there is also a default entryand if the object selected is T or I then the default index specifications as well asspecific entries are shown. For example, if the user is fin2, the table is tfgld006and the object is I, the first default index specifications are shown, then the onesfor I1, I2, I3 are shown.

Edit storage

Edit the storage file using the vi editor.

Page 58: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver administration

Installation and Administration Guide for Sybase

3-10

Escape to shell

This option creates a child shell. When you log out of that shell, you are returnedto the main menu.

Storage file management

Information about Sybase tables is specified in a file$BSE/lib/sybase/syb_storage, commonly called a storage file.

When putting the table or index specifications in the storage file, care should betaken not to create multiple specifications that refer to the same group table orindex. This is explained in the example that follows.

acp:acp:<Encrypted Password>:financeacr:acr:<Encrypted Password>:financegld:gld:<Encrypted Password>:financesls:sales:<Encrypted Password>:tradepur:purchase:<Encrypted Password>:trade

Three BAAN users acp, acr and gld are in the same group named finance.

Now consider following storage file.

{acp}tfgld006:505:T:group:000:0:{acr}tfgld006:505:T:group:001:0:{gld}tfgld006:505:T:group:001:0:{sls}tdinv001:606:T:group:001:5:{pur}tdinv001:606:T:group:001:5:::I::::

This file is valid from the syntax point of view. But since acp, acr and gld are inthe same group, they refer to the ame group table tfgld006 with differentspecifications. This is conflicting and leads to trouble. If the table does not existand if acp creates the table, the server creates the table without hash columnsbecause the entry for acp specifies no hash optimization. If acr tries to access thattable, the BAAN IV database driver assumes that an index has a single hashcolumn and will try to use it in a query. Since the column does not exist thequery fails and the database call produces an error. A similar problem exists withthe table tdinv001 for BAAN users sls and pur, when sls creates the table and purtries to access it.

This situation can be avoided if a common entry for all BAAN users in the groupis created, as follows:

{acp,acr,gld}tfgld006:505:T:group:001:0:{sls,pur}tdinv001:606:T:group:001:0:

Page 59: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver administration

Installation and Administration Guide for Sybase

3-11

Now there is only one set of specifications for the group table. When a new useris added to the group, this entry should be modified to include the new user.When a user is dropped from the group, that user’s name should be dropped fromthis entry.

This problem occurs only if an installation has more than one group. If aninstallation has a single group, a group table entry can be created that isapplicable to all users. For example:

tfgld006:505:T:group:001:0:

If there are any private tables of the same name, those entries should be placedbefore this entry.

When an installation has multiple groups, for group objects such as a table orindex, a single entry should be created that consists of all BAAN users in thegroup. Not following this rule may lead to inconsistencies in the storage file andruntime errors.

The syb_maint6.1 toolThe tool syb_admin uses the syb_maint6.1 tool to perform administration tasks.The tasks performed by syb_admin can also be started manually by invokingsyb_maint6.1.

syb_maint6.1 performs several administration functions. Each function requirescertain options to be specified. In the function descriptions below, all optionsmust be specified unless they are listed within brackets. For options listed withinbrackets, exactly one of the two sets of options within brackets must be specified.

Note that changes made through syb_maint6.1 will not effect the files syb_usersand syb_groups. Any unknown user specified as input to syb_maint6.1 will becreated.

The syb_maint6.1 functions and their required options are explained below:

Adding a user to a group:syb_maint6.1 –a<BAAN IV user>

–m<Sybase user> –p<user password> –G<group name>–P<group password>

Changing a user password:syb_maint6.1 –r<BAAN IV user>

–m< Sybase user> –p<new user password>

Dropping a user from a group:syb_maint6.1 -d<BAAN IV user>–G<Group name> –P<group password>

Page 60: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver administration

Installation and Administration Guide for Sybase

3-12

Adding a group:syb_maint6.1 –A<group name>–P<group password>

Changing a group password:syb_maint6.1 -R<Group name> –P<new group password>

Dropping a group:syb_maint6.1 –D<group name> –P<group password>

Listing users:syb_maint6.1 –l

Listing groups:syb_maint6.1 –L

Listing storage:syb_maint6.1 –S<table> -u<BAAN IV user> -C<customer number> -O<object>

Printing usage information:syb_maint6.1 –U

Printing version information:syb_maint6.1 { –v | –V }

Page 61: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installation and Administration Guide for Sybase

4-1

This chapter supplies information about aspects of the general configuration andtuning that includes:

n Sybase database configuration and tuning aspectsn BAAN IV Sybase database driver configuration and tuning aspectsn SUN tuning aspects

Configuration and tuning aspectsConfiguring and tuning the Sybase database is important in order to removepossible performance bottlenecks and to optimize the BAAN performance on theSybase database. In this appendix several topics are described briefly. For furtherdetails, refer to the Sybase server documentation.

High-level lock retries

When a row-lock cannot be acquired, high-level lock retries are initiated. Thismeans that the same action is performed after a sleep period. The environmentvariable LOCK_RETRY or the resource variable lock_retry can define the retrypattern. This can contain a comma, separated list of combinations of number ofretries and sleep periods in milliseconds (ms), for example:

LOCK_RETRY=”5*100,5*500”

or

lock_retry:”5*100,5*500” (resource variable)

This is the default retry pattern, which means that the action is retried 5 timeswith a sleep period of 100 ms, then 5 times with a sleep period of 500 ms. Thelock retries can also be disabled by specifying:

LOCK_RETRY=”0”

or

lock_retry:”0”

This is a feature common to all database drivers.

The LOCK_RETRY variable can be used in both level-1 and level-2 databasedrivers.

4 BAAN IV Sybase database driverconfiguration and tuning aspects

NOTE

Page 62: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver configuration and tuning aspects

Installation and Administration Guide for Sybase

4-2

Optimistic and pessimistic reference checks

To optimize concurrency the BAAN IV Sybase database driver supportsoptimistic and pessimistic reference checks. In lookup reference mode wheninserts are performed in a child table, the BAAN IV Sybase database driververifies that the reference exists in the parent table and locks the row in order tobe sure that another user cannot delete it within the current transaction. Thisapproach is called the pessimistic approach. This approach also blocks an insertof another user referencing the same parent row, thereby affecting theconcurrency. Another approach to this problem is that a row in the parent table isnot locked, depending upon the choice of the user. This approach is called theoptimistic approach. As the record is not locked, another user can still perform aninsert operation, which improves the concurrency.

File formatsThe BAAN environment uses various files for administration. Some of these arecommon to all database drivers, while others are specific to a single databasedriver.

This section describes the format of various files used specifically by theBAAN IV Sybase database driver. For information on files common to alldatabase drivers, refer to the BAAN Tools Technical Manual.

File $BSE/lib/sybase/syb_users

The BAAN IV Sybase database driver to connect to the Sybase ASE uses thisfile. This file is commonly called the user file.

The user file contains information on all BAAN users on the system who use theBAAN IV Sybase database driver. Each line in this file is made up of four fields,which are separated by a colon (:).

< BAAN User >:< Sybase User >:< User Password >:< User Group >.

BAAN user

This is the value set for the variable $USER.

Sybase user

This is the Sybase login using the database that is accessed. This can be differentfrom the BAAN user name. BAAN users can not share the Sybase login.

Page 63: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver configuration and tuning aspects

Installation and Administration Guide for Sybase

4-3

Sybase user password

This is the password assigned to the Sybase user while creating a Sybase login.The BAAN IV Sybase database driver to log into the Sybase ASE uses thispassword. The password is stored in encrypted form.

User group

This is the group to which the BAAN user belongs. A sample user file is shownbelow.

acp:acp:MyNO?%H$h9/Bnc9yb/@2‘(llU=8:4Wbj:financeacr:acr:\‘$YW/k\RfbL^<qhM<vxk3Dhm2ayV^]7:financegld:gld:>9~[{’EOu^UA,)[(vt\MTw3y=AhTdPgK:financesls:sales:N$x’1$xHoY+^5hm[.:7JQx-;B(=>@,^/:tradepur:purchase:KqJeZwD@PC6d3Z+KojKb,;/utq%0nJa+:tradet1:tool1:jkfjkdjkjkjd3Z+KojKb,;/utq%0nJa+:toolst2:tool2:KqJjsfjkjsdfj*and#ojKb,;/88890nJB-:tools

Here is an explanation of the user file shown in the above example.

Explanation of sample user fileBAAN user Sybase user GroupaAcp acp financeaAcr acr financegGld gld financesSls sales tradepPur purchase tradeT1 tool1 toolsT2 tool2 tools

The Sybase user can be different from the BAAN user. Also multiple BAANusers cannot share a Sybase user.

This file is created and maintained by the maintenance utility syb_admin.

File $BSE/lib/sybase/syb_groups

The BAAN IV Sybase database driver to connect to the Sybase ASE uses thisfile. This file is commonly called the group file.

This file contains information on all groups used by all BAAN users who use theBAAN IV Sybase database driver. Each line in this file is made up of two fields,which are separated by a colon (:).

< Group Name >:< Group Password >

Page 64: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver configuration and tuning aspects

Installation and Administration Guide for Sybase

4-4

Group name

This is the name used by the BAAN IV Sybase database driver to login to SybaseASE when performing table-level actions, such as create table, and drop table forgroup tables. This is a Sybase login and the login is owner of a database of samename.

Group password

This is the password assigned to the group when a Sybase login was created forit. The password is in encrypted form. The BAAN IV Sybase database driveruses this password, when it performs login as a group.

A sample file is shown below.

finance:5tT’”I*/qmn;7cORtYP:8*Hksop*9‘g6trade:ESMQ3Ti(khD‘@@a+,y”75+B5andNEno<f”tools:B8jkj8%*’jkjlkjsKJLJkjRjjkJLjlUt

Here the group file contains groups finance, trade and tools.

This file is created and maintained by the maintenance utility syb_admin.

File $BSE/lib/sybase/syb_storage

This file is used to specify various object parameters for the BAAN IV Sybasedatabase driver. This file is more commonly called the storage file. TheBAAN IV Sybase database driver references this file while creating objects aswell as during data manipulation, such as queries. This file can be created andmanaged by any text editor such as vi or any other UNIX utility.

Each line in this file consists of seven fields that are separated by a colon (:). Theformat of the line is as follows.

[{BAAN user}]< table_name >:< customer number >:< object >:< owner type >:< indexoptimization >:< refresh time >:[< storage specifications >]

The fields in square brackets are optional. An explanation of each field follows:

BAAN UserThe table information can be specified per BAAN user. This can be performedby putting the BAAN user name in curly brackets, {}. Then specifications in thisline are applicable to that BAAN user only. A list of BAAN users can also bespecified, each user being separated by a comma (,). For example, {acp,gld,acr}.

If a BAAN user is not specified, the information is applicable to all BAAN users.

Page 65: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver configuration and tuning aspects

Installation and Administration Guide for Sybase

4-5

Table NameThis is name of the referenced table. This may be specified in one of thefollowing formats, using the asterisk (*) as a wildcard:

n “*” means all packages, such as “{acp}*:...” or “*:

n Package code “{acp}tf,tc:...” or “ti,td,tt:...”.

n Package and module code “{acp}tfacp:...” or “tiitm,tdsls:...”.

n Package code, module code and table number “{acr}tfacr011:...” or“ttadv999,ttadv995:”

n A combination of the above options, separated by comma “,”“{gld}tfgld006,tfacp,tccom010,ti:....”

Customer NumberThe customer number can be specified in one of the following formats:

n “*” means all customer numbers. tf:*:...n A 3 digit customer number, {gld}tfgld:001:....n A comma separated list of 3 digit customer numbers.

“{gld}tfgld:001,002:...”.

ObjectThe object, to which this line refers can be specified in the following formats:

n “*” table and all indexes on it.n T the table only.n I all indexes on a table.

One or more indexes on the table, indicated by In where n is the number of theindex, such as I10. You can also specify a list of indexes, separated by comma,such as I2,I10,I4.

Owner TypeThis defines the type of owner for a table. The type can be either private orgroup. Its owner can access a private table only. All users in that group canaccess a group table.

This field is meaningless for indexes because all indexes are used internally bythe Sybase ASE and are not accessed explicitly by a user.

Page 66: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver configuration and tuning aspects

Installation and Administration Guide for Sybase

4-6

Index OptimizationThis is to specify the level of index optimization. This can be specified as octalor hexadecimal number.The following values are applicable:

n 000Use no hash columns

n 001Use single has optimization

n 010For singleton selects on this table, the BAAN IV Sybase database drivercreates and uses stored procedures. This flag is specified for the table.Procedures are used for all unique indexes of the table.

You can specify a default optimization value for each index in the correspondingtable line. If an index specification does not contain this parameter, the defaultoptimization is taken from the corresponding table entry.

Refresh TimeRefresh time is used to set the validity period of a data set, when optimization isin effect. Refresh time is meaningful only for tables; for indexes it is ignored.This is specified as number of seconds. If none is specified, the default value iszero.

For usage of refresh time, refer to section on Optimization in the chapter on theBAAN IV Sybase database driver.

StorageThe BAAN IV Sybase database driver provides a facility for controlling variousparameters used for creating and accessing tables. These parameters are specifiedin the storage file. For detailed information on these parameters, refer to thechapter on the BAAN IV Sybase database driver. Options which are applicableto table are as follows.

SEGMENT “segment name”ROWSPERPAGE nPREFETCH mCACHE “lru”/”mru”CURSROWCOUNT nLOCKMODE “allpages”/”datapages”/”datarows”STATISTICSPROFILE

Page 67: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver configuration and tuning aspects

Installation and Administration Guide for Sybase

4-7

Note that some of the options require a number as value. Options that areapplicable to indexes are as follows.

SEGMENT “segment name”FILLFACTOR nROWSPERPAGE nCLUSTERED

A default table and index entry (covering all user/tables/customer number) mustbe present. In the above example, the last two lines are the default table andindex entries.

NOTE

Page 68: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

BAAN IV Sybase database driver configuration and tuning aspects

Installation and Administration Guide for Sybase

4-8

Page 69: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installation and Administration Guide for Sybase

5-1

There are several facilities available for configuring the BAAN IV Sybasedatabase driver. The most common is through driver resources. Two otherfacilities for configuring the BAAN IV Sybase database driver are environmentvariables and the storage file. The driver resources and environment variables aredescribed in more detail in Appendix B and the storage file in Appendix C.

Driver resourcesThe database driver resources are parameters that can be set to modify thebehavior of the BAAN IV Sybase database driver. These parameters are set in afile called the resource file (db_resource). There is one resource file for alldatabase drivers that run in a BAAN IV environment; resources for all thedatabase driver types can be found there. A database driver reads the parametersset in the resource file when it is first invoked.

The resource file may contain many entries, with one entry per line. Each entry isused to set a single resource parameter, with the resource name followed by acolon and then the value to which the resource is to be set. The following is anexample of the contents of a resource file containing two entries:

syb_init:01syb_login_timeout: 300

When modifying the behavior of the database driver, it is often necessary tomodify the behavior of the BAAN IV application virtual machine to takeadvantage of the characteristics of the database driver. Therefore, there are twotypes of database driver resources: those that are used to modify the behavior ofthe database driver and those that are used to modify the behavior of theapplication virtual machine. Driver resources that are used to modify databasedriver behavior are called resources for the server. Driver resources that are usedto modify behavior in the application virtual machine are called resources for theclient.

5 Appendix A: Setting database driverbehavior

Page 70: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix A: Setting database driver behavior

Installation and Administration Guide for Sybase

5-2

In a UNIX environment, the resource file, db_resource, is located in thedirectory $BSE/lib/defaults, where $BSE refers to the directory where theBAAN IV software environment is installed. When both the database driver andthe application virtual machine run on the same machine, there will be only onedb_resource file containing all the necessary resources parameters. When thedatabase driver and the application virtual machine run on different machines,there must be one db_resource file located on the machine running the databasedriver that contains the server resources, and one db_resource file located on themachine running the application virtual machine that contains the clientresources.

In addition to the default resource file, db_resource, it is possible to set up analternative resource file to override resource values for specific users or groupsof users. The alternative resource file is specified with the environment variablesUSR_DBS_RES and USR_DBC_RES. USR_DBS_RES is used to specify thepath to a file containing an alternative resource file for the server and must be seton the machine running the database driver. USR_DBC_RES is used to specifythe path to a file containing an alternative resource file for the client and must beset on the machine running the application virtual machine. Any driver resourceset in the alternative resource file will override the setting of the same driverresource in db_resource. The next section describes how to set the databasedriver environment variables.

Environment variablesEnvironment variables can be used to override driver resources. Usually, adefault set of resource parameters is configured in the resource file. Theadministrator can override these default settings with environment variables.

For the most part, there is an environment variable corresponding to eachresource parameter. The environment variable name is usually the uppercaseequivalent of the resource parameter name. As with the database driverresources, some environment variables are used to modify the behavior of thedatabase driver (server) and some are used to modify the behavior of theapplication virtual machine (client). When a database driver environmentvariable for the server is to be used, it must be set on the machine running thedatabase driver to override the corresponding driver resource. When a databasedriver environment variable for the client is to be used, it must be set on themachine running the application virtual machine to override the correspondingdriver resource.

Page 71: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix A: Setting database driver behavior

Installation and Administration Guide for Sybase

5-3

Server environment variables

Environment variables that affect the database driver can be used to override thedriver resources for all tables in a database or for specific tables and companynumbers within the database. There are three ways to set the database driverserver environment variables:

n By using the BAAN IV sessions Maintain Database Definitions(ttaad4100m000)

n By manually modifying the BAAN IV tabledef6.1 file

n By using the standard operating system mechanism for setting environmentvariables

The BAAN IV session Maintain Database Definitions is the recommendedmethod to modify database driver behavior. This session causes environmentvariables for a particular database driver to override the defaults set in theresource file and allow the environment variables to be maintained centrally.

The session Maintain Database Definitions maintains database driverconfiguration information in a file called tabledef6.1. This file is stored in thedirectory $BSE/lib residing on the machine where the database driver runs.While it is recommended that the Maintain Database Definitions session beused to maintain this file, advanced users can modify this file manually. Theformat of the tabledef6.1 file is as follows:

<table name>:<company number>:<driver type>(<environment variable>=<value>)

If multiple environment variables are to be specified for a single table andcompany number, they are listed within the parentheses and separated bycommas. If all tables or all companies are to be specified, the asterisk (*) is usedin place of table name or company number. For example, the following entry canbe made in the tabledef6.1 file:

tccom010:812:sybase(SYBPROF=0.4)

In this example all the queries on table tccom010812 which require at least 0.4seconds are logged in the SYBPROF file. Note that this table is considered tohave a different database definition from other tables. If a Sybase driver isalready running, but is accessing a different table, a separate driver will bestarted for this table. Environment variables that appear in the driverspecifications of the tabledef6.1 file are put into the driver’s environment beforeit is invoked, so they are available to the driver at startup.

Page 72: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix A: Setting database driver behavior

Installation and Administration Guide for Sybase

5-4

If the default database driver resources must be modified for specific users, thestandard operating system method can be used to set database driver environmentvariables for specific users. These environment variables will override thesettings created in the Maintain Database Definitions session for these users.

Client environment variables

Database driver environment variables that affect the client can be used tooverride the client resources that affect the application virtual machine. Theseenvironment variables must be set on the machine running the application virtualmachine and should be set using the standard operating system methods used forsetting environment variables. Any client environment variables that are usedoverride the equivalent resource variables set for the client in the db_resourcefile.

Storage fileThe storage file provides a way to specify the distribution of table and index datain different segments. Storage parameters are used by the database driverwhenever a DDL statement such as a create table or create index statement isexecuted. The following is an example of an entry in the storage file:

SEGMENT tableseg LOCKMODE datapages

In this example, the database driver adds the ‘in <tablespace name> index in<index tablespace name>’ clause to the create statement during index or tablecreation.

A storage file is defined for each database driver. The storage file for theBAAN IV Sybase database driver is called syb_storage and is located in thedirectory $BSE/lib/sybase. The format of the storage file is described in detail inAppendix C.

Page 73: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installation and Administration Guide for Sybase

6-1

This appendix lists all the database driver resources and environment variablesthat can be used as configuration parameters to modify the behavior of theSybase database driver. Some of these resources are used with the client andothers with the server. In this context, the client is the BAAN IV applicationvirtual machine and the server is the BAAN IV Sybase database driver. If theBAAN IV application virtual machine and the database driver are running ondifferent machines, client resources must be set on the machine running theBAAN IV application virtual machine and server resources must be set on themachine running the database driver. Resources for both the client and the servermust be set on both machines.

A description of how to set the database driver resources and environmentvariables can be found in Appendix A.

This appendix provides the following information:

n Summary of Sybase resources and environment variablesn Detailed description of Sybase resources and environment variables

Summary of Sybase resources andenvironment variablesThere are four types of resources and environment variables that can be usedwith the BAAN IV Sybase database driver:

n Client and server resources used by all BAAN IV database driversn Client resources used by all BAAN IV database driversn Server resources used by all BAAN IV database driversn Resources used only by the BAAN IV Sybase database driver

The following four tables provide a summary of each of these types of resourcesand environment variables. Detailed descriptions of each entry in the tables canbe found beginning on Page 6-3.

6 Appendix B: Database driverresources and environment variables

Page 74: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-2

Client and server resources used by all BAAN IV database drivers

Resource name Environment variable Description

rds_full RDS_FULL Sets maximum number of rows transferred inone block

tt_sql_trace TT_SQL_TRACE Allows viewing of SQL query information

Client resources used by all BAAN IV database drivers

Resource name Environment variable Description

bdb_debug BDB_DEBUG Sets debugging link between client and server

bdb_driver BDB_DRIVER Sets database specifications

ssts_set_rows SSTS_SET_ROWS Sets number of rows read ahead (single tablesingle row)

USR_DBC_RES Specifies alternative resource file for client

Server resources used by all BAAN IV database drivers

Resource name Environment variable Description

bdb_max_session_schedule

BDB_MAX_SESSION_SCHEDULE

Defines mechanism for closing idle driversessions

Dbslog DBSLOG Allows driver profiling

Dbsinit Specifies optimistic or pessimistic referencechecking

lock_retry LOCK_RETRY Defines the number of lock retries and thesleep period between retries

USR_DBS_RES Specifies alternative resource file for server

Page 75: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-3

Resources used only by the BAAN IV Sybase database driver

Resource name Environment variable Description

syb_char_set Sets the Sybase alpha character set

syb_con_max_prepares

Sets number of cursors that can be defined inone connection

syb_ddl_timeout Sets timeout value for DDL statements

syb_init Allows selection of Sybase version

syb_lock_timeout Sets locking timeout behavior

syb_login_timeout Sets login timeout behavior

syb _max_connections

Sets maximum number of connections toSybase

syb_misc_options Specifies various database driver options

syb_national_language

Specifies language for error messages

SYBPROF Allows profiling

SYBSTAT Allows statistics to be gathered

syb_tds_packet_size

Specifies packet size of TDS protocol

Detailed description of Sybase resources andenvironment variablesThis section provides detailed information about the BAAN IV Sybase driverresources and environment variables. The driver resources are divided into twosections: those that are generic to all BAAN IV database drivers and those thatare specific to the BAAN IV Sybase driver. Each group of resources is listed inalphabetical order.

Page 76: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-4

Generic driver resources

bdb_debug / BDB_DEBUG

Driver resource bdb_debug

Environment variable BDB_DEBUG

Client/Server resource Set for client only

Type Integer (octal)

Default 0

Description This variable is used to generate debugginginformation about the communication between theclient and the database driver. When set, the clientprints debugging information to standard error (stderr).The following categories of debugging information canbe specified:

00001 server types

00002 database actions

00004 delayed lock actions

00010 reference information

00040 TSS info from $BSE/lib/tss_mbstore

00100 permission information

Multiple categories can be defined by adding the octalvalues. The value is compared bitwise to determine if agiven category should be logged.

bdb_driver / BDB_DRIVER

Driver resource bdb_driver

Environment variable BDB_DRIVER

Client/Server resource Set for client only

Type String

Default None

Description This variable is used to set a database specification,usually found in the file tabledef6.1. When this variableis set, all tables will be accessed using the databasedriver specified and tabledef6.1 will not be read. Thedriver specified must be defined in the file$BSE/lib/ipc_info.

Page 77: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-5

bdb_max_session_schedule / BDB_MAX_SESSION_SCHEDULE

Driver resource bdb_max_session_schedule

Environment variable BDB_MAX_SESSION_SCHEDULE

Client/Server resource Set for server only

Type Integer

Default 3

Description This variable defines the mechanism for closing idlesessions in the driver. Whenever the client process hasno more references (cursors or queries) to the session,it can be closed by the client. Closing an idle session isdone after a number of schedule ticks. A schedule tickis generated whenever a BAAN IV session is ended. Atthis point, all idle sessions will have a schedule counterincremented. When the value of the schedule counterreaches the value of bdb_max_session_schedule, thesession is closed

The default for bdb_max_session_schedule is three.Setting bdb_max_session_schedule to one wouldresult in fewer connections from the driver to theRDBMS since whenever a BAAN IV session is ended,the corresponding RDBMS session (logon) is closed(logoff).

Page 78: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-6

dbsinit

Driver resource dbsinit

Environment variable —

Client/Server resource Set for server only

Type Integer (octal)

Default 0

Description This variable allows flags to be set to specify theoptimizations to be used. At this time, legal values are000 (not set) and 001. Other values are reserved andshould not be used.

A flag of 00001 specifies that an optimistic approachshould be used when checking for references in parenttables. The referenced row in the parent table is notlocked, improving the overall concurrency. If this flag isnot set, optimistic reference checking is not used.

Other values are reserved for future use and should notbe used. Multiple categories can be defined by addingthe octal values. The value is compared bitwise todetermine if a given category should be logged.

Page 79: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-7

dbslog / DBSLOG

Driver resource dbslog

Environment variable DBSLOG

Client/Server resource Set for server only

Type Integer (octal)

Default 0

Description This variable provides detailed debugging informationabout the online processing of the driver. Theinformation is logged in the file dbs.log in the driver’scurrent directory. The following debugging categoriescan be specified:

0000001 Data Dictionary info of tables within thedriver

0000002 Query info (SQL Level 1)

0000004 Query plan info (SQL Level 2)

0000010 Row action information

0000020 Table action information

0000040 Transaction action information

0000100 DBMS input/output data (SQL Level 2)

0000200 Administration file info (SQL drivers)

0000400 DBMS SQL statements

0001000 General debug statements

0002000 Query processing info (for tt_sql_trace info)

0004000 Data buffering info (communication)

0100000 Lock retries logged (includes session name)

0200000 Logs successful locks and longest lockduration in a transaction

Multiple categories can be defined by adding the octalvalues. The value is compared bitwise to determine if agiven category should be logged.

Page 80: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-8

lock_retry / LOCK_RETRY

Driver resource lock_retry

Environment variable LOCK_RETRY

Client/Server resource Set for server only

Type String

Default 5*100,5*500

Description This variable defines the high-level locking behaviorthat is used when an action is locked. It defines thenumber of retries and the length of the sleep periodsbetween retries in milliseconds (MS). For example, forthe default setting, the action is retried five times with asleep period after each try of 100 MS. The action isthen retried five more times with a sleep period of 500MS after each retry.

rds_full / RDS_FULL

Driver resource rds_full

Environment variable RDS_FULL

Client/Server resource Set for both client and server

Type Integer

Default 5

Description This variable defines the maximum number of rowstransferred between the BAAN IV application virtualmachine and the driver as one block. Multiple blocks(and thus network round trips) are transferred if morerows are requested. This variable should be set to thesame value for both client and server.

Page 81: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-9

ssts_set_rows / SSTS_SET_ROWS

Driver resource ssts_set_rows

Environment variable SSTS_SET_ROWS

Client/Server resource Set for client only

Type Integer

Default 3

Description This variable defines the number of rows to be readahead for a fetch request from the client. The default isthree rows, which means that for one fetch request,three rows will be read. For the following two fetchrequests, rows will be taken from the client row bufferor fetched from the database without re-executing thequery.

tt_sql_trace / TT_SQL_TRACE

Driver resource tt_sql_trace

Environment variable TT_SQL_TRACE

Client/Server resource Set for both client and server

Type Integer (octal)

Default 0

Description This variable is introduced to view the BAAN IV SQLquery information being handled in client and server.When this variable is set, the client prints debuginformation to the display; the server prints informationonly if the dbslog variable allows it. The informationcontains different categories which can be enabledseparately, such as evaluation trees, SQL statements,bind variables, timings, and communication debugging.The possible values of the TT_SQL_TRACE variableand their descriptions are shown below:

000040 (c) Show queries with their QID

000200 (c) Show query execution times

002000 (c) Show calls of internal SQL functions

004000 (c+s) Show query execution tree

010000 (s) Show query evaluation plan

020000 (s) Show FullTableScan

Page 82: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-10

USR_DBC_RES

Driver resource

Environment variable USR_DBC_RES

Client/Server resource Set for client only

Type String

Default None

Description This variable contains the file specification of analternative resource file for the client. The filespecification is based on the BSE directory and iswithin double quotes. When set, any resources in thealternative resource file override the same clientresources set in db_resource.

USR_DBS_RES

Driver resource

Environment variable USR_DBS_RES

Client/Server resource Set for server only

Type String

Default None

Description This variable contains the file specification of analternative resource file for the client. The filespecification is based on the BSE directory and iswithin double quotes. When set, any resources in thealternative resource file override the same serverresources set in db_resource.

Page 83: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-11

Sybase driver specific resources

syb_char_set

Driver resource syb_char_set

Environment variable -

Client/Server resource Set for server only

Type String

Default Not set

Description If a character set is specified using this variable, theBAAN IV database driver turns on the conversionbetween this set and the Sybase character set. Forexample, to use the Japanese character set with euc,set this variable as syb_char_set:eucjis.

syb_con_max_prepares

Driver resource syb_con_max_prepares

Environment variable -

Client/Server resource Set for server only

Type Integer

Default 256

Description The client library allows the driver to define anunlimited number of cursors and prepare an unlimitednumber of statements in one connection. However,cursors and statements take resources and the BAANIV database driver can run out of memory if there is nolimit kept on these parameters.

By default, the BAAN IV database driver never allowsthe total of cursors and statements in a connection toreach beyond 256. If a connection needs to preparemore statements or define more cursors, existingstatements and cursors are first freed. Use this variableto change that limit to another value.

Setting the value too high results in more memoryallocated in the BAAN IV database driver and otherSQL server resources (like the procedure cache) and itmay run out of memory. Setting the value too low leadsto frequent re-preparing statements and re-declaringcursors, which results in slow performance.

Page 84: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-12

syb_ddl_timeout

Driver resource syb_ddl_timeout

Environment variable -

Client/Server resource Set for server only

Type Integer

Default 3600

Description As with syb_lock_timeout, the BAAN IV database driversets a non-zero timeout value. This value may be goodfor queries and updates but may be short for otheractions, such as creation of many indexes on a tablethat contains a large number of rows. For such actions,the BAAN IV database driver increases the timeout tohigher values (default 3600 seconds). Use ddl_timeoutto set another value in seconds. Sybase ASE 11.9provides server based lock timeouts to detected lockerrors. Do not use this variable for Sybase ASE 11.9environments.

syb_init

Driver resource syb_init

Environment variable -

Client/Server resource Set for server only

Type Integer

Default Not set

Description The BAAN Sybase database driver can operate withSybse ASE 11.5 as well as Sybase ASE 11.9. Thereare significant differences between the two. By default,the driver assumes that the underlying Sybase RDBMSis ASE 11.5. When you use Sybase ASE 11.9, set theresource variable syb_init to the value 01. If you useSybase ASE 11.9, but do not set syb_init, the driverexibits Sybase ASE 11.5 behavior. This works, but willnot be not optimized. On the other hand, if syb_init isset to 01 and underlying RDBMS is Sybase ASE 11.5,the driver returns errors and does not work.

Page 85: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-13

syb_lock_timeout

Driver resource syb_lock_timeout

Environment variable -

Client/Server resource Set for server only

Type Integer

Default 300

Description By default, the client library waits forever for a requestto complete. The BAAN IV database driver sets atimeout of 300 seconds by default. Use this resourcevariable to set the timeout to some other value inseconds. Setting the timeout to zero (infinite waiting) isnot recommended. If the value is too low, spurioustimeouts may result, especially on a busy server.

ASE 11.9 provides server-based lock timeouts. In aSybase ASE 11.9 environment, this timeout is not usedfor the client library. It is set inside the server, and isused to abort a command which failed to obtain a lock.The client library default timeout is used for ASE 11.9.

syb_login_timeout

Driver resource syb_login_timeout

Environment variable -

Client/Server resource Set for server only

Type Integer

Default 60

Description The default login timeout used in the client library is 60seconds. Use this variable to change the default logintimeout in seconds.

Page 86: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-14

syb_max_connections

Driver resource syb_max_connections

Environment variable -

Client/Server resource Set for server only

Type Integer

Default 25

Description By default, the client library allows 25 connections froma single process. This variable can be used to changethat value.

Page 87: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-15

syb_misc_options

Driver resource syb_misc_options

Environment variable -

Client/Server resource Set for server only

Type Integer (octal)

Default 0

Description Use this variable to specify various options for theBAAN IV database driver. These options are octalvalues and multiple options can be specified byperforming an OR operation of individual values.

001 The value of 001 causes the BAAN IV databasedriver to execute the “set showplan on”statement at the start of each connection.Sybase ASE returns a query execution plan tothe BAAN IV database driver. The BAAN IVdatabase driver prints this information in thedbs.log file if the DBSLOG flag 01000 is set. Formore information on the dbs.log file, see theinformation on DBSLOG in the genericresources section.

002 The value of 002 changes the default behaviourof the Sybase driver for network buffering. Bydefault, the BAAN IV database driver disablesTDS packet buffering in the Sybase clientlibrary. In most of the cases, this leads to betterperformance at the cost of higher networktraffic. This flag enables the buffering in clientlibrary. This flag affects the client side and doesnot affect the Sybase ASE. Sybase ASE alsohas the option to disable the buffering on theserver side, by turning on the configurationoption “tcp no delay”.

004 The value of 004 causes the BAAN IV databasedriver not to force indexes for select queries (bydefault, Baan driver forces index on selectqueries). If stored procedures are created ontable when this flag is set, the procedures donot force an index in the query. For example, touse the Japanese language, the record shouldbe syb_national_language:japanese.

Page 88: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-16

syb_national_language

Driver resource syb_national_language

Environment variable -

Client/Server resource Set for server only

Type String

Default Not set

Description If this resource variable is set, the BAAN IV databasedriver uses the specified language for error messages.

SYBPROF

Driver resource -

Environment variable SYBPROF

Client/Server resource Set for server only

Type Floating point

Default Not set

Description When you specify a value for this variable, anystatement that takes more than the specified number ofseconds is logged. The maximum precision that youcan specify is 0.01 seconds. Use this variable todetermine which table actions are the most timeconsuming.

SYBSTAT

Driver resource -

Environment variable SYBSTAT

Client/Server resource Set for server only

Type Integer

Default Not set

Description This allows database driver statistics to be reported. Ifyou set it to a value “n” greater than zero, statistics arelogged every “n” seconds while the driver is active. Ifyou set it to zero, a statistics report is generated whenthe driver terminates.

Page 89: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-17

syb_tds_packet_size e

Driver resource syb_tds_packet_size

Environment variable -

Client/Server resource Set for server only

Type Integer

Default 512

Description This specifies the packet size, in bytes, of the TDSprotocol used by the Sybase client library and the SQLserver for communication. If you increase the packetsize, you may boost performance. If you increase theclient side packet size, also change the Sybase ASEmaximum packet size. Set the Sybase ASE optionsmax network packet size and default networkpacket size to allow larger packets.

Sybase environment variables

The following Sybase variables can be set either as environment variables orspecified in the $BSE/lib/tabledef file. The latter method is preferred.

SYBASE is the directory where the Sybase RDBMS software is installed.

DSQUERY is the name of the Sybase server to be used. The value set for thisvariable should exist in the interface file.

See the Sybase RDBMS Installation and Administration Manuals for moreinformation about the interface file. If this is not set, use the default nameSybase.

Page 90: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix B: Database driver resources and environment variables

Installation and Administration Guide for Sybase

6-18

Page 91: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installation and Administration Guide for Sybase

7-1

The storage file provides a way to specify the distribution of table and index datain different segments. Storage parameters are used by the database driverwhenever a DDL statement such as a create table or create index statement isexecuted. The following is an example of an entry in the storage file: We need aSybase specific example here.

SEGMENT tableseg LOCKMODE datapages

In this example, the database driver adds the “in <tablespace name> index in<index tablespace name>” clause to the create statement during index or tablecreation. If the tablespace for a table or index is not specified, the table and indexdata are created in the default segment. If index data is to be separated, it isnecessary to specify a tablespace.

A storage file is defined for each database driver. The storage file for theBAAN IV Sybase database driver is called syb_storage and is located in thedirectory $BSE/lib/sybase.

The entries in the syb_storage file consists of fields that are the same for thestorage files for all database drivers and storage parameters that are specific tothe Sybase database driver. This appendix describes the fields that make up theentries in the syb_storage file.

Storage file formatThe storage file consists of one or more entries, each consisting of several fieldsseparated by colons. The format of an entry in the storage file is as follows:

[{<user list>}]<table/module specification>:<company number>:<object type>: <private |group>:<table/index optimization>:<refresh time>:<storage parameters>

The following describes each of the fields in an entry in the storage file.

7 Appendix C: Storage file format andconfiguration options

Page 92: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix C: Storage file format and configuration options

Installation and Administration Guide for Sybase

7-2

Storage file field descriptions

user list

Description This field consists of a list of comma-separated usernames to which this entry applies. When no list isspecified, the entry applies to all users.

Example {maria,john}

table/module specification

Description This field consists of a list of comma-separated tablenames or a module name to which the entry applies.An asterisk (*) indicates all tables.

Example ttadv000,ttadv999 two specific tables

ttadv all tables in module tt and packageadv

tt all tables in module tt

* all tables

company number

Description This field consists of a list of company numbers towhich the entry applies. An asterisk (*) indicates allcompany numbers.

Example 000,999 companies 000 and 999

* all companies

Page 93: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix C: Storage file format and configuration options

Installation and Administration Guide for Sybase

7-3

object type

Description This field consists of a list of object (table or index)identifications to which the entry applies. The followingoptions can be specified:

T table only

I all indexes

I <index number> only specified index

* both table and indexes

Example I1,I2 only index 1 and 2

T only for table

private | group

Description This field identifies the owner of the table. Either privateor group should be specified.

table/index optimization

Description Specific flags related to indexes and tables can bespecified. When specified on a “T” object entry, itdefines the default for all indexes.

The following octal values can be used to set the flagsfor a specific index or table:

0000 Use no optimization (no hash columns)

0001 Use single hash optimization

0010 Use stored procedure for singleton select onunique index

Default values can be defined for each table entry. Toset multiple options, the octal values can be OR’ed.

Example 0011

Page 94: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix C: Storage file format and configuration options

Installation and Administration Guide for Sybase

7-4

refresh time

Description This specifies the amount of time (in seconds) that aretrieved dataset is considered valid. No fetch from thedatabase will be made if the same request is madewithin this time. A value of 0 specifies no fetchoptimization.

Example 5

Page 95: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix C: Storage file format and configuration options

Installation and Administration Guide for Sybase

7-5

storage parameters

Description These are defined by the specific database driverimplementation and often map to table and indexcreation options available in the host RDBMS.

The following Sybase storage parameters are defined:

CURSROWCOUNT

The client library can provide buffering for rows. Whenperforming a fetch on a cursor, it is possible to fetchmultiple rows from the Sybase ASE to the client libraryinternal buffers. The subsequent fetchs return the datafrom client library buffers, rather than the Sybase ASE.This parameter specifies the number of rows that theclient library fetches internally when the BAAN IVdatabase driver performs a fetch on the cursor. TheBAAN IV database driver still gets a single row butsubsequent fetches get data from the client library andnot from the Sybase ASE, which is faster. This is usefulwhen fetch optimization is performed.

STATISTICS

This parameter enables the statistics feature of theBAAN IV database driver for the table. See “Tuning” inthe first chapter for more information.

PROFILE

This parameter enables the profiling by BAAN IVdatabase driver for this table. See “Tuning” in the firstchapter for more information.

CLUSTERED

This parameter specifies that the primary index for thetable should be clustered. Although Sybase RDBMSallows any index of the table to be clustered, it makessense to keep the most frequently used index asclustered. So the BAAN IV database driver makes onlythe primary index clustered. If the primary index isdouble hashed, the ascending primary index isclustered. Use the SEGMENT parameter if the primaryindex is going to be clustered.

ROWSPERPAGE

This parameter specifies the max_rows_per_pagefactor for table or indexes. When creating clusteredindexes, the BAAN IV database driver ignores thisparameter.

Note that max_rows_per_page and fillfactor aremutually exclusive parameters and only one of theseshould be specified for an index.

Page 96: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix C: Storage file format and configuration options

Installation and Administration Guide for Sybase

7-6

FILLFACTOR

This parameter specifies the fill factor for the index.Note that fillfactor and max_rows_per_page aremutually exclusive parameters and only one of theseshould be specified for an index.

PREFETCH

This parameter is used to specify a prefetch kilobytesize for a query. This is used when the index is forced.The valid values are 2, 4, 8 or 16.

CACHE

This parameter is used to force a cache strategy, forexample, “mru” or “lru” in selects.

LOCKMODE

LOCKMODE is not used with Sybase ASE 11.5.

Sybase ASE 11.9 provides various locking modes fortables. The BAAN Sybase database driver uses“datarows” locking mode as default when creatingtables. The locking mode can be changed using theLOCKMODE option in the storage file. This optiontakes three values: “allpages”, “datapages” and“datarows”. Note that “datarows” is the defaultbehavior.

Once a table is created with any lock mode, updatingthe storage file will not change the lock mode for thetable. After updating the storage file, the table must bedropped and recreated to change the lock mode.

SEGMENT

This parameter specifies the segment on which thetable or index should be placed.

Indexes can be located on a segment different from thesegment on which the table is created. The onlyexception is a clustered index which, by its nature,follows the table. Thus if the table is created on onesegment, then a clustered index is created on anothersegment, the table is moved to the segment on whichthe index is created. To avoid this effect, the BAAN IVdatabase driver always creates a clustered index onthe same segment as that of the table.

For non-primary indexes or for a non-clustered primaryindex, a SEGMENT other than table segment can beused.

Page 97: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix C: Storage file format and configuration options

Installation and Administration Guide for Sybase

7-7

Examples For non-primary indexes or for a non-clustered primaryindex, a SEGMENT other than table segment can beused. Some examples are shown below:

tiitm001:*:T:group:0111:0:

tiitm001:*:I:group:0111:0:SEGMENT indexsegmentCLUSTERED

In the example above the table and the primary indexare created on the default segment. Other indexes arecreated on the segment named indexsegment.

tiitm001:*:T:group:011:0:SEGMENT tablesegment

tiitm001:*:I:group:011:0:CLUSTERED SEGMENTindexsegment

In the example above the table and primary index arecreated on the segment named tablesegment. Otherindexes are created on the segment namedindexsegment.

tiitm001:*:T:group:01:0:SEGMENT tablesegment

tiitm001:*:I:group:01:0:SEGMENT indexsegment

In the example above the table is created on thesegment named tablesegment. All indexes are createdon the segment named indexsegment.

The storage file is scanned from the beginning whenever a create table or createindex is performed. The first entry that matches the table or index is taken, so theorder in which the entries are specified is important. For example: We need tochange the following to be Sybase examples:

{maria,john}ttadv999,ttadv000:000:T:private:011:5:SEGMENT mydatasegmentCLUSTERED{maria,john}ttadv999,ttadv000:000:I::011:5: SEGMENT myindexsegmenttdsfc:505:::011:5:*:*:T:group:011:5:SEGMENT datasegment CLUSTERED*:*:I:group:011::SEGMENT indexsegment

In the example above, the users maria and john will create tables ttadv999 andttadv000 of company 000 in segment mysegment. The associated indexes will becreated in segment myindexsegment and index 1 will be a clustered index. Allusers creating tables in module tdsfc will create tables and indexes in the defaultsegment. Other users create tables and indexes in segments datasegment andindexsegment, respectively, with index 1 being a clustered index.

If the segment for a table or index is not specified, the table and index data arecreated in the default segment. If you want to separate the index data, you mustspecify a segment.

NOTE

NOTE

Page 98: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix C: Storage file format and configuration options

Installation and Administration Guide for Sybase

7-8

Page 99: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Installation and Administration Guide for Sybase

8-1

This chapter lists the SQL queries generated by the BAAN IV database driver forthe various selects. In the examples, the following table is used:

Table: t_byte, t_int, t_float, t_long, t_string, t_date,t_doublePrimary index: t_byte, t_intDuplicate index: t_long

The BAAN IV database driver uses the “force index” option of the Sybase ASEoptimizer and specifies the index name for select queries. When the duplicateindex has no hash optimization, it uses the primary index parts to force the selectorder.

No hash optimization,

Unique index

SELECT_FIRST, SELECT_GTEQselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntufrom dbo.taabdb996000 (Index I1a )where t_byte > @kt_byte OR t_byte = @k2t_byte AND (t_int >= @kt_int)order by t_byte ,t_intat isolation 0

SELECT_NEXT, SELECT_GREATselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntufrom dbo.taabdb996000 ( Index I1a)where t_byte > @kt_byte OR t_byte = @k2t_byte AND (t_int > @kt_int)order by t_byte ,t_intat isolation 0

SELECT_EQUAL,select t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntufrom dbo.taabdb996000 ( Index I1a)where t_byte = @kt_byte AND t_int = @kt_intat isolation 0

8 Appendix D: BAAN IV Sybasedatabase driver SQL queries

Page 100: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix D: BAAN IV Sybase database driver SQL queries

Installation and Administration Guide for Sybase

8-2

SELECT_LAST, SELECT_EQLEselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntufrom dbo.taabdb996000 ( Index I1a )where t_byte < @kt_byte OR t_byte = @k2t_byte AND (t_int <= @kt_int)order by t_byte DESC,t_int DESCat isolation 0

SELECT_PREV, SELECT_LESSselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntufrom dbo.taabdb996000 ( Index I1a )where t_byte < @kt_byte OR t_byte = @k2t_byte AND (t_int < @kt_int)order by t_byte DESC,t_int DESC at isolation 0

SELECT_EQUAL_WITH_LOCKselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntufrom dbo.taabdb996000 ( Index I1a )where t_byte = @kt_byte AND t_int = @kt_intfor update at isolation 2

Duplicate Index

SELECT_FIRST, SELECT_GTEQselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntufrom dbo.taabdb996000 ( Index 2a)where t_long >= @kt_longorder by t_long ,t_byte, t_intat isolation 0

SELECT_GREATselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntufrom dbo.taabdb996000 (Index 2a)where t_long > @kt_longorder by t_long ,t_byte, t_intat isolation 0

SELECT_LAST, SELECT_EQLEselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntufrom dbo.taabdb996000 (3) where t_long <= @kt_long order by t_longDESC,t_byte DESC,t_int DESC

SELECT_LESSselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntufrom dbo.taabdb996000 (3) where t_long < @kt_long order by t_long DESC,t_byte DESC,t_int DESC

Page 101: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix D: BAAN IV Sybase database driver SQL queries

Installation and Administration Guide for Sybase

8-3

Single hash optimization

Unique index

SELECT_FIRST, SELECT_GTEQselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntu,hash1from dbo.taabdb996000 (Index I1a)where hash1 >= @khash1order by hash1at isolation 0

SELECT_NEXT, SELECT_GREATselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntu,hash1from dbo.taabdb996000 (Index I1a)where hash1 > @khash1order by hash1at isolation 0

SELECT_EQUALselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntu,hash1from dbo.taabdb996000 (Index I1a)where hash1 = @khash1at isolation 0

SELECT_LAST, SELECT_EQLEselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntu,hash1from dbo.taabdb996000 (Index I1a)where hash1 <= @khash1order by hash1 DESCat isolation 0

SELECT_PREV, SELECT_LESSselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntu,hash1from dbo.taabdb996000 (Index I1a)where hash1 < @khash1order by hash1 descat isolation 0

Page 102: Installation and Administration Guide for Sybase - Baanbaansupport.com/docs/baan/U7019dus.pdf · Installation and Administration Guide for Sybase 1-1 This chapter describes the general

Appendix D: BAAN IV Sybase database driver SQL queries

Installation and Administration Guide for Sybase

8-4

SELECT_EQUAL_WITH_LOCKselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntu,hash1from dbo.taabdb996000 (Index I1a )where hash1 = @khash1for update at isolation 2

Duplicate index

SELECT_FIRST, SELECT_GTEQselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntu,hash2from dbo.taabdb996000 (Index 2a)where hash2 >= @khash2order by hash2at isolation 0

SELECT_NEXT, SELECT_GREATselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntu,hash2from dbo.taabdb996000 (Index 2a)where hash2 > @khash2order by hash2at isolation 0

SELECT_LAST, SELECT_EQLEselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntu,hash2from dbo.taabdb996000 (Index I2a)where hash2 <= @khash2order by hash2 descat isolation 0

SELECT_PREV, SELECT_LESSselect t_byte,t_int,t_float,t_long,t_string,t_date,t_double,t_Refcntd,t_Refcntu,hash2from dbo.taabdb996000 (Index 2a)where hash2 < @khash2order by hash2 descat isolation 0


Recommended