Read Microsoft Word - U7040cus.doc text version

BaanERP Tools

Technical Manual

A publication of: Baan Development B.V. P.O.Box 143 3770 AC Barneveld The Netherlands Printed in the Netherlands © Baan Development B.V. 1998. All rights reserved. The information in this document is subject to change without notice. No part of this document may be reproduced, stored or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Baan Development B.V. Baan Development B.V. assumes no liability for any damages incurred, directly or indirectly, from any errors, omissions or discrepancies between the software and the information contained in this document. Document Information Code: Group: Edition: Date: U7040C US User Documentation C October, 1998

Table of contents

1 Installing BaanERP Windows (BW) Hardware and software requirements Installing the BaanERP Windows (BW) software Installation directory of BaanERP Windows (BW) The BECS utility Functionality of BECS Registering the BECS utility 2 BI server Introduction Architecture Requirements for installation Installing the BI server Moving the BI server to another system Configuring the BI server Starting the BI server BI server as a Windows NT Service Adjusting the BI HTML-page Client issues 3 Database tools General bdbpre bdbpost bdbreconfig refint 4 Database management General Accessing tables tabledef6.2 fd6.2.package combination Example table access (table and Bshell on the same system) Database drivers Accessing tables on other systems Audit trail Database mirroring Alternative databases

1-1 1-1 1-2 1-9 1-10 1-10 1-10 2-1 2-1 2-1 2-4 2-5 2-7 2-7 2-7 2-9 2-10 2-11 3-1 3-1 3-1 3-6 3-10 3-14 4-1 4-1 4-1 4-1 4-2 4-2 4-2 4-3 4-3 4-3 4-5

Technical Manual i

Table of contents

Communication protocols Socket protocol Local sockets Remote sockets (only for database servers) Pipes protocol Message queue protocol Example ipc_info file 5 Native language support General Composed characters Conversion tables Input conversion table Output conversion table Example of total conversion NLS editor Initial screen options Maintenance of NLS conversion tables NLS-related files Terminal information file Printer information file Input and output conversion table Terminal setup Character sets and fonts Sort tables Shift tables ISO 8859-1 character set (0-127) DEC vt100/vt200 character set (0-127) DEC vt100/vt200 character set (128-255) List of compose sequences Input/output table vt200 Output table Printer output table MT910 HP Prestige character set Overview of Esc/Ctrl codes 6 Information files Terminal information file Boolean entries Numbers Strings Keys Color support Sending colors separately

4-5 4-7 4-7 4-7 4-8 4-8 4-9 5-1 5-1 5-1 5-2 5-2 5-2 5-3 5-4 5-5 5-5 5-7 5-7 5-8 5-8 5-9 5-9 5-9 5-10 5-11 5-13 5-15 5-17 5-20 5-24 5-25 5-29 6-1 6-1 6-1 6-2 6-3 6-9 6-11 6-11

Technical Manual ii

Table of contents

Colors in combination with code features Parameterized strings Example of terminal information files Printer information files Bar codes Example of printer information file for mt910 printer 7 User Interface (UI) Page mode Tab processing Default Button handling Event processing How to select the UI Page mode How to mark UI objects as synchronizing fields 8 Customer support tools General Error logging Log file Log file layout Log file maintenance Submitting errors to customer support Example error logging 9 Executable programs Database management General Oracle Sybase Informix DB2 Logic server (Bshell) Bshell6.2 Debugging the Bshell during run time Memory usage Miscellaneous bshcmd6.2 badmin6.2 Installation Development License management licd6.2 licmon6.2 Printer management Shared memory

6-13 6-14 6-16 6-21 6-26 6-29 7-1 7-2 7-2 7-2 7-3 7-4 8-1 8-1 8-1 8-1 8-2 8-3 8-3 8-4 9-1 9-1 9-1 9-2 9-2 9-2 9-3 9-3 9-3 9-4 9-9 9-10 9-10 9-13 9-13 9-14 9-14 9-14 9-15 9-16 9-17

Technical Manual iii

Table of contents

Network TRITON Super Set Time zone utilities Middleware UNIX equivalents Miscellaneous 10 Errors General UNIX errors Database errors 11 Shared memory management General Using the shared memory manager Installation of shared memory Create an entry in the file shm_param file Determine shared-memory parameters Using shmvalues6.2 Using shmmanager6.2 Fill the entry in the shm_param parameter file Installation of shared memory Starting shmtimer6.2 Error messages during installation Syntax srdd_tab Filling shared memory Kernel requirements General description of adjusting UNIX kernels Kernel parameters General kernel parameters Example parameter file shm_param 12 Remote databases General Settings for remote database configurations Local host Remote Local tabledef6.2 User files Remote Local and remote tables Settings for remote menus/forms/objects

9-17 9-18 9-20 9-20 9-20 9-21 10-1 10-1 10-1 10-4 11-1 11-1 11-1 11-2 11-2 11-3 11-3 11-4 11-5 11-6 11-6 11-7 11-9 11-10 11-11 11-11 11-12 11-17 11-18 12-1 12-1 12-2 12-3 12-4 12-4 12-5 12-5 12-7 12-8 12-8

Technical Manual iv

Table of contents

13 Multibyte management General Triton Super Set Using multibyte character sets Installation Printing multibyte characters Utilities tsscomp6.2 tsscvt6.2 tssinfo6.2 Character set description Locale information Storage of multibyte characters 14 Audit management General Storage of audit data Sequence files Information file Location of audit files Other parameters of audit files Audit management Table data dictionary as seen by audit server Commands logged by audit server Data stored by audit server Format of audit row Examples of the audit row for various operations Limit on the size of audit data Audit server Long transactions and overflow file Sequence termination Sequence file maximum size reached Table audit data dictionary changed Sequence terminated by user Transaction termination Reusing sequence files File locking Limit on open files Opening large number of tables in single session Multisession support File security for various audit management files Audit server debugging options Audit errors

13-1 13-1 13-1 13-3 13-3 13-3 13-3 13-3 13-4 13-5 13-7 13-9 13-10 14-1 14-1 14-1 14-1 14-2 14-2 14-3 14-4 14-5 14-6 14-6 14-7 14-9 14-10 14-10 14-10 14-11 14-11 14-11 14-13 14-13 14-16 14-16 14-17 14-18 14-18 14-18 14-19 14-19

Technical Manual v

Table of contents

Authorizations Format of audit files auditdef6.2 Information file Sequence file audit_spec file 15 OLE Automation General BaanERP as OLE Automation server Restrictions Example: Import BaanERP users DLL function example Visual Basic example Example: Using BaanERP SQL DLL information

14-20 14-22 14-22 14-23 14-26 14-31 15-1 15-1 15-2 15-4 15-4 15-5 15-6 15-7 15-7

Technical Manual vi

About this document

This document is a reference guide explaining how you can customize the BaanERP application for use by specific organizations. It is intended for use by BaanERP application developers and application managers. You can use this reference guide to set up and maintain a BaanERP application. In this document you will find information about database tools and management, audit management, native language support, and terminal information, as well as some limited installation instructions. Chapter 1, "Installing BaanERP Windows (BW)," describes how to install BaanERP Windows (BW). This assumes that you already have BaanERP installed on the server. Chapter 2, "BI server," summarizes how to install the BaanERP Internet Server application, which is used as a gateway between the BaanERP Internet client (BI) and the BaanERP application server (Bshell), to expose the BaanERP functionality to the Internet domain. Chapter 3, "Database tools," describes tools you can use for the following tasks:

n n n n

Convert a database table to a sequential file (bdbpre) Create a database table from a sequential dump or append data to an existing database table (bdbpost) Reconfigure a database table according to a new data dictionary (bdbreconfig) Check or repair the referential integrity within the database (refint)

Chapter 4, "Database management," discusses the working and usage of several protocols that can be used for local and remote communication. Chapter 5, "Native language support," describes the communication between the character set of a terminal and that of Bshell6.2. Chapter 6, "Information files," describes terminal information files, which store information such as the type of terminal, terminal operations, how to access keys on the keyboard, color support, cursor movements, and whether code features are blinking, bold, or reverse.

Technical Manual vii

About this document

Chapter 7, "User Interface (UI) Page mode," describes the User Interface (UI) Page mode in BaanERP. In normal mode, the 4GL Engine validates the entered data per field. In the UI Page mode, the 4GL Engine validates data per page rather than per field. The synchronous interaction between the UI driver and the Bshell is therefore significantly reduced, which improves response times. Chapter 8, "Customer support tools," describes two functions used for solving errors in a Bshell environment: error logging and the bserel6.2 program. Error logging is keeping a record of error messages in a log file. The program bserel6.2 provides information on the BSE environment as installed on your system. Chapter 9, "Executable programs," describes all of the executable programs used for database management. Chapter 10, "Errors," describes all the errors that can occur when you are working in the BaanERP environment, and offers a solution. Chapter 11, "Shared memory management," discusses shared memory, which is a part of the internal memory intended for common usage. Chapter 12, "Remote databases," explains how the BaanERP client/server architecture enables the user to work with databases distributed over one or more systems. Chapter 13, "Multibyte Management," explains how to use the 32-bit wide character space, which has been implemented in BaanERP Tools to support all possible character sets. Chapter 14, "Audit Management," describes the audit management facility including the audit server, the audit management utility, and where audit data is stored. Chapter 15, "OLE Automation," describes how BaanERP works with OLE Automation, an industry standard that applications use to expose their OLE objects to development tools, macro languages, and other applications that support OLE Automation.

Technical Manual viii

1

Installing BaanERP Windows (BW)

This chapter describes how to install BaanERP Windows (BW). It assumes that BaanERP is already installed on the server. If this is not the case, refer to the database-specific installation guide. BaanERP Windows (BW) is a graphical user interface (GUI) program in BaanERP. BW runs on an Intel compatible PC in a Windows 95 or Windows NT environment. BW displays BaanERP as an application with the same look and feel as a native Windows application. This chapter describes:

n n n n

The hardware and software requirements How to install the BaanERP Windows (BW) software The installation directory of BaanERP Windows (BW) The BaanERP Windows (BW) environment variables

Hardware and software requirements

The following software and hardware requirements must be met before you can install BaanERP Windows (BW).

n

The operating system Windows 95 or Windows NT Server version 4.0 must be installed and running. The system on which BaanERP Windows is to be installed, must be at least an Intel-based system with a 50 MHz 486DX processor. Furthermore, BaanERP Windows requires at least a SVGA video display, 16 MB of main memory (RAM), and 8 MB of free disk space.

n

Technical Manual 1-1

Installing BaanERP Windows (BW)

Installing the BaanERP Windows (BW) software

To install the BaanERP Windows (BW) software, you can follow one of these procedures:

n

If you have a UNIX BaanERP server, the BaanERP Windows (BW) software can be copied from the directory $BSE/mswindows/Bw5.xx on the server to a temporary directory on the client by using ftp. Double-click the file setup.exe. This starts the BW installation program. If the client has a local CD-ROM drive, you can install BaanERP Windows (BW) directly by using the BaanERP distribution CD-ROM. If the client has no CD-ROM drive, you can share the CD-ROM of the server.

n

n

NOTE

The description below assumes that your client has a local CD-ROM drive and is running the Windows NT operating system. Take the following steps to install BaanERP Windows.

1 2 3 4

Close all running applications and insert the BaanERP distribution CD-ROM in the CD-ROM drive. A Welcome message is displayed. Choose Next. A Licence Agreement message screen is displayed. Choose Yes. The Select environment dialog box is displayed.

Technical Manual 1-2

Installing BaanERP Windows (BW)

Click Install new environment if you perform a fresh installation, and enter a name for the new installation. If you want to upgrade an existing BW installation, you must click Select existing environment to choose the existing environment to be upgraded. Choose Next to continue.

5

The Choose Destination Location dialog box is displayed. The layout of the dialog box depends on whether you are installing BW on a PC client or a Windows NT server. If you are installing on a PC client, the following dialog box is displayed:

Technical Manual 1-3

Installing BaanERP Windows (BW)

If you are installing on a Windows NT server, the following dialog box is displayed:

Accept the default path or choose Browse to enter another path. Choose Next to continue.

6

The Setup Type dialog box is displayed:

Technical Manual 1-4

Installing BaanERP Windows (BW)

You can select the following server types: - User Interface This type is a BaanERP Windows (BW) client. - User Interface and Logic This type is a stripped version of a BaanERP Windows NT server (with local application logic). - Full installation (including application files and database) This type is the complete BaanERP Windows NT server version.

7

Select User Interface and choose Next. The Select Program Folder dialog box is displayed. Select the Program Folder to which the BaanERP Windows icons must be added (default BaanERP) and choose Next. The Setup Information dialog box is displayed. Choose Next to continue with the displayed setup (or choose Back to change the displayed setup). After the software is installed you must choose OK to exit the installation script. The BaanERP program folder is displayed. Double-click the BW Configuration Tool icon. The BW Configuration dialog box is displayed.

8 9

10 Supply the following information.

On the Application Server tab you must fill in the following boxes: - Hostname Enter the host name of the BaanERP server.

Technical Manual 1-5

Installing BaanERP Windows (BW)

- Connect As

Enter a valid user name as known on the BaanERP server.

- Ask password at startup

If this check box is selected, you can only supply the password during the BaanERP login procedure.

- Use saved password

If this check box is selected, the BaanERP logon procedure is skipped, and the saved password is used.

- Current user

Select this check box to make use of the Windows Integrated Security feature. In this case you will use your current user identity to log on to the BaanERP Windows NT server.

NOTE

For Windows 95 the unified logon feature will only work if you are actually logged on to Windows 95. You can only make use of the Windows Integrated Security feature, if your BaanERP server is a Windows NT server.

NOTE

- BSE

Enter the path to the BSE environment on the BaanERP server (equals the BSE environment variable on the BaanERP server).

- Bshell name

Enter the application logic to use on the remote BaanERP host (changing the default of bshell will only be useful during debugging).

- Command

Enter the option you want to pass to the bshell. You can, for example, define environment variables by using the following syntax:

-- -set Environment Variable1=xxx -set Environment Variable2=yyy

On the NLS tab, you must fill in the following box:

- Locale

Select the character set to be used (the default character set is International [ISO]). On the Font tab, fill in the following box: - Font Type Enter the desired font type. You can change the setting by choosing the button at the right side of the font boxes.

Technical Manual 1-6

Installing BaanERP Windows (BW)

On the Automation tab, you can fill in the following box: - Class Name This box contains the name of the Baan automation object Baan.Application.server, where server is the hostname of the BaanERP server you supplied on the Application Server tab.

NOTE

Choose Save As on the Application Server tab to save the new configuration in a different configuration file. However, only one configuration can be active per BaanERP session.

11 Choose RUN! to start your BaanERP session.

NOTE

The BaanERP .bwc files are registered by the Windows NT or Windows 95 operating system. You can find the .bwc files in the directory Lib\User under the installation directory of the BaanERP client software. This implies that you can start a BaanERP logon procedure by double-clicking the icon in front of the relevant .bwc file in the File Manager. You can also make BaanERP program icons by dragging the .bwc configuration files to a Program Group.

Technical Manual 1-7

Installing BaanERP Windows (BW)

12 From the BaanERP Tools menu, choose Software InstallationÐ

Installation. Open the Download Help Files (ttadv8245m000) session. This session has two options: - Download help files This command installs the windows Help files on your client. Select the packages for which you want to see Help and choose Download Help Files from the Specific menu. - Edit HTML Help transfer script When you install HTML help on an HTTP server, you must edit the HTML Help transfer script. This script is used for transferring the HTML help files from the application server to the HTTP server. To execute this script, you need access to the HTTP server.

Technical Manual 1-8

Installing BaanERP Windows (BW)

Installation directory of BaanERP Windows (BW)

The installation directory C:\Program Files\Baan\BW5 is created during the setup process of BaanERP Windows (BW). During setup you can change this installation directory. This section assumes you have chosen the default name for the installation directory of BaanERP Windows (BW). The following subdirectories are created in directory C:\Program Files\Baan\BW5 during setup:

n

C:\Program Files\Baan5\BW\bin This directory contains the bw.exe program to start the BaanERP application. It also contains the bwconfig.dll for the configuration program. C:\Program Files\Baan5\BW\lib This directory contains the files bw.ini (initialization file), bw5.reg (object registration file), bw.tlb (type library information for OLE Automation), and tss_bw (language support). C:\Program Files\Baan\BW5\log This directory contains logging information about BaanERP Windows. C:\Program Files\Baan\BW5\samples This directory contains a Microsoft Excel spreadsheet, which is an example of the use of OLE Automation to access BaanERP dynamic link libraries. C:\Program Files\Baan\BW5\tmp This directory contains the temporary files. C:\Program Files\Baan\BW5\help This directory contains the Help files.

n

n

n

n

n

The following subdirectories are created in the directory C:\Program Files\Baan\BW5\lib.

n

C:\Program Files\Baan\BW5\lib\nlsinf This directory contains the special character set file xwindows.in. C:\Program Files\Baan\BW5\lib\user This directory contains the configuration files.

n

Technical Manual 1-9

Installing BaanERP Windows (BW)

The BECS utility

If you want to use both a BAAN IV and a BaanERP server from a single workstation, you must install two different BW versions on your workstation. Before the BECS utility was available, this generated the problem that both BW versions wanted to be the owner of the BW configuration files (the files with extension .bwc, in which your configuration settings are stored). Therefore, it was unpredictable which BW version would be started if you double clicked a .bwc file. This problem is solved by the BECS utility: it enables you to run different BW versions on a single workstation.

Functionality of BECS

The BECS utility offers the following functionality:

n

It takes the ownership of files with the extension .bwc. By doing this, it resolves the potential conflict described above. After BECS is correctly installed, you will start BECS by double clicking on a .bwc file. Based on the location of your .bwc file, BECS will locate the associated BW version, and start this BW version accordingly. For this, your .bwc file must be stored in the lib\user subdirectory of the directory where you installed the BW version. BECS will start bin\BW.exe in this same directory. It can show you the different BW-versions installed on your system. Once the BW versions have been registered, you will get an overview of all the .bwc files for the BW versions if you start BECS. This enables you to go to the configuration screen for each of the .bwc files, and to launch BW using the selected configuration screen.

n

Registering the BECS utility

To make BECS.exe the owner of all .bwc files, you must follow the steps below:

1 2

Copy BECS to the location you want to have it, for example, C:\Program Files\Baan\BECS.exe. In the same directory where you found this file you can find the file BECS.reg. At the end of this file, you will find the following lines:

HKEY_CLASSES_ROOT\BW_Configuration\shell\Open\command = "$(BSE)\bin\BECS.exe" "%1" HKEY_CLASSES_ROOT\BW_Configuration\shell\Config\command = "$(BSE)\bin\BECS.exe" -config "%1"

Technical Manual 1-10

Installing BaanERP Windows (BW)

3 4

Please edit this file, and replace the portion $(BSE)\bin\BECS.exe by the path of your choice, for example, C:\Program Files\Baan\BECS.exe. Execute the file BECS.reg by double clicking it. This will make BECS.exe the owner of all .bwc files.

Registering BW environments To let BECS.exe show all available .bwc files, you must create registry keys for all BW environments. You can do so by following the steps below:

1 2 3

Start regedit Go to HKEY_LOCAL_MACHINE\SOFTWARE\Baan Create a new key for each BW environment you want to register, for example, both Baan4 and Baan5. Within each key you must add a new string value named BSE, containing the patname to the directory where you installed the BW version. For example, the settings could look like the ones below:

[HKEY_LOCAL_MACHINE\SOFTWARE\Baan\Baan4] "BSE"="C:\\Program Files\\Baan\\Bw4" [HKEY_LOCAL_MACHINE\SOFTWARE\Baan\Baan5] "BSE"="C:\\Program Files\\Baan\\Bw5"

Technical Manual 1-11

Installing BaanERP Windows (BW)

Technical Manual 1-12

2

BI server

Introduction

The BaanERP Internet Server ap plication (BI server) is used as a gateway between the BaanERP Internet client (BI) and the BaanERP application server (Bshell), to expose the BaanERP functionality to the Internet domain.

Architecture

The architecture of the BI server is shown in the following figure:

Figure 1, BI server architecture

The following components are included in the architecture:

n

A Bshell running on an application-server system. This is a normal BaanERP application server to which both BaanERP Windows (BW) clients and BI applets can connect. For each client (BI or BW) there is always one connection with a Bshell. An HTTP-server system, on which an HTTP-server application runs, and one or more BI server applications. This setup is used as a gateway between the BaanERP applications and Internet browsers. BI applets always connect to the Bshell through the BI server. There is never a direct connection between Bshell and BI applet.

Technical Manual 2-1

n

BI server

One of the HTML pages, which is managed by the HTTP server, contains a reference to the BI applet. When a browser performs a GET for this page, the BI applet is downloaded to the requesting browser. The HTTP-server system and the application-server system can be one system or they can be two distinct systems.

n

A client system running a Java-enabled HTML browser. The BI applet runs within this browser. The BI applet establishes a direct TCP/IP connection with the BI server running on the HTTP-server system or on another system.

The following figure shows a timing diagram for setting up the connection between a BI applet and a Bshell using the BI server.

Figure 2, Connection using the BI server

Technical Manual 2-2

BI server

Security is important when you offer application functionality over the Internet. Security provision is available at three levels:

1 2 3

The HTTP server security mechanisms can be used to offer secure access to the HTML page containing the BI applet. Secure communication between the BI server and the BI applet is supported using the Secure Sockets Layer (SSL) v3.0 protocol. Application-server system authentication.

The first level can be used to restrict access to the BI applet to a set of registered users. This feature is completely dependent on the HTTP server and is not described here. The second level offers secure communication between the BI server and the BI applet. At this level the SSL protocol is supported. The SSL protocol provides connection security that has these basic properties:

n

The connection is private. Encryption is used after an initial handshake to define a secret key. Symmetric cryptography is used for data encryption. The peer's identity can be authenticated by using asymmetric or public key cryptography. The connection is reliable. Message transport includes a message integrity check using a message authentication code (MAC).

n

n

The BI server uses a CipherSuite that does not offer server-side certification or client-side authentication. Furthermore, the CipherSuite uses exportable versions of the cryptographic algorithms so that the software can be delivered to all countries. Note that Secure Sockets Layer (SSL) client-side certification is not used, because this would require that each client get and store a certificate from a certification authority. Instead, client authentication relies on the user name and password validation used to connect to the application-server system. When you use a Secure Sockets Layer (SSL) connection, this user name and password are encrypted when they are transmitted from the BI applet to the BI server. In addition, you can restrict access to the HTML-page containing the BI applet by using the HTTP server security mechanisms, which might also require client authentication. The BI server can be configured to use:

n n

No Secure Sockets Layer (SSL) security Secure Sockets Layer (SSL) security

Technical Manual 2-3

BI server

The third level uses the authentication mechanism of the application-server system. Each BI user provides a user name and password to log on to the application-server system. Configuration The BI server allows for configuration of important communication parameters by a system administrator. These configuration parameters include:

n n n n n

Listener port Enable/disable Secure Sockets Layer (SSL) security Application-server system name or IP address Enable/disable logging of access history and errors When logging is enabled, the log file name

Requirements for installation

Before you start the installation, you must note the following requirements:

n n n

Required related products Performance requirements Installation requirements

These requirements are explained in the following sections. Required related products The BI server depends on the following related products, which must be installed on the HTTP-server system:

n n

A Java run time environment that conforms to the JDK 1.1. An HTTP server capable of downloading Java applets to a browser

Performance requirements The number of clients that can be supported by a single BI server application is not restricted by the BI server. However, the Java virtual machine or the underlying operating system can limit the number of simultaneous clients supported by one instantiation of the BI server.

Technical Manual 2-4

BI server

Installation requirements These are the requirements for installing the BI server and BI client components on the HTTP-server system. Before installing the BI components on the HTTP-server system, you must install and configure the following third-party products:

n

An HTTP server. The operating system of the HTTP-server system determines which HTTP server must be installed. To run the HTTP server on a Windows NT server, you must install Microsoft Internet Information Server (IIS). If your server is running on a UNIX system you can, for example, install Netscape Enterprise servers or Apache. A Java virtual machine compatible with Java 1.1. The operating system of the HTTP-server system determines which Java virtual machine must be installed. Contact your operating system supplier to get an implementation of a Java virtual machine.

n

Installing the BI server

After you have prepared the HTTP-server system as described in the section "Requirements for installation," perform the following steps to install the BI components on the HTTP-server system.

NOTE

Both the HTTP-server system and the BaanERP application server can be UNIX or Windows NT systems. The following example installation assumes that you are installing on a UNIX platform.

1 2

Copy the BI installation file $BSE/internet/bisetup.class from the BaanERP server to the HTTP-server system. Start the BI installation program by entering the following on the command line: java bisetup The java string is the name of the Java interpreter. This name is supplierdependent (for example, jview for the Microsoft Java virtual machine).

Technical Manual 2-5

BI server

3

The installation program asks for a destination directory for the BI components. This must be a directory in the HTML tree that you can access through the HTTP server (a directory below the document root directory of the HTTP server). If this directory does not yet exist, it is created. After completing the installation program, the directory structure on the target system is similar to the following structure:

$PUBLIC_HTML/$TARGETDIR/client/ie4/bi.cab /grid.cab /ssl.cab /netscape/bi.jar /bi.html /readme.txt /images/logo.jpg /server/*.class

In this structure you can access the $PUBLIC_HTML directory in the HTML tree through the HTTP server, in a directory below the document root directory of the HTTP server. $TARGET_DIR is a directory below $PUBLIC_HTML where the BI package has been installed.

4 5

At this point you must determine on which TCP port you want the BI server to listen. Choose a free port. Edit the HTML file that you can find at $PUBLIC_HTML/$TARGETDIR/client/bi.html. All the parameters mentioned in the section "Adjusting the BI HTML-page" must be filled in according to the actual configuration. Start the BI server program. See the section "Starting the BI server" for details. The arguments must correspond with the values entered in the HTML file.

6

Technical Manual 2-6

BI server

Moving the BI server to another system

Some firewall configurations require that the BI server run on a system other than the HTTP-server system. In this case you must perform the following steps after you have performed steps 1-3 described in the section "Installing the BI server."

1 2

Install a virtual machine compatible with Java 1.1 on the system where you want to run the BI server. Copy the BI-server class files from the HTTP-server system to the same system. These class files can be found on the HTTP-server system at: $PUBLIC_HTML/$TARGETDIR/server. You must copy this complete directory tree, preserving the directory structure. Determine the TCP port on which you want the BI server to listen. Choose a free port. Edit the HTML file on the HTTP-server system, which you can find at $PUBLIC_HTML/$TARGETDIR/client/bi.html. All the parameters mentioned in the section "Adjusting the BI HTML-page" must be filled in according to the actual configuration. Start the BI server program. See the section "Starting the BI server" for details. The arguments must correspond with the values entered in the HTML file.

3 4

5

Configuring the BI server

This section describes the additional steps to configure the BI server after the installation, and contains the following sections:

n n

Starting the BI server Adjusting the BI HTML-page

Starting the BI server

The following command shown starts the BI server, listening on one TCP/IP port and forwarding incoming connections to the application-server system appserver. The java string is the name of the Java interpreter. This name is supplier dependent, for example, jview for the Microsoft Java virtual machine. java BI server [­s ] [­l logfile] [­c] [­t level] ­p port ­a appserver

Technical Manual 2-7

BI server

Options ­s When this option is specified, the Secure Sockets Layer (SSL) is enabled . When this option is not specified, SSL is disabled. When security is enabled, the BI applet must also use SSL for communication with the BI server. The BI applet gets this information through the applet parameters in the HTML page. See the parameter SECURITY in the section "Adjusting the BI HTML-page."

­l logfile

When this command is specified, logging of access history and errors is redirected to the file defined by the logfile placeholder. When this command is omitted, logging information is sent to the standard output, the Java console. The level of logging detail is set with the ­t command. ­c When this option is specified, the logging file indicated with the option ­l is first cleared, that is, truncated. If this option is not specified and the logging file specified with the ­l option already existed, all logging information is appended to this file. ­t level When this option is specified the level of detail for logging can be specified. A higher level gives more detail. Level 0 disables logging. The default for this option is level 1. The maximum level is 3. ­p port This mandatory option is used to specify the port number on which this BI server listens for incoming BI applet connections. Usually a port number higher than 1024 must be chosen, because lower numbers are reserved for system services. The BI applet must also use this port number when connecting to the BI server. The BI applets gets this port number via the applet parameters in the HTML page. See the parameter PORT in the section "Adjusting the BI HTML-page." ­a appserver This mandatory parameter specifies the application-server system. The appserver can be the hostname of the application-server system or its IP address.

Technical Manual 2-8

BI server

BI server as a Windows NT Service

If you are running the BI server on a Windows NT system, you can install the BI server as a Windows NT Service. Before you do this, make sure that you can start the BI server in your environment by manually starting the server. To install the BI server as an NT Service you must perform the following steps:

1 2

Install the Windows NT Resource Kit. This section assumes it is installed at C:\ntres. From the Windows NT Resource Kit, install the executable SRVANY.EXE as an NT Service. You can do this by entering the following commands at the DOS command prompt:

- C:\>cd \ntres - C:\ntres>INSTSRV BiService1 c:\ntres\srvany.exe

3

Start the Control Panel and choose the Services applet. Now perform the following steps:

- - - -

In the Services applet, choose BiService1 Choose Startup In the Startup dialog box, select the startup type Automatic Select Log on as System Account. Do not allow this service to interact with Desktop - Close the Control Panel

4

Start a registry editor, for example, regedt32, and perform the following steps:

- Look up HKEY_LOCAL_MACHINE\SYSTEM\ - Add another key under this key named: Parameters - Add the values listed in the following table to this key:

Registry values Value name Application Value type Value string REG_SZ C:\winnt\jview.exe BI server ­l <logfile> ­c ­a <hostname> ­p <portnum> $PUBLIC_HTML\$TARGETDIR\server

CurrentControlSet\Services\BiService1.

AppParameter REG_SZ AppDirectory REG_SZ

Close the registry editor.

5

When you restart your Windows NT system, the service is started automatically.

Technical Manual 2-9

BI server

If you want more than one BI server to be started as a Windows NT Service, repeat steps 1 - 5, and use another name for BiService1.

Adjusting the BI HTML-page

The following example shows the content of an HTML-page loading the BI applet in a browser.

<applet archive="netscape/bi.jar" code=BiLogon width=400 height=200> <param name=cabinets value="ie4/bi.cab, ie4/grid.cab, ie4/ssl.cab"> <param name=HOSTNAME value=""> <param name=PORT value=2000> <param name=SECURITY value=NONE> <param name=BSE value=/usr/bse> <param name=BSHELL value=bshell> <param name=COMMAND value=""> </applet>

The parameters that must be passed to this applet are as follows:

n

HOSTNAME The value of this parameter is the TCP/IP hostname or IP address of the system on which a BI server application is listening. When this parameter is omitted or set to an empty string, the BI applet connects to the server, from which the HTML-page containing the applet code was running. This is the default value. However, some firewall configurations require that the BI server runs on a system other than the HTTP-server system. See the section "Moving the BI server to another system". PORT The value of this parameter is the port number on the HTTP server system on which a BI server application is listening. This must correspond with the port number passed to the BI server with the ­p option. The BI applet always connects to the server from which the HTML-page containing the applet code was running. The default value is 2000. SECURITY The value of this parameter is used to determine the security mode of the connection between the BI applet and the BI server. If this value is "SSL," the BI applet starts a Secure Sockets Layer (SSL) connection with the BI server. (The BI server must have been started with the ­s option for the related port).

n

n

Technical Manual 2-10

BI server

If this value is "NONE" or this parameter is omitted, the BI applet starts a normal TCP/IP connection with the BI server. (The BI server must have been started without the ­s option for the related port). The default value is NONE.

n

BSE The value of this parameter is the BSE directory path on the applicationserver system. It is used to set the correct Bshell environment. The default path is /usr/bse. BSHELL The value of this parameter is the Bshell name on the application-server system. It is used to indicate which Bshell must be started (tag in $BSE/lib/ipc_info). The default value is Bshell. COMMAND The value of this parameter is the command string to be passed to the Bshell. This can be the environment setting for the Bshell and the name of the first session to be started. The default command is empty.

n

n

Client issues

At the time of writing this document, no detailed information about the supported browsers at the client side could be given. For the most up-to-date information about the supported browsers refer to the file $PUBLIC_HTML/$TARGET_DIR/client/readme.txt, installed on the HTTPserver system.

Technical Manual 2-11

BI server

Technical Manual 2-12

3

Database tools

General

The database tools are designed for database management, and are independent of how the database is organized. At run time the system selects a database driver depending on the contents of the file tabledef. You can then use these database tools to:

n n

Convert a database table to a sequential file (bdbpre) Create a database table from a sequential dump or append data to an existing database table (bdbpost) Reconfigure a database table according to a new data dictionary (bdbreconfig) Check or repair the referential integrity within the database (refint)

n

n

If there are changes in the data dictionary, for example, if fields are added or field lengths are changed, you can reconfigure the old table to a new one. The data dictionary changes are incorporated in the new table, which also contains the data dictionary table data. The system you use determines the extension for the database tool name. For example, bdbpre used on Windows NT is called bdbpre.exe, and on UNIX it is called bdbpre6.2. The following is a description of each of the database tools.

bdbpre

NAME bdbpre Convert database tables to a sequential file. SYNOPSIS bdbpre [­q output file] [­uUvVsrxyzkK][­p pack_comb][­t sep][­o dir] [­d driver type][­N table [table ..]][­I file][­E file][­O file] [­C company number list/range]

Technical Manual 3-1

Database tools

DESCRIPTION The bdbpre tool reads tables for given company numbers, converts them into sequential data and writes them to standard output. This output can be redirected to a file that can be used as input for bdbpost. The bdbpre tool prints information such as names, the number of records, and any errors. You can use the ­s option to suppress the messages produced by bdbpre at run time. This option is useful when you use the output of bdbpre as the direct input to bdbpost. The file fd6.2.package combination is always used for searching dictionary information. The following examples use $BSE/lib/tabledef6.2 to get information about the database type and driver. If you want to use a specific database driver for a particular conversion, you can use the ­d option. If you use this option, tabledef6.2 is not read. You can use bdbpre in the following ways:

n

You can convert a database table for more than one company number by specifying a range of company numbers. For example:

bdbpre ­Ntimcs099 ­C000-005 > timcs099_dump

n

You can convert a database table for given company numbers. For example:

bdbpre ­Ntimcs088 ­C000 004 005 > timcs088_dump

n

You can specify all the tables for which you want to create a sequential dump in some file in package module format. The ­I option reads this file and creates a sequential dump for each table and the specified company numbers. For example:

bdbpre ­Iseqfile ­C000-009 > BIGdump Type cat seqfile to view the contents of seqfile: timcs001 timcs002 timcs003 ........ timcs099

Technical Manual 3-2

Database tools

In the previous examples the database driver type is retrieved from $BSE/lib/tabledef6.2. If you want to use a specific database driver for a particular conversion you can use the ­d option. If you use this option, tabledef6.2 is not read. The database driver can be of the following types:

n n n n n

Sybase (sybase) Oracle (oracle) Informix Online (informix) DB2 (db2) Microsoft SQL Server (msql)

The name between the brackets is the entry that must exist in the $BSE/lib/ipc_info file. Enter the full database specification or host name, as in tabledef6.2 (optional with specifications). For example:

­d oracle ­d "oracle(ORACLE_HOME=/usr/oracle)" ­d bv8c03

Possible options: ­u/U Print usage information. ­v/V Print information about the version of bdbpre. ­p <pack_comb> define package combination. ­s Suppress error messages, statistics, and so on. ­C Company numbers for given table, in two formats:

- Specific company numbers (for example, 001 002 003) - Range of company numbers (for example, 001-999)

­d Database driver type, as follows: O (Oracle) I (Informix) S (Sybase) D (DB2) M (Microsoft SQL-Server) You can use the -d option to copy data from one instance of a database to another, for example:

-d "oracle(ORACLE_HOME=/usr/oracle, ORACLE_SID=D1)"

Technical Manual 3-3

Database tools

­N Database table name. Specify specific table names, for example, ­N timcs000 timcs016. The ­I and ­N options are mutually exclusive. ­I Input file with table names. The ­I and ­N options are mutually exclusive. ­E file Redirects errors to file ­O file Redirects output to file ­q output file Redirect terminal output to file output file ­k Drop table after dump is created. ­K Drop table. Create a backup before dropping. This is only possible if the DBMS supports this. ­t Used to insert a separator (Default \0). Useful for separating the fields when downloading records from the Bshell.

EXAMPLE

You want to download your database to UNIFY which uses | as a separator. Whenever you specify the ­t parameter, a sequential file (.S) is created for each table in the current directory unless the ­o option is specified. bdbpre ­t"|" ­Ntimcs016 ­C000 creates timcs016000.S in the current directory. This sequential file is an ASCII dump of table timcs016000, in which case the fields are separated by |. You can load this file directly into Oracle, UNIFY, and so on, using SQL. The options ­x and ­t are mutually exclusive. ­x Creates an ASCII dump with a fixed-length record and without any separators. This option is useful for downloading to databases such as dBASEIII, which require fixed-length records without any separators. In some cases a value is printed in the dump file that does not match the number of digits before decimal points (DIGV). For example, suppose DIGV=3 and the printed value=1234. The whole value, more than 3 digits, is written in the dump file, and an error message appears. To prevent this, you can use the following options in combination with the ­x option:

EXAMPLE

Technical Manual 3-4

Database tools

­y Skip out-of-domain records for fixed-length dumps. See ­x. ­z Set value to 0 (zero) if value and DIGV do not match, that is, nullifies out-ofdomain records. Creates individual, fixed-length ASCII File with the extension .F. See ­x.

EXAMPLE

bdbpre ­x ­Ntimcs016 ­C000 creates timcs016000.F, which is an ASCII dump with fixed-length records. This file can be loaded directly into dBaseIII. ­o Can be specified with the options ­x and ­t to specify the directory name in which the sequential file is created (.S or .F).

EXAMPLES

Convert Informix database to a sequential dump. The database driver is explicitly Informix.

bdbpre ­dinformix ­Ntimcs000 ­C000-004 > timcs000_dump

The database driver is retrieved from $BSE/lib/tabledef6.2

bdbpre ­Ntimcs000 ­C000-005 > timcs000_dump

Convert Oracle to Informix.

bdbpre ­s ­doracle ­Nttadv099 ­C000 001 | bdbpost ­dinformix

Transport the file to another database:

bdbpre ­t"|" ­d"oracle(ORACLE_SID=D1)" ­Ntimcs016 ­C000 ­oor_dump_016 bdbpre ­x ­dinformix ­Ntimcs016 ­C000 ­oci_dump_016

SEE ALSO bdbpost

NOTES

If you are piping your bdbpre output directly to bdbpost without giving the ­s option, messages on the screen are jumbled. If the ­d option is not used, the database driver is taken from $BSE/lib/tabledef6.2. Also, if a remote driver is specified in tabledef6.2 the database table from the remote machine is used, but the data dictionary is taken from the current machine, which can cause great difficulties.

Technical Manual 3-5

Database tools

bdbpost

NAME bdbpost Create a database table from a sequential dump or append data to an existing database table. SYNOPSIS bdbpost [­I input file][­O output file][­{qE} output file] [­uUvVARfilxnmkK][­p pack_comb][­e file][­d driver type][­D seq_dir] [­t sep] [­c compnr][­C compnr range][pattern] DESCRIPTION The bdbpost tool reads from either the argument you supply or from the standard input and creates a new database table if that table does not exist. If the append option is turned on, it appends data to an existing table. The bdbpost tool also compares current data dictionary information with the information in the dump. If they do not match, the bdbpost tool gives an error. If the current data dictionary is not present, it creates a data dictionary based on the dump. For each table, bdbpost prints information such as the table name, indexes, the number of records, and any errors. The bdbpost tool can be run using a sequential dump created by bdbpre or by using sequential dumps from other databases. The different methods are shown in the following examples: This example shows how to use a sequential dump created by bdbpre. On system 1:

bdbpre ­doracle ­Ntimcs016 ­C000-003 > timcs_dump

On system 2:

bdbpost < timcs_dump

This example shows the use of sequential dumps (­x or ­t option of bdbpre) from other databases. In this case the ­D option is mandatory to get the directory name in which .S files are stored.

bdbpost ­dinformix ­t"|" ­D./seqdir bdbpost ­doracle ­x ­D./seqdir

Options ­x, ­t, and ­D are required when you upload ASCII files from another database to the Bshell format.

Technical Manual 3-6

Database tools

­D Path for sequential files, which have the extension .S or .F. ­t Separator. If you want to load a sequential dump containing separators (for example, dump from UNIFY has separator |), make sure the file name is the table name with the extension .S.

EXAMPLE

If you want to load a UNIFY sequential dump into the table ttimcs016000, first move the sequential dump to the ttimcs directory with name ttimcs016000.S. bdbpost ­Dttimcs ­t"|" searches for a .S file in ttimcs and if that file is found, the corresponding tables are created or appended. With the ­D option all .S files in that directory are used to create/append the tables, so be sure to remove unwanted .S files before running bdbpost. ­x If you want to load a sequential dump with a fixed-length record without any separators (.F files, for example dump from dBase-III), make sure the file name is the table name with the extension .F.

CAUTION

EXAMPLE

Suppose you want to load a dBASEIII sequential dump into the timcs016000 table (Oracle organization). bdbpost ­doracle ­Ddbase ­x searches for an .F file in dbase and if that file is found the corresponding table is created or appended. In some of these examples the database driver type is retrieved from $BSE/lib/tabledef6.2. If you want to use a specific database driver for a particular conversion, you can use the ­d option. The database driver can be of the following types:

n n n n n

Sybase (sybase) Oracle (oracle) Informix Online (informix) DB2 (db2) Microsoft-SQL Server (msql)

Enter the driver name of the database driver between the parentheses. See also the section "bdbpre." The following parameters can be used for bdbpost: ­u/U Print usage information. ­v/V Print information about the version of bdbpost.

Technical Manual 3-7

Database tools

­p Define package combination <pattern> Pattern to specify tables that are filtered out of the dump. Wildcards such as * and ? are allowed. ­c Company number for the tables to be created. ­C Range of customer numbers on which to perform the bdbpost operation. This must be the last option specified in the command, other than the <pattern> option. ­d Database driver type, as follows: O (Oracle) I (Informix) S (Sybase) D (DB2) M (Microsoft SQL-Server) You can use the -d option to copy data from one instance of a database to another, for example:

-d "oracle(ORACLE_HOME=/usr/oracle, ORACLE_SID=D1)"

­x Load ASCII file (.F) with fixed-length records. ­D The directory name for ASCII files to be loaded. ­e File to store the names of unsuccessfully created tables. ­k The existing tables are deleted. ­K The existing tables are deleted after a backup is made (if DBMS supports this). ­l Display contents of input. ­I <file> Redirects input from input file <file>. ­O <file> Redirects output to output file <file>. ­E <file> Redirects errors to error file <file>.

Technical Manual 3-8

Database tools

­q <output file> Redirect terminal output to output file. ­m Disable domain constraints. ­i Ignore domain range error and skip record. ­n Ignore referential integrity constraints. ­A Append to an existing table. If duplicate records exist, do not overwrite them from the dump. Print duplicate record summary at the end. Create table if it does not exist. ­R Append to an existing table or create a new one. If a record already exists, the record in the dump replaces it. A summary is given at the end. Note that only the existence of the primary key is checked. If a primary key exists, the record is replaced. If the primary key does not exists but a secondary key exists, error 100 (duplicate record) occurs. ­t Specify the used separator. The ­t option is used when loading an ASCII file from another database. ­f Fast mode. Tables are created by first inserting all rows and then creating the indexes (if DBMS supports this). When using the ­f option be aware of the following:

n n n

EXAMPLES

Interrupting bdbpost results in table inconsistency An index cannot be created in case of a duplicate conflict For large tables, the adding of indexes can take a long time (> 15 minutes)

bdbpre ­doracle ­Nttadv000 ­C000-010 > dump bdbpost ­doracle < dump

Creates (appends) all tables in dump

bdbpost ­l < dump

Gives you names of tables in dump

bdbpost ­C000-005 < dump

Creates/appends tables only in the given customer range

bdbpre ­doracle ­Nticom000 ­C000-010 > dump

Technical Manual 3-9

Database tools

bdbpost ­C000-005 ticom* < dump

Creates/appends tables only in the given customer range and where the table name matches the pattern ticom.

bdbpost ­R ­C000-005 ttadv* < dump

Creates/appends tables only in the given customer range and where table name matches the pattern ttadv. If duplicate records exist, they are replaced by records from the dump.

bdbpre ­dsybase ­Nttadv099 ­C000-999 | bdbpost ­doracle

Converting from one database organization to another (From Sybase to Oracle organization).

bdbpost ­doracle ­Dunify ­t"|"

Loading from other databases (UNIFY to Oracle)

bdbpost ­Doracle ­x ­dsybase

(Oracle to Sybase)

CAUTION

If a remote driver is specified in tabledef6.2, the database table from the remote machine is used but the data dictionary is taken from the current machine, which can cause great difficulties. When the ­m or ­n option is used, the data in the database can violate the Baan integrity constraints. Data can violate the Baan domains or it can violate Baan referential integrity. SEE ALSO bdbpre

bdbreconfig

NAME bdbreconfig Reconfigure database table according to new data dictionary. SYNOPSIS bdbreconfig [­uUvVpscinmfTZ][­t dir][­o file][­e file][­d driver type] [­N table [table [..]] [­I file][­O file][­E file][­S number][­C company numbers]

Technical Manual 3-10

Database tools

DESCRIPTION The bdbreconfig tool reads a table name and company numbers as arguments and converts them into a new table definition that matches a new data dictionary definition. The bdbreconfig tool requires the following:

n n n

A new data dictionary with a .new extension The current data dictionary (for example dtimcs016) Tables matching those in the current data dictionary

After successful completion, old tables are deleted and new tables are generated. The bdbreconfig tool finds the optimum way to reconfigure. If there is no real change in the old and new data dictionaries, it prints the message "No conversion required." It also sees to it that a database remains consistent. You can perform some reconfigurations by modifying the old data dictionary. Otherwise the reconfiguration steps are:

1 2 3

Compare the current and new data dictionaries. If reconfiguration is required, create a sequential dump (R.<table name>, for example R.timcs016244) for the specified tables. Delete old tables.

4 From the sequential dump, build new tables that match the new data dictionary definition. The following options are available with bdbreconfig: ­U/u Usage information. ­V/v Version information. ­p The name of the used package combination. ­p <pack. comb.> Define the package combination. ­s This suppresses error messages and other information. ­C Company numbers for a given table in these formats:

n n

Specific company numbers (for example 001 002) Range of company numbers (for example 001-010)

Technical Manual 3-11

Database tools

­d Database driver type, as follows: O (Oracle) I (Informix) S (Sybase) D (DB2) M (Microsoft SQL-Server) You can use the -d option to copy data from one instance of a database to another, for example:

-d "oracle(ORACLE_HOME=/usr/oracle, ORACLE_SID=D1)"

­T If the domain changes, the table is not reconfigured. ­B Backup table instead of dropping. ­Z Reorganize, that is, clean up, the table. ­I The file with table names. ­i Ignore errors during reconfiguration, for example, duplicates. ­n Ignore referential integrity constraints. ­m Disable domain constraints. ­f Fast rebuild of table (first rows, then indexes). ­N List of tables to be reconfigured. ­c This compares two data dictionaries and checks whether reconfiguration is required. ­t The directory name for temporary dump files. ­I File with table names to reconfigure. ­o File with successfully reconfigured tables. ­e File with unsuccessfully reconfigured tables.

Technical Manual 3-12

Database tools

­O file Redirects output to output file file. ­E file Redirects errors to error file file. ­S number number is the maximum size per sequence. number can be specified as any number or a number followed by K for kilobytes, M for megabytes, and G for gigabytes. The default size is 2G per dump sequence. The bdbreconfig tool reconfigures only one table of given company numbers at a time.

EXAMPLE

bdbreconfig ­Ntimcs016 ­C001

Reconfigures timcs016 for company no. 001.

bdbreconfig ­Ntimcs016 ­C000-010

Reconfigures timcs016 for a range of company numbers. If bdbreconfig is used without the ­c option, the exit status is either 0 or 1, depending on successful or unsuccessful completion. If the exit status is 1 (unsuccessful) the file specified at the ­o option contains tables that can be reconfigured, and the file at the ­e option contains the tables that cannot be reconfigured. If bdbreconfig is used with the ­c option, the file specified at the -o option contains the table names which are found correct, and the file specified at the -e option contains the table names that must be reconfigured.

CAUTION

Make a copy of the dump before executing the following. In case of interrupted reconfiguration while the R.table file still exists, the following command uses the dump R.ttadv100222 to rebuild the table. bdbreconfig ­N ttadv100222+

EXAMPLE

bdbreconfig ­Ntimcs016 ­C000-003

Reconfigures timcs016 for some company numbers according to the new data dictionary, provided that dtimcs/dtimcs016 and dtimcs/dtimcs016.new are present.

bdbreconfig ­dsybase ­Ntimcs016 ­C000

Reconfigures Sybase table timcs016000. When the ­m or ­n option is used, the data in the database can violate the Baan integrity constraints. Data can violate the Baan domains or it can violate Baan referential integrity.

Technical Manual 3-13

Database tools

refint

NAME refint Check or repair the referential integrity within the database. SYNOPSIS refint [­uU][-vV][-b|-B file][-a |-A file][-l |-L file][-c][-n][-r][-s] [-p package][-I infile][-O outfile][-E errfile][-N table [table [..]]] [-C compnr [compnr [..]]] DESCRIPTION The refint tool checks the integrity of references in the database. You can also use it to repair the integrity of a corrupted database. Integrity refers to the accuracy or validity of data. The environment variable KEY_BUFFER specifies the number of keys stored in a buffer before updating the database. Default KEY_BUFFER=10000. You can use the following options: ­u/U

Print usage information.

­v/V Print version information. ­p Define package combination. ­C Specify company numbers. ­b/B List references before repair (-b output file is ref_before). ­a/A List references after repair (-a output file is ref_after). ­c Check validity of references. ­n Nullify undefined references, all references to the specified tables are checked.

Technical Manual 3-14

Database tools

­r Repair reference counter, from all specified tables the reference counters are checked and changed if necessary. Undefined references to the specified tables are displayed on the screen. ­l/L File for undefined references. (-l file is ref_undefined). ­I File containing table names to be checked. ­N <table> Specify table (format: ttadv100 or ttadv100999). ­s Handle one single-parent table only.

EXAMPLES

refint ­Iref_tables ­c ­n ­C100 refint ­Ntimcs016 ­l

Technical Manual 3-15

Database tools

Technical Manual 3-16

4

Database management

General

Database servers and user interface servers perform processes different from those performed by the client, the Bshell. They communicate with the Bshell using a communication protocol. This section discusses the working and usage of several protocols that can be used for local and remote communication. Local communication means that server and client are started on the same host machine. Remote communication means that server and client are on different machines.

Accessing tables

Tables can be distributed as follows:

n n n

Local: the tables and the Bshell are on one system Remote: the Bshell is on one system; all the tables are on another system Combination: some tables and the Bshell are on one system; some tables are on another system

To access a table, the Bshell and database drivers must know the database type and the location of the table. This information has been stored in the following files:

n n

tabledef6.2 fd6.2.package combination

tabledef6.2

Table references that refer to a database type are stored in the file tabledef6.2. This file is located in the directory $BSE/lib. To fill this file, use the Tables by Database (ttaad4111m000) and Database Definitions (ttaad4510m000) sessions on the BaanERP ToolsÈDatabase ManagementÈDatabase Definitions and Directories. If the tables are on a different system, you specify the host name of the remote system instead of entering the database type. The Bshell knows which database server must be started and in which database the required tables can be found.

Technical Manual 4-1

Database management

fd6.2.package combination

The file fd6.2.package combination is used to refer the following dictionary types to a specific directory (path) for a specific package combination:

n n n n n n

Forms Menus Objects Program scripts Functions Report scripts

The file fd6.2.package combination is located in the directory $BSE/lib. To fill this file, use the Directories of Software Components (ttadv1115m000) session in the BaanERP ToolsÈ Application CustomizationÈ Packages and Modules menu. The specific directory path of the table definitions must be entered in the Package Combinations (ttaad1520m000) session and is also placed in the fd6.2.package combination file. You can access this session through the BaanERP ToolsÈ Application DevelopmentÈ Packages and Modules menu.

Example table access (table and Bshell on the same system)

This example roughly explains how the Bshell accesses a table if they are on the same system. Suppose you work with company number 001, and read in an application table ttmod003. The contents of tabledef6.2 are:

*:001:oracle7(ORACLE_HOME=/a1/oracle/product/7.3.3,ORACLE_SID=baan5):N

First, Bshell reads tabledef6.2, searches for the reference and in this case starts the Oracle server. A connection between Bshell and server is made. Then the server accesses the table and the database action is carried out.

Database drivers

When an action is carried out on a table, a database driver (server) is started in the background for the database type in question.

Technical Manual 4-2

Database management

Accessing tables on other systems

When the database is on a different machine, the communication takes place as described in the following example. Suppose that in a Bshell program running on the system host_local, you want to read a record from the table ttmod000111 (table ttmod000 in company 111). This table is stored on the remote system, whose host name is host1. First, the Bshell searches tabledef6.2 on the system host_local for the table in question. The file contains the following reference:

ttmod:111:host1

This means that all tables of ttmod with company number 111 are stored on the remote system host1. Next, the Bshell accesses the system host1, where it reads tabledef6.2. This file contains the reference:

ttmod:111:oracle

This implies that the desired tables are stored in the Oracle database. The oracle server is then started. The desired table is searched and accessed using tabledef6.2 on the system host1. The record is read and its data is sent to the Bshell program on the system host_local.

Audit trail

Audit trail is a method by which actions on a record are logged in several audit files using an audit server. To work with audit trails, you must place the server name in the file $BSE/lib/ipc_info. In addition, you must specify in tabledef6.2 that you are using audit trail. To do this, set the Audit Trail field to Y or make the audit server the mirror server. See the section, "Database mirroring." When the client performs an action on a table, the action is logged in an audit file through the audit server. See also the chapter "Audit management."

Database mirroring

Tables can be stored in one or more database systems. The file tabledef6.2 contains references to the database where the tables are saved and/or read. For each reference you can specify one or more database systems where the tables are positioned. An example is:

tccom:*:oracle&host2.

This reference indicates that all tables of the tccom are in the Oracle database and on the system host2.

Technical Manual 4-3

Database management

The tables from the previous example are copies. A change applied to a table from tccom is carried through in the Oracle database on the local system and on the remote system host2. Also, a change to the tccom tables on the remote system must be carried through in the database on the local system. This means that tabledef6.2 on the remote system must contain a reference to the local system. If the system refers to a remote system, tabledef6.2 on that system is read. This file contains a reference to both the tables from tccom and to the systems where copies of the tccom tables are stored. In case of a read action, if there is a local database for the tables, it is used without a lock to enhance performance. If no local database has been defined, a remote database is used. The principle of database mirroring is outlined in the following figure.

Figure 3, Database mirroring

In this example, a change applied to a table in tccom is carried through in both the Sybase database on the local system and in the Oracle database on the remote system. A table is read, without a lock, from the Sybase database.

Technical Manual 4-4

Database management

Alternative databases

The file tabledef6.2 contains references to the database where the tables are saved and/or read. For each reference you can specify an alternative database driver or host where the table is located. Assume tabledef6.2 contains the following line:

*:*:host1|oracle

The previous example indicates that a table is searched or stored on host1. If that operation fails, the table is searched or stored in a local Oracle database. If this also fails, the table cannot be accessed. If you are using mirroring databases, you can specify an alternative database driver or host for each database system.

*:*:oracle&host1|host2

The previous example means that a table must be accessible in a local Oracle database. Besides that, it is searched or stored on host1. If host1 is not available, the table is searched or stored on host2.

Communication protocols

Communication between the client and the server includes both local and remote communication. Local communication means that both the client and the server are on the same system, which does not apply to remote communication. Depending on the hardware configuration, you can choose the following protocols for the communication between the client and the server:

n n n

Sockets (local or remote) Pipes Message queues

Only the remote socket protocol can be used for remote communication. For the communication between client and servers, the following files and/or directories are needed:

n n

ipc_info (in the $BSE/lib directory) A remote user file (ruser name). This file is located in the $BSE/lib/user directory, and is described in detail in the chapter "Remote databases."

Technical Manual 4-5

Database management

The ipc_info file contains the following data:

n n n n n n

Server name Operation mode Semaphore key Message key Protocol Path of the server program

The server name is the name of the server, which can be used in other files, for example in tabledef6.2 for database servers. Only the single mode can be used as operation mode, because the multimode is not yet implemented. In single mode, one server can communicate with one client. The client can communicate with more than one server, however, as shown in the following figure.

Figure 4, Single operation mode

The semaphore key and message key have not been implemented either. You can choose from the following protocols:

n n n

Socket (s) Message queue (m) Pipes (p)

These protocols are described in more detail in the following sections. The server's path can include environment variables, for example $BSE, which must be used as ${BSE}. An example of the ipc_info file is shown in Example ipc_info File.

Technical Manual 4-6

Database management

Socket protocol

A socket is a UNIX function that enables processes to communicate in both directions. The socket protocol is subdivided into local and remote sockets. Local sockets are used for local communication; remote sockets for remote communication. The client uses a local socket address if it is free at that moment. Both sockets are described in the following paragraphs.

Local sockets

When a client (Bshell) opens a table, the client reads tabledef6.2. If this file refers to a certain server, the client reads data about that server from the file ipc_info. The file ipc_info contains data such as the protocol to be used and the position of the executable server. Next, the client uses a socket to start the server and establish communication with the server.

Remote sockets (only for database servers)

Suppose that the client on host A wants to open a table on host B as in the following figure.

Figure 5, Remote socket protocol

Suppose that the client on host A wants to open a table on host B. This is done through sockets. The client reads tabledef6.2 on host A, which indicates that the table is on host B. The client logs on to host B using the password found in the file r<user's name> in the $BSE/lib/user directory.

Technical Manual 4-7

Database management

The client uses a remote execute call (rexec()) to start ipc_boot6.2 on host B, which starts fs6.2. fs6.2 is used to open, read, and write data from a remote $BSE directory. The ipc_boot process reads ipc_info to find the directory in which fs6.2 is located. Then an exec() call is done, so that the ipc_boot6.2 process changes to fs6.2. The client searches tabledef6.2 on host B, to determine which driver must be used to open the desired table, for example, Oracle. Another remote execute call is done; this time to start the Oracle driver on host B. Again ipc_boot6.2 is started and reads ipc_info for the path of the Oracle driver. Now icp_boot6.2 does an exec() call to the Oracle driver. Communication then proceeds normally between client and Oracle driver.

Pipes protocol

The pipes protocol is analogous to the local socket protocol. In pipes protocol, the client and server communicate through unnamed pipes streams. A pipe is a UNIX function that enables processes to communicate in one direction. The communication between the client and the server takes place through two pipes.

Message queue protocol

The message queue protocol is only used for local communication. With this protocol the client starts the server. The client and server communicate through a message queue using a semaphore key. This key indicates whether a message queue contains information, so that the client or server knows that information has been sent. See the following figure.

Figure 6, Message queue protocol

Technical Manual 4-8

Database management

For example, suppose the client wants to send information to the server. This information or message is put in a message queue, and the semaphore key is given the value of 1. The semaphore key shows the server that information has been sent, so that the server can read it. After the server reads it, the semaphore flag is reset and released, so that the client knows its information has been read. If the client process is canceled, the client will not put data in the message queue. However, the semaphore key is decremented using an undo value. The server reads the message queue and finds no message. Thus, the server knows that the client process has been terminated and stops its own process.

Example ipc_info file

Server name oracle7 informix Bshell fs6.2 Protocol (s/m/p) s00s s00s s00s s00p Path of executable server ${BSE}/bin/ora7_srv6.2 /usr1/bse/bin/inf_srv6.2 ${BSE}/bin/bshell6.2 ${BSE}/bin/fs6.2

Technical Manual 4-9

Database management

Technical Manual 4-10

5

Native language support

General

Native Language Support controls the communication between the character set of a terminal and that of Bshell6.2. Bshell6.2 has the 8-bit character set of ISO 8859-1. Most terminals and printers do not support this character set, so Native Language Support techniques are implemented. The character set of the terminal is uniform. However, various countrydependent keyboards can be used with the same terminal. Not all the characters of the terminal character set can be found on the keyboard. The remaining characters must be composed. How to compose characters is described in the section "Composed characters." An input conversion table is used to convert the character set of a terminal to that of the Bshell. In this table a character from the terminal character set is converted to the corresponding value from the ISO 8859-1. This means that characters from the Bshell must be converted again to correctly control the terminal or printer. Both the printer and the terminal need an output conversion table. For a description of the conversion tables, see the section "Conversion tables." To maintain the conversion tables you can use the NLS editor. This editor is described in the section "NLS editor."

Composed characters

Characters that are not found on a keyboard must be composed by a unique combination of two or more existing characters. An example of a list of composed characters is contained in the section "List of compose sequences." Prior to entering the combination, you must press a compose key. The compose key is defined in the terminal information file of the terminal. For more information see the section "NLS-related files." The compose key can be linked to a special key on the keyboard, for example, a function key. You can also compose characters by using the Compose character key, if it is present on the keyboard. This key has the same function as the compose key.

Technical Manual 5-1

Native language support

The manufacturer of the terminal has defined the composed characters. The user documentation of the terminal contains a list of these composed characters.

Conversion tables

You need two kinds of conversion to make the character sets of Bshell and the terminal or printer compatible: input conversion and output conversion.

Input conversion table

The input conversion table converts the entered characters to their corresponding values in the ISO 8859-1 character set. Composed characters and characters that are not compatible with the ISO character set must be included in this table. To record and/or modify an input conversion table, use the NLS editor, described in the section "NLS editor." An example of an input conversion table is given in the section "Input/output table vt200."

Output conversion table

The output conversion table converts the characters of the ISO character set to their corresponding values in the terminal or printer character set. You, therefore, need two output conversion tables:

n n

Terminal output table Printer output table

In this way a character is displayed or printed as entered. To record and/or modify an output conversion table you can use the NLS editor, described in the section "NLS editor." An example of an output conversion table is given in section "Input/output table vt200" and the section "Printer output table MT910 HP Prestige character set."

Technical Manual 5-2

Native language support

Example of total conversion

Terminal type: vt200 with North American keyboard Printer type: Mannesmann mt910 Required character: ÿ = ISO8859-1 code 255 = DEC vt200 code 253

The character ÿ is not found on a North American keyboard so it must be composed. The compose sequence can be y". To convert the composed character (DEC code 253) to its ISO 8859-1 representation (code 255), the input conversion table of the terminal must contain the following line:

\255 y"

The result of the input conversion is that the keyboard input Compose[y]["] is stored as ISO character y on disk or Bshell memory. To display the entered (required) character on your screen, ISO code255 must be converted to DEC code 253. Therefore the terminal output conversion table must contain the following line:

\255 \253

To print the entered (required) character on a Mannesmann mt910 printer the printer output table must contain the following line:

\255 y\b\168

This means that character ÿ is printed as:

[y] <Backspace>["] y \b \168

Technical Manual 5-3

Native language support

This example is shown in the following figure.

Figure 7, Example NLS conversion

NLS editor

Use the NLS editor to maintain input and output conversion tables. To start the editor, type nlsedit6.2. To maintain printer output tables, use the ­p option followed by the printer name. To maintain a terminal conversion table, the shell variable TERM must have the value corresponding to your terminal type. For an X-terminal to display the characters of ISO 8859-1, you must have the right font. The section "NLS-related files" contains an example of suitable fonts. After you have started the editor, the upper part of the ISO character set (160255) is displayed. If a character cannot be displayed on your screen, it might be because it is not found in the character set of the terminal. You can display feasible options by typing ?. Exit the editor by typing Q.

Technical Manual 5-4

Native language support

Initial screen options

Feasible initial screen options are: -d/h/o -t -r -s set decimal/hex/octal display mode edit nls_in and nls_out tables toggle display of characters toggle character set

With the options -D, -H, and -O you can change the display mode of the character values into decimal, hexadecimal, or octal. The -T option is used to edit the conversion tables. A second screen appears. The initial screen shows the characters displayed by the terminal as defaults. With the -R option you can set this mode on/off. The default characters displayed on the initial screen are characters of the upper part (160-255) of the ISO character set. With the -S option you can switch between the lower part (32-127) and the upper part of this character set. You can display the initial screen options by typing ?. The window that appears shows also your terminal setup, NLS table names, and shell variable BSE.

Maintenance of NLS conversion tables

By entering the -T option on the initial screen you can maintain the input and output conversion tables. Five columns are displayed as illustrated in the following example.

input A` A' A\^ int 192 193 194 s À Á Â # 0 1 0 output \192 \193 \194

The left column, input, contains the compose sequence of the input characters. This column also contains single input characters not transparent with the ISO character set. The second column, int, displays the values of the characters in the ISO character set. The third column, s, shows the characters as they are represented after output conversion.

Technical Manual 5-5

Native language support

The fourth column, #, contains the character set number. Character sets are defined at the terminal or printer. The possible values are 0-9, and the default is 0. The last column, output, contains the output sequence of the characters. You can type the output sequence in decimal, hexadecimal or octal code. The bottom of the screen shows the display mode in which the values of the characters are displayed. The last line indicates the marked character. The numeric representations and description are also included. Feasible options to maintain conversion tables are: ­D/H/O -N ­ARROW DOWN ­ARROW UP ­CTRL+N ­CTRL+P ­K ­C ­S ­W ­+/set decimal/hexadecimal/octal display mode toggle numeric/alpha mode compose sequence next line previous line next page previous page single key enter compose sequence enter output sequence write nls_in and nls_out file increment/decrement character set number

With the options -D, -H, and -O you can change the display mode of the character values into decimal, hexadecimal, or octal. The -N option converts alphanumeric characters from the input and output table to their numeric values, and vice versa. To move the bar to the following or previous line, use the key ARROW DOWN or ARROW UP. Pressing CTRL+N or CTRL+P moves the bar 15 lines forward or backward. To enter the input sequence of a single key, press -K. The editor asks you to press the required key. That character is included directly in the table. You do not need to press ENTER after you have entered the character. After pressing -C you can enter the compose sequence. You can enter up to 35 characters.

Technical Manual 5-6

Native language support

To type the output sequence, enter -S. You can enter up to 35 characters. After any modification, you can store the input and output tables by entering -W.

NLS-related files

To work with NLS you must have the following files in your BSE environment:

n n n n

Terminal information file$BSE/lib/terminf/... Printer information file$BSE/lib/printinf/... Input conversion table$BSE/lib/nlsinf/... Output conversion table$BSE/lib/nlsinf/...

You must also have the right terminal setup, shell variable TERM, and font. For some additional features you can use sort tables and shift tables.

Terminal information file

The terminal information files have been placed in subdirectories of the directory $BSE/lib/terminf. For example, terminal information files starting with the letter v are placed in subdirectory v. Two lines must be added to each terminal information file, to indicate the conversion tables used by the terminal:

nls_in=<terminal type>.in nls_out=<terminal type>.out,

For example, for a vt200 terminal, the terminal information file vt200 can contain the following lines:

nls_in=vt200.in nls_out=vt200.out,

The compose key code is also defined in the terminal information file:

kcompose=<compose key code>,

The code can be anything that does not conflict with other special keys. For example, suppose you want to define the compose key as ESC+C. Add the following line to the terminal information file:

kcompose=\ec,

Technical Manual 5-7

Native language support

Printer information file

The printer information files have been placed in subdirectories of the directory $BSE/lib/printinf. For example, printer information files starting with the letter m are placed in subdirectory m. The following line must be added to each printer information file, to indicate the output conversion table used by the printer:

nls_out=<printer type>.out,

For example, for an mt910 printer, the printer information file mt910 must contain the following line:

nls_out=mt910.out,

Input and output conversion table

The input and output conversion tables are stored in directory $BSE/lib/nlsinf. Possible table names in this directory are:

<terminal type>.in (input conversion terminal) <terminal type>.out (output conversion terminal) <printer type>.out (output conversion printer)

For each terminal there is one input and one output conversion table. For each printer there is only an output conversion table. The format of every line in a conversion table is:

<string><tabs or spaces><string>

A string can consist of one or more:

n n n n n n n

ASCII codes (A-Z, a-z, and 0-9...) Octal codes (\01, \012, \012...) Decimal codes (\1, \12, \12...) Hexadecimal codes (\0x1, 0x12...) Control codes (^A, ^B, ^C...) Escape codes (\E, \e, \s, \n, \r, \f, \v, \b) Special codes (\\, \^ )

A list of control and escape codes is given in the Overview of Esc/Ctrl codes." The first column contains the numeric representation of the ISO 8859-1 character set. In an input table, the second column contains the compose sequence of the input characters. In an output table, the second column contains the numeric representation of the output characters. The columns are separated by spaces or tabs.

Technical Manual 5-8

Native language support

Examples of conversion tables are given in the section "Input/output table vt200."

Terminal setup

The communication mode of the terminal must be 8-bit no parity. The shell variable TERM must have the name of the terminal information file of the terminal.

Character sets and fonts

Line drawing characters do not need to be included in the character set. These characters are drawn by the Bshell itself. To check the suitability of character sets, type the following command:

xfontsel ­pattern ­*-*-iso8859-1

To choose the font and set the shell variable FONT, type the following command:

csh: setenv FONT "`xfontsel ­pattern *-c-*-iso8859-1-print`" sh: FONT="`xfontsel ­pattern *-c-*-iso8859-1-print`" export FONT

After reducing the number of options, a character set can be chosen in this program. Suitable character sets are:

-bitstream-terminal-medium-r-normal--18-140-100-100-c-110-iso8859-1 -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1 -misc-fixed-medium-r-normal--15-120-100-100-c-90-iso8859-1

Sort tables

You can use a sort that differs from the default sort method. To do this you can use a sort table to specify the weight of characters. The file with the sort table has the default name:

$BSE/lib/nlsinf/sort.tab

You can make your own sort table by filling the environment variable SORT_TABLE with the name of your own sorting file. A sort table has two columns. The first one contains the character, the second contains the weight of that character.

Technical Manual 5-9

Native language support

For example, to sort the B before the A, create a sort table with the following contents:

\65 \66 or A B \66 \65 B A

You can use escape and control codes, like \012, \e, ^A. See the section "Input and output conversion table" for more information.

Shift tables

Shift tables can be used to specify lowercase and uppercase characters that belong together. The file with the shift table has the default name:

$BSE/lib/nlsinf/shift.tab

You can make your own shift table by filling the environment variable SH_TABLE with the name of the file with your own shift table. A shift table has two columns. The first one contains the uppercase character, the second contains the lowercase character. For example, to specify the lowercase and uppercase character c with cedilla, create a shift table with the following contents:

\199 \231

Technical Manual 5-10

Native language support

ISO 8859-1 character set (0-127)

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 SP 17 ! 18 " 19 # 20 $ 21 % 22 & 23 ` 24 ( 25 ) 26 * 27 + 28 ` 29 30 . 31 / 47 ? 46 > 63 O 45 = 62 N 79 _ 44 < 61 M 78 ^ 95 o 43 ; 60 L 77 ] 94 n 111 42 : 59 K 76 \ 93 m 110 127 41 9 58 J 75 [ 92 l 109 } 126 40 8 57 I 74 Z 91 k 108 | 125 39 7 56 H 73 Y 90 j 107 { 124 38 6 55 G 72 X 89 I 106 z 123 37 5 54 F 71 W 88 h 105 y 122 36 4 53 E 70 V 87 g 104 x 121 35 3 52 D 69 U 86 f 103 w 120 34 2 51 C 68 T 85 e 102 v 119 33 1 50 B 67 S 84 d 101 u 118 32 0 49 A 66 R 83 c 100 t 117 48 @ 65 Q 82 b 99 s 116 64 P 81 a 98 r 115 80 ` 97 q 114 96 p 113 112

Technical Manual 5-11

Native language support

128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143

144 145

160 NBSP 161 ¡

176 ° 177 ± Á 178 ² Â 179 ³ Ã 180 ' Ä 181 µ Å 182 ¶ Æ 183 · Ç 184 , È 185 ¹ É 186 ° Ê 187 » Ë 188 ¼ 189 ½ 190 ¾ Î 191 ¿ Ï Í Ì À

192 Ð 193 Ñ 194 Ò 195 Ó 196 Ô 197 Õ 198 Ö 199 × 200 Ø 201 Ù 202 Ú 203 Û 204 Ü 205 Ý 206 Þ 207 ß

208 à 209 á 210 â 211 ã 212 ä 213 å 214 æ 215 ç 216 è 217 é 218 ê 219 ë 220 ì 221 í 222 î 223 ï

224 ð 225 ñ 226 ò 227 ó 228 ô 229 õ 230 ö 231 ÷ 232 ø 233 ù 234 ú 235 û 236 ü 237 ý 238 þ 239 ÿ

240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255

146 ¢ 147 £ 148 ¤ 149 ¥ 150 ¦ 151 § 152 ¨ 153 © 154 ª 155 « 156 ¬ 157 158 ® 159 |

162 163 164 165 166 167 168 169 170 171 172 173 SHY 174 175

Technical Manual 5-12

Native language support

DEC vt100/vt200 character set (0-127)

0 NUL 0 1 SOH 1 2 STX 2 3 ETX 3 4 EOT 4 5 ENQ 5 6 ACK 6 7 BEL 7 8 BS 8 9 HT 9 10 LF A 11 VT B EM 19 26 SUB 1A 27 ESC 1B + 2B * 2A 43 ; 3B 16 DLE 10 17 DC1 11 18 DC2 12 19 DC3 13 20 DC4 14 21 NAK 15 22 SYN 16 23 ETB 17 24 CAN 18 25 ) 29 42 : 3A 59 K 4B ( 28 41 9 39 58 J 4A 75 [ 5B ` 27 40 8 38 57 I 49 74 Z 5A 91 k 6B & 26 39 7 37 56 H 48 73 Y 59 90 j 6A 107 { 7B % 25 38 6 36 55 G 47 72 X 58 89 I 69 106 z 7A 123 $ 24 37 5 35 54 F 46 71 W 57 88 h 68 105 y 79 122 # 23 36 4 34 53 E 45 70 V 56 87 g 67 104 x 78 121 " 22 35 3 33 52 D 44 69 U 55 86 f 66 103 w 77 120 ! 21 34 2 32 51 C 43 68 T 54 85 e 65 102 v 76 119 32 SP 20 33 1 31 50 B 42 67 S 53 84 d 64 101 u 75 118 0 30 49 A 41 66 R 42 83 c 63 100 t 74 117 48 @ 40 65 Q 51 82 b 62 99 s 73 116 64 P 50 81 a 61 98 r 72 115 80 ` 60 97 q 71 114 96 p 70 113 112

Technical Manual 5-13

Native language support

12 FF C 13 CR D 14 SO E 15 SI F US RS GS FS

28 ` 1C 29 ­ 1D 30 . 1E 31 / 1F

44 < 2C 45 = 2D 46 > 2E 47 ? 2F

60 L 3C 61 M 3D 62 N 3E 63 O 3F

76 \ 4C 77 ] 4D 78 ^ 4E 79 _ 4F

92 l 5C 93 m 5D 94 n 5E 95 o 5F

108 | 6C 109 } 6D 110 ­ 6E 111 6F

124 7C 125 7D 126 7E 127 DEL 7F

Technical Manual 5-14

Native language support

DEC vt100/vt200 character set (128-255)

128 80 129 81 130 82 131 83 132 84 133 85 134 86 135 144 DCS 90 145 PU1 91 146 PU2 92 147 STS 93 148 CCH 94 149 MW 95 150 SPA 96 151 EPA 97 136 152 ¨ 98 137 153 © 99 138 154 ª 9A 139 155 CSI 9B « AB AA 171 » BB A9 170 ° BA 187 Ë CB A8 169 ¹ B9 186 Ê CA 203 Û DB B8 185 É C9 202 Ú DA 219 ë EB § A7 168 ¥ A5 166 ¶ A6 167 · B7 184 È C8 201 Ù D9 218 ê EA 235 û FB B6 183 Ç C7 200 Ø D8 217 é E9 234 ú FA 251 D7 216 è E8 233 ù F9 250 £ A3 164 A4 165 µ B5 182 Æ C6 199 ¢ A2 163 ³ B3 180 Ä B4 181 Å C5 198 Ö D6 215 ç E7 232 ø F8 249 F7 248 E6 231 C4 197 Õ D5 214 ¡ A1 162 ² B2 179 Ã C3 196 Ô D4 213 å E5 230 ö F6 247 160 ° A0 161 ± B1 178 Â C2 195 Ó D3 212 ä E4 229 õ F5 246 B0 177 Á C1 194 Ò D2 211 ã E3 228 ô F4 245 176 À C0 193 Ñ D1 210 â E2 227 ó F3 244 D0 209 á E1 226 ò F2 243 192 208 à E0 225 ñ F1 242 F0 241 224 240

Technical Manual 5-15

Native language support

140

156 9C

172 ¼ AC 173 ½ AD 174 AE 175 ¿ AF

188 Ì BC 189 Í BD 190 Î BE 191 Ï BF

204 Ü CC 205 Ý CD 206 CE 207 ß CF

220 ì DC 221 í DD 222 î DE 223 ï DF

236 ü EC 237 ý ED 238 EE 239 EF

252 FC 253 FD 254 FE 255 FF

141

157 OSC 9D 158 PM 9E

142

143

159 APC 9F

Technical Manual 5-16

Native language support

List of compose sequences

Character NBSP | " # @ [ \ ] { | } ¡ ¢ £ ¥ § ¤ © ® ª « ¬ SHY ° ± ² ³ ' × ÷ µ Description Nonbreaking space Broken bar Diaeresis Quotation mark Commercial at sign Opening bracket Backslash Closing bracket Opening brace Vertical bar (or pipe) Closing brace Inverted exclamation mark Cent sign Pound sign Yen Sign Section sign Currency sign Copyright sign Registered trademark sign Feminine ordinal indicator Left angle quotation mark Not sign Soft hyphen Macron Degree symbol, Ring above Plus or minus Superscript two Superscript three Acute accent Multiplication sign Division sign Micron sign Composition \s\s || "" ++ Aa (( // )) (/^ )!! C/ LYSo Xo CO RO A_ << -, -\ =0^ +2^ 3^ '' Xx :/u

Technical Manual 5-17

Native language support

Character ¶ · º , ¹ » ¼ ½ ³ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø

Description Paragraph mark Middle dot Masculine ordinal indicator o_ Cedilla Superscript one Closing chevrons Common fraction one-quarter Common fraction one-half Common fraction three-quarter Inverted question mark Uppercase A with grave accent Uppercase A with acute accent Uppercase A with circumflex accent Uppercase A with tilde Uppercase A with diaeresis Uppercase A with ring above Uppercase ligature A with E Uppercase C with cedilla Uppercase E with grave accent Uppercase E with acute accent Uppercase E with circumflex accent Uppercase E with diaeresis Uppercase I with grave accent Uppercase I with acute accent Uppercase I with circumflex accent Uppercase I with diaeresis Uppercase Icelandic ETH Uppercase N with tilde Uppercase O with grave accent Uppercase O with acute accent Uppercase O with circumflex accent Uppercase O with tilde Uppercase O with diaeresis Uppercase O with oblique stroke

Composition P! .^ ,, 1^ >> 14 12 34 ?? A` A' A^ A~ A" A* AE C, E` E' E^ E" I` I' I^ I" DN~ O` O' O^ O~ O" O/

Technical Manual 5-18

Native language support

Character Þ Ù Ú Û Ü Ý ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ø þ ù ú

Description Uppercase Icelandic thorn Uppercase U with grave accent Uppercase U with acute accent Uppercase U with circumflex accent Uppercase U with diaeresis Uppercase Y with diaeresis Lowercase German sharp s Lowercase a with grave accent Lowercase a with acute accent Lowercase a with circumflex accent Lowercase a with tilde Lowercase a with diaeresis Lowercase a with ring above Lowercase ligature a with e Lowercase c with cedilla Lowercase e with grave accent Lowercase e with acute accent Lowercase e with circumflex accent Lowercase e with diaeresis Lowercase i with grave accent Lowercase i with acute accent Lowercase i with circumflex accent Lowercase i with diaeresis Lowercase Icelandic ETH Lowercase n with tilde Lowercase o with grave accent Lowercase o with acute accent Lowercase o with circumflex accent Lowercase o with tilde Lowercase o with diaeresis Lowercase o with oblique stroke Lowercase Icelandic thorn Lowercase u with grave accent Lowercase u with acute accent

Composition TH U` U' U^ U" Y" ss a` a' a^ a~ a" a* ae c, e` e' e^ e" i` i' i^ i" dn~ o` o' o^ o~ o" o/ th u` u'

Technical Manual 5-19

Native language support

Character û ü ý ÿ

Description Lowercase u with circumflex accent Lowercase u with diaeresis Lowercase y with acute accent Lowercase y with diaeresis

Composition u^ u" y' y"

Input/output table vt200

\160 \161 \162 \163 \164 \165 \166 \167 \168 \169 \170 \171 \172 \173 \174 \175 \176 \177 \178 \179 \180 \s\s !! c/ Lxo Y|| So "" cO a_ << -, -\\ rO =0\^ +2^ 3^ ''

Technical Manual 5-20

Native language support

\181 \182 \183 \184 \185 \186 \187 \188 \189 \190 \191 \192 \193 \194 \195 \196 \197 \198 \199 \200 \201 \202 \203 \204 \205 \206 \207

/u p! .\^ ,, 1^ o_ >> 14 12 34 ?? A` A' A\^ A~ A" A* AE C, E` E' E\^ E" I` I' I\^ I"

Technical Manual 5-21

Native language support

\208 \209 \210 \211 \212 \213 \214 \215 \216 \217 \218 \219 \220 \221 \222 \223 \224 \225 \226 \227 \228 \229 \230 \231 \232 \233 \234

DN~ O` O' O\^ O~ O" xx O/ U` U' U\^ U" Y' TH ss a` a' a\^ a~ a" a* ae c, e` e' e\^

Technical Manual 5-22

Native language support

\235 \236 \237 \238 \239 \240 \241 \242 \243 \244 \245 \246 \247 \248 \249 \250 \251 \252 \253 \254 \255

e" i` i' i\^ i" dn~ o` o' o\^ o~ o" :o/ u` u' u\^ u" y' th y"

Technical Manual 5-23

Native language support

Output table

\160 \164 \166 \168 \172 \173 \174 \175 \180 \184 \190 \208 \215 \222 \240 \247 \253 \254 \255 \s \168 | " \183 \183 \183 \183 \183 \183 D x P \183 / y p \253

Technical Manual 5-24

Native language support

Printer output table MT910 HP Prestige character set

\160 \161 \162 \163 \164 \165 \166 \167 \168 \169 \170 \171 \172 \173 \174 \175 \176 \177 \178 \179 \180 \181 \182 \183 \184 \s \184 c\b| \175 \186 \188 | \189 \171 \s a\b_ << \176 \s \176 \179 \254 \s \s \168 u \s . ,

Technical Manual 5-25

Native language support

\185 \186 \187 \188 \189 \190 \191 \192 \193 \194 \195 \196 \197 \198 \199 \200 \201 \202 \203 \204 \205 \206 \207 \208 \209 \210 \211

\s \250 >> \247 \248 \s \185 \161 \224 \162 \225 \216 \208 \211 \180 \163 \220 \164 \165 \230 \229 \166 \167 \227 \182 \232 \231

Technical Manual 5-26

Native language support

\212 \213 \214 \215 \216 \217 \218 \219 \220 \221 \222 \223 \224 \225 \226 \227 \228 \229 \230 \231 \232 \233 \234 \235 \236 \237 \238

\223 \233 \218 x \210 \173 \237 \174 \219 \89 \240 \222 \200 \196 \192 \226 \204 \212 \215 \181 \201 \197 \193 \205 \217 \213 \209

Technical Manual 5-27

Native language support

\239 \240 \241 \242 \243 \244 \245 \246 \247 \248 \249 \250 \251 \252 \253 \254 \255

\221 \228 \183 \202 \198 \194 \234 \206 / \214 \203 \199 \195 \207 y\b\168 \241 \239

Technical Manual 5-28

Native language support

Overview of Esc/Ctrl codes

ASCII mnemonic SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI DLE DC1 (Xon) DC2 DC3 (Xoff) DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS SPACE Dec code 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0032 Hec code 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1A 0x1B 0x1C 0x1D 0x1E 0x20 Oct code 0001 0002 0003 0004 0005 0006 0007 0010 0011 0012 0013 0014 0015 0016 0017 0020 0021 0022 0023 0024 0025 0026 0027 0030 0031 0032 0033 0034 0035 0036 0040 \s \e ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^\ ^] ^^ ^Q ^R \n \v \f \r \b Esc code Ctrl code ^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O ^P

Technical Manual 5-29

Native language support

Technical Manual 5-30

6

Information files

Terminal information file

A terminal information file stores information including the type of terminal, terminal operations, how to access keys on the keyboard, color support, cursor movements, whether code features are blinking, bold, reverse, and so on. Terminal information files are stored in the directory $BSE/lib/terminf. To create a new terminal information file, create a subdirectory in the terminf directory whose name is the first letter of the future terminal information file. The terminal information file is stored in that subdirectory. For example, the terminal information file for a vt100 terminal is stored in the directory:

$BSE/lib/terminf/v/

A terminal information file can contain three types of entries:

n n n

Boolean entries Numbers Strings

Each entry is closed by a comma (,). Comment text can be added, preceded by a number sign (#). You can include another terminal information file at any position in the current file with the line, for example:

include=vt100,

Boolean entries

A Boolean entry reflects a feature of the terminal. A Boolean entry is set to true by including it in the terminal information file. It is set to false either by not including it or by prefixing it by an exclamation point (!), for example, !vt100. Here are the available Booleans and what they mean when set to true:

aux_dual

Indicates that output to the aux port also appears on the terminal screen. The terminal screen is disabled during aux printing.

color_cf

Provides color control in combination with code features.

Technical Manual 6-1

Information files

color_sep

Colors and code features are controlled separately.

mcf

You can move the cursor when the code feature (cf) is active.

mgr

You can move the cursor when the program is in graphics mode.

nclrwc

The terminal does not clear the screen when the width is switched from 80 to 132 columns or vice versa (No CLeaR on Window (width) Change).

vt100

After a character is entered on the last position (80 or 132), the cursor remains on that position. The following character causes the cursor to jump to the next line.

xhp

Code features and graphic characters are not removed when they are overwritten by characters in normal mode, but have to be removed explicitly (HP terminals).

Numbers

Numbers are variables that indicate the size of the terminal or particular features. The following numbers are available:

cf_pos=

Number of positions required to switch a code feature on and off. The default value is 0. The maximum value depends on the terminal type.

cols=

Number of available columns on the screen. The maximum is 132. If this value is set to 80 you cannot switch the display to 132 positions.

disp_vt100=

Number of columns the cursor is to move if, in the last column (80th or 132nd), the terminal receives a backspace (vt100 mode). The default value is 1. The maximum value depends on the terminal type.

gr_pos=

Number of positions required to switch the graphics mode on and off. The default value is 0. The maximum value depends on the terminal type.

lines=

Number of lines on screen (variable). The environment variable LINES can overwrite this value.

Technical Manual 6-2

Information files

tmo=

Timeout sequence after pressing ESC. The given number divided by 10 specifies the time (in seconds) in which a sequence can be typed in after ESC. If no character is pressed between this time, the pressing of ESC is handled normally. The default timeout sequence is 5 (0.5 second).

Strings

String variables are filled with a sequence of characters that can be used to perform particular terminal operations. You can use the following special characters to assign string variables:

Escape codes: \b \e or \E \f \n \r \t \s \xx \0xx \xxx Control codes: backspace escape form feed new line carriage return tab space decimal value xx= octal value xx= hexadecimal value xx= ASCII-code ^A t/m ^Z (1-26) ^[ (27) ^\(28) ^](29) ^^ (30) ^_ (31) 1-255 1-377 1-FF (for example \x1F)

You can also use an octal value instead of an alphabetical representation. For example, "escape" becomes \033. The control codes are converted to the ASCII codes 1 to 31. For example, ^B equals the ASCII character with decimal value 2 (STX). The following string variables are possible:

aux_off=

Closes the auxiliary port. All data is displayed on the terminal.

aux_on=

Opens the auxiliary port. All data sent to the terminal is passed to the aux port.

bell=

Audible signal (usual value: ^G).

cadr=

Absolute column positioning string. See the section "Parameterized strings" about the use of a parameterized string.

Technical Manual 6-3

Information files

cbl=

Character used in graphics mode to display the lower left corner (+). If it is not available, a viable alternative is +. Do not leave the variable empty, because this can result in screen layout problems.

cbr=

Character used in graphics mode to display the lower right corner (+). If it is not available, a viable alternative is +. Do not leave the variable empty, because this can result in screen layout problems.

cf_b=

Code feature, blinking.

cf_br=

Code feature, blinking, and reverse.

cf_bru=

Code feature, blinking, reverse, and underlined.

cf_bu=

Code feature, blinking, and underlined.

cf_B=

Code feature, bold.

cf_Bb=

Code feature, bold, and blinking.

cf_Bbr=

Code feature, bold, blinking, and reverse.

cf_Bbru=

Code feature, bold, blinking, reverse, and underlined.

cf_Bbu=

Code feature, bold, blinking, and underlined.

cf_Br=

Code feature, bold, and reverse.

cf_Bru=

Code feature, bold, reverse, and underlined.

cf_Bu=

Code feature, bold, and underlined.

cf_n=

Code feature, normal.

cf_r=

Code feature, reverse.

Technical Manual 6-4

Information files

cf_ru=

Code feature, reverse, and underlined.

cf_u=

Code feature, underlined.

clear=

Clears the entire display and moves the cursor to the top left corner of the screen.

csr=

Character sequence for changing the scrolling region. The first parameter indicates the start line. The second parameter indicates the end line of the scrolling region. See also the section "Parameterized strings."

ctl=

Character used in graphics mode to display the upper left corner (+). If it is not available, a viable alternative is +. Do not leave the variable empty, because this can result in screen layout problems.

ctr=

Character used in graphics mode to display the upper right corner (+). If it is not available, a viable alternative is +. Do not leave the variable empty, because this can result in screen layout problems.

cu_off=

Cursor off (invisible).

cu_on=

Cursor on (visible).

cub=

The cursor moves back the specified number of columns. See the section "Parameterized strings."

cub1=

The cursor moves back one position.

cud=

The cursor moves down the specified number of rows. See the section "Parameterized strings."

cud1=

The cursor moves down one row.

cuf=

Move the cursor forward by the specified number of columns. See the section "Parameterized strings."

cuf1=

The cursor moves forward one position.

Technical Manual 6-5

Information files

cup=

Absolute cursor positioning. See the section "Parameterized strings."

cuu=

The cursor moves up by the specified number of rows. See the section "Parameterized strings."

cuu1=

The cursor moves up one row.

delch=

Deletes the character below the cursor.

delli=

Deletes one line.

dt=

Character used in graphics mode to display the lower T-bar. If it is not available, a viable alternative is +. Do not leave the variable empty, because this can result in screen layout problems.

el=

Deletes to the end of the row.

es=

Deletes to the end of the screen.

ewin=

Erases the current window.

flash=

Flashes the screen instead of beeping when an error occurs.

gr_off=

Turns graphics mode off.

gr_offB=

Turns bold graphics mode off.

gr_on=

Turns graphics mode on.

gr_onB=

Turns bold graphics mode on.

hb=

Character used in graphics mode to display the horizontal bar. If it is not available, a viable alternative is ­. Do not leave the variable empty, because this can result in screen layout problems.

Technical Manual 6-6

Information files

home=

Positions the cursor in the upper left corner of the screen.

if=

Name of file containing codes to initialize the terminal. This initialization is done after the initialization string in init and before the string in init2. Within the file you can, for example, specify a large number of codes that do not fit in a string of soft font codes.

inch=

Insert one character, usually a space at the current cursor position.

init=

Initialization string sent to the terminal to set it up for proper use by the Bshell. This string is sent before any other output.

init2=

Initialization string sent to the terminal to set up. This string is sent during initialization of the terminal, after the string init and the codes in the file specified at entry if.

inli=

Insert one line.

kr=

Character used in graphics mode to display the center crossbar (+). If it is not available, a viable alternative is +. Do not leave the variable empty, because this can result in screen layout problems.

ladr=

Absolute line positioning string. See the UNIX manual TERMINFO(4) and the section "Parameterized strings" about defining such a string with one parameter.

lt=

Character used in graphics mode to display the left T-bar. If it is not available, a viable alternative is +. Do not leave the variable empty, because this can result in screen layout problems.

nls_in=

Name of NLS input conversion table. See the NLS4.2 user manual.

nls_out=

Name of NLS output conversion table. See the NLS4.2 user manual.

rc=

Restores cursor position and attributes saved with the character sequence specified with entry sc.

Technical Manual 6-7

Information files

reset=

Reset initialization string. The terminal is set up in such a way that it can be used in UNIX or other programs. The string is sent after the Bshell terminates execution.

rt=

Character used in graphics mode to display the right T-bar. If it is not available, a viable alternative is +. Do not leave the variable empty, because this can result in screen layout problems.

sc=

Save cursor position and attributes.

set0=, to set9=

Set a character set of the terminal. The default set is set0.

set80=

Set the display width to 80 column.

set132=

Set the display width to 132 columns.

ut=

Character used in graphics mode to display the upper T-bar. If it is not available, a viable alternative is +. Do not leave the variable empty, because this can result in screen layout problems.

vb=

Character used in graphics mode to display the vertical bar. If it is not available, a viable alternative is | (pipeline). Do not leave the variable empty, because this can result in screen layout problems. The following dim code features are used in graphics mode if the normal code features are defective. (Poppy and Wyse terminals):

cblB=. See cbl, but bold. cbrB=. See cbr, but bold. ctlB=. See ctl, but bold. ctrB=. See ctr, but bold. dtB=. See dt, but bold. hbB=. See hb, but bold. krB=. See kr, but bold. ltB=. See lt, but bold. rtB=. See rt, but bold.

Technical Manual 6-8

Information files

utB=. See ut, but bold. vbB=. See vb, but bold.

Keys

This section describes how you can access keys on the keyboard. Use the string assigned to each entry to specify either the sequence that simulates the key or the sequence that is generated when the user presses the key. If you want to use a special key in the Bshell, you have to specify this key in the terminal information file. If the key is present on the keyboard, you must assign the corresponding sequence to it. If the key is not present, you can assign another sequence. For several key entries, a default value is given along with the ASCII code and decimal code. For example:

CTRL+J (LF, 10d)

The following keyboard entries are possible:

k1=, to k20=

Specifies the function keys F1 to F20.

k1c=, to k20c=

Specifies the function keys when the CTRL key is held down.

k1s=, to k20s=

Specifies the function keys when the SHIFT key is held down.

k1sc=, to k20sc=

Specifies the function keys when the SHIFT and CTRL keys are held down.

kbs=

Backspace; moves cursor one position back. Default: CTRL+H (BS, 8d).

kbtab=

Specifies the back tab key.

kcompose=

Key compose; used to define a code for NLS character composition.

kcs=

Key column switch. If it cannot display all 132 columns at once, switches function between the left and right half of the display (usually \eC or \ec).

kd=

Key down; moves cursor one position down. Default: CTRL+J (LF, 10d).

Technical Manual 6-9

Information files

kdc=

Key delete character; removes one character. Default: <Del> (127d).

kdo=

Key do.

kesc=

Key escape.

kf=

Key forward; moves cursor one position to the right. Default: CTRL+L (FF, 12d).

kfind=

Key find.

khlp=

Key help.

khome=

Key home; moves the cursor to the upper left corner of the screen. Default: CTRL+^ (RS, 31d).

kid=

Key interrupt debugging.

kinshere=

Key insert.

kkill=

Key kill.

kl=

Key left; moves the cursor one position to the left. Default: CTRL+H (BS, 8d)

knscreen=

Key page down.

kpr=

Key print.

kpscreen=

Key page up.

kre=

Key refresh; rewrites screen (usually \eR or \er).

kremove=

Key remove.

kselect=

Key select.

Technical Manual 6-10

Information files

ktab=

Key tab.

ku=

Key up; moves the cursor up one line. Default: CTRL+K (VT, 11d).

pf1=, to pf4=

DEC vt100 "gold" keys. NOTE (only for Baan-C programmers): Using event functions, your program can catch the keys defined in your terminal information file. When the program catches a key-press event, it returns a code for that key. The codes used for the keys are shown in the header file $BSE/include6.2/bic_key. For example, a line in the header file is:

#define KEY_F(1) 1024

This indicates that the F1 function key (k1 in a terminal information file) is identified by code 1024. You can use the macro KEY_F(1) in your program to check if the defined sequence for the F1 function key is given. See the section "Example of terminal information files" for an extensive example of terminal information files.

Color support

Colors can be sent to the screen separately or in combination with code features, depending on the capabilities of the terminal. This is set in the terminal information file with the Boolean values color_cf and color_sep.

color_cf

The code feature can be sent together with the color codes in one single escape sequence.

color_sep

The color codes cannot be combined with the code features.

Sending colors separately

You can use the following string entries in the terminal information files to set the foreground and background color:

bg_black= bg_red= bg_green=

Technical Manual 6-11

Information files

bg_yellow= bg_blue= bg_magenta= bg_cyan= bg_white=, fg_black= fg_red= fg_green= fg_yellow= fg_blue= fg_magenta= fg_cyan= fg_white=

You can also assign escape sequences to these entries. For example:

color_sep bg_black=\e[40m bg_red=\e[41m bg_green=\e[42m bg_yellow=\e[43m bg_blue=\e[44m bg_magenta=\e[45m bg_cyan=\e[46m bg_white=\e[47m, fg_black=\e[30m fg_red=\e[31m fg_green=\e[32m fg_yellow=\e[33m fg_blue=\e[34m fg_magenta=\e[35m fg_cyan=\e[36m

Technical Manual 6-12

Information files

fg_white=\e[37m,

Colors in combination with code features

The following numbers are used as %p1 and %p2 parameters in combined code feature and color strings (color_cf).

black=0 red=1 green=2 yellow=3 blue=4 magenta=5 cyan=6 white=7

The colors can be sent to the terminal along with code features with the following string entries. The foreground and background color must be specified as parameters.

cf_co_n=, # colors as specified and code feature normal cf_co_B=, # code feature bold cf_co_b=, # code feature blinking cf_co_Bb=, # code feature bold and blinking cf_co_r=, # code feature reverse cf_co_Br=, # code feature bold and reverse cf_co_br=, # code feature blinking and reverse cf_co_Bbr=, # code feature bold, blinking and reverse cf_co_u=, # code feature underlined cf_co_Bu=, # code feature bold underlined cf_co_bu=, # code feature blinking underlined cf_co_Bbu=, # code feature bold, blinking underlined cf_co_ru=, # code feature reverse underlined cf_co_Bru=, # code feature bold, reverse underlined cf_co_bru=, # code feature blinking, reverse underlined

Technical Manual 6-13

Information files

cf_co_Bbru=, # code feature bold, blinking, reverse underlined

For example:

cf_co_n=\e[0;22;%p1%{30}%+%d;%p2%{40}%+%dm cf_co_B=\e[0;1;%p1%{30}%+%d;%p2%{40}%+%dm cf_co_b=\e[0;5;22;%p1%{30}%+%d;%p2%{40}%+%dm cf_co_Bb=\e[0;1;5;%p1%{30}%+%d;%p2%{40}%+%dm cf_co_Br=\e[0;1;7;%p1%{30}%+%d;%p2%{40}%+%dm,

In the previous example, %p1 is foreground color; p1=0-7 and %p2 is background color; p2=0-7. See the section, "Colors in combination with code features." For use of parameters within a string entry, see the section "Parameterized strings."

Parameterized strings

Some of the string entries described in the section "Terminal information file" require a number of parameters. For example, to address the cursor, the cup entry requires two parameters: the row and column to address to. The use of parameters within a string entry is described in this section. The parameter mechanism uses a stack and special codes, starting with % to manipulate the stack.

Technical Manual 6-14

Information files

The codes have the following meanings:

Code %d %2d %3d %02d %03d %c %s %P[a-z] %p[1-9] %g[a-z] %{nn} %+ %%* %/ %m %& %| %\^ %= %> %< %! %\~ %I Meaning Take a number from the stack (pop()) Take a number with a minimum of two digits Take a number with a minimum of three digits Take a number with exactly two digits Take a number with exactly three digits Take a character from the stack Take a string from the stack Take a variable [a-z] from the stack Push a parameter [1-9] onto the stack Get a variable [a-z] and push it onto the stack Push a decimal constant nn onto the stack Take two numbers from the stack and push their sum Take two numbers from the stack and push their subtraction; push(pop() ­ pop()) Take two numbers from the stack and push their multiplication Take two numbers from the stack and push their division; push(pop() / pop()) Take two numbers from the stack and push the modulus of their division; push(pop() mod pop()) Take two numbers from the stack and push the result of their logical AND. Take two numbers from the stack and push the result of their logical OR. Take two numbers from the stack and push the result of their logical EXOR. Take two numbers from the stack and compare them. Dependent on the equality, TRUE or FALSE is pushed onto the stack. Take two numbers from the stack and compare them. If the first number is greater than the second, TRUE is pushed onto the stack, otherwise FALSE is pushed. Take two numbers from the stack and compare them. If the first number is less than the second, TRUE is pushed onto the stack, otherwise FALSE is pushed. Take a number from the stack and push its negative value onto the stack. Take a number from the stack and push the result of its logical NOT. Add 1 to the first two parameters (for ANSI terminals). Binary operations are in postfix form with the operands in the usual order. That is, to get x ­ 5, you must use %gx%{5}%%i\e[%p1%d;p2%dr

EXAMPLES

This example is used for changing the scrolling region on C.Itoh terminals. The first parameter +1 specifies the start row, the second parameter +1 specifies the end row of the region. Both are used as numerics in the escape sequence.

Technical Manual 6-15

Information files

\e[0;22;%p1%{30}%+%d;%p2%{40}%+%dm

The sequence in this example is used for setting a color and code feature. The code feature normal is set, the foreground color is set to the first parameter +30, and the background color is set to the second parameter +40.

Example of terminal information files

This section contains examples of terminal information files for some terminal types. Examples are given of include files, color usage, function keys, setting fonts, and so on. Comments and explanations are added where the number sign (#) precedes the text.

#******************************************************* # @(#) # @(#) File : vt100 # @(#) # @(#) Terminal : VTxxx terminals (CITOH / DEC) # @(#) Setup : VT100 ­ 7 bit; # @(#) Multinational Char. Set # @(#) Emulation Mode : ANSI 8-bit # @(#) Character Set : ISO Latin-1 # @(#) # @(#) Copyright : Baan Service b.v. (c) # @(#) Customer : Baan International b.v. # @(#) # @(#) Comment : If the terminal has a DEC Supplemental char.set # @(#) then vtansi_d must be included instead of vtansi # @(#) #******************************************************* # Include files #******************************************************* include=vtansi, #******************************************************* # @(#) # @(#) File : vtansi # @(#) # @(#) Comment : Generic terminf-file for VTxxx terminals # @(#) supporting ANSI mode and ISO character set # @(#) #******************************************************* #***************************** # Include files #***************************** include=vtansi.fkeys,

Technical Manual 6-16

Information files

#***************************** # Booleans #***************************** vt100 #nclrwc mcf mgr, #***************************** # Numbers #***************************** cols=132 lines=24 cf_pos=0 gr_pos=0 tmo=5 disp_vt100=0, #***************************** # Strings #***************************** # Setup # # init \e[?3l set 80 cols # \e[0;1m reset attributes and set bold # \e> set keypad mode to numeric # \e[1l set cursor key mode to normal # \e[?25l set cursor mode to visible # init2 \e(B ASCII ­> G0 # (fonts) \e-A Latin-1 ­> G1 # ^O (SI) invoke G0 into GL # gr_on \e(0 Spec.Graph ­> G0 # reset \e[0m reset attributes # \e[H cursor position 0,0 # \e[2J reset entire screen # init=\e[?3l\e[0;1m\e>\e[1l\e[?25l init2=\e(B^O\e-A reset=\e[0m\e[0;0H\e[2J\e(B^O\e-A, set80=\e[?3l set132=\e[?3h, bell=^G tmo=20, csr=%i\e[%p1%d;%p2%dr, # Line Draw Chars (Char.set: DEC Special Graphic) # gr_on=\e(0^O gr_ond=\e(0^O\e[0m

Technical Manual 6-17

Information files

gr_off=\e(B^O gr_offd=\e(B^O\e[0m, cbl=m cbld=m cbr=j cbrd=j ctl=l ctld=l ctr=k ctrd=k dt=v dtd=v ut=w utd=w lt=t ltd=t rt=u rtd=u kr=n krd=n hb=q hbd=q vb=x vbd=x, # Code Features # cf_n=\e[0m cf_d=\e[0;1m cf_b=\e[0;5m cf_db=\e[0;1;5m cf_r=\e[0;7m cf_dr=\e[0;1;7m cf_br=\e[0;5;7m cf_dbr=\e[0;1;5;7m cf_u=\e[0;4m cf_du=\e[0;1;4m cf_bu=\e[0;4;5m cf_dbu=\e[0;1;4;5m cf_ru=\e[0;4;7m cf_dru=\e[0;1;4;7m cf_bru=\e[0;4;5;7m cf_dbru=\e[0;1;4;5;7m, # Cursor Control & Positioning # cu_on=\e[?25h cu_off=\e[?25l

Technical Manual 6-18

Information files

cup=%i\e[%p1%d;%p2%dH, cuu=\e[%p1%dA cuu1=\e[1A cud=\e[%p1%dB cud1=\e[1B cuf=\e[%p1%dC cuf1=\e[1C cub=\e[%p1%dD cub1=\e[1D, home=\e[0;0H clear=\e[0;0H\e[2J\e[?25l, # Editing # inch=\e[@ delch=\e[P inli=\e[L delli=\e[M el=\e[0K es=\e[0J #ewin=, # Printer Control # aux_on=\e[5i aux_off=\e[4i, # Nls # nls_in=generic.in, #******************************************************** # @(#) # @(#) File : vtansi.fkeys # @(#) # @(#) Comment : Include-file for VTxxx terminals function-keys # @(#) (ANSI-compatible) # @(#) #******************************************************** # Available Keys #***************************** # Function Keys # #k6=\e[17~ #k7=\e[18~ #k8=\e[19~ #k9=\e[20~ #k10=\e[21~ k11=\e[23~

Technical Manual 6-19

Information files

k12=\e[24~ k13=\e[25~ k14=\e[26~ #k15=\e[28~ #k16=\e[29~ #k17=\e[31~ #k18=\e[32~ #k19=\e[33~ #k20=\e[34~, # VT "Gold Keys" # pf1=\eOP pf2=\eOQ pf3=\eOR pf4=\eOS, # VT Cursor Pad # khlp=\e[28~ kdo=\e[29~ kfind=\e[1~ kinshere=\e[2~ kremove=\e[3~ kselect=\e[4~ kpscreen=\e[5~ knscreen=\e[6~ ku=\e[A kd=\e[B kf=\e[C kl=\e[D, #***************************** #BA6.2 Special Keys #***************************** #Misc. Keys # # F6 = kmenu F17 = kprocess # F7 = kcompose F18 = kkill # F8 = kre F19 = knextdisp # F9 = kcs F20 = kprevdisp # F10 = kswitch # kmenu=\e[17~, kcompose=\e[18~, kre=\e[19~, kcs=\e[20~, kswitch=\e[21~, kprocess=\e[31~,

Technical Manual 6-20

Information files

kkill=\e[32~, knextdisp=\e[33~, kprevdisp=\e[34~, #*****************************

Printer information files

The directory where printer information files are stored is $BSE/lib/printinf. Create a subdirectory in the directory printinf. Its name must be the first letter of the future printer information file. The printer information file is stored in this subdirectory. For example, the printer information file for a Mannesmann mt910 is stored in the directory $BSE/lib/printinf/m/ The name of the file itself is an abbreviation of the printer name, for example, mt910. You can include another printer information file at any position in the current file with the include command. For example, include=mt910 The variables are filled in accordance with the specifications (escape sequences) of the printer as listed in the printer manual. Some of them can be omitted, because they are not required for the majority of the applications. These variables are marked with *. A variable definition consists of a name, a =, an escape sequence (containing special characters), and a comma. Lines are closed by a new line character. If a printer does not offer an escape sequence for boldface and underlined text, and the specific variables are left empty, the filter program simulates these functions by backspace and carriage return. The positions are then covered twice. You switch this simulation off by entering the value \000 for the definition of bold on/off or underline on/off, or by entering no value (for example pbold=,).

Technical Manual 6-21

Information files

The escape sequences can contain special characters. They can be divided into escape codes and control codes.

Escape codes \b backspace \E or \e escape \f form feed \n newline \r carriage return \t tab \s space \xx decimal value \0xx octal value \xxx hexadecimal value xx=1-255 xx=1-377 xx=1-FF (for example \x1F) Control codes ^A to ^Z ^[ ^\ ^] ^^ ^_

You can use an octal value instead of an alphabetical representation. For example, "escape" then becomes \033. The control codes are converted to the ASCII codes 1 to 31. For example, ^B equals the ASCII character with decimal value 2 (STX). A printer information file can have the following Boolean entries:

n n n n n n

rsf_pbold, reset font after pbold rsf_prev, reset font after prev rsf_punder, reset font after punder rsf_pobold, reset font after pobold rsf_porev, reset font after porev rsf_pounder, reset font after pounder

A printer information file can have the following variables:

barcode_dir=

Bar-code directory (relative to $BSE/lib/barcode)

bin1=

Select first paper bin.

bin2=

Select second paper bin.

bin3=

Select third paper bin.

Technical Manual 6-22

Information files

bin4=

Select fourth paper bin.

hpos=

Set horizontal cursor position of the printer.

initpage=

String sent before each page.

initpr=

Initialization string preceding the output to the printer. This variable must be filled with the codes for large typeface.

initprog=X

The output of program X (full path name) is sent to the printer.

initpr2=

The second initialization string sent after initprog.

landscape=

Select landscape printing.

large=

Large typeface (10 cpi) control. Some printers require a code to changethe typeface size.

nls_out=

NLS output table name.

middle=

Medium typeface (12cpi) control. Some printers require a code to change the typeface size. You can use the following codes to set the print color:

p_black= p_red= p_green= p_yellow= p_blue= p_magenta= p_cyan= p_white=, pbold=

Print boldface characters. A boldface character can print wider than its original. This does not imply any proportional spacing. Printing graphic characters (with ASCII code over 127 decimal) yields additional line feeds on most Mannesmann printers. If this variable is not used, the Bshell simulates boldface printing by reprinting each line, making use of the carriage return character.

Technical Manual 6-23

Information files

pcbl=

Print +. If this variable cannot be filled because the printer cannot print it, for example, a + is used.

pcbr=

Print +. If this variable cannot be filled because the printer cannot print it, for example, a + is used.

pctl=

Print +. If this variable cannot be filled because the printer cannot print it, for example, a + is used.

pctr=

Print +. If this variable cannot be filled because the printer cannot print it, for example, a + is used.

pdbl_wide=

Double wide mode on.

pdt=

Print ­. If this variable cannot be filled because the printer cannot print it, for example, a + is used.

pfont1=, to pfont16=

Select font 1 to font 16. These fonts are user definable.

phb=

Print ­. If this variable cannot be filled because the printer cannot print it, for example, a ­ is used.

pitalic=

Italic mode on.

pkr=

Print +. If this variable cannot be filled because the printer cannot print it, for example, a + is used.

plt=

Print |. If this variable cannot be filled because the printer cannot print it, for example, a + is used.

pnlq=

NLQ mode on.

pobold=

Switch off boldface printing without affecting character size.

podbl_wide=

Double wide mode off.

Technical Manual 6-24

Information files

pofont1=, to pofont16=

Deselect font 1 to font 16. These fonts are user definable.

poitalic=

Italic mode off.

ponlq=

NLQ mode off.

porev=

Reverse mode off.

portrait=

Select portrait printing.

posubscript=

Subscript mode off.

posuperscript=

Superscript mode off.

pounder=

Underlined printing off.

prev=

Reverse mode (white on black).

prt=

Print |. If this variable cannot be filled, for example, because the printer cannot print it, a + is used.

psubscript=

Subscript mode on.

psuperscript=

Superscript mode on.

punder=

Print underlined characters. If this variable cannot be filled, the Bshell simulates underlining by printing underscore characters on the next line.

put=

Print ­. If this variable cannot be filled because the printer cannot print it, for example, a + is used.

pvb=

Print vertical bar. If this variable cannot be filled because the printer cannot print it, for example, a | (pipeline) is used.

Technical Manual 6-25

Information files

q1=, to q13=

These 13 variables can be filled with strings that specify whether a character must be printed in double width, italicized, and so on The variables are userdefinable. These codes have been replaced and they will be removed in a future release.

resetpr=

Resets the printer. The string is sent to the printer after all output. Fill this variable with a form feed (\014) followed by the Large typeface codes.

resetprog=X

The output of program X (full path name) is sent after the reset string.

resetpr2=

The second reset string, sent after resetprog.

set0=, to set9=

Set a character set of the printer. The default set is set0.

small=

Small typeface (16.66-17 cpi) control. Some printers require a code to change typeface size.

usr1=, to usr16=

Define user entry1 to user entry16.

Bar codes

The report writer interfaces with the printer driver using bar-code scripts. A barcode script saves the cursor position, prints a bar code with given height and returns to the saved cursor position. These scripts must be available in the directory barcode_dir. This directory is relative to $BSE/lib/barcode, so if barcode_dir = hp_barcode, the bar-code directory is $BSE/lib/barcode/hp_barcode. Bar-code scripts are prefixed by the word "type" and post fixed by a two-digit number. For example:

type01.

Technical Manual 6-26

Information files

Following is an example of such a bar-code script. It saves the cursor position and restores it after the bar code has been printed. Bar codes can only be implemented when such a scheme is possible.

#!/bin/sh # # Sample driver for HP Laserjet 4 # with "Bar Codes & More Font Cartridge" # # Prints EAN/UPC with the code under it. # $1 means the bar code # $2 means the height of the bar code (number of lines) # code=$1 height=$2 Push() { # push cursor position (max 20x) echo "\033&f0S\c" } Pop() { # pop cursor position echo "\033&f1S\c" } NextRow() { # move to next row, relative echo "\033&a+1R\c" } # ­ save cursor position ­ filter assumes same pos. after bar code print Push str1=`echo $code | awk '{ print substr($1, 1, 5) }'` str2=`echo $code | awk '{ print substr($1, 6, 5) }'` # ­ select EAN/UPC 13 mil font echo "\033(8Y\033(s1p12v0s3b0T\c" while [ $height ­gt 1 ] do Push echo "($str1-$str2(\c" Pop NextRow

Technical Manual 6-27

Information files

height=`expr $height ­ 1` done # ­ last (empty) line of bar code Push echo "(- (\c" Pop # ­ select Courier 12cpi. echo "\033(10U\033(s0p12.00h10.0v0s0b3T\c" # ­ move x+25 dots echo "\033*p+25X\c" # ­ print code (text) echo "$str1 $str2\c" # ­ restore cursor position for filter Pop exit 0

Technical Manual 6-28

Information files

Example of printer information file for mt910 printer

This shows what a printer information file can consist of. You can add comments in the same manner as in a terminal information file.

#mt910 small=\E{s16.66H\EL08 large=\E{s10H middle=\E{s12H initpr=\E{s12H\EF66 resetpr=\E{s12H\EF66\014 pctl=+ pctr=+ pcbl=+ pcbr=+ put=+ prt=+ plt=+ pdt=+ phb=pvb=| pkr=+ pbold=\E"g1B pobold=\E"g0B prev=\E"g1K porev=\E"g0K punder=\EI pounder=\EJ pitalic=\E{s1S poitalic=\E{s0S landscape=\E"g1R portrait=\E"g0R nls_out=mt910.out,

Technical Manual 6-29

Information files

Technical Manual 6-30

7

User Interface (UI) Page mode

This chapter describes the User Interface (UI) Page mode in BaanERP. The UI Page mode improves the response times on networks where information processing can be delayed, for example, a wide area network (WAN). In normal mode, the 4GL Engine validates the entered data per field. In the UI Page mode, the 4GL Engine validates data per page, and not per field. The synchronous interaction between the UI driver and the Bshell is therefore significantly reduced. The UI Page mode is designed for experienced BaanERP users, because the interaction between BaanERP and the user is not as extensive as in the normal mode. In the normal mode, an error message is displayed immediately when data entered in the active field is not correct. In the UI Page mode, an error-logging window appears, which shows all errors that occurred during the validation of all the data entered on the page. In the UI Page mode, the UI driver groups together a number of UI objects that form a logical unit. A UI object is for example, a field, a button, or a check box. The logical unit is known as a page. A page can be an overview window or a tab in a details session with more than one tab. If the UI Page mode is selected, each UI object automatically belongs to a page. If the UI object is positioned on a tab, the object is considered part of the page associated with the related tab. In any other case, the UI object is part of the page associated with the overview window. The following functions are implemented in the UI Page mode to improve network performance:

n

The UI handles the movement from an active element to another element without any communication with the Bshell. An active element is a portion of the screen that is currently operational or subject to command operations. Usually the cursor or a highlighted section shows the active element on the display screen. Active elements are, for example, fields, command buttons, check boxes, or list boxes. The UI client handles the behavior of the default button for the command buttons on a page.

n

Technical Manual 7-1

User Interface (UI) Page mode

n

Events that result from status changes of UI objects are delayed until a complete page is filled, or another synchronization event occurs. The delayed events are sent into a minimum number of network frames.

Tab processing

When the UI page mode is selected, the UI driver processes Tab key movements in the details window. The Tab key sequence is identical to the creation order of the UI objects on a page. Other navigation keys, such as Page Up, Page Down, Home and End are reported to the Bshell with the appropriate keystroke.

Default Button handling

When the UI Page mode is selected, the UI driver handles the default command button. This is the command button that is highlighted when the dialog box is initially displayed. It can also be the command button with the bold border, indicating that it is automatically selected if you press Enter.

Event processing

If the UI Page mode is selected, events are treated differently by the UI driver than when normal mode is selected. There are four different event categories:

n n n n

Suppressed events Delayed events Synchronization events Bypass events

Suppressed events If the UI Page mode is selected, a UI object does not send suppressed events to the Bshell . Instead, suppressed events are handled locally by the UI driver on the client. An example of a suppressed event is moving from an active element to another active element. Delayed events Status changes of UI objects can be delayed. As soon as a synchronization event occurs, for example, by using the Validate button, the changed UI objects are requested to synchronize their status with the 4GL engine. The delayed events are sent in the same order as the Tab key sequence of the UI objects on the page. This is not necessarily the order in which the user enters data. If possible, the delayed events are sent into one network frame, to reduce response times.

Technical Manual 7-2

User Interface (UI) Page mode

Synchronization events The synchronization events make sure that the statuses of the changed UI objects are sent to the Bshell for validation. Synchronization events are:

n n n n n n n n

Selecting a menu item Clicking a button on a toolbar, or a pushbutton Moving to another tab Moving from a synchronizing field to another field Starting a browse session Pressing a key that is not handled by the UI client Resizing a window Using the scroll bar

Bypass events The following bypass events are sent immediately to the Bshell without first being synchronized with the delayed events:

n n n

Using the online Help Closing a Windows application that was started through the application Start feature of the UI client Using OLE objects

How to select the UI Page mode

The UI Page mode is selected per user to make sure that inexperienced BaanERP users cannot use it. You must define the UI Page mode in the user profile of the user. The user profile is defined in the User Management module in BaanERP Tools. Follow these steps to select the UI Page mode for a user: 1 To select a user data template, or to create a new user data template, start the User Data Template (ttams1110m000) session in the Authorization Management System (AMS) module. Be sure to select the Use Page mode check box under Options on the System Data tab. 2 Start the User Data (ttaad2500m000) session in the User Management module. Double-click the user for which you want to select the UI Page mode to start the details session. 3 Under Templates, enter the new User Data template, which is page-mode enabled. Click Save to return to the overview session. 4 Click on the Specific menu Convert Changes to Runtime DD to rebuild the user profile in the runtime database.

Technical Manual 7-3

User Interface (UI) Page mode

5 Restart BaanERP to activate the changed user profile. Check that the following are true to verify that the UI Page mode has been successfully selected:

n n n n

All the fields and options in the overview windows and detail windows are available All commands on the menus of the menu bar in an overview window are available On the Window menu the Validate command is available in an overview window The Validate button shows on a details window

How to mark UI objects as synchronizing fields

You can mark UI objects on an overview window or details window as synchronizing fields. This means that when you move from one active field or button to another field or button, all delayed events are sent to the Bshell for validation. You can mark the following fields and buttons as synchronizing fields:

n n n n n

Edit fields Check boxes Option buttons List boxes Combo boxes

You must use the Form Editor in BaanERP Tools to mark a form field as a synchronizing field. Complete the following steps to start the Form Editor: 1 On the BAANERP Tools menu, click Application Development, and then click Forms to start the Forms (ttadv3500m000) session. 2 Select a form. On the Specific menu click Check Out to release the form for modification. 3 On the Specific menu, click Edit/View Form... to start the Form Editor. Depending on the form type, the appropriate Form Editor starts. The following form editors are available in BaanERP:

n n

The Static Form Editor, which shows the form in an ASCII format The Dynamic Form Editor, which is a graphical editor in a Windows format

Technical Manual 7-4

User Interface (UI) Page mode

You can carry out one of the following procedures to mark a field as a synchronizing field: Static Forms 1 In the ASCII editor, click the field to start the Form Fields (ttadv3501s000) session. 2 On the General tab, select the Synchronized check box. 3 Click Close to return to the Form Editor. 4 On the Specific menu, click Check In to finish the procedure. Dynamic Forms 1 In the graphical Dynamic Form Editor, click the field to start the Field Properties session. 2 On the Miscellaneous tab, select the Synchronized check box. 3 Click OK to return to the graphical Dynamic Form Editor. 4 On the Specific menu, click Check In to finish the procedure.

Technical Manual 7-5

User Interface (UI) Page mode

Technical Manual 7-6

8

Customer support tools

General

This chapter describes two aspects essential to solving errors in a Bshell environment: error logging and the bserel6.2 program. Error logging is keeping a record of error messages in a log file. The log file contains information about when the error occurred and which processes were then active. See the section "Error logging." The program bserel6.2 provides information on the BSE environment as installed on your system. Among other things, bserel6.2 checks permissions, the availability of programs, and the correctness of program objects. This data can be collected in a report and viewed on screen, printed, or sent to a file. If you want to submit an error to the Customer Support Center of Baan Info Systems, add both the error logging report and the bselrel6.2 report to your error report.

Error logging

Certain actions in a Bshell program can result in an error. Usually an error is displayed and from it you can see what went wrong. To localize Bshell errors, a status report of the program is written to a log file. Use this file to find out where and when the error occurred.

Log file

The log files the errors are written to are stored in directory $BSE/log. Its name format is:

log.<program name>

This means that when an error occurs in Bshell6.2, it is logged in the file log.Bshell6.2. If it occurs in bx6.2, it is logged in log.bx6.2, and so on.

Technical Manual 8-1

Customer support tools

Log file layout

The header of the log file is: "START of log message", followed by:

n n n n n n n

Date, time, logon name, and TTY number Source program name with line number Keyword UNIX process, user, and group identifiers for program User type, language code, logon code and TTY number of the user error number and bdb error number error message as displayed on screen

If, for instance, you end a Bshell program with an Interrupt (CTRL+\), this action is written as an error in the log file. The message keyword is "core dump." The log file also contains the following blocks:

n n n

Process List Screen Dump Process Information

The Process List block is a list of the active Bshell processes at the moment the error occurred. This list contains the following information for each Bshell process:

n n n n n n

Process identifier Parent Status cpu.flags Process name Line number (debug mode only)

Technical Manual 8-2

Customer support tools

The Screen dump block contains the screen active at the moment the error occurred. The last block, Process Information, contains the individual process information about each process from the list. It can consist of:

n n n n n n n n n n n

The line from the process list for the process involved Session code, process ID, and parent number Object Main table Zoom field Return zoom field Default printer Forms Reports Tables Variables, including values in force when the error occurred (empty strings, strings with value 0, and strings consisting of tabs are not logged). The section "Example error logging" contains an example of error logging

Log file maintenance

If the log file is not regularly purged it grows enormously, which affects your storage capacity. Also, a large log file is difficult to read. You are therefore advised to rename the log file to log.save on a weekly basis, using the UNIX mv command. After a backup has been made of the system including log.save, you can remove it from the system. The backup tape should be kept for two weeks.

Submitting errors to customer support

If you are confronted with a Bshell error message for which you have no solution, you can contact the Customer Support Center (formerly known as Response Center). To your report you add the part of the log file relating to it. You can print this part using the UNIX grep command (for example by date, time, logon code, or TTY number). The following section contains an example of error logging. The log file contains two error reports. Suppose you want to print the first one. You can do this using grep in four ways: by date, time, user name, or TTY number. The following example shows the command lines for each of these:

cat log.bshell6.2 | grep 91-07-29 |pr |lp ­d{printer name} date cat log.bshell6.2 | grep 16:53:14 | pr |lp ­d{printer name} time cat log.bshell6.2 | grep bsp | pr |lp ­d{printer name} name cat log.bshell6.2 |grep 22 | pr | lp ­d{printer name} TTY

Technical Manual 8-3

Customer support tools

Example error logging

NOTE

Each line of the following output starts with date, time, logon name, and TTY number, such as the following:

98-03-04[15:06:54]etimban: 98-03-04[15:06:54]etimban: ******* S T A R T of Log message ******* 98-03-04[15:06:55]etimban: Log message called from /vobs/tt/lib/al_1/al_fpath.c: #241 keyword: sopen 98-03-04[15:06:55]etimban: Pid 19313 Uid 10575 Euid 10575 Gid 1700 Egid 1700 98-03-04[15:06:55]etimban: user_type S language 2 user_name etimban TTY ote locale ISO88591/NULL 98-03-04[15:06:55]etimban: Errno 2 (No such file or directory) bdb_errno 0 98-03-04[15:06:55]etimban: Log_mesg: 98-03-04[15:06:55]etimban: No definition in definition file for sopen(F_BRDD:dtffas402, dtffas402) 98-03-04[15:06:55]etimban: ********** E N D of Log message **********

Technical Manual 8-4

9

Executable programs

Database management

This chapter describes the executable programs used for database management, which are located in the directory $BSE/bin. Whether you have all the executable programs described in this chapter depends on your particular installation set. The programs are sorted by type of database server. References are included for programs described in other documents.

General

audit_srv6.2

This is the name of the server that handles logging of actions on the database. See the chapter "Audit management."

bdbpre6.2

Program to convert database tables to a sequential dump. See the chapter "Database tools."

bdbpost6.2

Program to create database tables from a sequential dump. See the chapter "Database tools."

bdbreconfig6.2

Program to reconfigure database tables. See the chapter "Database tools."

dpt6.2

Test program of database actions. Program for internal use, not for the end user.

refint6.2

Function to check the referential integrity of database tables. See the chapter "Database tools."

gcommand6.2

Database test program used internally to solve problems. Not intended for the end user.

qptool6.2

Database test program used internally to solve problems. Not intended for the end user.

Technical Manual 9-1

Executable programs

Oracle

ora7_inst6.2

The program used to install the Oracle driver.

ora7_deinst6.2

The program used to deinstall the Oracle driver.

ora7_srv6.2

This is the driver for Oracle Version 7.

ora7_maint6.2

The Oracle version of the program used to maintain the database.

ora8_srv6.2

This is the driver for Oracle Version 8.

ora8_maint6.2

The program used to maintain Oracle version 8.

Sybase

syb_install6.2

The program used to install the Sybase driver.

syb_srv6.2

This is the Sybase driver itself.

syb_admin6.2

The shell script for doing administration.

syb_maint6.2

The Sybase version of the program used to maintain the database.

Informix

inf_install6.2

The program used to install the Informix driver.

inf_srv6.2

This is the Informix driver itself.

inf_admin6.2

The shell script for doing administration.

inf_maint6.2

The Informix version of the program used to maintain the database.

Technical Manual 9-2

Executable programs

DB2

db2_install6.2

The program used to install the DB2 driver.

db2v5_srv6.2

This is the driver executable program that functions with DB2 V5.

db2_admin6.2

The shell script for doing administration with DB2.

db2v5_maint6.2

This is the maintenance executable program, to be used with the DBA module, which works with DB2 V5.

Logic server (Bshell)

Bshell6.2

This is a virtual processor between the user interface, database drivers, applications, and operating system. This program makes applications, including BaanERP Tools, independent of the operating system. The Bshell functions as a shell between the application and the operating system. When you start the user interface, it connects with the Bshell on a machine on the network. This is the usual way to start the Bshell. Note that you can run Bshell and user interface on different machines. The following settings are required:

n

Add a line to your local or remote $BSE/lib/ipc_info file similar to:

bshell s 0 0 s ${BSE}/bin/bshell6.2

n

When running on a remote host fill the r user> file as described in the chapter "Remote databases". You can specify where the application logic server is located in the User Data Template (ttams1110m000) session on the Authorization Management SystemÈ Definition of TemplatesÈ Miscellaneous menu. You must then connect the template to the user using the User Data (ttaad2500m000) session on the BaanERP ToolsÈ Database Management menu.

n

The environment variable DS_AS overrules these settings of the user file (example: DS_AS=host!bshell).

Technical Manual 9-3

Executable programs

SYNOPSIS Bshell6.2 [options] [program [program arguments]] Options for Bshell6.2 are described in the following sections:

n

n n

Debugging the Bshell during run time - Baan CPU - Scheduler - File I/O - Miscellaneous - Message and log extract Memory usage Miscellaneous

The al_1 function parse_arguments recognizes the following options by default:

-- : end of parameter list -set var=val : set environment variable var to val

To pass options to the Bshell, enter them in the command line of the BW Configurator, for example:

-- ­set CORE=1 ­dbgcpu ­dbgfun ttaad2100m000 - pass "-set CORE=1 ­dbgcpu ­dbgfun" options to Bshell - and run Appication Configuration (ttaad2100m000) session

Bshell logs all its output to $BSE_TMP/bshell.PID. This log file is removed when the Bshell exits normally. You can instruct the Bshell to keep the logfile with the ­keeplog option.

Debugging the Bshell during run time

To debug the Bshell while the BaanERP application is running, display the Option Dialog dialog box, which appears as an icon while you running BaanERP, and click Debug Bshell. The Runtime debugging of Bshell dialog box displays. You can also choose these options from the command line. Baan CPU Debug functions In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Debug Functions. Or, from the command line, run ­dbgfun. Use debug version of the CPU In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Debug CPU. Or, from the command line, run ­dbgcpu.

Technical Manual 9-4

Executable programs

Show Bshell CPU instructions In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Debug Instructions. Or, from the command line, run ­ dbginstr. Dump 3GL stack traces on function entry In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Dump Stack Traces. Or, from the command line, run ­ dbgstack. Debug get.var and put.var functions In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Getvat/Putvar debug. Or, from the command line, run ­ dbggpvar. Show program flow In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Program Flow. Or, from the command line, run ­dbgflow. Scheduler Debug scheduler In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Debug Scheduler. Or, from the command line, run ­ dbgsched. Show process actions (for example, activate, sleep, kill) In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Show process actions. Or, from the command line, run ­ dbgmulact. File I/O Show all files that are currently opened by the Bshell In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Show opened files. Or, from the command line, run ­dbgfile. Debug file access In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Debug file access. Or, from the command line, run ­dbgfdev.

Technical Manual 9-5

Executable programs

Miscellaneous Show object information In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Show object information. Or, from the command line, run ­ dbgobj. Show whether domains, data definitions and objects are loaded from disk or shared memory In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Show SRDD use. Or, from the command line, run ­ dbgsrdduse. Show various TSS debugging information In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Debug TSS. Or, from the command line, run ­dbgtss. Show data input options (not for fields) In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Debug data.input(). Or, from the command line, run ­ dbgdata. Stop debugger, if possible, when a message is sent to the message window In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Debug Messages. Or, from the command line, run ­dbgmesg. Show loaded resources In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Debug Resources. Or, from the command line, run ­dbgres. Do not remove the logfile after ending the Bshell In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Keep Log File. Or, from the command line, run ­keeplog. Add time stamps to Bshell log output In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Add Time Stamps. Or, from the command line, run ­logtime. Database related Show the Baan database activities initiated from the Bshell In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Show BDB Actions. Or, from the command line, run ­ dbgbdbact. Show actions related to enums In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Print Enums. Or, from the command line, run ­dbgenums.

Technical Manual 9-6

Executable programs

Show locking errors In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Show locking errors. Or, from the command line, run ­ dbglck. Show database server type In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Show BDB server type. Or, from the command line, run ­ dbgsrv. BDB/SQL Tracing To trace BaanERP database and SQL actions, display the Option Dialog box and click Debug Bshell. The Runtime debugging of Bshell dialog box appears. You can also choose these options from the command line. BDB Debug Flags Shows the drivers and parameters currently in use In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL Tracing tab, select Driver Type. Or, from the command line, run BDB_DEBUG=01. Show database actions such as Insert, Update, Delete, Commit, and Abort In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL Tracing tab, select Database Actions. Or, from the command line, run BDB_DEBUG=02. Show information on currently set locks In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL Tracing tab, select Delayed Locks. Or, from the command line, run BDB_DEBUG=04. Show references between tables In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL Tracing tab, select References. Or, from the command line, run BDB_DEBUG=010. Show all tables using native storage format In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL Tracing tab, select Multibyte Storage. Or, from the command line, run BDB_DEBUG=040. Show the permissions and roles allowed for each user In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL Tracing tab, select Permissions/Roles. Or, from the command line, run BDB_DEBUG=0100.

Technical Manual 9-7

Executable programs

BDB_DEBUG Value Shows the current setting that can be used in a ­set BDB_DEBUG=<value> from the command line. TT SQL TRACE Flags Show the full text of a query with an ID number In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL Tracing tab, select Show query with ID. Or, from the command line, run TT_SQL_TRACE=040. Show how long a query has been running In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL Tracing tab, select Query execution times. Or, from the command line, run TT_SQL_TRACE=0200. Show main SQL functions such as SQLExec, SQLParse, SQLFetch, and SQLBind In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL Tracing tab, select Internal SQL functions. Or, from the command line, run TT_SQL_TRACE=02000. Show the best possible design for indexing, joins, and so on In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL Tracing tab, select Query evaluation plan. Or, from the command line, run TT_SQL_TRACE=04000. Show all full table scans In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL Tracing tab, select Show full table scans. Or, from the command line, run TT_SQL_TRACE=020000. Show low-level communication between client and driver In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL Tracing tab, select Show BDB communication. Or, from the command line, run TT_SQL_TRACE=040000. Show current time to level of milliseconds: YYYYMMDDhhmmss.mmm In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL Tracing tab, select Add time stamps (SQL). Or, from the command line, run TT_SQL_TRACE=0400000. TT_SQL_TRACE value Shows the current setting that can be used in a ­set TT_SQL_TRACE=<value> from the command line.

Technical Manual 9-8

Executable programs

Memory usage

Show currently running processes in Bshell In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Dump Process List. This option is not available from the command line. Show total memory usage In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Total Memory. Or, from the command line, run -dbgmemtot. Show free memory list In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Free Memory. Or, from the command line, run ­ dbgmemfree. Show used memory list In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Memory Used. Or, from the command line, run ­ dbgmemused. Show memory usage per block In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Memory Block List. Or, from the command line, run ­ dbgmemblk. Show all memory statistics In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select All Memory Info. Or, from the command line, run ­dbgmem. Add remark to log file (enter the remark in the field, then click the button) In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Write Remark to Log. This option is not available from the command line. Display shared-memory information In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug Levels tab, select Display Shared Mem. This option is not available from the command line.

Technical Manual 9-9

Executable programs

Miscellaneous

­vV : version information. ­r : show resources ­deftext : show Bshell tex.ts. ­mdebug : display Bshell messages sent to display server. ­dbgref : show reference paths. ­dbgrefer : show references. ­dbgbdbact : show database actions. ­dbgenums : show loading of enums. ­dbgpty : debug pseudo terminals (pty). ­dbgorb : debug ORB integration (where available) . ­set var=val : set environment variable var to val. ­logfile <file> : log stdout/stderr output in file. ­appendlog : append to logfile (only useful with ­logfile option). ­nolog : stdout and stderr go to the controlling terminal. ­delay sec : delay for sec seconds before continuing.

bshcmd6.2

This command can be used to change the log facilities of the Logic Server (Bshell) or kill one or more Bshell processes. The actions done with this command are performed while the Bshell is runing. SYNOPSIS bshcmd6.2 [options] <bshell_pid> Possible options:

­v : print version information.

­p : show process list. ­m : show memory usage. ­d <dbglvl> : set DEBUG_LEVEL to (octal) <dbglvl>.

Technical Manual 9-10

Executable programs

The following <dbglvl> values are available:

0000000001 : show data input actions. 0000000002 : show object information. 0000000004 : show reference paths. 0000000020 : debug functions. 0000000040 : database server information. 0000000100 : show delayed locks. 0000000200 : show process actions (sleep, kill, and so on). 0000000400 : database reference information. 0000001000 : show database actions. 0000002000 : debug file access. 0000004000 : show loaded resources. 0000010000 : show loading of enums. 0000020000 : show Bshell CPU instructions. 0000040000 : use debug version of the CPU. 0000100000 : show whether domains, data definitions and objects are loaded from disk or shared memory. 0000200000 : debug get.var & put.var functions. 0000400000 : debug scheduler. 0001000000 : debug pseudo terminals. 0002000000 : show opened sequential files. 0004000000 : debug TSS functions. 00020000000: debut ORB integration. 00040000000: show stack traces. 00100000000: debug messages. 00200000000: show program flow.

­k pid : Kill Bshell process ID pid. ­e : kill all Bshell processes. ­M "message" : Send message to Bshell.

Technical Manual 9-11

Executable programs

­W sec : Wait until the previously issued command is executed. After this the previous command is overwritten. ­w sec : Wait sec seconds for Bshell to execute command. ­u sec : Send SIGUSR1 to Bshell (wakeup). Only to be used in combination with ­w option. Waits sec seconds to see if the command is executed. ­s : Show entire contents of log file (if accessible). Only to be used in combination with ­p and ­w option. -l : Print log file name of Bshell. Only to be used in combination with ­p and ­w option. -T cmdstr : Modify BDB_DEBUG or TT_SQL_TRACE (Bshell) and DBSLOG, TT_SGL_TRACE, {DBMS}STAT (drivers) tracing variables. cmdstr can contain multiple commands of the form: trace variable=value: set variable to value trace variable+value: add bits to variable trace variable-value: remove bits from variable

REMARKS

All output is stored in the Bshell's log file (default: $BSE_TMP/bshell.pid). Only one command can be active at a time. New commands overwrite previous ones. Check the return value to see if a command has been processed. The bshell_pid process number is a member of the output of the UNIX ps command.

EXAMPLES

bshcmd6.2 ­s ­p ­w 10 <bshell_pid>

Show the process list, and wait 10 seconds for response. When no actions are done within 10 seconds, no output is given.

bshcmd6.2 ­d 02000 <bshell_pid>

Set DEBUG_LEVEL to 02000.

bshcmd6.2 ­M "Hello" ­u 10 ­w 10 <bshell_pid>

Send a message to a specific Bshell.

bshcmd6.2 ­k <pid> <bshell_pid>

Kill the Bshell process <pid>. The <pid> process number can be accessed from the shell program (ttstpshell) with the ps command.

bshcmd6.2 ­T "TT_SQL_TRACE+02000" <bshell_pid>

Set TT_SQL_TRACE to log interface calls.

Technical Manual 9-12

Executable programs

badmin6.2

Used to perform administration of the Bshell. The usage is as follows: badmin6.2 [-UuVv] [-qo outfile] [-qe errfile] ­chkuser <user> | ­chkgroup ­ostype Available options are: ­U or ­u : print usage. ­V or ­v : print release number. ­qo outfile : redirect standard output to file outfile. ­qe errfile : redirect error output to file errfile. ­chkuser user : returns a 0 if user exists, otherwise returns a 1. ­chkgroup group : returns a 0 if group exists, otherwise returns a 1. ­ostype ostype : returns 0 if operating system is ostype, otherwise returns a 1. ostype can be either NT or UNIX.

Installation

cmt6.2 Script for component merge tool. Used to migrate the sources from usercustomized applications to new BaanERP versions. install6.2 Script for installing the BaanERP software. install.help ASCII file containing Help for the installation procedure. sh_server6.2 Shell server used to execute system-dependent commands. bsp.setperm6.2 Script used to assign the correct permissions to all the BaanERP software. binperm6.2. Script used to assign the correct permissions to binaries in the $BSE/bin directory after a new porting system is set up.

Technical Manual 9-13

Executable programs

Development

bic6.2 Program compiler for Baan C compiler. repgen6.2 Report generator. std_gen6.2 4GL-program preprocessor. bic_cstub6.2 Converts a BaanERP library to a C library. bic_info6.2 Shows information for specified object. bic_jstub6.2 Generates a Java class from a BaanERP DLL object.

License management

brand6.2 Program to authorize an environment. You must be logged in as the root user to run this program. hostid6.2 Program to print the host identification number. Available options: ­vV : version information. ­o : print this number in an octal format. ­h : print this number in a hexadecimal format.

licd6.2

Daemon process to watch over the license. Because sockets are used, the Ethernet software must be installed before you can use the license daemon. The file $BSE/lib/licence6.2 must contain the name of the host on which the license daemon is running, as follows:

n n

host name (must be present in /etc/hosts) internet address (x.x.x.x)

Note that brand6.2 expects to find the host name in licence6.2.

Technical Manual 9-14

Executable programs

Available options: ­vV : version information. ­d : debug. ­f : keep licd6.2 running in foreground. This is useful with the ­d option.

licmon6.2

Monitor to retrieve information from the license daemon. The options that can be used when starting the monitor are: ­vV : version information. ­b : show brand information. ­B : show brand information from brand file and shared memory. ­C : clear brand information from shared memory. Use this option when shared memory is incorrect. ­w : show users. ­W : show other connections. ­k : kill license daemon. ­u : show user count. ­s : show statistics. ­d : print debug information. ­h host : retrieve information from the given host. ­p n : ping the license server n times (test connection). The commands that can be entered within the license monitor are: brand information: show the brand information of this host. help : show the available commands. ping [n] : ping the license server [n times] (test connection). quit : quit license monitor. stats : show server statistics. users : show user count who [all]: list users [all: list other logons].

Technical Manual 9-15

Executable programs

Resources: licence_timeout : specifies the number of seconds the license daemon waits for a reply from another license daemon, or the number of seconds a Bshell waits for a reply from the license daemon. The default is 30 seconds. Do not lower this value. With wide area networks (WAN) it is advisable to set this value to 60. You can change or set the licence_timeout setting in the resource file.

Printer management

filter6.2

Program to translate BaanERP native codes to printer codes used by the pdaemon6.2 program.

lp6.2

System spooler interface for the pdaemon6.2 program.

pdaemon6.2

Daemon process to print requests from the environment. This program must be started by the user root. The options that can be used at calling the printer daemon are: ­v : print version and porting information of the daemon. ­k : kill the running printer daemon. ­f : Start daemon as foreground process (for debugging). ­d n: Print debugging information to stderr. The higher n is, the more information is output. ­r : Remove the lock file and start daemon (use this in rc.start). ­h : print the above options. Resources: maxproc: maximum number of background (filter) jobs. Default: 20. maxtries: maximum number of minutes to retry opening the database files. Default: 30 minutes. sleeptime: sleep time between two polls. Default: 10 seconds. shell_cmd: shell which runs the lp6.2 system interface. Default: /bin/sh. strict: The interval in seconds the printer daemon command (up/down) is checked for all devices. If this resource is not set, the printer daemon command of the device in question is checked as soon as a print job is found.

Technical Manual 9-16

Executable programs

Change default values in the file: $BSE/lib/defaults/pdaemon6.2

IMPORTANT

It is highly recommended that you group physical printers into logical printers. The daemon recognizes if a printer is busy and chooses another physical printer device. It also calculates the size of the several queues for physical printers, so it chooses the queue with the lowest number of bytes.

Shared memory

shmmanager6.2 Manager program for shared memory. See the chapter "Shared memory management." shmtimer6.2 Daemon process that stores and updates the current time in shared memory. See the chapter "Shared memory management." shmvalues6.2 Program to generate entries for the "shm_param" file. See the chapter "Shared memory management." srdd_init6.2 Program to load the data dictionary for the Bshell from shared memory.

Network

client6.2 Test program of the client part. fs6.2 Program to handle remote file I/O. With this program you can approach files on another system. On the other system you must put the program fs6.2 in the ipc_info file. See the chapter "Database management." ipc_boot6.2 Program to start remote processes. See the chapter "Database management." server6.2 Test program of the server part.

Technical Manual 9-17

Executable programs

TRITON Super Set

tsscomp6.2 Compiles and checks TSS information file tss6.2. See the chapter "Multibyte management." tsscvt6.2 TSS conversion filter. See the chapter "Multibyte management." tssinfo6.2 Gives information about current TSS settings. See the chapter "Multibyte management." uniinfo6.2 The uniinfo6.2 option requires an argument: ­u. The usage is as follows: uniinfo6.2 [-vahsdow] [-l locale] [-u Unicode hex value] [-n Native hex value] uniinfo6.2 shows all Unicode values from 0x0000 to 0xffff and the corresponding native character values, UTF-8 values, and TSS character values in hexadecimal format. By default, uniinfo6.2 shows only values from 0x000 to 0x00ff. uniinfo6.2 converts multibyte character strings into TSS strings or vice versa. You can determine the input/output character set by setting the locale with the ­l flag, otherwise it is read from the user file. The default mode is to convert to the character set of the Bshell. This can be reversed with the ­o option. Some additional options are: ­v : show version information. ­d : show additional debug information. ­w : do not accept any conversion warnings, but exit(1) instead. ­a : show all Unicode from 0x0000 to 0xffff. ­h : show Unicode from 0xE800 to 0xEA00. ­s : do not show when native character is zero. ­o : show the indexed contents of mapping tables. ­l : choose another locale. ­u : shows Native, UTF-8, and TSS value for the Unicode value. ­n : shows Unicode, UTF-8, and TSS value for the native value. ­t : shows Unicode, Native, and UTF-8 value for the TSS value. ­8 : shows Unicode, Native, and TSS value for the UTF-8 value.

Technical Manual 9-18

Executable programs

­m : use shared memory instead of local application memory. ­p : performance check (you must use ­dp option as parameter). ­dp : shows performance measurements of basic Unicode, UTF-8, and TSS conversion routines. For more information, see the chapter "Multibyte management." unimap6.2 Do not use the ­u option with this executable program. The usage is as follows: unimap6.2 [-vdeow] [mapping table file] [-l locale] [dbcs ranges] This program generates Unicode mapping tables based on the mapping information file, which is provided in .txt format in Microsoft Excel. The mapping file is called locale and is located in $BSE/lib/unicode/. The file locale.N2U is the Native to Unicode mapping file, and the file locale.U2N is the Unicode to Native mapping file. The leading byte ranges of the double-byte character set can be specified as optional parameters. Additional flags are: ­v : show program version. ­d : show additional debug information. ­e : add 0x8080 to convert JIS0208 values to EUC. This conversion is applied to Native to Unicode mapping file only. ­f : place no zero value where no mapping value is specified from 0x00 to 0x20 rather than 0x00 to 0xff. ­w : do not accept any conversion warnings, but exit(1) instead. ­o : print mapping tables in ASCII hex format. ­z : place zero value where no mapping value is specified. See the chapter "Multibyte management."

Technical Manual 9-19

Executable programs

Time zone utilities

zic6.2 Time zone information compiler. zdump6.2 Dumps time zone information to standard output. date6.2 Shows the dates based on BaanERP time zones.

Middleware

orb_srv6.2 Implementation program that supports the server portion of object request broker (ORB) communication. bshellorb6.2 Variation of the Bshell used to integrate BaanERP with CORBA programs.

UNIX equivalents

compress6.2 Program to compress data. Equivalent to the UNIX compress command. diff6.2 Program used to compare two files. Equivalent to the UNIX diff command. kermit6.2 Serial communications program. Equivalent of the UNIX kermit command.

sort6.2

Sort program. Equivalent of the UNIX sort command. You can use the environment variable BSE_SORT to specify a path where temporary files are stored during the sort process.

Technical Manual 9-20

Executable programs

Miscellaneous

binput6.2 Program to read input. This can be used in shell scripts. bput6.2 Program to set or print terminal settings. encrypt6.2 Program to encrypt passwords, which is used to fill the r<user> file. See the chapter "Database management." mirror6.2 Program for demonstrations and courses. nlsedit6.2 Editor to maintain input and output conversion tables for Native Language Support. See the chapter "Native language support." popup6.2 Program to handle popup screens. This can be used in shell scripts. sum6.2 Sum program, used to calculate and patch executable programs.

Technical Manual 9-21

Executable programs

Technical Manual 9-22

10

Errors

General

There are three categories of errors:

n n n

Error numbers 1-99 are generated by UNIX or XENIX Error numbers 100-899 are database errors Error numbers 900-999 are network errors

Error numbers between 34 and 100 are system dependent.

UNIX errors

1 EPERM Not owner This error indicates an attempt to modify a file that cannot be modified, except by its owner or super user. This error also appears when ordinary users attempt to do things allowed only to the super user. 2 ENOENT No such file or directory This error occurs when a specified file name should exist but does not, or when one of the directories in a path name does not exist. 3 ESRCH No such process This error means that no process can be found that corresponds to the one specified. 4 EINTR Interrupted system call This error means that an asynchronous signal (such as interrupt or quit), which the user has chosen to catch, occurred during a system call. If the system resumes execution after processing the signal, it will appear as if the interrupted system call returned this error code. 5 EIO I/O error This error means that there has been some physical I/O error. In some cases, this error can point to the call following the one to which it actually applies. 6 ENXIO No such device or address This error means that I/O on a special file refers to a subdevice that either does not exist, or is beyond the limits of the device. It may also occur when, for example, a tape drive is not online or no disk pack is loaded on a drive.

Technical Manual 10-1

Errors

7 E2BIG Arg list too long This error occurs when an argument list longer than 5120 bytes is presented to a member of the UNIX exec family system calls. 8 ENOEXEC Exec format error This error means that a request has been made to execute a file which, although it has the appropriate permissions, does not start with a valid magic number. A magic number is the first two bytes in a file, used to determine what type of file it is. See a.out(5). 9 EBADF Bad file number This error means that either a file descriptor does not refer to an open file, or that a write request has been made to a file that is opened only for reading that a read request has been made to a file that is opened only for writing. 10 ECHILD No child processes This error means that a process that has no child processes waiting, has executed a wait. A child process is a process spawned by another process (the parent process). 11 EAGAIN No more processes This error means that a fork failed, either because the process table of the system is full or because the user is not allowed to create any more processes. 12 ENOMEM Not enough space This error means that during an exec or sbrk, a program has asked for more space than the system is able to supply. This is not a temporary condition. The maximum space size is a system parameter. The error can also occur when the arrangement of text, data and stack segments requires too many segmentation registers, or if there is not enough swap space during a fork. 13 EACCES Permission denied This error means that an attempt was made to access a file in a manner forbidden by the protection system. 14 EFAULT Bad address This error means that the system encountered a hardware fault when it attempted to use an argument of a system call. 15 ENOTBLK Block device required This error means that a nonblock file was specified where a block device was required, for example, in mount.

Technical Manual 10-2

Errors

16 EBUSY Device busy This error means that an attempt was made to mount a device that was already mounted or to dismount a device on which there is an active file (open file, current directory, mounted-on file, active text segment). The error also occurs when an attempt is made to enable accounting that is already enabled. 17 EEXIST File exists This error means that an existing file was mentioned in an inappropriate context, for example, a link. 18 EXDEV Cross-device link This error means that an attempt was made to link to a file on another device. 19 ENODEV No such device This error means that an attempt was made to apply an inappropriate system call to a device, for example, a read on a write-only device. 20 ENOTDIR Not a directory This error means that a nondirectory was specified where a directory is required, for example in a path prefix or as an argument to chdir(S). 21 EISDIR Is a directory This error means that an attempt was made to write to a directory. 22 EINVAL Invalid argument This error means that an invalid argument was used, for example, dismounting a nonmounted device; mentioning an undefined signal in signal or kill; reading or writing a file for which lseek has generated a negative pointer. This error is also used by the math functions described in the (S) entries of the UNIX manual. 23 ENFILE File table overflow This error means that the systems table of open files is full, and temporarily no more open commands can be accepted. 24 EMFILE Too many open files This error means that too many file descriptors are open. No process can have more than 20 file descriptors open at a time. 25 ENOTTY Not a typewriter This error means that the selected device does not have the properties of a terminal. 26 ETXTBSY Text file busy This error means that an attempt was made to execute a pure-procedure program that is currently open for writing or reading. It can also mean that an attempt was made to open for writing a pure-procedure program that is being executed.

Technical Manual 10-3

Errors

27 EFBIG File too large This error means that the size of a file exceeded the maximum (1,082,201,088 bytes) or ULIMIT; see ulimit(S). 28 ENOSPC No space left on device This error means that when an ordinary file is written, there is no free space left on the device. 29 ESPIPE Illegal seek This error means that an lseek was issued to a pipe. 30 EROFS Read-only file system This error means that an attempt was made to modify a file or directory on a read-only device. 31 EMLINK Too many links This error means that an attempt was made to link more than the maximum number of links to a file. The maximum number of links to one file is 1000. 32 EPIPE Broken pipe This error means that a write was made on a pipe for which there is no process to read the data. This condition normally generates a signal. The error is returned if the signal is ignored. 33 EDOM Math arg out of domain of func This error means that the argument of a function in the math package is out of the domain of the function. 34 ERANGE Math result not representable This error means that the value of a function in the math package cannot be represented within machine precision.

Database errors

100 EDUPL This error means that a duplicate value exists. 101 ENOTOPEN This error means that the table is not open. 102 EBADARG This error means that an illegal argument has been specified. 103 EBADKEY This error means that an illegal key description has been specified. Use the bdbpre and bdbpost tools.

Technical Manual 10-4

Errors

106 ENOTEXCL This error means that the table is not exclusively locked action. You can either wait until the lock on table is released or you can remove the lock yourself. 107 ELOCKED This error means that the record you are trying to retrieve is locked. You can either wait until the lock is released or remove the lock yourself. 108 EKEXISTS This error means that the key already exists. 109 EPRIMKEY This error means that you are trying to perform an illegal action on a primary key. Refer to the log file for more information. 110 EENDFILE This error means that the end of the file has been reached. 111 ENOREC This error means that no record was found that matches the query criteria. 112 ENOCURR This error means that there is no current record. 113 EFLOCKED This error means that the table is locked. You can either wait until the lock is released or you can remove the lock. 114 EFNAME File name too long This error means that you are using a file name that is too long. Refer to your system requirements to check the maximum length for a file name. 116 EBADMEM This error means that the system cannot allocate memory because it is out of memory. Try restarting the Bshell as a possible solution. 117 EBADCOLL This error means that there is a problem with the collating, or sorting order. 123 ENOSHMEM This error means that no shared memory is initialized. You can use for example the rc.start script to initialize shared memory. 129 EUSER This error means that too many sessions have been started. 136 ENOSPACE This error means that there is no space in shared memory. You can either initialize the shared memory, or change the shared memory parameters.

Technical Manual 10-5

Errors

140 ETRANSON This error means that this operation is invalid when the transaction is on. 141 ETRANSOFF This error means that this operation is invalid when the transaction is off. 142 EADMON This error means that some administration process is running. 146 ENOSNAPSHOT This error means that the system cannot take a snapshot of the database, probably because it is locked by another user. You can either wait until the lock is released or you can remove the lock. 148 EOFRANGE This error means that there has been an error in the data type range check. 201 EROWCHANGED This error means that the record was changed after a delayed lock. 202 EDBLOCKED This error means that the database is locked. You can either wait until the lock is released or you can remove the lock yourself. 203 ETRANSACTIONON This error means that this action is not allowed within a transaction. 204 EISREADONLY This error means that this transaction is read only. 205 ENOTINRANGE This error means that the field value is out of range and does not agree with the domain definition. 206 ENOTLOCKED This error means that the record is not locked. 207 EAUDIT This error means that there is an error of the audit trailer. 208 EPERMISSION This error means that the action you have just attempted is not allowed at this time. 209 EMIRROR This error means that there is an error in the mirroring of the database. The tables are inconsistent. You can use bdbpre and bdbpost to copy the tables correctly.

Technical Manual 10-6

Errors

210 EMLOCKED This error means either that the record is locked in the mirrored database, or that the tables are inconsistent, or that the mirroring definition in tabledef6.2 is not compatible. 213 ETRANSACTIONOPEN This error means that the transaction is started, but not updated. This is an internal Bshell error. 214 EUNALLOWEDCOMPNR This error means that an operation for mapping company numbers is not allowed. If the logical company is not equal to the physical company, you are not allowed to do a drop/clear table operation. 215 EDBDILLEGAL This error indicates an illegal state that should never occur. 251 EAUDSETUP This error means that the audit server setup is not correct. See the log.audit file for more information. 252 EAUDCORRUPT This error means that an audit file is corrupt. See the log.audit file for more information. 253 EAUDLOCKED This error means that the audit file is locked by another user. See the log.audit file for more information. 254 EAUDABORT This error means that a commit transaction has failed in the audit server action See the log.audit file for more information. 301 ESQLQUERY This is a general SQL error code. This error occurs when there is a problem with the SQL syntax. 302 ESQLSYNTAX This error means that the SQL syntax is not correct. 303 ESQLREFER This error means that a reference in the query cannot be found. 304 ESQLUNDEFINED This error occurs when something went wrong but no error code can be set.

Technical Manual 10-7

Errors

305 ESQLWRONGROW This error means that a wrong record was returned. This probably means either that the table index is corrupt or that the RDBMS has a different sorting order than the BaanERP software. 501 EMEMORY This is an internal memory error. 502 EBDBON This error means that the user is already logged on. 503 EBADADRS This error means that an illegal address has been used. 504 EBADFLD This error means that a column is undefined. 505 ENOSERVER This error means either that no server is specified in tabledef6.1, or that the server cannot be started. See the log file for more information. 506 ENOTABLE This error means that the table does not exist. 507 ETABLEEXIST This error means that the table you are trying to create already exists. 508 EBDBNOTON This error means that you are not logged on to a database. 509 EBADCURSOR This error means that you have a bad memory cursor or that a bad table pointer has been specified. 510 EDBNOTON This error means that the database is not on. Start the database to correct the problem. 511 EWRONGVERSION This error means that the version of client is not the same as the version of the server. 512 EDDCORRUPT This error means that the data dictionary is corrupt. Use bdbpre and bdbpost tools to repair it. 513 ENODD This error means that the data dictionary was not found.

Technical Manual 10-8

Errors

514 ESECURITY (Oracle) This is a security error. It probably means you do not have the correct user or group permission. 515 ELICENSEERROR This is a license error. It probably indicates an unpatched binary. 516 EUPDSEGM This error occurs during the making or filling of rollback segments. It probably means that the disk is full. 517 EDELAYED This is a general error indicating delayed locking. 518 ENOSESSION This error means that an invalid session code has been specified. 519 ENOCOMPNR This error means that either no company number an illegal company number has been specified. A valid company number is a number between 0 and 999. 520 EBUFUPD This error occurs when flushing of buffered updates fails. The flushing can fail due to a lock or referential integrity constraint. 521 ENOSHM This error means that shared memory has not been loaded. See the chapter "Shared memory" for more information about starting shared memory. 522 EBDBDBCONNECTIONLOST This error means that the connection between the driver and database has been lost. 600 EREFERENCE This is a general reference error. For more information, see the log file. 601 EREFLOCKED This error means that the reference table is locked. You can either wait until the lock is released or remove the lock yourself. 602 EUNDEFREF This error means that the reference is not defined. It is probably a problem in the run time data dictionary. For more information, see the log file. 604 EREFUPDATE This error means that a reference could not be updated.

Technical Manual 10-9

Errors

605 EREFEXISTS This error means that the record cannot be deleted while the reference exists. See the log file for more information. 606 EREFNOTEXISTS This error means that the reference does not exist. 607 ENOREFTBL This error means that the reference table was not found. The data dictionary might not be correct. See the log file for more information. 608 ENOREFCNT This error means that no reference counter fields are present. 609 EUPDREFCNT This error can occur when the reference counter is updated. 700 ESETLOCALE This error can occur when you are setting the locale. See the log file for more information. If an error code greater than 1000 is displayed, the error can be retrieved as follows, depending on the database driver used: Informix/Oracle: error ­ 1000 gives DB error Example UNIX

Error no: 11400 Error: 11400 ­ 1000 = 10400 UNIX error = 0 (last two digits)

Example Oracle:

Error no: 1979 Error: 1979 ­ 1000 = 979 Not a GROUP BY

NOTE

When a fatal error occurs, more information is stored in the log files in the directory $BSE/log. For example, if bdbpost causes an error, it is reported in the file log.bdbpost.

Technical Manual 10-10

11

Shared memory management

General

Shared memory is a part of the internal memory intended for common usage. All users can read from and write to it. In BaanERP Tools the shared memory contains part of the data dictionary. A prerequisite for shared memory is that it must be supported by the hardware and there must be sufficient internal memory available. This chapter describes the way shared memory can be used for BaanERP Tools.

Using the shared memory manager

The shared memory manager is located in the $BSE/bin directory and can be started as follows:

shmmanager6.2 [-iksavr]

The options are: ­i: installation of shared memory. ­k: deletion of created shared-memory blocks. After shared memory is deleted you must reinstall it. You can only use this option if all processes that use shared memory have finished. If not, the system displays a message. ­s: display of technical information on the contents of shared memory. This includes:

- common Bshell pointers - description of segment table

­a: display of allocation data, such as addresses, segments, size, and so on. ­v: display of machine and porting data.

Technical Manual 11-1

Shared memory management

­r: resetting of shared memory. Removes all data from shared memory except the first segment. You do not have to reinstall shared memory afterwards. The result of this option is the same as when using ­k option followed by ­i option. You can only use this option if all processes that use shared memory have finished. If not, the system displays a message:

# of attaches = <number> Cannot remove ..# of attaches not equal to zero

The ­a, ­i and ­v options are discussed in the section "Installation of shared memory."

Installation of shared memory

The Bshell requires at least 4 MB of internal memory to function properly. After the kernel selects a virtual address, the kernel does not always leave enough memory for the Bshell. You must therefore specify a virtual address to determine where shared memory is allocated in internal memory. You can determine an adequate address using the shared memory manager, shmmanager6.2. This section includes the instructions for the installation of shared memory. Following the installation is a description of error messages that can come up during installation. The section "Kernel parameters" contains the minimum values of the kernel parameters.

Create an entry in the file shm_param file

The shmmanager6.2 program uses the shm_param parameter file, which contains parameters to install shared memory for a specific machine. This file is stored in directory ${BSE}/lib. Create an empty entry in this file for the machine in question. It must read as follows: Machine_id/OS release:; { }

NOTE

This entry must be preceded by a default entry. See also the section "Example parameter file shm_param." The OS release is only used if the file contains more than one entry for the same machine ID. You can display the machine ID and the OS release using the command shmmanager6.2 ­v.

Technical Manual 11-2

Shared memory management

Determine shared-memory parameters

You can determine these parameters by using one of the following commands:

n n

shmvalues6.2 shmmanager6.2 ­a

Using shmvalues6.2

The program shmvalues6.2 finds the boundaries of shared memory by itself and generates a default entry, which you can include in the shm_param parameter file. For example:

default:; { } Machine_id:; { } Machine_id/OS release:; { SHM_START = a40000 SHM_STEP = 80000 SHM_BUFSIZE = 512 SHM_MAXMEM = 10 }

SHM_START is the start address of the first shared-memory segment. SHM_STEP is the difference between the start addresses of two consecutive segments. SHM_BUFSIZE is the size of a segment in KB. SHM_MAXMEM is the maximum number of segments. The syntax for shmvalues6.2 is: shmvalues6.2 [-dvV] [-m Seg_size_in_MB] [-s Seg_size_in_KB] Possible options are as follows:

­d : the ­d option provides you with additional information through error messages when the boundaries of the operating system are exceeded. ­m : the program shmvalues6.2 first tries to allocate 4 MB of memory to make

sure enough memory is left after shared memory has been installed. You can use the ­m option to increase or decrease the amount of allocated memory. You specify it in megabytes, that is, ­m 3 = 3 MB.

Technical Manual 11-3

Shared memory management

­vV : the ­v or ­V option displays machine and porting data.

­s : Use this option to increase or decrease the SHM_BUFSIZE value (default 512 KB). This value must be less than or equal to the kernel parameter SHMMAX.

NOTE

You can create a parameter file by entering:

shmvalues6.2>shm_param

The entry is written to standard output (stdout) and all error messages are written to stderr.

CAUTIONS

SHM_BUFSIZE is below recommendations; try tuning the kernel. SHM_MAXMEM is below recommendations; try tuning the kernel.

FATAL ERRORS

Can't allocate <size> MB of memory: <system error message>; Please try tuning the kernel or lower the value Couldn't create any ID of any size: <system error message> Error while removing shmid <shmid>: <system error message> Failed to attach any segment: <system error message> Error while detaching shmid <shmid>: <system error message>

The shmvalues6.2 program returns a positive value in the event of a fatal error.

Using shmmanager6.2

If you cannot determine the shared-memory parameters by using shmvalues6.2, you can use the shared memory manager. This takes longer, but it yields more information on the addresses of the segments and on the instances where errors can occur. Execute the shmmanager6.2 with the ­a option. You are prompted for the number of kilobytes to be allocated and the number of segments to be created. For the Bshell, specify 4096 KB and 10 segments, respectively.

Technical Manual 11-4

Shared memory management

For example:

# shmmanager6.2 ­a No. of kbytes to be malloc: 4096 No. of shm segments to be created: 10 addr[0]: 0xa40000 id[0]: 40 < SHM_START = a40000 addr[1]: 0xac0000 id[1]: 41 addr[2]: 0xb40000 id[2]: 42 addr[3]: 0xbc0000 id[3]: 43 addr[4]: 0xc40000 id[4]: 44 addr[5]: 0xcc0000 id[5]: 45 addr[6]: 0xd40000 id[6]: 46 addr[7]: 0xdc0000 id[7]: 47 addr[8]: 0xe40000 id[8]: 48 addr[9]: 0xec0000 id[9]: 49 < SHM_MAXMEM = 10 step 0x80000 < SHM_STEP = 80000 step 0x80000 step 0x80000 step 0x80000 step 0x80000 step 0x80000 step 0x80000 step 0x80000 step 0x80000 step 0x80000 ret 0

Fill the entry in the shm_param parameter file

Enter the variables as determined in the shm_param parameter file. The following variables are mandatory:

n n n

The start address of the first shared-memory segment: SHM_START The number of shared-memory segments: SHM_MAXMEM The difference between the start addresses of the segments: SHM_STEP

You can retrieve the values of these variables from the information in the example on the preceding page. For this example, fill the entry in the parameter file as follows:

Machine_id/OS release:; { SHM_START = a40000 SHM_MAXMEM = 10 SHM_STEP = 80000 }

Technical Manual 11-5

Shared memory management

Installation of shared memory

Use the ­i option to install shared memory. For example:

# shmmanager6.2 ­i BUFSZ 524288, MAXATTCH 10, START 0xa40000, STEP 0x80000 Start /usr/bse/bin/shmtimer6.2: Shmtimer started: pid = 22743, time = 790343035 (Tue Jan 17 12:43:55 1995) Starting successful

NOTE

During installation the BSE shell variable must be the same as the one for the Bshell users. You can avoid installing shared memory manually each time by including the installation in your system's start-up procedure. If the BSE variable is not /usr/bse, it must be set during the start-up procedure and shmmanager6.2 must be started with the ­I option.

Starting shmtimer6.2

The UNIX time() function is a system call often called in database servers. On multiprocessor systems, use of the time() function can be quite heavy. Even though a process can run successively on different processors, this must be invisible to the process. The process requires that each processor returns the same time, using time(). Therefore, the processors have to synchronize their internal clocks every time the time() function is called. The shmtimer6.2 program can prevent this overhead. shmtimer6.2 is a daemon process that writes the current time in shared memory. The time is updated every second. This reduces the number of calls of the time() function to a maximum of one per second. When shared memory (shmmanager6.2 ­i) is initialized, the shmtimer6.2 program starts. When shared memory is removed (shmmanager6.2 ­k), the shmtimer6.2 stops first. The following options can be used for shmtimer6.2: ­i : Initialize shmtimer6.2 A shmtimer6.2 program is started, and runs in the background. ­k : Kill shmtimer6.2 The running shmtimer6.2 program is killed. The allocated shared memory is cleared, but not removed.

­s : Show status as stored in shared memory:

- The current time - The process ID of the running timer

­u : Show information about shmtimer6.2

Technical Manual 11-6

Shared memory management

­v : show version and porting data of shmtimer6.2

When shmtimer6.2 stops, the shared memory is cleared, as described for the ­k option. From then on, the system calls the UNIX time() function instead of reading the time from shared memory. If shmtimer6.2 is killed, shmtimer6.2 cannot clear its shared memory. Because shmtimer6.2 is killed, the time in shared memory is never updated, but the time is still read from shared memory. In that case, shmtimer6.2 ­s gives a warning. A new shmtimer6.2 can be started with shmtimer6.2 ­i.

Error messages during installation

The error messages are described in the order in which they can occur. No more space

# shmmanager6.2 ­a No. of kbytes to be malloc: 4096 no more space abort ­ core dumped

This error happens because some computer systems put a limit on the amount of virtual memory (MAXUMEM) used by a process. Hence the shared memory manager can not be capable of allocating 4096 K. Solution: Adjust the kernel parameters. See the section "Kernel requirements." Cannot create shared-memory segments of 512K

# shmmanager6.2 ­a No. of kbytes to be malloc: 4096 No. of shm segments to be created: 10 shmget errno 22 etc...... Errno 22 (EINVAL): The kernel cannot create any shared-memory segments of 512 K (SHMMAX).

Solution: Adjust the kernel parameters. See the section "Kernel requirements."

Technical Manual 11-7

Shared memory management

Not enough virtual memory

# shmmanager6.2 ­a No. of kilobytes to be malloc: 4096 No. of shm segments to be created: 10 shmat errno XX id 46 addr[0]: 0xa40000 id[0]: 40 addr[1]: 0xac0000 id[1]: 41 addr[2]: 0xb40000 id[2]: 42 addr[3]: 0xbc0000 id[3]: 43 addr[4]: 0xc40000 id[4]: 44 addr[5]: 0xcc0000 id[5]: 45 addr[6]: 0xffffffff id[6]: 46 (first invalid segment) addr[7]: 0 id[7]: 6747 (junk) addr[8]: 0 id[8]: 9644 (junk) addr[9]: 0 id[9]: 20492 (junk) step 0x80000 step 0x80000 step 0x80000 step 0x80000 step 0x80000 step 0x80000 step 0xff53ffff step 0x1 step 0 ret 0 Errno XX can be: 12 (ENOMEM): The user process does not have sufficient virtual memory (MAXUMEM) 24 (EMFILE): (In this example) the kernel cannot create more than 6 shared-memory segments per process (SHMSEG).

Solution: Adjust the kernel parameters. See the section "Kernel requirements." If the kernel cannot allocate 10 segments, as in the previous example, you need to fill the entry in the shm_param file as follows:

Machine_id/OS release:; { SHM_START = a40000 SHM_MAXMEM = 6 SHM_STEP = 80000 }

Technical Manual 11-8

Shared memory management

Syntax srdd_tab

The srdd_tab6.2 file can be divided into several sections. Each section is indicated by the package combination for which components have to be loaded into shared memory. For example:

package=31Sa

This parameter means that the components below this line belong to package combination 31Sa. After this line first the domains are specified. For example: dti.pd dtt.pd The following data is the table definitions. For example: dttaad000 dttaad001 After that the objects have to be placed. For example: ottstpconv ottstpdisplay So the syntax must be: package={pc} for domains: <d{p}.pd> for data definitions: <d{p}{t}> for objects and reports: <o{p}{m}{o}> The abbreviations are: {pc} package combination {p} package {m} module {t} table {o} object (program/report) You can also read parts of a data dictionary on a remote system into shared memory. To do this, write the host name of the remote system at the beginning of a line. For example:

${BSE}/standard6.2/ddbaan/dti/dti.pd ibm1!/usr3/bse/standard6.2/ddbaan/dtd/dtd.pd ${BSE}/standard6.2/ddbaan/dttadv/dttadv100 ${BSE}/standard6.2/ddbaan/dtppdm/dtppdm100 /usr2/bse/standard6.2/ttB40_a_CP/ottadv/oadv1100

If the file srdd_tab6.2 contains a redirection to a remote system, a remote user file must be available for the user who executes srdd_init6.2.

Technical Manual 11-9

Shared memory management

Filling shared memory

You can load parts of the data dictionary into shared memory: data definitions, objects, reports, and domains. In the file $BSE/lib/srdd_tab6.2, specify which parts to load into shared memory. You can fill the file srdd_tab6.2 using BaanERP Tools: Shared Memory Data (ttaad4150m000) session To load program and report objects. %SEttaad1120m000 session To load table definitions and domains. The parts of the data dictionary loaded into shared memory have an entry consisting of the inode number, date, time, and name. If the entry of a part in shared memory does not match the entry for that part on hard disk, the parts on hard disk are loaded locally, but not into shared memory. The old part remains in shared memory until you execute shmmanager ­k to delete shared memory blocks. Then you reinstall shared memory using shmmanager ­i. Use the srdd_init6.2 program to load the parts of the data dictionary into shared memory. The available options are: ­l : print what is done by the program, including error messages, if any. Use only in combination with the ­i option. ­i : initialize the parts that must be loaded in shared memory. ­p : print a list of loaded components. ­v : version information of the program. Use the shmmanager6.2 ­s command or the UNIX command ipcs ­m to see which segments are used and how much space is left to load other parts of the data dictionary. Error messages and other messages are written to stderr. You can write them to a file by entering the command: srdd_init6.2 ­i 2> file name Directory ${BSE}/etc contains the file rc.start. This program is executed at system startup. Shared memory is installed, filled, and initialized for a BSE environment specified in this file. The programs shmvalues6.2, shmmanager6.2, and srdd_init6.2 are used.

Technical Manual 11-10

Shared memory management

Kernel requirements

General description of adjusting UNIX kernels

Static kernels The kernel of a UNIX system is a program that runs from booting to shutting down. The kernel performs all actions in which user programs access resources. Internally, the kernel keeps lists of the actions that are executed simultaneously. Because those lists have limited capacity, a very large number of simultaneous actions can cause an overflow. When there is an overflow, the kernel cannot process any new actions. Consequently, when another action is added to the list the system displays an error message. For example, if the number of files opened at the same time is greater than permitted by the kernel, the system responds with error message 23 (ENFILE File table overflow). To avoid this error message, the user can create a new kernel that allows a larger number of files to be opened simultaneously. The kernel is stored on the system in different forms. First, it includes sources, libraries, an include file and, most importantly, a file containing kernel parameters. Second, the kernel is present as an executable and can be generated from the previously-mentioned files. Third, a kernel runs in the internal memory. Adjusting the kernel requires a three-step procedure:

1 2 3

Adjust the file with kernel parameters. Generate the kernel as an executable from the parameter file. Reboot the computer, allowing the new kernel to be loaded into internal memory and started.

Dynamic kernels With a static kernel, boundaries are set through a kernel parameter. With a dynamic kernel, the user can adjust boundaries during run time. The kernel of an IBM system is fully dynamic (except for a few parameters), so the user does not have to reboot the computer to activate changes. You can use a command to modify the kernel of an IBM while the system is still running. Furthermore, the kernel is automatically adjusted if the required number of resources is greater than permitted by the kernel.

Technical Manual 11-11

Shared memory management

The kernels of Digital and Sun systems are semidynamic. When the system is booted, some kernel parameters are read from a file and the kernel is adjusted accordingly. The user can adjust other parameters while the kernel is running.

Kernel parameters

The recommended values for the parameters presuppose the following conditions:

n n

A standard BaanERP installation One active session per Bshell

You can use the sar command while working in BaanERP to keep track of parameter usage and adjust the parameters where necessary. This is of particular interest for BaanERP customization. When using other databases, take into account the kernel tuning references from the corresponding documentation.

NOTE

When using raw devices, you must set the parameters relating to the cache such as NBUF or BUFPAGES to low values, according to the database-specific documentation, not to the relatively high values suggested in this document. The following descriptions for parameters refer to the number of users. If there is more than one active session per Bshell, instead of number of users, read number of active sessions. Processes NPROC The NPROC parameter specifies the maximum number of processes that can be run simultaneously in the system.

NPROC = 64 * users & NPROC = 1.1 * MAXUP Adjust: error 11

MAXUP The MAXUP parameter specifies the maximum number of processes that can be run per logon code. This restriction does not apply to the superuser. If several users log on using the same logon code, those users must share this number of processes.

MAXUP=64 Adjust: error 11, message 'fork failed: too many processes'

Technical Manual 11-12

Shared memory management

REGION, NREGION The REGION parameter specifies the maximum number of program regions that can be active at the same time. Each UNIX process has at least three regions: text, data, and stack. The text part is shared if a program runs more than once. Shared memory also uses the region resources.

REGION=3* * NPROC

Files NFILE The NFILE parameter specifies the maximum number of files that can be opened simultaneously on the system.

NFILE = 512 * users Adjust: Message " file table overflow"

The command sar ­v 1 1 shows the number of open files and the maximum number of files to be opened, under the header "file-sz." NOFILES, SFNOLIM(SVR4), MAXFILES (HP) The NOFILE parameter specifies the maximum number of files that can be opened per process.

NOFILES >+ 256 Adjust: error 24, Too many connected sessions (INGRES).

On an SVR4 system the user can use not only the kernel parameter sfnolim, but also a command to change the maximum number of open files per process. That command is "limit ­ 256", including the quotation marks. This new value only applies in this shell.

Technical Manual 11-13

Shared memory management

Buffers NBUF Under SVR3 and SVR4, the NBUF parameter has a different meaning. SVR3 The NBUF parameter specifies the number of system buffers available for block I/O.

NBUF = 1/3 of total internal memory (SVR3) NBUF = 0 (HP)

SVR4 In UNIX SVR4, buffers contain only indexes, superblocks, and file header information. They do not contain file data. The actual file data is stored in pages of virtual memory. The amount of virtual memory available for this purpose is determined by the SEGMAPSZ parameter. The NBUF parameter specifies the number of system buffer headers available for block I/O.

NBUF = default, for example, 100 Adjust: Performance problems (sar ­b)

NHBUF The NHBUF parameter specifies the number of hash table entries that can be allocated in the system.

NHBUF = 1/5 * NBUF Adjust: Performance problems

BUFPAGES The BUFPAGES parameter specifies the number of pages in the file's system buffer cache.

BUFPAGES = 1/3 of total internal memory) /4096, (HP) Adjust: Performance problems

SEGMAPSZ The SEGMAPSZ parameter specifies the size of the bitmap for file I/O. This map determines the number of 4K pages and therefore the amount of memory available for file I/O. If the value is 0, the kernel calculates the value as a function of the amount of physical memory.

SEGMAPSZ = 0 or 1/x of total internal memory. Adjust: Performance problems

Technical Manual 11-14

Shared memory management

BUFHWM The BUFHWM parameter specifies the maximum amount of memory, in kilobytes, that can be used by block I/O buffers. If the value of BUFHWM is 0 (the default), the kernel sets the value of the I/O buffers to 25% of available memory. Shared memory SHMALL The SHMALL parameter specifies the maximum amount of shared-memory text segments that can be created.

SHMALL = SHMNI Adjust: error 24

SHMMAX The SHMMAX parameter specifies the maximum size, in bytes, of a sharedmemory segment that can be created. Several shared-memory segments of this size can be created in an environment per process.

SHMAX >= SHM_BUFSIZE (in $BSE/lib/shm_param)

SHMMIN The SHMMIN parameter specifies the maximum size of a shared-memory segment in bytes.

SHMMNI = SHMSEG * ENVIRONMENTS Test with: ipcs ­m

SHMSEG The SHMSEG parameter specifies the maximum number of shared-memory segments that can be used by a process.

SHMSEG = 30 Adjust: error 24

Semaphores SEMMAP The SEMMAP specifies the number of entries in the control map used to manage semaphores. This map is used to keep track of free areas in the system pool of semaphores.

SEMMAP = SEMNI +2 Adjust: Message "Mfree map overflow"

Technical Manual 11-15

Shared memory management

SEMMNI The SEMMNI parameter specifies the maximum number of semaphore identifiers in the kernel. This is the number of unique semaphore sets that can be active at any given time.

SEMMNI = 32 * users Adjust: error 28

SEMMNS The SEMMNS parameter specifies the maximum number of semaphores ipc ­sb permitted in the system.

SEMMNS = SEMMNI Test with: "ipc ­sb"

SEMUME The SEMUME parameter specifies the maximum number of undo entries per undo structure. Each undo entry represents a semaphore that has been modified with the undo option specified in the semop(2) system call.

SEMUME = 10 Adjust: error 22

Message MSGMAP The MSGMAP parameter specifies the number of entries in the control map, for example 100, used to manage message segments. Each entry in this map represents a free area in the message buffer area.

MSGMAP = default Adjust: Message "mfree map overflow"

MSGMAX The MSGMAX parameter specifies the maximum size of a message in bytes. If the protocol m (message queues) is used in the file $BSSE/lib/ipc_info, the value must be set to 4096.

MSGMAX = 4096 & MSGMAX <= MSGMNB

MSGMNB The MSGMNB parameter specifies the maximum length, in bytes, of a message queue.

MSGMNG = 4096 Check with: ipcs ­qo

Technical Manual 11-16

Shared memory management

MSGMNI The MSGMNI parameter specifies the maximum number of message queues that can be used on the system.

MSGMNI=32 *users Adjust: error 28

MSGSEG The MSGSEG parameter specifies the number of message segments permitted on the system, for example 1024. Each message on a message queue consists of one or more message segments. The size of each segment is specified by the MSGSSZ parameter.

MSGSEG = default

MSGSSZ The MSGSSZ parameter specifies the size, in bytes, of a message segment, for example, 8. Each message consists of contiguous set of message segments large enough to hold the text of the message.

MSGSSZ = default

MSGTQL The MSGTQL parameter specifies the maximum number of message headers, in other words, the maximum number of open messages.

MSGTQL = 32 * users

General kernel parameters

ULIMIT, HFSZLIM, SFSZLIM SVR3 The ULIMIT parameter specifies the maximum size of a single file on disk. SCO UNIX and HP use blocks of 512K. SVR4 The kernel parameter ULIMIT is not used in SVR4. SVR4 uses the parameter HFSZLIM for the hard limit and SFSZLIM for the soft limit. These parameters are in bytes. SVR3 and SVR4 both contain the built-in command ULIMIT through which the kernel parameter value can be reduced.

Technical Manual 11-17

Shared memory management

NINODE The NINODE parameter specifies the maximum number of inodes that can be used in the SV file system. This includes open files, used pipes, and the current directory. The UFSNINODE parameter specifies the number of inodes for the UFS file systems.

Example parameter file shm_param

# The default entry (please do not modify) default:; { SHM_BUFSIZE = 512 SHM_MAXMEM = 30 SHM_STEP = 80000 } SCO_UNIX_386/3.2.2:; { SHM_START = 80400000 SHM_MAXMEM = 10 SHM_STEP = 400000 }

Technical Manual 11-18

12

Remote databases

General

The client/server architecture as supported by BaanERP enables the user to work with several database types. These databases can be distributed over one or multiple systems. A remote database configuration is one where an application server (bshell) and the database are not on the same system. The possible reasons for setting up a remote database configuration are:

n

System performance If all users start the application on the same system, the CPU is primarily occupied by the Bshell and the display server. You can divide the load by letting the users work on local systems and keeping the database on a remote system. Lack of disk space on local system If all tables cannot be stored on the same system due to a lack of disk space, some of the tables can be installed on a second system. Distributed applications For practical reasons you can decide to install the application tables on different systems per application. Mirrored databases For security reasons database actions can be carried out on two systems simultaneously using database mirroring.

n

n

n

This chapter describes how to set up a remote database configuration and also explains how to use it.

Technical Manual 12-1

Remote databases

Settings for remote database configurations

To work with a remote database configuration, you must predefine a number of settings. You must know on which systems the tables are located, and also which types of databases are going to be used. Also, if the communication structure has not changed, the porting sets of the binaries on the local and remote systems can be different, otherwise they must be equal. It is recommended to have the same porting sets. This chapter explains how you can configure a remote database system. The tables can be located in various ways in a remote database configuration:

n n

All tables are located on one or more systems A part of the tables are located on the local and another part of the tables are located on a remote system

Figure 8, All tables on remote system

In figure 8, the user interface and the application logic (Bshell) are both installed on the local host. From version 6.1 forward, they can be installed on different systems. Assuming that all tables are installed on a remote system and the user interface and application logic (Bshell) are installed locally, the following files must be available for the system to work normally:

Technical Manual 12-2

Remote databases

Local host

On the local host, the following files and directories must be present: $BSE/bin:

audit_srv6.2 ba6.2 badmin6.2 Bdbpost6.2 bdbpre6.2 Bdbreconfig6.2 bic6.2popup6.2 bic_cstub6.2 bic_info6.2 Binperm6.2 binput6.2 bput6.2 brand6.2 Bshcmd6.2 Bshell6.2 bsp.setperm6.2 client6.2 Compress6.2 encrypt6.2 Explode6.2 filter6.2 Gcommand6.2 hostid6.2 kermit6.2 licd6.2 licmon6.2 lp6.2 nlsedit6.2 pdaemon6.2 qcommand6.2 qptool6.2 refint6.2 repgen6.2 rz6.2 shmmanager6.2 shmvalues6.2 sort6.2 srdd_init6.2 std_gen6.2 sum6.2 sz6.2 tsscomp6.2 tsscvt6.2 tssinfo6.2

$BSE/lib: tabledef6.2 fd6.2.<package_comb> (optional) ipc_info /user/r<user> $BSE/etc: rc.start rc.stop $BSE/tmp $BSE/log

Technical Manual 12-3

Remote databases

Remote

It is recommended that you install the complete $BSE-environment on the remote system. If no application is started on the remote system, executable programs such as Bshell6.2 and ba6.2 do not have to be installed there. It is practical if one or more users can run the application locally on the remote system. For this reason they must be run on the remote system. That is why the entire BSE environment must be installed there. The remote system must include at least the following files: $BSE/bin: fs6.2 ipc_boot6.2 database_servers with associated executable programs, such as ora7_srv6.2 installation and validation programs, such as install6.2, licd6.2, and so on. $BSE/lib: tabledef6.2 user/u<user> ipc_info driver-specific directory, for example, ora fd.6.2.<package_comb> (optional) $BSE/etc ­ rc.start rc.stop If these files are available on the local and the remote system, respectively, you can adapt the following files. The data dictionary contains sessions where you can adapt the files. It is better to adapt the files in the sessions in the data dictionary and not directly in the files themselves.

Local

On the local system the following files are configuration dependent:

n n n

tabledef6.2 Database Definitions (ttaad4510m000) and Tables by Database (ttaad4111m000)) u<user> Remote User Data (ttaad2500m000) r<user> Remote User Data (ttaad2501m000)

Technical Manual 12-4

Remote databases

tabledef6.2

Start the application by executing the user interface (UI). The UI then starts the application logic (Bshell), which reads the file tabledef6.2 to search for the table location and database type. Tables can be stored on a local or remote system, which is also indicated in this file. The file tabledef6.2 is filled using the Database Definitions (ttaad4510m000) and Tables by Database (ttaad4111m000) sessions on the menu BaanERP ToolsÈ Database ManagementÈ Database Definitions and Directories. These sessions indicate whether tables are installed on a remote database. The file tabledef6.2 is located in the $BSE/lib directory. For more information about tabledef6.2, refer to the help text for business object Database Management, on the menu BaanERP ToolsÈ Database ManagementÈ Database Definitions and Directories. You can specify whether each table is installed locally or remotely by entering the remote system name in the System Name field in the Database Definitions (ttaad4510m000) session. Then use the Tables by Database (ttaad4111m000) session on the menu BaanERP ToolsÈ Database ManagementÈ Database Definitions and Directories to assign tables to this table definition. For example, assume that all tables are installed on the remote system host1. This means that tabledef6.2 on the local system must contain the line: *:*:host1:N. If all tables are on a remote system you can set the variable BSE_REM on the local system. If there is no tabledef6.2 file on the local system, the Bshell searches for this on the remote system, otherwise it reads the local tabledef6.2 file. The variable BSE_REM indicates the remote system:

BSE_REM=host1

User files

To start an application, every user (logon) must have a user file. The Bshell reads this user file to test whether the user is authorized to start the application. The Remote User Data (ttaad2501m000) session creates the file $BSE/lib/user/r<user>. If all tables are installed on the remote system, the user files can be installed there, too, instead of on the local system. In that case you can set the system variable BSE_REM with the system name of the remote system, for example BSE_REM=host1. The Bshell looks first in the local $BSE/lib directory. If it cannot find the needed files there, it uses the BSE environment ($BSE/lib) on the remote system.

Technical Manual 12-5

Remote databases

The remote system now reads the user file u user. To access tables on a remote system, you need to log on to the remote system. This is done using a remote logon user file named r user. You create this file using the Remote User Data (ttaad2501m000) session. Read session Help for information on how to create this file. Variant I Two variants of r user are possible. If the user's logon is the same on the local and the remote system, variant I is sufficient. Define the remote system, the path on that system, and the password to log on to the remote system. In variant I, the following information is needed:

n n n

EXAMPLE

Name of remote host BSE path on remote host Encrypted password on remote host

A user "peter" would like to work with BaanERP on his local work station. The database tables he wants to use, however, are located on a remote system called host. To access the remote data, he needs a file rpeter in the directory $BSE/lib/user. If all tables are located on the remote system, he sets the following system variable:

BSE_REM=host1

This makes sure that everything is read from the remote BSE environment except the bin directory. When using Variant I, user peter must have a logon entry on the remote system. The file r user must contain the name of the remote system, the path of the BSE on the remote system and the user's encrypted password for the remote system. Variant II A second variant of r user allows you to log on to the remote host using another logon code. Indicate whether the UNIX and BaanERP permissions must be inherited from the other user. If so, the user file u user on the remote system must have the same UNIX logon as on the local system. In variant II, the following information is needed:

n n n n n

Name of remote host BSE path on remote host Logon name on remote host Encrypted password on remote host SUID inherited logon

Technical Manual 12-6

Remote databases

The remote user file can contain more than one line. When using variant II, you can also specify a logon code to access the remote system. This can be a different logon code than "peter," for example "john." After that you enter the encrypted password for the remote logon (john). The remote system must still have a user file upeter. Variant II also allows you to take the UNIX and/or BaanERP authorizations defined for the logon john. To do so, specify "yes" or "no" for the fields SUID and Inherit Logon. SUID switches the user ID from peter to john. Inherit Logon makes sure the BaanERP authorizations defined for john apply also to peter. To switch the user ID, the file ipc_boot6.2 ($BSE/bin) must have UNIX root permission root and the s-bit must be set. From a security point of view this is not advisable. Here is an example of the two variants: Variant I:

host1 /usr2/bse NZ+,AHtg&#K-kt"Q{$=Y3-"VLDN'CRtZ host2 /usr1/t/bse [email protected]#c67h78i\{}907h67h5R

Variant II:

host1 /usr2/bse john NZ+,AHtg&#K-kt"Q{$=Y3-"VLDN'CRtZ no yes host2 /usr1/t/bse [email protected]#c67h78i\{}907h67h5R yes yes

Remote

Whenever a local system connects to the remote system, ipc_boot6.2 is the first program to start. That process in turn starts fs6.2, which can read tabledef6.2 on the remote system. It finds an entry in tabledef6.2, showing the database type for a range of tables to be accessed. A database server is started, for example, ora7_srv6.2. The path for both fs6.2 and the database server is read from the file $BSE/lib/ipc_info. Once on a remote system, you cannot call a third system. This means that tabledef6.2 must always have an entry on the tables.

Technical Manual 12-7

Remote databases

Figure 9, Local and remote tables

Local and remote tables

Tables are located on the local as well as on the remote host. Another option is to distribute data storage over a local and a remote system. In that case both the local and the remote system must have the complete BSE environment installed. The file tabledef6.2 now contains entries for local as well as remote system tables. This can also be defined in the Database Definitions (ttaad4510m000) and Tables by Database (ttaad4111m000) sessions on the menu BaanERP ToolsÈ Database ManagementÈ Database Definitions and Directories.

Settings for remote menus/forms/objects

Not only databases, but also forms, menus, objects and scripts can be distributed over one or more systems. The directories for the software components are defined in the Directories of Software Components (ttadv1115m000) session. This session fills the file fd6.2.package_combination. In this session you can specify whether the component is on the local or remote system. See also the session Help information.

Technical Manual 12-8

13

Multibyte management

General

The currently used 8-bit wide character space is not large enough to fit most Asian character sets. Asian countries such as Japan, China, and Korea need at least 16 bits of character space to accommodate local characters. Therefore a 32bit wide character space has been implemented in BaanERP Tools to support all possible character sets. Be aware that a character is not necessarily the same as a byte and can take up more than one screen position. A character in the Bshell occupies one or two screen positions at a size of 4 bytes.

Triton Super Set

Triton Super Set (TSS) is a collection of character sets that can be used in BaanERP applications. TSS accommodates all multibyte character sets in a single package. TSS includes both ASCII character sets and multibyte character sets, such as Japanese, Chinese, Hebrew. To distinguish between, for example, Japanese and Chinese, TSS consists of planes, each of which holds a 64KB-size character set, or 256 pages of 256 characters. This is shown in the following figure. Numbers are according to the hexadecimal system. For example, the value of 0x21 is 33 in the decimal notation.

Figure 10, BaanERP Super Set (TSS)

Technical Manual 13-1

Multibyte management

The characters 0x00 ­ 0x20 and 0x7F ­ 0x9F cannot be included in the sets, because these ranges contain control and escape codes. This leaves the following ranges:

0x212121 ­ 0x7EFFFF 0xA12121 ­ 0xFFFFFF

To distinguish TSS characters, the character contains the prefix 0x9B. Hence the complete TSS ranges are:

0x9B212121 ­ 0x9B7EFFFF 0x9BA12121 ­ 0x9BFFFFFF

Code Features (CF) and Line Drawing Characters (LDC) have been implemented in the code range of ISO-8859/1 as follows:

n n n n

Line Drawing Characters | 0x80 ­ 0x8A Code Features | 0x8B ­ 0x9A TSS Lead byte | 0x9B Reserved | 0x9C ­ 0x9F

These code ranges do not conflict with the currently implemented EUC character sets, but they can cause problems when you import these codes. Also these codes overlap with SHIFT-JIS trailing bytes, causing import conversion errors. Therefore the code ranges are translated into ASCII characters (0x00-0x7F) during the export phase and are converted back into the correct LDC and CF characters during the import phase. Currently assigned planes are:

Character set KANJIEUC/SHIFTJIS KANJIEUC/SHIFTJIS CCDC_HP15 GB2312-80 GB2312-80 BIG5 CNS11643 CNS11643 HEBREW Page 0x21 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x30 Range from 212121 2321a1 24a121 25a1a1 26a120 27a140 28a1a1 29a121 3021a0 Range to 217e7e 2321df 24fe7e 25ffff 26a17f 27f9d5 28fefe 29fe7e 3021fa Remarks JISX0208-1983 JISX0201-1976 CCDC GB2312-80 Extended GB CNS11643 Plane 1 CNS11643 Plane 2 ISO-8859/8

Technical Manual 13-2

Multibyte management

Using multibyte character sets

Installation

Entering or displaying multibyte characters is subject to a series of conditions. The window manager must support multibyte characters and must have been initialized in the proper native language. If necessary, change the shell variables LANG and LC_ALL before starting the window manager. This prevents the title bar of a window from displaying improper characters. These settings are system dependent. If necessary, follow the procedure to add a character to TSS, as described in the BaanERP Super Set. Enter the proper TSS locale in the Application Configuration (ttaad2100m000) session. The locale is defined in the Maintain Locale Data (%SEtttss0104m000) session and contains the definition of the character set.

Printing multibyte characters

To print multibyte characters, make sure the following conditions are met:

n

A device created in the Device Data (ttaad3500m000) session must be linked to a TSS locale that contains the definition of the character set in question. If the proper locale is not specified, the printer daemon cannot print the report. The printer must be able to print the characters from the TSS locale. Check your printer manuals.

n

Utilities

This section describes the available programs belonging to BaanERP Super Set. These programs are present in the directory $BSE/bin.

tsscomp6.2

NAME tsscomp6.2 This program compiles and checks TSS information file tss6.2. This program is executed by the Convert TSS Data to Runtime (tttss0103m000) session. SYNOPSIS tsscomp6.2 [-svV] [-e error file] [-d debug level] [­i input file] [­o output file]

Technical Manual 13-3

Multibyte management

DESCRIPTION tsscomp6.2 compiles the file tss6.2, which contains the descriptions of all supported character sets into a fast-loading binary file tss_c6.2. It also performs several checks on the entered data of the character sets. The available options are: -s -e -vV -d -i -o Suppress output of errors. Check the exit value to determine if the program has been successful. Write all warnings and errors to file error file. Prints version and porting information. Used to provide some debugging information. This is a bit set. Optional input file. Default $BSE/lib/tss6.2. Optional output file. Default $BSE/lib/tss_c6.2.

Return values:

n n

0 = success > 0 = failure

tsscvt6.2

NAME tsscvt6.2 TSS conversion filter. SYNOPSIS tsscvt6.2 [-vV] [-dow] [-l locale] DESCRIPTION This program converts multibyte characters strings into TSS strings or vice versa. The input/output character set can be set using the ­l option, but is read from the user file (locale resource) if not given. Use the ­o option to convert from TSS to the native character set. The available options are: -vV -d -w show version and porting information. show some additional debug information. Do not accept any conversion warnings, but exit(1) instead.

Technical Manual 13-4

Multibyte management

Return values:

n n

0 = success > 0 = failure

tssinfo6.2

NAME tssinfo6.2 This program offers information about the current settings such as your TSS locale, NLS locale, character set information, and so on. SYNOPSIS tssinfo6.2 [-vV] [-sf] [-l locale] DESCRIPTION The available options are: -vV -s -f -l

EXAMPLE

show version and porting information. show character set definition of TSS locale. show font assignments. show information about the given locale. This is read from the user file if not given.

: bsp : KANJIEUC_AIX32 : KANJIEUC : ja_JP :1 : 0x1 : 0x9b217e7e : 0x20 : 0x9b217e7e : 0x1 : 0x7f : 0x20 : 0x7a

Command: tssinfo6.2 ­sf User TSS locale TSS character set NLS locale Factor Multibyte strings: Database min. Database max. Forms min. Forms max. Single byte strings: Database min. Database max. Forms min. Forms max.

Technical Manual 13-5

Multibyte management

Character set definition for KANJIEUC

NATIVE From 1 8ea1 a1a1 To 7f 8edf fefe TSS from 1 9b2321a1 9b212121 to 7f 9b2321df 9b217e7e

Font assignments

Font 0 1 2 Display Size 1 2 1 Font string iso8859-1 jisx0208.1983-0 jisx0201.1976-0

Technical Manual 13-6

Multibyte management

Character set description

The file tss6.2 in the directory $BSE/lib contains a description of the character set. Normally this file is filled using the TSS Character Sets (%SEtttss0101m000) session. This file describes all supported character set with a special description language. The format is as follows:

Set(<number>, "Name", "Description") { ( range <number>-<number> in <expr> out <expr> store <number> bytes <number> setno <number> ) [more ranges...] } <number> can be hexadecimal: 0xnn, octal: 0nnn or decimal: nnn. <expr> can be: 1. simple type (fast) & value binary AND with value | value binary OR with value + value ADD value - value SUBTRACT value 2. complex type (slow) "expression". See the "expr" function.

Range In/out Store

Defines the input range (native data). Convert the character data for input (conversion to TSS) and output conversion to native character set). Defines the place in the character set where the data is stored in TSS after the in conversion expression (add 0x9b000000 to see where it is stored, but not in the conversion entries). Gives information about the number of bytes per native multibyte character. Refers to the X-character set-number as defined in $BSE/lib/locale/LOCALE for display purposes. LOCALE is the current locale as defined in the user file.

Bytes setno

Technical Manual 13-7

Multibyte management

A character set usually consists of several subsets, such as ASCII, KANJI-EUC, and KATAKANA in some Japanese environments.

NOTE

Never change the character set data in an active environment. This can have catastrophic results, and the changed conversion tables can corrupt your data beyond repair. KANJI-EUC

Set(3, "KANJIEUC", "Japanese EUC") { # ASCII ( range 0x1-0x7f store 0x0 bytes 1 setno 1 ) # KATAKANA (JISX0208) ( range 0x8ea1-0x8edf in &0x00ff out |0x8e00 store 0x232100 bytes 2 setno 3 ) # KANJI (JISX0201) ( range 0xa1a1-0xfefe in &0x7f7f out |0x8080 store 0x210000 bytes 2 setno 2 ) }

EXAMPLE

Technical Manual 13-8

Multibyte management

Locale information

The file tss_locale6.2 in the directory $BSE/lib contains all possible TSS locales that can be defined in the user file or specified with special commands, such as tsscvt6.2 ­l locale. This file is filled by the Maintain Locale Data %SEtttss0104m000) session. The format is as follows:

Locale, Charset, NLS_locale, MBdbLow, MBdbHigh, MBFormLow, \ MBFormHigh, SBdbLow, SBdbHigh, SBFormLow, SBFormHigh

Locale Charset NLS_locale MbdbLow MBdbHigh MBFormLow MBFormHigh SBdbLow SbdbHigh SBFormLow SBFormHigh

EXAMPLE

As specified in the user file. Any of the character sets defined in tss6.2. The NLS locale. Mainly used for character collation. May be NULL. The lowest possible multibyte character value for database storage. The highest possible multibyte character value for database storage. The lowest possible multibyte character value for forms (see the expr function). The highest possible multibyte character value for forms (see the expr function). The lowest possible single byte character value for database storage. The highest possible single byte character value for database storage. The lowest possible single byte character value for forms (see the expr function). The highest possible single byte character value for forms (see the expr function).

# Japanese ­ HPUX 9.0 KANJIEUC_HPUX: KANJIEUC, Japanese.euc, 1, 65278, 32, \ 65278, 1, 127, 32, 122

# \ is used here to indicate that the line following this character must actually be in the same line. The directory $BSE/lib/locale contains files having names identical to the locale names, with character set information used to display the character set ranges. A set is chosen by the setno entry in the tss6.2 character set description file. These files are managed by the Fonts (tttss0106m000) session.

Technical Manual 13-9

Multibyte management

EXAMPLE

Taken from KANJIEUC_AIX

# character set display width iso8859-1 1 jisx0208.1983-0 2 jisx0201.1976-0 1

The sequence number of these character sets is the value that is used as setno entry in the tss6.2 file and in the TSS Character Sets (%SEtttss0101m000) session.

Storage of multibyte characters

Normally the characters are stored as TSS characters. However, you can also store the characters as native characters. To do that, the file tss_mbstore6.2 must be created in the $BSE/lib directory. That file contains the database fields, whose value or text must be stored as native instead of TSS characters.

native character : 8ea1 TSS character : 9b238ea1

The file is processed in the following order. The asterisk (*) refers to all tables.

* ppmmm### ppmmm###.field ppmmm###ccc ppmmm###ccc.field (p:package, m:module, #:table number, c:company number)

EXAMPLE

# entire table: ttaad320 # only field stat from ttaad320000 ttaad320000.stat

Do not store native data as SHIFT-JIS. This conflicts with the LDC (line drawing characters) and CF (code features) characters. It is better to store native data as KANJI-EUC. You can use the SHIFT-JIS character set for the user interface BX/BW. These programs have been designed to handle this conflict, by adding special flags to all stored characters. For other parts of the BaanERP application it is problematic to store the SHIFTJIS characters combined with LCD and CF characters. A good approach is to choose tables for which data must be stored as SHIFT-JIS. These tables can be manually added to the file tss_mbstore6.x.

Technical Manual 13-10

14

Audit management

General

This chapter introduces the audit management facility provided with BaanERP Tools from Version 6.0 onward. It describes the audit server, the audit management utility, and where audit data is stored. It also describes the structure of the audit files. Finally, this chapter explains how to give users permissions to print, maintain, or clean audit data.

Storage of audit data

For each table in each company number, the audit server uses a set of files to store audit data. You can read audit files using the 4GL functions or the dictionary programs. This section describes the types of file that are used.

Sequence files

The audit data is stored in a set of files called sequence files. There can be multiple sequence files per table per company number. Apart from storing audit data and transaction information, a sequence file also stores information about audited columns of the table, the audit data dictionary. The name of the sequence file is built using the table name and company number. The format of the sequence file name, where prefix a indicates an audit file, just as t indicates a table itself, is as follows:

a<mmmnnn><company number>.<sequence file number> mmm represents the module code nnn represents the file number

For example for table ttadv999 and company 000 the sequence files are:

aadv999000.000 aadv999000.001 aadv999000.002 aadv999000.003 ..........

For detailed information of the sequence file, refer to the section "Format of audit files."

Technical Manual 14-1

Audit management

Information file

There is one information file per table per company number, which:

n n

Stores information about all sequence files used for this table/company number combination Contains controlling information used to create and maintain sequence files

The name of the information file is based on the table name and the company number. The format of the information file name is as follows, where mmm represents the module code and nnn represents the file number:

a<mmmnnn><company number>.inf

For example, for table ttadv999 and company 0, the information file is aadv999000.inf.

NOTE

There is one set of files per table name/company number combination. This means that any associated information, sequence file, or operation is identified by the table name/company number combination. For the sake of readability this document uses the word "table" to refer to a table name/company number combination.

Location of audit files

The file $BSE/lib/auditdef6.X is used to specify the location of the sequence and information files for the tables. Under the directory specified in auditdef6.X, a subdirectory is created for each module. Audit files for all tables in this module for all company numbers are stored in this directory, unless a different directory is specified for different company numbers. The format of the directory name is:

a<Package Code><Module Code>

Here is an example of an entry in auditdef6.X:

ttadv:*:/usr/adv/AUDIT *:*:/usr1/AUDIT

In this example the audit files for all ttadv tables are stored in the directory /usr/adv/AUDIT/attadv. For all other tables, respective directories are created under /usr1/AUDIT. For example, atfacr is created for the BaanERP Finance acr module, atiitm for the BaanERP Industry itm module, and so on.

Technical Manual 14-2

Audit management

There can also be an entry such as:

ttadv:*:/usr/adv/AUDIT/#

In this case all ttadv tables are stored under specific respective company numbers. For example, for company number 000 the files are stored under directory /usr/adv/AUDIT/000/attadv.

Other parameters of audit files

The location of the audit files is controlled as explained in the section "Location of audit files." The user can control other parameters. These are defined in a file named $BSE/lib/audit_spec. For more information on this file, and specifications of parameters in it, refer to Format of Audit Files. Information file The tables for which audit trail is enabled can contain sensitive data such as company financial information. This means that the audit files also contain sensitive data. Audit management contains a security mechanism by which access to the audit data can be controlled according to user requirement. A security level is defined per table/company number combination. Depending on the security level, users can or cannot access or modify the audit data. The audit server reads the security level from the audit_spec file and stores it in the information file of the table. The central audit management utility (see the Audit Management business object), uses this security level to control audit data access and modification. Sequence File The start and end sequence numbers for a table are specified in the audit_spec file. For example, if for table ppbdb000 within company 000, the start sequence is 0 and the end sequence is 999, the table has the following sequence files:

abdb000000.000 abdb000000.001 .... abdb000000.998 abdb000000.999

Technical Manual 14-3

Audit management

For the same table, if for company 100 the start sequence is 1, and the end sequence is 50, the files are:

abdb000100.001 abdb000100.002 .... abdb000100.049 abdb000100.050

In principle, all audit data for a table/company number combination can be written to a single sequence file. But because this file becomes too big to manage properly, the audit data is split across multiple sequence files. The maximum size of a sequence file for a table is defined in the audit_spec file. If the limit is exceeded, the audit server tries to use the next sequence file.

Audit management

The audit management version 6.2 incorporates the following features in BaanERP audit management utility:

n

Audit data is stored in a set of files, instead of a single file. Multiple files allow for better management than a single large file. See the section "Storage of audit data." Each transaction is identified by a transaction header, which logs useful information about the transaction, such as the corresponding user and time. Also, the data is organized per transaction. Each transaction has a header followed by all audit data, which enables easy tracking of the changes that users have made. When the audit data is being written, information of audited columns in tables is also stored in audit files. If the table data dictionary is later changed, you can still interpret old audit data by using the stored column information. Table level commands affecting table data such as create table, clear table, and drop table, are also logged by the audit server. Audit management such as printing audit files and display audit sequences is done by using the sessions belonging to the Audit Management business object.

n

n

n

n

Technical Manual 14-4

Audit management

Table data dictionary as seen by audit server

When a table data dictionary is created in a BaanERP environment, the audit trail can be enabled for each column. This allows a user to audit a single column or all the columns on the table. The audit server is concerned only with audited columns of a table. It logs the information only for the audited columns. If a column is not audited, no information is logged for it. If the table has no audited columns, no information is logged for the table. The file tabledef6.2 specifies the tables and columns for which audit is enabled. See also the section "Accessing tables" in the chapter on database management. For the rest of this chapter, it is assumed that all columns are to be audited unless stated otherwise. The audit data dictionary (the information of audited columns) is stored in the sequence header. This information is stored in a particular order of table columns. First, information for all audited primary key columns is stored in the order in which they form the primary key. Next, information of remaining audited columns is stored in the order in which they occur in the table. For example, suppose a table has columns c1, c2, c3, c4, c5, c6 with primary key (c4, c2) and all columns except c5 are audited. The audit data dictionary contains information for the columns in this order: c4, c2, c1, c3, c6. For each column, the audit data dictionary stores the column name without the table name prefix, field type, size, and depth. The format of a column entry in the audit data dictionary is as follows:

Name Type Depth Size

Name Stores column name without table name prefix. Type Single byte indicating field type. The defines in BDB layer for field type are used, because 4GL also uses the same values. For example, for the CHAR field, the BDB type is BDB_CHAR, and the 4GL counterpart DB.CHAR has the same define as BDB_CHAR. Depth Single byte, indicating depth of the field. Size 2 bytes, indicating field size. For array fields this is the size total of all fields in array.

Technical Manual 14-5

Audit management

Commands logged by audit server

The audit server tracks all commands that affect the table data, that is, insert, update, and delete commands. It also tracks certain table level commands such as create table, drop table, and clear table, which affect all rows in a table. For each of these commands, the audit server puts certain information in the audit files. This information can be considered as Audit Row in the audit file. The audit server does not track select commands (with or without lock), or other table level commands such as change order, count rows, or create or drop index, because they do not change the table data in any way.

Data stored by audit server

Row operations For row operations, the audit server keeps the values of audited fields. Insert actions The new values of all audited fields to be inserted are stored in the audit file. Delete actions The field values of the record to be deleted are stored in the audit file. Update actions To comply with an application user requirement, the old and new values of the fields that are changed in an update are stored. Primary key field values are also stored, even if they have not been changed. In addition, if any other audited column changes, its old and new values are stored. If an audited field is not changed, and it is not a primary key field, its value is not stored in the audit row. In addition to field values, a one-character code indicating the type of row operation is also stored. Table operations For table operations such as create table, drop table, and clear table, it is sufficient to store only an indicator. The audit server stores a one-byte indicator for table operations.

Technical Manual 14-6

Audit management

Application data In accordance with the application user requirement, the audit server keeps 4 bytes extra space reserved in each audit row, to be used by application programs. Application programs are free to use this space for their own usage. This 4-byte space is called application data. The audit server does not interpret the application data in any way.

Format of audit row

The format of the audit row in the sequence file is as follows:

Length Appl Data Action Data...

Length A two-byte field that indicates the length of this audit row (excluding this field itself). Appl Data A four-byte field reserved for application program usage. The audit server, when writing a row, initializes this to nulls. Action A one-byte character code indicating the action done on the table. The following codes are available: -C -R -L -I -D -U create table drop table clear table insert row delete row update row

Data The previous fields fulfill the audit requirement for table-level actions. No Data field is included for table-level actions.

Technical Manual 14-7

Audit management

For row level actions, the important values of audited fields are stored as data, as explained in the following sections. Insert/Delete actions Values of all audited fields are stored for insert and delete actions. They are stored in the same field order as that of the audit data dictionary of a sequence header. If the audit data dictionary of a table has columns in the order c4, c2, c1, c3, c6, the values are stored in the same order. Update actions For update actions, the field number precedes the field values in the audit row. Field numbers used here are related to the sequence of fields in the audit data dictionary and not to the original table data dictionary. Suppose a table has columns c1, c2, c3, c4, c5, c6, with primary key (c4, c2), and all except c5 are audited. The audit data dictionary contains information for these columns in order c4, c2, c1, c3, c6. Thus the field number 0 refers to field c4 and not to field c1. Similarly field 3 refers to c1 and not to c3. For update actions, an audit row looks as follows:

Length Appl Data 'U' Multiple field entries

A single field entry is as follows:

Field number Changed? Old value New value

Field number A two-byte entry that indicates the field in the audit data dictionary. Changed A single-byte flag, used to indicate whether the field is updated or not. The field value for primary key fields must be stored, whether it is changed or not. When the field value is changed, the corresponding flag is set to Y, otherwise it is set to N. The values for all other audited fields are stored in the audit row only if they are changed, so for these fields, the flag is always set to Y. Old Value The old value of the field that is being updated. For a primary key column that is not changed, this is the only value stored. New Value If an audited field value is changed, this represents the new value. For primary key audited fields that are not changed, this field is not present in the audit row.

Technical Manual 14-8

Audit management

Using this logic, the following is possible: The primary key field (audited) is not changed. In this case the field entry is:

Field number N Old value

The primary key field or any other audited fields are changed. In this case the field entry is as follows:

Field number Y Old value New value

Here the new value follows the old value.

Examples of the audit row for various operations

Suppose you have a table with the columns c1, c2, c3, c4, c5, c6 with primary key (c4, c2). If all columns except c5 are audited, the audit data dictionary contains information for these columns in order c4, c2, c1, c3, c6. The field number 0 then refers to field c4, field number 1 is c2, and so on. Create Table

Length Appl Data 'C'

Here the length is the same for all tables, 5. Drop Table

Length Appl Data 'R'

Here the length is the same for all tables, 5. Clear Table

Length Appl Data 'L'

Here the length is the same for all tables, 5. Insert Row

Length Appl Data `I' c4 c2 c1 c3 c6

Here c4, c2, and so on, indicate the values of the corresponding fields. Each field entry size is the size of the field itself.

Technical Manual 14-9

Audit management

Delete Row

Length Appl Data `D' c4 c2 c1 c3 c6

Update Row Assume that c2 (primary key column) and c6 are changed.

Length Appl 'U' 0 N c4.o 1 Y c2.o c2.n 4 Y c6.o c6.n

Here, the entry for field 0 (c4) is present, although it is not changed, because the field is a primary key field. Its only value stored is c4.o, the old value. Because c2 (field 1) and c6 (field 4) are changed, their old and new values are stored as .o and .n respectively.

Limit on the size of audit data

All audit data generated in a transaction for a table is always put in a single sequence file. The transaction data is never split up across sequence files. If the current sequence does not have enough space to write the transaction data (that is if its size exceeds the maximum sequence size), the audit server tries to write the transaction data in the next sequence file. If the transaction data cannot be accommodated in the entire sequence file, the audit server cancels the transaction. If this happens, the application programmer must either reduce the scope of the transaction or increase the maximum file size for the sequence file.

Audit server

Long transactions and overflow file

The audit server buffers audit data in its memory buffers until the end of the transaction. For example, if during a transaction 100 rows are inserted in a table and then a commit is done, all the audit rows for the insert are buffered by the audit server. This data is written to the audit files only at the time of commit. The audit server uses individual memory buffers for each table. The size of the buffers is set to enable them to hold large amounts of data. However, the memory buffers might not be able to contain the results of a very large transaction. In this case, the audit server uses an overflow file to buffer the remaining data. The overflow file is created in $BSE/tmp. There is one overflow file per session per server. Its name is made using the session ID and process ID (pid) of the audit server, as follows:

ao.{Session Id>.<Process Id of the Audit Server>

Technical Manual 14-10

Audit management

A single overflow file is used to buffer data for all the tables in the session for which the memory buffers were insufficient. At the end of the transaction, if any table has data in the overflow file. The overflow file is read and put in the corresponding sequence file. After all data has been read and copied from the overflow file, the overflow file is deleted. If a transaction is canceled, the overflow file is deleted.

NOTE

The memory buffers of the audit server can hold a large amount of data. If the audit server still has to use the overflow file, the transaction is too big. This can be a flaw in application design or coding. If possible, such transactions must be avoided.

Sequence termination

The audit server uses a set of sequence files to store audit data for a table. The audit server switches from one sequence file to the next under the following circumstances.

Sequence file maximum size reached

Audit data generated in a transaction for a table is written to a single sequence file. If the size of the transaction data exceeds the maximum sequence-file size limit for the current sequence, the audit server marks the current sequence file as terminated and writes the transaction data to the next sequence file. Before the audit server switches to the next sequence, it ensures that the maximum possible space is available. If the transaction data for the table still cannot be accommodated, then it cannot be put in any sequence file. This is an error condition and the audit server cancels the transaction. Note that in this case the current sequence is not terminated. When this error occurs, you can either increase the maximum size of the sequence file or reduce the scope of the transaction.

Table audit data dictionary changed

When the audit server starts using a sequence, it writes the audit data dictionary to the sequence headers of the sequence file and the information file. Audit data in the sequence file depends on the audit data dictionary of that sequence. For example, for an insert/delete action, all audited field values are put in the sequence in the order in which they occur in the audit data dictionary. For updates, the field values are preceded by field numbers, which are offsets in the audit data dictionary. The reading of audit data by the 4GL interface is also dependent on the audit data dictionary of the sequence.

Technical Manual 14-11

Audit management

If the audit data dictionary changes after the system writes some audit data to a sequence file, you cannot continue using the same sequence. In this case, the audit server stops using the current sequence and marks it closed while the audit data dictionary has been changed. It starts using the next sequence. Note that here the switch is made only if the audit data dictionary changes. This is different from changing the table data dictionary. Changing table data dictionary does not mean that the audit data dictionary is also changed. Events that lead to changes in the audit data dictionary are in the following example. Suppose you have a table with columns c1, c2, c3, c4, c5, c6 with primary key (c4, c2) in which all except c5 are audited. The audit data dictionary contains information for these columns in order c4, c2, c1, c3, c6. Consider the following changes: Number of audited columns changed If the audit trail status for any field is changed, the audit data dictionary changes. For example, if audit trail is enabled for c5, the audit data dictionary must have column information in the order c4, c2, c1, c3, c5, c6. This is different from the audit data dictionary of the current sequence, so a sequence change occurs. Similarly, if auditing is disabled for c1, the new audit data dictionary is c4, c2, c3 and c6, which is different from the current audit data dictionary. As a result, a sequence change occurs. Order of audited primary key columns changed Initially the primary key was (c4, c2). If its definition is changed to (c2, c4), the new audit data dictionary is c2, c4, c1, c3, c6. Because this is different from the audit data dictionary of the current sequence, the audit server closes the current sequence and uses the next sequence. Order of other audited columns changed The audit data dictionary changes if the order changes in which the columns (other than the primary key columns) occur in the table definition. For example, if the table is now defined as c1, c2, c4, c5, c6, c3, the new audit data dictionary is c4, c2, c1, c6, c3. In this case the sequence order is changed.

Technical Manual 14-12

Audit management

Number of audited primary key columns changed You can change the number of audited primary key columns without affecting any of these conditions. For example, if the primary key definition is changed to (c4, c2, c1), the new audit data dictionary is the same as the current audit data dictionary. But because c1 is now a primary key field, its value must be stored in an update action even if it is not changed. In earlier updates in the current sequence, this would not have been done. To make the sequence file consistent, the audit server switches to the next sequence.

Sequence terminated by user

If current security allows them to, application users can terminate the current sequence by using the central audit management utility (see the Audit Management business object). Application programs can also terminate the sequence. In this case the terminating program sets the sequence end date and time and the sequence status.

Transaction termination

When a transaction is started, the audit server buffers audit data until the transaction ends. Depending on the manner in which the transaction is ended, two types of behavior are possible: simple commit/abort or two-phase commit. Simple commit and abort When doing simple commit, the buffered data for all tables in the transaction is written to the corresponding sequence file, one table at a time. For example, suppose a transaction involves four tables t1, t2, t3, and t4. When doing the commit, first the audit data for t1 is written, then the data for t2, and so on. When the data for all tables is written successfully, the audit server sends a success code back to the client. If writing data for any table fails, the audit server returns the E_BDB_ABORT error to the client indicating that the transaction is canceled. If this happens and the data is already written for some tables, it must be marked invalid. In this example, if the audit server fails to write data for table t3 after writing data for tables t1 and t2, the server changes the status of transactions for tables t1 and t2 to ABORT_DONE. If the client decides to cancel the transaction, the audit server just discards the buffered data for the tables, if any. No data needs to be written for any table.

Technical Manual 14-13

Audit management

Two-phase commit protocol Beginning with Tools release 6.1c, BaanERP supports the two-phase commit functionality for audit servers only. Two-phase commit is not supported for database servers. A three-part process takes place when an application issues a commit:

n n n

Prepare audit drivers (first phase) Simple commit to all database drivers Commit audit drivers (second phase)

Prepare audit drivers (first phase) To prepare for a commit, the system writes audit data to the audit files and sets the PREPARE_DONE flag in the status field of the transaction header in the sequence files of the tables involved. If the preparation for a commit fails for any one table during the update of multiple audited tables, the PREPARE_DONE is reversed. That is, the ABORT_DONE flag is set for the tables on which the PREPARE_DONE was set. PREPARE_DONE is not set for the remaining tables. The audit server issues an E_BDB_ABORT error to the client to indicate that the transaction has aborted. Simple commit to all database drivers Next a commit is issued to all the database drivers involved in the transaction. If the commit fails for any of the database servers, the system issues an ABORT on the remaining database servers. Because BaanERP does not support two-phase commit for database servers, the system cannot issue an ABORT on the database servers for which the commit was already issued. Commit audit drivers (second phase) After all database drivers have successfully committed, all audit servers involved in the transaction are committed. A COMMIT_DONE flag is set in the transaction status field of the transaction header for all the audited tables involved in the transaction. If the commit fails for any table, the transaction status field is set to ABORT_DONE for all audited tables involved in the transaction, including tables for which a COMMIT_DONE was set. When all the tables involved in the transaction have both their PREPARE_DONE and COMMIT_DONE flags set, the transaction has been successfully completed and successfully audited.

Technical Manual 14-14

Audit management

How to use and set two-phase commit If any of the audited tables involved in the transaction is specified in the file $BSE/lib/xchdef, the transaction performs a two-phase commit. Otherwise, the decision is based on the resource variable dbcinit. If dbcinit is set to 01, twophase audit commit is used for all audit transactions regardless of whether the table is specified in the file $BSE/lib/xchdef. If none of the audited tables involved in the transaction is specified in the file xchdef, and if dbcinit is not set to 01, a simple audit commit is performed for that transaction. Performing a simple commit is fast. But performing a two-phase commit guarantees that, if both PREPARE_DONE and COMMIT_DONE flags are set, a full commit is done. For Drop Table and Create Table actions, two-phase commit is always used regardless of whether the audited table is specified in xchdef file or dbcinit is set. Format of $BSE/lib/xchdef6 The format of an entry in the xchdef6 file is as follows: table_name:company_number:{Y|N}

EXAMPLE

ttadv:*:Y tiitm001:*:Y ttaad410:000:Y *:*:N

In this example, two-phase commit is used for the following tables:

n n n

all tables in the module ttadv for all companies table tiitm001 for all companies table ttaad410 for company 000 only

For other tables the decision is based on the setting of the dbcinit resource variable. If the xchdef6 file is not present, the system behaves as though the file were present with the entry:

*:*:N

In other words, the decision is based on the dbcinit resource variable only.

Technical Manual 14-15

Audit management

Reusing sequence files

Suppose you have a table with start sequence 0 and end sequence 49, for a total of 50 audit files. In the first run, each sequence file is created. After all 50 sequences are created and used, the audit server normally uses sequence 0 again, overwriting the existing file. If you do not want this to happen, you can disable the reuse feature. Instead of overwriting the file, the audit server then sends an error message saying that the file must be deleted before the server can reuse the files. Thus when the reuse feature is disabled, an existing sequence file is not overwritten. You have to delete the file by using the Purge Audit Files (ttaad4161m000) session before the audit server can continue. If the reuse feature is enabled, the audit server overwrites any existing sequence file.

NOTE

If you want to receive a message before the data in audit files is destroyed, you must disable the reuse feature. This can be done by not specifying a SEQREUSE keyword in audit_spec file. If you want to use the reuse feature, include the keyword SEQREUSE in the audit_spec file. Always delete the sequence files using the Purge Audit Files (ttaad4261m000) session rather than by using commands such as rm or del. This is because the status of the sequence file is maintained in the sequence header in the information file. When this session deletes the sequence file, it also sets the status of this sequence in the information file as deleted. If the file is removed by any other means, the status is not set and this results in inconsistency.

File locking

When writing the data for a transaction, the audit server can close the current sequence and start using the next sequence. Thus it can change the current sequence field in the information file header. It also changes the sequence status and sequence end time for the current sequence, and changes the status and start date/time of the next sequence. Even if the audit server does not switch sequences, it needs to change the current offset in the information header and the number of transactions in the sequence header. This means that it always changes the information header and the sequence header. Moreover, because the sequence header is maintained in the sequence file and information file, both of these must be changed.

Technical Manual 14-16

Audit management

At the start of a transaction termination command for each table and before writing buffered data to the audit file, the audit server locks the information file header and sequence header in the information file and sequence file. The audit server puts write locks on, so that no other read or write lock can succeed. After the data for all tables is written, the locks on all tables are released. If there is an error on any table, the status of transactions for tables already written is changed to abort and the locks on all tables are released.

Limit on open files

When writing audit data for a table, the audit server has to open the information file and one sequence file for that table. Once these are opened, they are kept open for subsequent use even after the end of a transaction. These open files can be used in all subsequent transactions involving this table. Having so many files open, however, means that the server can reach the OPERATING SYSTEM limit of maximum open files per process. For example, if a transaction involves 15 tables, 30 files are opened at the end of that transaction. If the next transaction has 10 different tables, 20 more files are opened. At the end of the second transaction 50 files are open, which is over the maximum limit. When this limit is reached, the server closes two open files: the information file and the sequence file for a table. The server uses the least recently used (LRU) criteria to choose the table for which the files are closed, as explained in the following paragraph. The audit server uses a data structure, called a handler, to keep track of the file descriptors for the information and sequence files on each table. When these files are opened, the file descriptors are stored in the handler. The handlers of all tables are kept in a linked list in an LRU manner. For example, when files are first opened, the handler is allocated and is put in most recently used (MRU) position. As other tables are opened, this handler moves toward the LRU position. Later on, if this table is involved in another transaction, the same handler is reused and is again moved to the MRU position. Also, when a file is open, all data is written to the file before the data goes to the next table. Thus, until all data is written for a table in the current transaction, the handler for that table is guaranteed to stay in MRU position and in no way can it reach LRU position. If the audit server reaches the open file limit when opening a new information file, sequence file, or overflow file, it picks up the LRU handler in the handler list and closes its information file and sequence file. The assumption is that because the table has not recently been used, it is the best choice as a victim for closing files.

Technical Manual 14-17

Audit management

Opening large number of tables in single session

A session can update a large number of tables. On systems that have a small maximum number of open files, this can create a problem. Suppose a session with a limit of 30 open files starts to update 50 tables. After opening the information and sequence files for the first 30 tables, the system reaches the maximum limit of open files. When files for table31 are opened, the LRU logic is activated and files for table1 are closed. But table1 is itself in transaction and its files are locked. When the audit server closes the files, the locks are released and other processes can alter the files. Now the same audit server may again need to operate on the audit files of table1. This means that the audit files for table1 need to be opened again. But if the files were changed in the meantime, the status is changed to ABORT_DONE. In this case, the audit server gives an error and cancels the transaction.

Multisession support

The audit server supports multiple sessions, which means that the same audit server is used for multiple sessions within the client. The audit data dictionary of a table is kept globally. The same table/company number in multiple sessions shares a single audit data dictionary. The handlers (one used per table/company number combination) are kept in global lists. If multiple sessions operate on the same table/company number combination, they share a single handler.

File security for various audit management files

It is important that the audit_spec file has read permission for all users, and that write permission is granted only to the Administrator user. Otherwise users other than Administrator can change the security parameter in the file, which would allow them illegal access.

Technical Manual 14-18

Audit management

Audit server debugging options

For debugging purposes, a code is put in the audit server at appropriate stages to print useful information. In normal usage, this printing is not enabled. You can enable it by setting an environment variable AUDITLOG. You can print various types of information by setting this variable to different values. The values must be set as octals. 0001 0002 0004 0010 General information Print audit rows generated Print audit data dictionary for table Print data structures such as information header, sequence header, and transaction header

The information is put in a log file. The name of the file is audit.log.pid of the server. This file is created in the current directory of the audit server.

Audit errors

The audit server uses the following error messages. If you receive one of these error messages, refer to $BSE/log/log.audit for more information regarding the cause of the error.

E_AUD_SETUP 251 The audit setup is not correct.

This can occur if the specification in $BSE/lib/audit_spec file is not in proper format.

TOSEQ 6 SECURITY 28 MAXSEQSIZE 25K or

No table/company number combination

aa:00a:TOSEQ 6 SECURITY 28 MAXSEQSIZE 25K

Incorrect company number.

*:*:TOSEQ 6 SECURITY 28 MAXSEQSIZE 5K

The maximum sequence size limit is less than the specified limits. Refer to the section "Format of audit files" for details about the format of this file. It can also mean that the current sequence file was illegally removed or that the sequence files were removed without using the 4GL interface. Audit files used during the first run can also cause this error.

E_AUD_CORRUPT 252 An audit file is corrupt.

Some corruption of the information file has occurred. There is a mismatch of sequence headers in information file and sequence file.

Technical Manual 14-19

Audit management

E_AUD_LOCKED 253 Another user has locked the audit file.

Multiple users are trying to use the same audit file at the same time. The audit file is locked before it can be modified, and the next user receives an error message.

E_AUD_ABORT 254 Commit transaction has failed in audit server.

The audit file is changed when the audit data is written to the audit file. When too many files are opened and the maximum limit is reached, the LRU file is closed. This error can refer to the file used in the transaction. When the file is reopened, the starting date time of the sequence header is checked with memory data structure. If they are not the same, the E_AUD_ABORT error is returned.

Authorizations

The Administrator user grants audit security permissions to users using the Audit Authorizations (ttaad4562m000) session, on the menu BaanERP Tools, Audit Management. These permissions determine whether the user is allowed to use the sessions in the Audit Management business object. Security permissions assigned to users are checked against previously existing records to see if they conflict. You can assign security permissions for all packages, modules, table numbers, and companies. You can give some permissions for all packages, and disable these permissions by giving no permissions to a range of packages. You can use the Specified command to give particular permissions to a specified package. By using Specified, the highest priority is given to the security permissions assigned for that particular package, module, table and company. You cannot assign security permissions for a range within a range. Suppose you assign some permissions using the All command, then disable permissions for a range between tt--vv. You cannot then enable permissions within this range or an overlapping range. However, you can use the Specified command to enable the permissions for a specific package. The conflicting records are not stored in the table. The security permissions for users are stored in a table ttaad462, which you can access accessed using the sessions within the Audit Management business object. The security checking is done at two layers, one at the user level and another for reading audit information. The user can have permissions at the user level but not for reading the audit information. At audit level, the security permissions are stored in the audit information header of the audit information file.

Technical Manual 14-20

Audit management

User level permissions None All Print Clean Maintain

Audit level permissions Print Clean Maintain Application-defined

At user level, the Administrator user can grant permissions in different combinations. The Administrator user assigns its own permissions to print and clean audit information through the Audit Authorizations (ttaad4562m000) session, on the menu BaanERP Tools, Audit Management. The only session the Administrator user is allowed to execute without being assigned any security permissions, is the maintain session. For example: None All Print Print/Clean Print/Clean/Maintain

NOTE

No permissions Print, clean, and maintain permissions Only print permissions Print and clean permissions Same as All

None and All are mutually exclusive. At Audit level the permissions can be granted in combinations except Application defined. Only Maintain can be combined with Application-defined. Print Print/Clean Print/Clean/Maintain Application defined Maintain/Application defined Only print permissions Print and clean permissions Same as all permissions Access to some sessions restricted Only Maintain permission, no print and clean permissions

The user is not allowed to print or clean up any audit information. To print, clean, or maintain the audit information from the audit files, the permissions must exist at both levels. Permission at user level Permission at audit level Print or print/clean Application defined

Technical Manual 14-21

Audit management

The user is not allowed to Print or Clean up any audit information in the audit files using the sessions in the Audit Management business object. It is possible, however, to run the Audit Information File (ttaad4160s000) session, because the user has Maintain permission only at audit file level. Permission at user level Permission at audit level Maintain or Print/Maintain or Clean/Maintain Maintain/Application defined

If the user is not Administrator and only Application-defined exists at the audit file level, no session of the Audit Management business object can be executed. The Administrator user can use the maintain session even if no permissions are assigned to the Administrator user. However, the Administrator user cannot use print and clean sessions unless security permissions are assigned to Administrator. If user bsp has Print permission at user level, a further check is made to see the security permissions at audit level. User bsp is only allowed to continue if print permission is available at the audit level. Otherwise the session is canceled and an appropriate message is displayed.

Format of audit files

auditdef6.2

This file is used to specify the directories in which audit files are created. There is one such file for each BSE environment, and it is located in $BSE/lib. This file has following structure:

<Table Name>:<Company Number>:<Directory Name>

The following section lists the meaning of each field. Table Name This indicates the table. This can be in the following formats: "*" ­ This means all tables in all packages. Package ­ This means all tables in this package. For example tf, td etc. Package & Module code ­ All tables in the module. For example, tccom, ttadv. Package, Module and table number ­ for example ttadv999, tccom010.

Technical Manual 14-22

Audit management

Company Number Tables can be chosen based on company number. For example: * ­ All companies. 100 ­ Company 100 only. 100,000 ­ Company 100 and 000. Directory Directory in which the audit files are stored. Under this directory, another directory is created, called: aPackage + Module Code

Information file

There is one information file per table per company number. You can read the information file by using the 4GL functions or the dictionary programs. The information file contains the controlling information for the sequence files, called the information header, followed by the sequence headers of all the sequence files created. The format of the information file name, where mmm means module code and nnn means table number, is as follows: a mmmnnn company number.inf For example, the name for table ttadv999, company 0, is aadv999000.inf. The structure of the information file is a header called information header, followed by multiple sequence headers, one for each sequence created. Information header n Version Information Used to store the version information. This must never be modified by the application by any means. Length: 4 bytes

n

Table name The table for which audit information is stored. Length: 8 bytes. Company Number The company of the table. Length: 2 bytes.

n

Technical Manual 14-23

Audit management

n

Status Specifies whether sequence reuse is allowed or not. Length: 1 byte. From Sequence Number Audit data is stored in sequence files specified from this value. Length: 2 bytes. To Sequence Number The last sequence file after which sequence reuse is started, or the user must take appropriate action, such as deleting the existing file before reusing them. Length: 2 bytes. End Sequence Number Specifies the last sequence written in the information file. This field is for internal use by Audit Server only! The user must never change this field, otherwise the audit server will not work correctly. Length: 2 bytes. Max. Size of 1 audit file in Bytes Specifies the maximum file size of a sequence file. Length: 4 bytes. Security Level This lists the users who have access to the information in the audit files. The security permissions regarding access to audit information are stored here. Length: 2 bytes. Current Sequence Number Determines the current sequence number that is used to write the audit data in the sequence file. Length: 2 bytes. Offset in current sequence file. Specifies the offset in the current sequence file where the audit data is written. Length: 4 bytes. Reserved space Space that is reserved for future use. Application programs must never use this space because it might be required for a future release of the audit server. Length: 8 bytes Length of following sequence header Length: 2 bytes

n

n

n

n

n

n

n

n

n

Technical Manual 14-24

Audit management

Sequence Header Each sequence file also begins with a sequence header. The information file contains copies of sequence headers for all sequences created.

n

Sequence Number This specifies the sequence number of the sequence file. Length: 2 bytes. Creation Date This specifies the creation date of the sequence file. Length: 8 bytes, format: YYYYMMDD. Creation Time This specifies the creation time of the sequence file. Length: 6 bytes, format: HHMMSS. Termination Date This specifies the termination date of the sequence file. Length: 8 bytes, format: YYYYMMDD. Termination Time This specifies the termination time of the sequence file. Length: 6 bytes, format: HHMMSS. Status The status gives information to the user whether the sequence file was user terminated, closed because of a data dictionary change, or closed because transaction data could not be accommodated in the sequence file. Length: 2 bytes. Number of transactions in the sequence This specifies the data of number of transactions present in the sequence file. Length: 2 bytes. Application Information ­ 1 Application Information ­ 2 Application Information ­ 3 Application Information ­ 4 These bytes are reserved for storing data specific to the application. If the application needs to store any information in audit files, these fields are used to store that information. Length: 4 bytes, per application information field.

n

n

n

n

n

n

n

n

Number of fields being audited The total number of fields that are being audited. Length: 2 bytes.

Technical Manual 14-25

Audit management

n

Number of fields in primary index Indicates how many fields are in primary key. Length: 1 byte. Field Name (Length: 8 bytes), Field Type (Length: 1 byte), Field Depth (Length: 1 byte), and Field Length (Length: 2 bytes) Field information for all fields that are being audited. First, the fields that are part of the primary index are written in the same sequence as in the primary index. Next, all remaining fields are written in the order in which they occur in the table data dictionary. For example, if fields f1, f2, f3, f4 are being audited and the primary index is on f4, f2, then field information is written first for f4, then for f2, and then for all remaining fields.

n

EXAMPLE

n

Reserved space This space is reserved for future use. Length: 8 bytes. Length of following sequence header Length: 2 bytes.

n

Sequence file

Multiple sequence files are used to store audit data for each table/company number combination. You can read the sequence files by using the 4GL functions or the dictionary programs. The format of the sequence file name, where mmm refers to the module code and nnn means table number, is as follows: a mmmnnn company number.sequence file number For example, these sequence files can exist for table ttadv999, company number 0: aadv999000.000 aadv999000.001 aadv999000.002 aadv999000.003 .... The sequence file contains the table name and company number, followed by the sequence header. This is followed by transaction data of multiple transactions. Transaction data is followed by a transaction header and contains multiple audit rows generated for the transaction.

Technical Manual 14-26

Audit management

Sequence File Layout n Table Name Length: 8 bytes

n

Company Number Length: 2 bytes Length of sequence header Length: 2 bytes Sequence Header Transaction Header Transaction Data (Audit rows) Transaction Header Transaction Data (Audit rows) Transaction Header Transaction Data (Audit rows) ....

n

n n n n n n n n

Transaction Header Format You need to log both the operating system user ID and the BaanERP user name. This is because a user can change the USER environment variable and use different BaanERP user names. Also, different BaanERP users can have different table privileges in SQL databases. Programs can find the operating system logon name by using the operating system user ID print.

EXAMPLE

Operating system user id Baan User Name Date ( YYYYMMDD ) Time ( HHMMSS ) Session Name

4 8 8 6 15

The transaction status can have one of the following values: COMMIT_DONE ABORT_DONE From Baan IVc onward, the status can also have the following flags. The values for these flags can be found in the audit include file. PREPARE_DONE GATI_UTC_FLDS

Technical Manual 14-27

Audit management

Transaction Status Number of audit rows in the transaction

1 2

Also since Baan IVc, the following fields are added at this position.

{ GATI 0 GATI 1 Commit Date ( YYYYMMDD ) Commit Time ( HHMMSS ) Reserved space } Total bytes of data of this transaction 4 4 8 6 8 4

You need to log both the operating system user ID and the BaanERP user name. This is because a user can change the USER environment variable and use different BaanERP user names. Also, different BaanERP users can have different table privileges in SQL databases. Programs can find the operating system logon name by using the operating system user ID print.

n

Operating system user ID Length: 4 bytes BaanERP user name Length: 8 bytes Date (YYYYMMDD) Length: 8 bytes Time (HHMMSS) Length: 6 bytes Session name Length: 15 bytes Transaction status Length: 1 byte. The transaction status can have the following values: COMMIT_DONE ABORT_DONE

n

n

n

n

n

n

Number of audit rows in the transaction Length: 2 bytes Total bytes of data of this transaction Length: 4 bytes

n

Technical Manual 14-28

Audit management

Transaction Data Format The format of the audit row is as follows:

{ Length of the row { SNAT } Application Data Type of operation Row Data }

n n n n n

2 4 4 1 ...

Length of the row (Length: 2 bytes) SNAT (Sequence Number of action in Audit Transaction) (Length: 4 bytes) Application data (Length: 4 bytes) Type of operation (Length: 1 byte) Row data

Four bytes of space are kept in every audit row to store application data. This data is stored and manipulated by 4GL applications and not by the audit server. The audit server keeps the 4 bytes of extra space to be used later. The type of operation is a single character field, indicating the database action performed on the table. The following characters are used to indicate audited database actions.

n n n n n n

C ­ Create table L ­ Clear table R ­ Drop (remove) table I ­ Insert row D ­ Delete row U ­ Update row

In the audit row, the row data is present only for row level actions. The field values, when stored, are stored in the same format as their data type. This means that a value for a long field is stored as a long data type in the audit row. The length of each field entry in the audit row is the same as the length of the column. The row data for an insert consists of the field values to be inserted of all audited fields, in the order in which they occur in the audit data dictionary. The row data for a delete consists of the field values of the row to be deleted and of all audited fields, in the order in which they occur in the audit data dictionary. Not all fields in the table are updated for an update. Apart from storing field values, an identifier is required to specify the field to which this data belongs.

Technical Manual 14-29

Audit management

Field numbers are used for identifying the fields. The field number is its position in the AUDIT data dictionary, starting with field 0. An entry for a field contains the following information:

n n n n

Field number ­ 2 bytes Is the value changed ­ 1 byte (Y or N). Old value New value

If a field is changed here, both old and new values are stored. If an audited primary key field is not changed, only the old value is stored. If other audited fields are not changed, nothing is stored. For all changes made to all audited fields, entries are made to the audit data.

n

Transaction status Length: 1 byte. Transaction status can have the following values:

- COMMIT_DONE - ABORT_DONE

n

Number of audit rows in the transaction Length: 2 bytes Total bytes of data of this transaction Length: 4 bytes

n

Transaction Data Format: n Length of the row (Length: 2 bytes) n Application data (Length: 4 bytes) n Type of operation (Length: 1 byte) n Row data Four bytes of space is kept in every audit row to store application data. This data is stored and manipulated by 4GL applications and not by the audit server. The audit server keeps the 4 bytes of extra space to be used later. The type of operation is a single character field, indicating the database action done on the table. The following characters are used to indicate audited database actions.

n n n n n n

C ­ Create table L ­ Clear table R ­ Drop (remove) table I ­ Insert row D ­ Delete row U ­ Update row

Technical Manual 14-30

Audit management

In the audit row, the row data is present only for row level actions. The field values, when stored, are stored in the same format as their data type. This means that a value for a long field is stored as a long data type in the audit row. The length of each field entry in the audit row is the same as the length of the column. The row data for an insert consists of the field values to be inserted of all audited fields, in the order in which they occur in the audit data dictionary. The row data for a delete consists of the field values of the row to be deleted and of all audited fields, in the order in which they occur in the audit data dictionary. Not all fields in the table are updated for an update. Apart from storing field values, an identifier is required to specify the field to which this data belongs. Field numbers are used for identifying the fields. The field number is its position in the AUDIT data dictionary, starting with field 0. An entry for a field contains the following information:

n n n n

Field number ­ 2 bytes Is the value changed ­ 1 byte (Y or N). Old value New value

If a field is changed here, both old and new values are stored. If an audited primary key field is not changed, only the old value is stored. If other audited fields are not changed, nothing is stored. For all changes made to all audited fields, entries are made to the audit data.

audit_spec file

The audit_spec file is used to specify audit file parameters. There is one such file for each BSE environment, and it is located in the $BSE/lib directory. The format of the file is Table Name:Company Number:Audit Specifications Following is the meaning of each field.

n

Table Name Indicates the table. The table name can have the following formats: * All tables in all packages. Package All tables in this package, for example tf, td, and so on.

Technical Manual 14-31

Audit management

Package & module code All tables in the module, for example tccom, ttadv. Package, module and table number For example ttadv999, tccom010.

n

Company This can be in one of following formats. * All companies. 100 Single company for example, company 100 only. 100,000 Comma-separated list of companies, for example, company 100 and 000.

n

Specifications The following specifications can be put in the file. Start sequence This is specified by the keyword FROMSEQ or fromseq. The start sequence is always 000. The user cannot change this. To sequence This is specified by the keyword TOSEQ or toseq followed by a sequence number. Note that there must be a space between the keyword and the sequence number. For example:

TOSEQ 999 or toseq 999

If the end sequence is not specified for a table/company combination, the default is 999. Maximum sequence file size This is specified by the keyword MAXSEQSIZE or MAXSEQSIZE followed by a size specification. Note that there must be a space between the keyword and the size specification. The size can be specified in: - bytes for example, MAXSEQSIZE 10000 (10000 bytes) - Kilobytes for example, MAXSEQSIZE 10K (10KB or 10*1024 bytes) - Megabytes, for example, MAXSEQSIZE 2M (2MB or 2*1024*1024 bytes) Note that for kilobyte and megabyte specifications, the characters K and M must be uppercase only and there cannot be a space between the number and the specification character.

Technical Manual 14-32

Audit management

If the maximum sequence size is not specified for a table/company combination, the default is 512K. Whether sequences can be reused or not. If existing sequences can be reused without deleting them first, the keyword SEQREUSE or seqreuse must be put in the specifications. If you do not want this, do not put the keyword in the specifications. If this is not specified for a table, the sequence reused is not allowed. Security Assigned to current table/company number audit files. This is specified as keyword SECURITY or security followed by a security number. Note that there must be a space between the keyword and the security specifications. For example:

SECURITY 4 or security 4

The different security levels and their codes are as follows:

Security Print Clean Maintain Application defined Value 4 8 16 32

The combination of these is explained in the section "Authorizations." To specify Clean and Maintain, security is specified as security 24 (the sum of 8 + 16). Application-defined cannot be combined with Print and Clean. It can be combined with Maintain permissions only. Note that these specifications can be put in any order.

CAUTION

The audit_spec file must have a default entry covering all tables/company numbers. This can be done with an asterisk (*) for table and company number fields. This must be the last line of the file. A sample audit_spec file can look as follows:

ttadv999:000:TOSEQ 99 FROMSEQ 000 MAXSEQSIZE 2M tt:000:seqreuse toseq 49 maxseqsize 1M tf:000:toseq 49 seqreuse maxseqsize 20K *:*:FROMSEQ 000 TOSEQ 499 MAXSEQSIZE 100K

NOTE

The audit_spec file must have read permission for all users and write permission for the Administrator user only. Otherwise users other than Administrator can change the security parameter in the file, which would allow them illegal access.

Technical Manual 14-33

Audit management

Technical Manual 14-34

15

OLE Automation

General

OLE Automation is an industry standard that applications use to expose their OLE objects to development tools, macro languages, and other applications that support OLE Automation. For example, a spreadsheet application can expose a worksheet, chart, cell, or range of cells--all as different types of objects. A word processor can expose objects such as application, document, paragraph, sentence, or selection. When an application supports OLE Automation, the objects it exposes can be accessed by Visual Basic. You can use Visual Basic to manipulate these objects by invoking methods on the object or by getting or setting the object's properties. For example, if you create an OLE Automation object named MyObj, you can write the following code to manipulate the object:

Dim MyObj As Object 'declaration

Sub PrintWordDoc() Set MyObj = CreateObject("Word.Basic") 'start MS Word MyObj.FileNewDefault 'open a new file MyObj.Bold 1 MyObj.Insert "Hello, world." 'insert new text MyObj.FilePrint 'print current file MyObj.FileSaveAs "C:\WORDPROCDOCS\TESTOBJ.DOC" MyObj.AppClose 'close MS Word Set MyObj = Nothing Exit Sub End Sub

This example runs Microsoft Word to create and print a document with the text, "Hello, world." The application that exposes objects is called an OLE Automation server, the application using those objects is called an OLE Automation client.

Technical Manual 15-1

OLE Automation

In fact the OLE Automation interface can be compared to the C Interface of BaanERP. Where the C Interface offers an interface from other C programs to BaanERP, OLE Automation offers an interface from other MS-Windows applications to BaanERP. The implementation is based on the BaanERP 4GL function parse_and_exec_function in the same way as the C Interface.

BaanERP as OLE Automation server

In combination with the BW user interface, BaanERP is also an OLE Automation server. The BaanERP application exposes an object through which clients can call BaanERP dynamic link library (DLL) functions. This section describes how you can create and use this BaanERP object. The BaanERP application exposes just one object, which is the application object. In Visual Basic this object can be created with:

Set BaanObj = CreateObject("Baan.Application")

This starts BaanERP with the BW user interface invisibly, in other words only the Option Dialog icon is displayed. OLE Automation objects, such as BaanObj, can have methods and properties. A method is a function that can be started to perform a certain action. A property is an attribute that has a value. Property values can be set and/or retrieved. The BaanERP application object has the following methods:

n n

ParseExecFunction "dllname", "functioncall" Quit

The BaanERP application object has the following properties:

Name Timeout FunctionCall Error ReturnValue ReturnCall Binary Type long string long string string boolean Value can be Set Set Retrieved Retrieved Retrieved Set

Technical Manual 15-2

OLE Automation

These methods and properties allow Visual Basic programmers to call any function in any DLL. For example:

BaanObj.Timeout = 10 ' 10 seconds timeout BaanObj.ParseExecFunction "mydll", "myfunction(arg1, arg2)" If BaanObj.Error <> 0 Then MsgBox("An error occurred") MsgBox("The return value is " + BaanObj.ReturnValue)

This calls the function myfunction in the DLL named mydll. Note how arguments are passed to myfunction. If arguments are passed by reference they can be changed by the function call, therefore the property ReturnCall contains the modified arguments after the call. The property Timeout is used to prevent blocking on erroneous calls. The property Error contains the return status of the ParseExecFunction call, and the property ReturnValue is the actual return value of the DLL function. If the DLL function returns a long value, it is converted to a string in ReturnValue. To return binary data in ReturnCall arguments, the Binary property must be set to true. ReturnCall can contain null characters. Possible values for the property Error are:

n n n n n n

0 success -1 unknown DLL name -2 unknown function name -3 syntax error in function call -10 timer expired -11fatal error in function

To end an automation session you can quit a BaanERP application as in this example:

Set BaanObj = Nothing

Technical Manual 15-3

OLE Automation

Restrictions

When you use the OLE Automation interface, you must consider the following restrictions:

n

Due to the 3GL function parse_and_exec_function, you cannot supply arrays as arguments to a DLL function. DLL functions with a variable number of arguments or optional arguments are not supported. When a string is passed by reference, the result cannot become longer than the input string. When a string must be filled make sure it is initialized with the same number of spaces as the maximum length that can be returned. The maximum length is defined in the domain of the variable. The maximum size of the FunctionCall string is 4KB (Bshell limit). The maximum size of the ReturnValue string is 4KB (Bshell limit). Two client applications cannot simultaneously use the same BW to make DLL function calls.

n

n

n n n

Example: Import BaanERP users

This example fills an MS-Excel spreadsheet with the names of all BaanERP users. To do this, you must:

n n

Implement DLL functions to obtain the names of the users from the database. Implement some Visual Basic code in MS-Excel.

Technical Manual 15-4

OLE Automation

DLL function example

The following DLL, called demo.dll, contains two functions that retrieve the names of the users from the database. One function initiates the query and gets the first name, and the other gets the next name. When the last record has been returned, an empty string is returned.

table tttaad200 long sql_id function extern string get_first_user() { string sql_query(512) string user(512) switch.to.company(0) sql_query = "select ttaad200.user from ttaad200" sql_id = sql.parse(sql_query) sql.exec(sql_id) e = sql.fetch(sql_id) if e = 0 then user = ttaad200.user else user = "" endif return(user) } function extern string get_next_user() { string user(512) e = sql.fetch(sql_id) if e = 0 then user = ttaad200.user else user = "" endif return(user) }

Technical Manual 15-5

OLE Automation

Visual Basic example

MS-Excel contains Visual Basic for Applications (VBA), which allows for scripting to control both the Excel application and other applications through OLE Automation. The following is the Visual Basic source that calls the DLL functions and displays the results in a spreadsheet. The subroutine GetBaanERPUsers is an MS-Excel macro that can be invoked through buttons or menus on the spreadsheet.

Dim user As String Dim BaanObject As Object Sub GetBaanERPUsers() On Error GoTo CannotConnectToBaanERP ' run BaanERP Set BaanObject = CreateObject("Baan.Application") On Error GoTo BaanAutomationError ' get first user BaanObject.ParseExecFunction "demodll", "get_first_user()" If (BaanObject.Error <> 0) Then GoTo BaanAutomationError user = BaanObject.ReturnValue Row = 1 Column = 1 While (user <> "") ' fill the spreadsheet Worksheets("Main Sheet").Cells(Row, Column) = user Row = Row + 1 If Row > 15 Then Row = 1 Column = Column + 2 End If ' get next user BaanObject.ParseExecFunction "demodll" "get_next_user()" If (BaanObject.Error <> 0) Then GoTo BaanAutomationError

Technical Manual 15-6

OLE Automation

user = BaanObject.ReturnValue Wend ' exit BaanERP Set BaanObject = Nothing Exit Sub ' error handling CannotConnectToBaanERP: MsgBox "Unable to connect to BaanERP" Exit Sub BaanAutomationError: MsgBox "A BaanERP automation error occurred" Set BaanObject = Nothing Exit Sub End Sub

Example: Using BaanERP SQL

The following example fills an MS-Excel spreadsheet using BaanERP SQL. To implement this, a DLL called ottdllsql_query has been developed to parse and execute the query. To receive more information about this library, enter the following command: *> bic_info6.2 ­eu ottdllsql_query

DLL information

The DLL ottdllsql_query contains:

n

Functions to parse, execute, and stop a query: - olesql_parse - olesql_fetch - olesql_break - olesql_close Functions to import query results into Visual Basic: - olesql_getstring - olesql_getint - etc

n

Technical Manual 15-7

OLE Automation

n

A function to convert an Easy SQL query to a string: - easysql_to_olesql Declaration of external variables, such as: - olesql_count - olesql_float0, olesql_float1 ... olesql_float9 (double variables) - olesql_int0, olesql_int1 ... olesql_int9 (long variables)

n

An MS-Excel example is installed in the SAMPLES directory of BW (BAAN.XLS). This spreadsheet contains several macros. The first macro, GetBaanUsers, shows a number of BaanERP users on the spreadsheet Worksheet Users. To use it, press the button on the Worksheet Users that starts this macro. For more information refer to the Visual Basic code in Worksheet Module 1. The second macro, GetItemCount, shows all item groups in BaanERP with the numbers of items per item group on the spreadsheet Worksheet Itemcount. Press the button on the Worksheet Itemcount to start this macro. To run the macro you have to insert an Easy SQL query in the BaanERP Application. To insert the query, start the Query Data (ttadv3580m000) session, insert a record named item and choose Maintain Query by Text Manager. In the text editor enter the following query:

select from group by order by tiitm001.citg, count(tiitm001.item) tiitm001 tiitm001.citg tiitm001.citg | Item group | Item | Item data

For more information refer to the Visual Basic code.

Technical Manual 15-8

Information

Microsoft Word - U7040cus.doc

240 pages

Report File (DMCA)

Our content is added by our users. We aim to remove reported files within 1 working day. Please use this link to notify us:

Report this file as copyright or inappropriate

35644


You might also be interested in

BETA
5188.book
Microsoft Word - U7040cus.doc