HowTo: Baan Tracing DBSLOG (Part II)

Now you’ve generated your DBSLOG=1570 output let’s look at what you’ve got:
DBSLOG is nice enough to tell you in your logfile exactly what flags were used to generate it.

<6692> 2009-11-09[20:17:44]: Logging started mode 01570
        ---- LOG ROW   INFO [0000010] ----
        ---- LOG TABLE INFO [0000020] ----
        ---- LOG DB    INFO [0000040] ----
        ---- LOG DBMS  INFO [0000100] ----
        ---- LOG SQL   INFO [0000400] ----
        ---- LOG DEBUG INFO [0001000] ----

This next part is more valueable than you might think. These are the parameters that your bshell/driver are picking up. This is a great place to look if you’ve set a parameter in your db_resource or tabledef and it doesn’t appear to be getting used.

It’s also a great way to find hidden tuning parameters ;)

Portingset mode 6.1c

oracle_attach_server
Timeout values : [9000] [900] [900] [900] [900]
allocate_sql_buffer_area size 32000.
oracle client version = 10.2.0.4.0
oracle_attach_server done.
Resources:      (E = env, P = putenv, D = default )
    lock_retry                E     "0"
    locale                      D   ""
    bdb_max_session_schedule  E D   -1
    bdb_max_sessions          E D   -1
    rds_full                  E     5
    tt_sql_trace              E D   037777777777 (oct)
    dbslog                    E     01570 (oct)
    dbslog_name               E D   "dbs.log"
    dbsinit                   E     021 (oct)
    baan_single_shot_queries  E D   0
    max_tables_joined         E D   -1
    cs_owner                    D   0 (oct)
    enable_refmsg             E D   0
    use_binary_columns        E D   0
    hint_idx_weight_equal     E D   1
    hint_idx_weight_range     E D   1
    hint_idx_weight_factor    E D   < 1.00000000>
    tbase_refresh               D   -1
    concat_expr               E D   ""
    aud_init                  E D   0
    audit_mask                E D   0 (oct)
    baan_sql_trace            E D   0 (oct)
    baan_sql_cacherows        E D   -1
    nls_lang                  EP    "american_america.we8iso8859p1"
    nls_sort                  EPD   ""
    oracle_home               EP    "/apps/oracle/10gR2"
    oracle_service_name       E D   ""
    oracle_sid                EP    "BAANTEST"
    two_task                  E D   ""
    oracle_client_home        E D   "/apps/oracle/10gR2"
    oracle_server_home        E D   "/apps/oracle/10gR2"
    oracle_local_template     E D   ""
    ora_sqlnet_compression    E D   1
    epc_disabled              EPD   "TRUE"
    ora_max_array_fetch       E     5
    ora_max_array_insert      E     5
    baan_oracle_prefetch      E D   1
    ansi_outer_join           E D   0
    use_oci7_interface        E D   0
    max_free_cursors          E D   32
    retained_cursors          E D   50
    max_sql_buffer            E D   32000
    sql_trace                 E D   ""
    ora_timeout               E     "{9000,900,900,900,900}"
    optimizer_goal            E D   ""
    ora_alter_session         E D   ""
    ora_default_tablespace    E     "baandata"
    ora_temporary_tablespace  E     "temp"
    ora_init                  E     0101000 (oct)
    ora_level1                E D   0
    max_open_cursors          E D   245
    ora_date                  E D   0
    oraprof                   E D   < -1.00000000>
    oraprof_name              E D   "oraprof"
    orastat                   E D   < -1.00000000>
    orastat_name              E D   "orastat"

Next it starts the connection to the database process. I’ll simulate an error 510 (database not on) so you can see where you can see where it would go wrong in the connection.
Here you see the error 510, the resulting oracle errors

Error ORA-1034 occurred during logon.
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory

and the info you need to find the problem:

ORACLE_SID=bla

Naturally, my database SID isn’t “bla”

Here’s the full trace:

Msg_type 13 received.
Msg_type 2 received.
oracle_open_session sid 1.
Open session : logon
ora_logon : name = 'bsp', pwd = .. ora_session 0x816f588
using resource oracle_local_template
oci_link_server ( dbase = '(DESCRIPTION=(SDU=8192)(TDU=8192)(ADDRESS=(PROTOCOL=beq)(PROGRAM=/apps/oracle/10gR2/bin/oracle)(ARGV0=oraclebla)(ARGS='(DESCRIPTION=(LOCAL=YES)(SDU=8192)(TDU=8192)(ADDRESS=(PROTOCOL=beq)))')(ENVS='ORACLE_HOME=/apps/oracle/10gR2,ORACLE_SID=bla'))(CONNECT_DATA=(SID=bla)))' ) : first time linked : attach connection : # logon = 1 : OK
ora_logon : OCISvcCtx  0x81b2a78 Allocated
oracle server version = 10.2.0.4.0

ora_error 1034 dbs_errno 510.
oci_unlink_server ( dbase = '(DESCRIPTION=(SDU=8192)(TDU=8192)(ADDRESS=(PROTOCOL=beq)(PROGRAM=/apps/oracle/10gR2/bin/oracle)(ARGV0=oraclebla)(ARGS='(DESCRIPTION=(LOCAL=YES)(SDU=8192)(TDU=8192)(ADDRESS=(PROTOCOL=beq)))')(ENVS='ORACLE_HOME=/apps/oracle/10gR2,ORACLE_SID=bla'))(CONNECT_DATA=(SID=bla)))', # logon = 1 ) : detach connection : OK
ora_logon error: ora_session 0x816f588 err 510
FATAL /view/port.6.1c.07.08/vobs/tt/servers/ORACLE_2/ora_native.c:#1769 :

Error ORA-1034 occurred during logon.
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory

Error BDB-510 returned.
Check the Oracle settings:
NLS_LANG = 'american_america.we8iso8859p1'
ORACLE_HOME (client) = '/apps/oracle/10gR2' (resource oracle_client_home)
ORACLE_HOME (server) = '/apps/oracle/10gR2' (resource oracle_server_home)
Oracle Service Name = '' (resource oracle_service_name --> TWO_TASK)
ORACLE_SID = 'bla'
Connection used oracle_local_template ( ? = oracle_server_home, @ = oracle_sid ):
(DESCRIPTION=(SDU=8192)(TDU=8192)(ADDRESS=(PROTOCOL=beq)(PROGRAM=/apps/oracle/10gR2/bin/oracle)(ARGV0=oraclebla)(ARGS='(DESCRIPTION=(LOCAL=YES)(SDU=8192)(TDU=8192)(ADDRESS=(PROTOCOL=beq)))')(ENVS='ORACLE_HOME=/apps/oracle/10gR2,ORACLE_SID=bla'))(CONNECT_DATA=(SID=bla)))

Logon failed; errno 510
Msg_type 1 received.
In detach server
oracle_detach_server
oracle_detach_server done.
In detach server

HowTo: Baan Tracing DBSLOG (Part I)

DBSLOG is my favorite toy. It looks all communications between the driver and the database.

I’m mostly familiar with the Oracle driver, so that’s what i’ll show here. Other drivers look different in DBSLOG.

Here are the options that can be sent to DBSLOG:

00000 – Turn DBSLOG tracing off
00001 -  Display data dictionary information on queried tables
00002 -  Display Query information for level one database queries
00004 -  Display query execution plan during a level two query
00010 -  Row level action (read, modify, delete) information
00020 -  Table level action information
00040 -  Translation information
00100 -  DBMS input/output data on a level two query
00200 -  Administrative file information for SQL drivers
00400 – DBMS SQL query statements
01000 -  General debug statements
02000 – Query processing information
04000 – Data buffering information passed thru communication channels

Basically you add the values to get the level of debugging level you want.

You might think that setting DBSLOG=99999 would give you everything you need, but that’s not always true. Some flags are mutually exlusive, and some flags add so much information as to make the file unreadable.

That’s why I always use DBSLOG=01570 which gives you:

General debug statements (1000) +
DBMS SQL query statements (400) +
DBMS input/output data on a level two query (100) +
Translation information (40) +
Table level action information (20) +
Row level action (read, modify, delete) information (10)

Unlike the bshell debugging commands DBSLOG is set via the environment so you would use

Unix:
export DBSLOG=01570
Windows
set DBSLOG=1570
Baan:
-- -set DBSLOG=1570

The logfile will be called dbs.log and will be located in your home directory in unix or $BSE/tmp in windows.

HowTo: Baan Tracing bic_info6.1

Now that you know where your object is located. You probably need some more information about it.

Before we saw that the object for my item master oitm0101 was located here:

/apps/baan/bse/application/tiB40U_c4_stnd/otiitm/oitm0101

Now if we want some info we can use one of three commands

what /apps/baan/bse/application/tiB40U_c4_stnd/otiitm/oitm0101
- or (if you're fancy) -
what `explode6.1 otiitm0101`
- or -
bic_info6.1 -w oitm0101

You can use bic_info.exe for Windows.

Both will give the result below:

---------------------------OBJECT IDENTS--------------------------------
@(#)/b40c/bse/application/tiB40_c5/ptiitm/pitm0101g, 04/11/16 [20:34], From wtreur
@(#)-DREL6_1
@(#)4GLE_BUILD_BaanIVc7_1184 -- bic_global@@/main/bugfixB40c6/developmentB40c7/10
@(#)4GLE_BUILD_BaanIVc7_1184 -- bic_object@@/main/bugfixB40c6/developmentB40c7/2
@(#)4GLE_BUILD_BaanIVc7_1184 -- bic_event@@/main/bugfixB40c6/developmentB40c7/1
[....]

Here you can see the compile date of the object, this is critical with dealing with Baan support
as they can usually map that object info to a defect or solution number assuming it’s a standard object.

HowTo: Baan Tracing DBGOBJ

dbgobj is one of the best bshell debugging options you have available to track down a problem.

It will give you the actual path to an object: this is essential if you have multiple VRCs to find out the VRC that the bshell is using (not always what you expect, and not always the same as explode6.x)

To execute this trace you add -dbgobj to your bshell. it’s best to add two other debugging commands to your bshell so you can specify your logfile:
-keeplog and -logfile

In Unix that would look like

ba6.1 -- -dbgobj -keeplog -logfile /tmp/bshell.log

In Windows you add it to the command line

Command: -- -dbgobj -keeplog -logfile c:\bshell.log

The output file will look like this:

---------------------------OBJECT HEADER--------------------------------
B:0000005:::(00001):Object      = otiitm0101
B:0000006:::(00001):Pathname    = /apps/baan/bse/application/tiB40U_c4_stnd/otiitm/oitm0101
B:0000007:::(00001):Magic               = [_bic_dll_]
B:0000008:::(00001):relno               = 61
B:0000009:::(00001):obj_revision        = 1
B:0000010:::(00001):object_flags        = 10

The key to look at is the path to the object. you can see here that I’ve got object otiitm0101 Installed in tiB40U_c4_stnd which is my standard update VRC for PMC. So we know that I haven’t customized my item master (thank goodness)

Error Tracing for End Users

I was going through some old documents of mine from back when I worked for Baan Support. I found a nice little guide that (I’m pretty sure I wrote) that may or may not still be available via support channels.

I got to thinking about it, and decided that instead of linking an old doc i wrote years ago I’d update it and post it in-line as a series.

Baan Tracing DBGOBJ
Baan Tracing bic_info6.1
Baan Tracing DBSLOG (Part I)
Baan Tracing DBSLOG (Part II)
Baan Tracing DBSLOG (Part III)

Here’s a good start, I’m taking requests for any new topics! just leave a comment here with whatever section you’d like more details on, or any new topics and if i know about it i’ll create a new post!