Sunday 22 November 2015

Baan Technical Architecture (Source- baanboard.com)

There are several ways of looking at the architecture behind Baan. From an administrator's perspective the chain model is prefered because it serves as a troubleshooting roadmap for any kind of connectivity issue. Just follow the chain until you find a broken link. If no links are broken, then it is time to call in the cavalery or put on your System Administrator's hat.
The hipbone's connected to the backbone...

The Chain Model

Presentation layer

  • Client (BW/BA/BI/BX/Worktop)

Application layer

  • Director (${BSE}/bin/ipcboot6.2)
  • Mapper (${BSE}/lib/ipc_info)
  • Wrapper (optional)
    • ENV trunk (optional)
  • Virtual Machine (bshell6.2)
    • Variables
      • lib/defaults/all
      • lib/defaults/bshell
      • lib/user/uname
  • Database Driver
    • Variables
      • db_resource

Database layer

Database

User connections in Baan (let's leave OpenWorld? out of the picture at this time. Baan does that in most of their versions too.) originates from the client. The client first calls the Director, the executable ipcboot6.2 (extention varies by tools set), which in turn collects information from the Mapper (ipc_info) to direct the client to its assigned virtual machine. Instead of going directly to the virtual machine, it is recommendable to have a wrapper script in place. This script can perform several household tasks (like checking the number of allowed connections per user, create a log of the users connection attempt, etc.) before calling the bshell6.2 executable. It is also recommendable to call an external file from the wrapper script that contains all required environment variables for Baan, the database and any third party software that may require these. Placing these vars in a separate file provides transparancy and easy maintenance. Once loaded, the virtual machine in turn reads variables from a number of different files before starting the database Driver. The database driver collects variable information from the db_resource file and makes the final link to the system's back-end.

Client

BW

BA

BI

BX

Worktop

Webtop


IPC_INFO

Here is an example of what ipc_info might look like. Older tools versions contain 6 columns.
bshell p ${BSE}/bin/mywrapper
bshell.test p ${BSE}/bin/mynewwrapper
bshell.trace p ${BSE}/bin/mywrapperthatstartsabshellwithtraceoptions
bshell.oratrace p ${BSE}/bin/mywrapperthatstartsabshellwithdbdrivertraceoptions
bshell.inst p ${BSE}/bin/bshell_inst6.2
audit p ${BSE}/bin/audit_srv6.2
sh_server s ${BSE}/bin/sh_server6.2
fs6.2 m ${BSE}/bin/fs6.2
nserver s ${BSE}/bin/nserver6.2
informix p ${BSE}/bin/inf_srv6.2
oracle7 p ${BSE}/bin/ora7_srv6.2
oracle8 p ${BSE}/bin/ora8_srv6.2
sybase p ${BSE}/bin/syb_srv6.2
db2 p ${BSE}/bin/db2_srv6.2
When the BW client connects to Baan, it scans the ipc_info file�s first column for an entry that matches the Bshell Name defined in the bshell environment. It then executes the corresponding field in the last column, which can be either the Baan Virtual Machine, or (as mentioned above) a wrapper script.
The second column in the table indicates whether the connection to the executable is made through pipe (p) or socket (s) or duplex (aka combo) mode (d). The combo mode is used for database drivers only and causes the database driver to be loaded in the virtual machine as a shared library, rather than as a separate process.


Wrapper Scripts

There is but one rule when building a bshell wrapper, which is that at some point in your code, you'll have to call the bshell6.2 executable.
This is the basis of all wrappers. Stripped to the bone it would look like:
#!/bin/ksh
${BSE}/bin/bshell6.2 $*
This script does nothing but start the baan virtual machine and is therefore pointless, but it serves as the foundation for anything you care to add on top of it.
#!/bin/ksh
. ${BSE}/setenv
${BSE}/bin/bshell6.2 $*
This version calls the file setenv, which contains all variable settings that are applicable to the Baan application. It could look like this:
export BSE=/opt/apps/baan/5.0b/bse
export BSE_TMP=${BSE}/tmp
export PATH=${PATH}:${BSE}/bin
export TERM=vt100
export ORACLE_BASE=/opt/apps/oracle
export ORACLE_HOME=/opt/apps/oracle/product/8.0.5
export ORACLE_SID=mybaan
export BDB_DATE=MM/DD/YYYY
export BDBCO=100
export FSRCO=100
export BDBSY=000
export BDB_LANG=2
export SESSION_TIMEOUT=120
export DS_TIMEOUT_DETECT=10
export DS_MAX_WAIT=60
Important here is that the $BSE and $BSE_TMP variables get set plus the database path (Oracle in this case).
An other addition could be to log all connection attempts in a file called loghist. This would make the wrapper script look like this: 
#!/bin/ksh
. ${BSE}/setenv
print `date` " | ${USER}" >> ${BSE}/log/loghist
${BSE}/bin/bshell6.2 $*
In addition, several tests can be performed on the user that is trying to connect (like checking the number of existing connections) and action can be taken accordingly before a virtual machine is launched.


BSHELL6.2

The executable bshell6.2 is the Baan virtual machine. Although everybody has heard of the term, in my experience not too many people(including seasoned Baan Admins) truly understand this concept or the rammifications of it. Foldoc's (second) definition of a VM is "A software emulation of a physical computing environment", which fits the Baan model perfectly. Picture your bshell as a PC, sitting somewhere out in serverland and you are connecting to it with a remote control program called your BW client. The benefit of using this method is platform independence, which was a big issue for ERP vendors during the 90s. [personal note: I never understood this need. When purchasing a multi-million dollar ERP program, one would think there is room in the budget for a dedicated server. Like all compromises, platform independency is a trade-off. Memo to ERP barons: Make a deal with a hardware manufacturer and just throw in your prefered, tested, QA'd server for "free".]
Bshell Options
The bshell can be started with several options. These options can be set on the client level or at the command line. Some can even be invoked after the bshell has started. The list below was sitting on my hard drive, but I believe it comes from Baanboard and we have NPRao to thank for it.

Options from the bshell6.x

(ntbshell.exe on NT)(can also be set with "-- [options] [program...]" in the Option Dialog window in bw or BECS)(*) = documented in bshell6.2
-appendlog : append to logfile (only useful with -logfile option)
-ba : connect with ba display server
-bx : connect with bx display server
-deftext : show bshell texts
-dbgbdbact : show the Baan database activities initiated from the bshell
-dbgcpu : use debug version of the cpu
-dbgdata : show datainput options (not for fields!)
-dbgenums : show loading of enums
-dbgfdev : debug file access
-dbgfile : show successfully opened sequential files
-dbgflow : show program flow (6.1c.06.03+)
-dbgfun : debug functions
-dbggpvar : debug get & putvar
-dbginstr : show bshell cpu instructions
-dbgjvmi : show JavaVM integration actions
-dbglck : show locking errors
-dbglts : debug Language Translation Support (LTS) X=dump, B=RDD, F=component
-dbgmem : show all memory statistics (see below)
-dbgmemblk : show memory usage per block
-dbgmemfree : show free memory list
-dbgmemtot : show total memory usage
-dbgmemused : show used memory list
-dbgmesg : stop debugger when warning message is sent to the display server (*)
-dbgmulact : show process actions (activate,sleep,kill etc.)
-dbgobj : show object information
-dbgorb : debug ORB (Object Request Broker) integration (where available)
-dbgpty : debug pseudo terminals pty
-dbgref : show reference paths
-dbgrefer : show references
-dbgres : show loaded resources
-dbgsched : debug scheduler
-dbgsrdduse : show srdd usage
-dbgsrv : show bdb server type
-dbgstack : dump 3GL stack traces on function entry
-dbgtss : Show TSS-diagnostics and go to debugger on TSS-error
-dbgflow : Unknown
-deftext : show bshell texts
-delay : delay for seconds before continuing (useful for attaching with a debugger:
set breakpoint at the function 'delay_ready')
-dsunicode : communicate with the display driver using Unicode strings (*)
-keeplog : don't remove the logfile after ending the bshell
-logfile : log stdout/stderr output in
-logtag <tag> : used together with -logfile. The <tag> is used in the logfile and is
especially useful when logging from multiple bshells (*)
-logtime : add time stamps to bshell log output (combine with -dbgmulact)
-mdebug : display bshell messages sent to display server
-nodebug : disable debugger.
-nolog : stdout and stderr will go to the controlling terminal (if possible - on remote
connection no output will appear)
-nounicode : don't read unicode files $BSE/lib/unicode/*.(N2U|U2N). (*)
-r : show resources
-server : run as a server without UI
-set var=val : set environment variable 'var' to 'val' (see below)
-vV : show program version
-windownames : pass unique window names to user interface for testtools (*)

Unknown options

-auto
-text "vi %s" vi +%d %s

With the option "-- -set var=val"

you can also pass other environment setting to the bshell (and underlaying processes) that have a special meaning.

Tracing and Logging:

-set TT_SQL_TRACE=value (or added values)" Logging information from the Baan database driver. Maximum value = 0277367
-set TT_SQL_TRACE=0000001 Parse Query Strings and show information
-set TT_SQL_TRACE=0000002 Show RDD usage of Query
-set TT_SQL_TRACE=0000004 Final Dump info queries
-set TT_SQL_TRACE=0000020 Database Actions ("Operand" "Operator")
-set TT_SQL_TRACE=0000040 Show queries wih their QID
-set TT_SQL_TRACE=0000100 Mode of query
-set TT_SQL_TRACE=0000200 Show query exec. times
-set TT_SQL_TRACE=0001000 Show table dependencies (matrices)
-set TT_SQL_TRACE=0002000 Show calls of internal SQL functions
-set TT_SQL_TRACE=0004000 Show query eval. plan (client+server)
-set TT_SQL_TRACE=0010000 Show quey ev. plan (server)
-set TT_SQL_TRACE=0020000 Show all full table scans
-set TT_SQL_TRACE=0040000 Database Action Messages
-set TT_SQL_TRACE=0200000 Query Distribution Plan
-set TT_SQL_TRACE=0400000 Show current time to level of milliseconds
-set BDB_DEBUG=value (or added values)" Sets debugging link between client and server
-set BDB_DEBUG=0001 Server information
-set BDB_DEBUG=0002 Communication between Server and Client
-set BDB_DEBUG=0004 Show information on currently set locks
-set BDB_DEBUG=0010 Show references between tables
-set BDB_DEBUG=0040 Show all tables using native storage format
-set BDB_DEBUG=0100 Permissions
-set DBSLOG=value (or added values)" Logging information from the online processing of the database driver.
-set DBSLOG=0000001 Data dictionary info of tables
-set DBSLOG=0000002 Query info (SQL level 1)
-set DBSLOG=0000004 Query info (SQL level 2)
-set DBSLOG=0000010 Row action info
-set DBSLOG=0000020 Table action info
-set DBSLOG=0000040 Transaction info
-set DBSLOG=0000100 DBMS input/output data (SQL level 2)
-set DBSLOG=0000200 Admin file info (SQL drivers)
-set DBSLOG=0000400 DBMS SQL statements
-set DBSLOG=0001000 General debug statements
-set DBSLOG=0002000 Query processing info
-set DBSLOG=0004000 Data buffering info (communication)
-set BLAT=option (may be added and combined)" starts Binary Logging And Tracing, spawning the whole range from bshell to the database driver (6.1c.06.03+/7.1c.02+)
-set BLAT="off"
-set BLAT="default" default is "t0 s1 t1 s1 t2 s0 t3 s0 th 5 t4 s011 th 5"
-set BLAT="logfile ""<path_and_filename>""" redirects output to filename (defaults to $BSE/tmp/blat.log)
t0 = proc
-set BLAT="proc s 00" no logging of Baan processes and their hyerarchy
-set BLAT="proc s 01" logging Baan processes and their hyerarchy
t1 = sess
-set BLAT="sess s 000" no logging lifetime of Baan sessions and propagation
-set BLAT="sess s 001" ... on 3GL/BDB level (client)
-set BLAT="sess s 002" ... on DBS level (database driver)
-set BLAT="sess s 004" ... on DBDL level (database driver/RDBMS integration)
-set BLAT="sess s 010" ... on DBS level (audit driver)
t2 = retry
-set BLAT="retry s 00" no logging of handling retry.points
-set BLAT="retry s 01" logging of handling retry.points
t3 = trans
-set BLAT="trans s 000" (commit and abort) transaction related logging off
-set BLAT="trans s 001" ... on 3GL/BDB level (client)
-set BLAT="trans s 002" ... on DBS level (database driver)
-set BLAT="trans s 004" ... on DBDL level (database driver/RDBMS integration)
-set BLAT="trans s 010" ... on DBS level (audit driver)
-set BLAT="trans th value" ... allows logging with threshold value [seconds]
t4 = sql
-set BLAT="sql s 000000" no logging of handling queries
-set BLAT="sql s 000001" ... 3GL/BDB level: Log aggregated information
-set BLAT="sql s 000002" ... 3GL/BDB level: Log all actions
-set BLAT="sql s 000010" ... 3GL/BDB level: Log BaanSQL text
-set BLAT="sql s 000020" ... 3GL/BDB level: Log bind variables
-set BLAT="sql s 000040" ... 3GL/BDB level: Log selected data
-set BLAT="sql s 000100" ... DBdriver Level2: Log aggregated information
-set BLAT="sql s 000200" ... DBdriver Level2: Log all actions
-set BLAT="sql s 001000" ... DBdriver Level2: Log BaanSQL text
-set BLAT="sql s 002000" ... DBdriver Level2: Log bind variables
-set BLAT="sql s 004000" ... DBdriver Level2: Log selected data
-set BLAT="sql s 010000" ... DBdriver Level1: Log aggregated information
-set BLAT="sql th value" ... allows logging with threshold value [seconds]
Note1: Processing of the loggings is supposed to be done by using tools.
See $BSE/api/blat (and Perl module Blat.pm)
Note2: Instead of spaces as (the default) separator an alternative (set by BLATSEP) can be used to
make it possible to have one argument on the environment variable assignment. -set BLATSEP=_
Note3: Not all options are implemented yet
Note4: the value of the threshold will allow only values that exceed the threshold value to be logged,
may also be "off" or "default".
Note5: bls6.x converts BLAT logfiles to readable format: open source example included
Note6: btop6.x reads the top <n> queries from the BLAT logfiles (logged with "sql s 011" option).
 

-set BAAN_ART_TRACE=[0|1|2|5]" Set this variable to debug the ARTM code in the application scripts.
-set BAAN_ART_TRACE=0 Tracing disabled.
-set BAAN_ART_TRACE=1 Basic tracing. Transactions are shown.
-set BAAN_ART_TRACE=2 Basic tracing plus the binary blocks that are sent to the ARM library
-set BAAN_ART_TRACE=5 The trace information is send to the file $BSE/tmp/bshell.pid.
-set BAAN_ART_USER='BAAN' Username under wich the transasctions will be registered
-set BAAN_ART_LIB=/opt/perf/lib/libarm.o Location of ARM library
Enable ART in $BSE/lib/defaults/all with
art_enable:1
art_trace:1
art_user:baan

Common BShell environment settings

Several common settings that influence the user environment overrule user settings in RDD
-set BAAN_WIN_TITLE=string_value sets a caption for the menu browser other than the default,
can be composed with:
%C Company Name
%c Company Number
%h Host Name
%p Package Combination
%s Session Code
%S Session Name
%u Userid
-set FONT=fixedsys use a non-standard font within BW
-set FONT_WIDTH=width_value use a non standard font width
-set FONT_HEIGHT=height_value use a non standard font height
-set BSE_COMPNR=company to login into specific company, note package combination must match or
no difference with current package combination
-set BSE_LOG_COMPNR=company to login to specific logistics company (>= Tools 7.3a, see solution 141113)
-set BSE_FIN_COMPNR=company to login to specific finance company (>= Tools 7.3a, see solution 141113)
-set BSE_LANG=value to change language (1=Dutch, 2=English, 3=French, 4=German etc.)
-set BSE_TMP=temporary folder to use a temporary folder other than $BSE/tmp
-set COMP_NR=company same as BSE_COMPNR
-set DS_AS=bshell_name [for ba6.1 only, to specify a specific bshell name from ipc_info] :
like setting Bshell Name in bw
-set DS_MAX_WAIT=value the timeout duration [seconds] in which BW has to respond to the sync message,
and override the default of 30 seconds
-set DS_TIMEOUT_DETECT=value the timeout duration [minutes] before the bshell starts sending a
sync message to BW
-set PACKAGE_COMB=package combination to login into specific package combination
-set NO_PC_CHECK=[0|1] if 1 then skip package combination/user/company check when starting session (sol 127095)
-set SESSION_TIMEOUT=value the number of minutes the bshell can be inactive before it terminates itself,
when the timeout is triggered a message is sent to the UI and the bshells stops
-set SUPPRESS_WINHELP=1 if you choose help the baan help appears instead of the windows version
of the baan help
-set UI=ascii allows to run bw with an ASCII interface
-set NO_WORKTOP=1 allows Gemini (Baan 6) users to run with just bw inteface, since gemini requires worktop by default
-set USE_SHM_INFO=value enables or disables shared memory use (*)
-set USER=baan_user to login using a different user (use the same system login with several Baan logins)
-set USR_DBC_RES=file specifies alternative resource file for client to read after the file
$BSE/lib/defaults/all is read.
Allows to overrule settings in the all file with setting a different value in the specified file
BShell settings for job management
Settings for job management
-set BSH_JOB=job set a job to active when starting the bshell
-set BSH_JOBOK=jobokfile set the file to be written to if job completes succesfully, or progress of job if BAAN_EXTJOB is set.
-set BAAN_EXTJOB=2 to turn on writing job history to the BSHJOB_OK file.
-set BAAN_JOBDAEMON=x Unsure of purpose, referenced in solution 72399.
BShell environment settings for specific tasks and applications
Settings for programmers and other specific tasks
-set AUDIT_FILE_PATH=folder set the location of the audit files
-set BAAN_SCM_GRP=value sets your checkout directory so more everyone that uses the same group
can see your changes.
-set BDB_DRIVER=value Sets database specifications
-set BDB_MAX_SERVERS_=value Defines the mechanism for schedule SCHEDULE closing idle server sessions
-set BDB_MAX_SESSION_=value defines mechanism for closing schedule SCHEDULE idle driver sessions
-set BDB_MAX_SESSIONS=value defines number of sessions per driver
-set CUNO_SRC=1 allows for exporting sources (used by Baan PEG with SMT)
-set DBSLOG_LOCK_PROF Specifies lock time above which locks are logged (*)
-set DBSLOG_LOGNAME=file Allows file name to be specified for logging (*)
-set ENABLE_REFMSG=value causes logging of denied update or delete actions (*)
-set LOCK_RETRY=n defines the number of lock retries and the sleep period between retries
-set MAX_RETRY=n the system may return n times to a retry point in case of an abort in an
update action, default=10
-set RDS_FULL=value to define max. nr. rows transfered between client and server as one block
(good for imports/exports)
-set SSTS_SET_ROWS=value Sets number of rows read ahead (single table single row)
-set TEST_RETRY=n each retry point is triggered n times
-set HIDE_FORMAT_ERRORS=[0|1] hide format errors due to $BSE/lib/datecurr, see solution 133239 (>= Porting Set 7.3a.03)
-set AFSLOG=1 Will log AFS calls in file afs.log
-set USE_MSJAVA_DLL=[0|1] configure use of Sun JVM (0) rather than default MS JVM (1 or unset) (>= 6.1c.07.03)
-set USE_ENHANCED_HOSTID=1 set to enable MAC address detection if NetBios protocol unavailable (>= 6.1c.07.04)
-set USE_MBTEXTCONV=[0|1] Enable multibyte text conversion when using notepad as text editor (sol 131939)
-set OLETRACE=1 Turn on tracing of OLE calls, useful for debugging worktop
dbsinit specifies optimistic or pessimistic reference checking and some MultiByte settings
inf_use_prepare_cache:0 in $BSE/lib/defaults/db_resource turn off the Prepare Statement Cache

-set USR_DBS_RES=file Specifies alternative resource file for server
Audit Debugging
-set AUDITLOG=octalval Turn on debugging of audit server, normally not enabled. Level of debugging is set by building up a value from the following octal values:
0001 General information.
0002 Print audit rows generated.
0004 Print audit-data dictionary for table.
0010 Print data structures such as information header, sequence header, and
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.
MS-SQL Specific resources
-set MSQL_JOIN_HINT=NONE Disable join hints, by if unset (default) join hints are default enabled. (>= Porting Set 7.3a.03)
Some unknown variables
-set BMASK=02
-set CORE=
-set LINES=
-set USE_BMASK_AS_ABSOLUTE=1
-set BSH_FRSES
-set IPC_NOSPAWN=1. This causes a fork() i.s.o. a spawn() between ba and bshell
-bse. Something to do with setting the bshell environment. (See porting set 7.3a.03 bugfix notes)
Call Graph Profiler (Porting Sets 6.1c.07.03+, 7.1d.03+, 7.3a.04+)
Creates a directory full of HTML files showing profile information.
-set PROFILE_ALL=1 Start profiling for all objects
-set PROF_DIR=<dir> Output files to specified directory, uses ${BSE_TMP} if unset
-set PROF_RTIME=1 Add section sorted on wall clock time (real time)
-set PROF_CLIENT="<action>:<dir>": Only Porting set 7.3a+
e.g. -set PROF_CLIENT="start:c\temp"
action = Either "start" or "save" to start client machines local browser
dir = full pathname to a directory on the local client PC.
no_ipc_msg_window:1 workaround for low number of users on Windows, see solution 121503 & porting set bugfixes76a02.txt

1 comment:

  1. The article is well-written, well-framed and very much informative. A lot more can be learned from this write-up. Pegasi Media Group is the world’s leading database vendor that provides you the email list that you want. It is a well-reputed database vendor in the market or industry. The organizations all over the world prefer to work with Pegasi Media Group to expand their businesses. The organizations that are working with us are very much delighted with our services. We aim at rendering best services to our clients. For further information, or to give your suggestions, please do not hesitate to contact us.Baan Users Email List

    ReplyDelete