Вы находитесь на странице: 1из 29

Old Siebel eScript T (typeless) Engine vs.

New ECMA Version 4 ST (Strong Type) Engine Introduction Oracle has recently introduced a new eScript engine known as the Strong Type or ST engine. This engine is available in versions 7.7, 7.8 and 8.0. The ST engine is the default engine in Siebel 8.0 and customers are encouraged not to disable it. Oracle cites these benefits for the new ST engine. + Improved performance + Improved scalability + New features only available with the ST engine In order to better advise our customers we undertook an independent benchmark comparing the T engine with the new ST engine. Our benchmark included these tests + T engine + ST engine + ST engine with deduce types enabled/checked + ST engine with all variables given types We ran a series of two tests. The second test was added after we did not see the results we expected and the results Oracle cites in their material from Oracle Open World 2006. The tests were: + A transaction mix that included math, string and Siebel objects. + A transaction mix that included just math and string operations but excluded Siebel objects

Results Findings Three major discoveries were found on this benchmark. The first was that for the first mix of transactions we did not see very much response time improvement. While CPU on the object manager improved with the ST engine the overall transaction time did not improve very much due to this transaction mix spending the majority of time doing SQL I/O. The implication from this is that end users may not see much improvement in response time from the new ST engine although their CPU certainly will improve. The second and third discoveries were identified on the second mix of transactions where we removed the Siebel object scripts and all I/O from the transaction mix. The second finding was when it comes to CPU intensive tasks like mathematical operations and string operations that the new ST engine is about twice as fast as the old T engine. The third and very much unexpected finding was that using the ST engine with strongly typed variables resulted in horrible performance! With strongly typed variables the performance of the ST engine was twice as slow as the T engine. After opening a service request with Siebel Technical Support it was determined that two change

requests exist for this issue and it is considered a product defect. It was later determined that variables of type String, Number and Boolean are slower when typed on var statements. Other data types such as PropertySet, BusObject, BusComp and Date were as fast or even faster when typed on var statements. Adding types to var statements presents other problems too. Here are examples of var statements with and without types. var myString; var myString : String; One very undesirable aspect of typing variables is that object compares for String, Boolean, Date and Numeric data types no longer works the way it used to with the old T engine. If you type your var statements you must change your object compares to use the valueOf() operator. For example if you type your strings this wont work: var myString : String; var yourString: String; if (myString == yourString) //This wont work anymore And instead you must code: if (myString.valueOf() == yourString.valueOf()) Changing most of your if statements is painful even with our PPS Tools Helper product. In addition to the above issue with adding types to your var statements you will find a service request that tells you not to type Arrays. Update - 4/4/2007 After conferring with Oracle Product Marketing we investigated the use of the corresponding primitive data types of chars, float and bool instead of the object types of String, Number and Boolean. We were delighted with the results. Performance was as good or better than non typed yet will still had the advantages of typing our variables. Plus with the primitive data types we did not have to use the quirky valueOf() function on comparisons. Conclusion We love the new ST engine and recommend for its features alone. Given the finding above with strongly typing your var statements our current recommendation about the ST engine is: Use the new ST engine but be sure to use primitive data types of chars, float and bool instead of String, Number and Boolean. Don't type Arrays until the stability issue that

currently exists is fixed. Customers with existing eScript code bases need not necessarily add types to their var statements. These customers should still see a big performance improvement. Also be sure to carefully test your application with the new ST engine before deploying to production! An important product defect relating to passing function parameters by reference has only just been fixed with and 8.0.

Is scripting evil?
(9 votes, average: 4.78 out of 5) Viewed : 2,379 times
Written on July 18, 2010 by neel in eScript, Functional Siebel

The term Scripting has always had a negative vibe around it in Siebel. It is avoided like plague and advised to be only used as last resort. Yet there has not a single project I seen in my 5 years of experience in Siebel that doesnt use scripting. I am not an advocate of scripting. I understand the reasons of not using scripting and also the problems one can face when trying to use scripting. Some of the main reasons or pitfalls of scripting (that I have come to know) are as following: 1. Performance: Siebel eScript is an interpreted language which means it is read and executed by eScript engine line by line at runtime which affects performance of a Siebel application. Also the functions and script has to be loaded in memory which means a badly written script can easily cause memory leaks and application crash. 2. Upgrade: This is one the biggest reasons of avoiding scripts. As you never know when a function will be made obsolete by Siebel an you need to replace it with new function. Also, Siebel doesnt take care of scripting and you need to do manual effort to port your scripts to upgraded version 3. Manageability: Writing scripts here and there and all over application makes application difficult to manage which means you never know when a small change done on one object might introduce a error in other object application. Also script written by one developer needs to be understood first before making changes in it making it is a time consuming and error prone process.

Now, what are reasons that force us to still resort to scripting despite the pitfalls and problems discussed above. I think below are the prime reasons for that but feel free to add to it in case if you feel something is missing: 1. Lack of declarative solution: More often than not complex business requirements force us to use scripting as there are no declarative solution available to complete them 2. Tight Deadlines: Although writing scripting is a time consuming task but still it is easier to complete complex requirement using scripting than configuration and workflows. 3. Lack of knowledge: To complete a complex requirement through declarative solution requires thorough knowledge of Siebel data model (database and tables) which comes after years of experience where asscripting requires you to have knowledge of BO layer which makes easy to implement requirements using scripting. This lands us in a Catch 22 situation. On one hand we fill the mind of developer to focus on declarative solutions and avoid scripting at all cost and on other hand more often than not he ends up writing scripts to achieve complex requirements. The biggest pitfall of such a paradox is: Developer just uses eScript and doesnt try to understand it, which results in inefficient and messy solutions. I am not supporting eScript but I am just trying to say that we end up using eScript sooner or later, so why not understand it better in order to use it in most efficient way when the time comes. So, I ask this question again Is Scripting is really EVIL? My answer to this question is NO. Atom bomb destroyed Nagasaki and Hiroshima and alsomovies like Armageddon has shown that Atom Bomb might be only thing that might save our earth in case if an asteroid decides us to pay a visit . So, it really depends on how you use a particular thing. Even a solution achieved through configuration can be as devastatingas a solution achieved through scripting if not done properly. I have actually seen some solutions function better when done through scripting as compared to configuration. I have seen developers creating tables and BCs so that they can avoid writing a 10 lines of code and use data map instead.

Now, the question is do we need to have such an extreme view for scripting and also when to use scripting and when to avoid scripting?? According to me scripting on BCs and Applets events should be avoided (almost like plague) but when it comes to finding solution of complex business requirements then you should keep you mind open and evaluate both scripting as well as declarative solution. EvenAlex doesnt consider a well written business service as scripting. So, what do you think???

try-catch-finally and throw Part 1

(9 votes, average: 3.11 out of 5) Viewed : 2,275 times
Written on June 17, 2008 by neel in eScript

Next in series >> Today we are going to discuss basic error handling technique while using eScript. As a script is written by a developer according to his perception of the requirement given to him so many times it is far from perfect and there are chances of breaking it in middle of processing, thus resulting in failure of the

complete functionality.

So, it is very important to handle the errors and do the cleanup so that script can exit gracefully rather than giving a weird constructs in try catch finally throw

error message to the user causing him

to panic. The basic technique that is used to handle error is use the below given

the scriptthat you are writing.

Explanation of keywords:

Try : It is the construct that is used encapsulate the code that can fail. Catch: As the name suggests it catches any exception or error that happens in code included in Try block Finally: This is the code this executed before processing of the script stops. throw: It is construct that is used to make sure that the execution of the

script stops and control is returned back to the object from where the script was invoked. It works same way as TheApplication().RaiseErrorText() but we cannot customize the error message that is displayed to the user. Basic Usage: The basic use of the these constructs is
try { //normal code here }//end of try block catch(e) //start of catch block just after try { // your error handling code goes here // which is usually display User friendly error message rather than weird technical message throw e; //this is optional it stops the execution of the script // but the finally block is still executed } finally //start of finally block { //this will be executed weather an exception occurs or not // so the normal practice is just to nullify the objects here }

try catch finally and throw Part 2

(6 votes, average: 4.17 out of 5) Viewed : 1,731 times
Written on June 17, 2008 by neel in eScript

<< Previous in series

Next in series >>

Explanation of e in catch block? e in catch block is an object that contains information about the error or exception that has happened. So, in case if you would like to show the actual error that has happened that you could use the following code


{ TheApplication().RaiseErrorText(User Friendly Message + e.toString()); }

It is not necessary to write an e here you can use any work that is not a reserved word. For example
catch(exp_obj) { TheApplication().RaiseErrorText(User Friendly Message + exp_obj.toString()); }

Caution while using Finally. Verify that the objects that you are trying to nullify inside finally are not define inside an if block as it could result in Object not defined error if flow never goes inside If block. For example
try { if(this.GetFieldValue(Status) == Urgent) { var BO = TheApplication().GetBusObject(Contact); var BC = BO.GetBusComp(Contact); // rest of the logic } } catch(expobj) { //you catching logic or you can use throw here } finally { BO = BC = null; }

In this code if value of the field Status is not urgent then variables BO and BC will never be declared which can result in variables not defined error. So either they should bedeclared outside if block or they should be nullified in the if block.

try catch finally and throw Part 3

(2 votes, average: 3.00 out of 5) Viewed : 2,058 times
Written on June 18, 2008 by neel in eScript

<< Previous in series Practical Example:

Next in series >>

Here is the usage of all the constructs in an example

function BusComp_PreWriteRecord () { try { var BO = TheApplication().ActiveBusObject(); var BC = BO.GetBusComp(Action); //we are working on Active BO so BC will have context of the current record so no need to query. var sActiveFlag = this.GetFieldValue("Active"); if (sActiveFlag == 'Y') { this.SetFieldValue("Status","Submitted"); BC.SetFieldValue(Status,Done); } } catch(e) { throw(e); } finally { BC = BO = null; } }

try-catch-finally and throw Part 4

(5 votes, average: 3.40 out of 5) Viewed : 3,042 times

Written on June 19, 2008 by neel in eScript

<< Previous in series

Next in series >>

In this post we will discuss throw keyword in detail. What is throw? In simple words throw is keyword used in error handling Is throw keyword compulsory to use? No, it is optional and in many cases it is not used. What is the purpose of throw? When we write a custom method then we have two choices.

First Choice: Handle those errors and take appropriate action in our script. This is accomplished using catch keyword. Second Choice: Let somebody else handle those errors in that case we use throw which in simple language means that An exception that has occurred I dont know how to handle it so I am passing it to you (you is Siebel here) and Siebel basically shows a pop-up displaying the description of the error that has occurred. Lets understand this with help of an example
try { //some logic to do something } catch(e) { if(e.toString() == Say some particular error A) { // do this } else

{ throw e; } } finally { // make objects null }

Now according to the above code if error has a some particular description then we handle it otherwise we just pass it on to Siebel which will display it to user. When should we use throw? throw is usually used in business service code which is going to be called from workflow. When an error occurs it will trigger the exception step of a workflow and assign the errorinformation to Error Code and Error Description process properties of workflow. If I dont use throw and just use blank catch try { //some code } catch(e) { ; } then the workflow will not get an exception and it will go on its merry way thinking everything is fine. I hope this clears any doubts that you might have about using throw. In next part I will discuss how to suppress some particular error using catch.

try-catch-finally and throw Final Part

(5 votes, average: 4.40 out of 5) Viewed : 3,962 times
Written on June 22, 2008 by neel in eScript

<< Previous in series

In this post I am just going to describe the how we can suppress all errors or some particular errors using error handling. Suppressing all errors Suppressing All Errors is very easy, all you need to do is just have blank catch statement for example
try { //some code } catch(e) {;}

The above mentioned code will result in suppressing of all errors which is never recommended as it can lead to data integrity issues. Just think user is entering some data and tries to save a record and the script written in write record results in some error. Now,

user wont see any error

messages and he will think he has entered record properly where as it is not the
case. So, we should never use this, until and unless we are pretty sure of what we are doing.

Suppressing particular errors: There are some cases in which we know that a particular type of error can occur which is not going to affect the functionality and we would like to suppress that error. That can be done by the following the below given steps: Replicate the error in Application.

(when the pop-up with error message is shown press CTRL+C and the error message will get copied)
Note down the text of the error Every error has an error code associated to the text, note down the error code in the error message. For example

A script failed to get the value for field Revision Number

because the field was not active.(SBL-EXL-00119)

for the above mentioned error the error code is SBL-EXL-00119. Now the below mentioned code will suppress above mentioned error and give a pop-up if any other type of error occurs
try { //some code } catch(e) { var errtext = e.toString(); if(errtext.indexOf("SBL-EXL-00119") == -1) TheApplication().RaiseErrorText("Error Occured"); }

To handle multiple errors you can have switch statement and basically do whatever you want to. Well, this is the end of Error Handling series hope it would have helped you all. Post your comments and question in the meanwhile I will start working on another topic

Exploring Siebel BC scripting events BusComp_PreSetFieldValue

(8 votes, average: 4.50 out of 5) Viewed : 2,816 times
Written on October 30, 2008 by neel in eScript

Scripting is very powerful tool in Siebel. You can do all sorts of things using script which you cannot achieve through configuration. If use properly it can enhance Siebel Application to any extent but if not used properly it can seriously hamper application life and cause issues like performance degradation, data integrity and other runtime errors. Siebel has provided us various events in which we can write script. Every event has its own significance and offers us something that others dont. So, it is very

important to choose the right event to write our script otherwise it can lead to problems. In this series I will discuss various events available at BC level in Siebel and answer questions like when and why you should be using particular event with the help of various requirements. So the first in the list is BusComp_PreSetFieldValue: As it is clear by its name it fires before a value of the field is set. The signature of this event is function BusComp_PreSetFieldValue (FieldName, FieldValue) Where FieldName is the name of the field which is being set and FieldValue is the value that is being set. Imp: This is the only event where we have access to Old and current value of the Field that is being set. So, it is usually used for requirement where you want to check old value before doing something with the new value. Note: You can access old value of the field using this keyword for example If user has changed the value of Status field from Completed to Closed this.GetFieldValue(Status) will give the value Completed and FieldValue will have Closed Lets try to understand with example. Requirement: I want to popup a message to user saying Please Fill the Comments Field if user sets the value of SR from Completed to Closed Precaution: Dont write validation scritps here as user has a choice to undo the record and your validation will fail Then the best place to write the code is BusComp_PreSetFieldValue. I am not writting the script here. Let me know if you want me the write the exact script also.

Boolean Fields in Siebel Best Practices

(4 votes, average: 4.00 out of 5) Viewed : 423 times

Written on October 22, 2011 by neel in Best Practices

Tip 1: Always provide a default value to a Boolean field (DTYPE_BOOL) in a business component,especially if it will be used in search spec to filter records.

Why? If you dont provide a default value (either by pre-default or post-default) to a boolean field then everywhere you have to take care of NULL and blank values in addition to Y and N. Lets take an example: You want to retrieve all the records where the value of a particular flag is is N then usually you provide following search spec [field] = N The search spec mentioned above will only retrieve records that have value as N it will miss the records with value as NULL or blank. To retrieve all the records you have change your search spec to [Field] = N OR [Field] IS NULL OR [Field] = A boolean fields until and unless it is specifically set to N has value as NULL in DB. Although on UI you will see N and NULL in same way (an unchecked record in an applet). From UI if you set a flag as Y and then uncheck it only then Siebel sets it value as N otherwise it is NULL. What is the problem in this? It is only increasing the search spec length! Unfortunately the side effect is not just the increase in the search spec length it impactsdatabase performance. As soon as you introduce IS NULL or IS NOT NULL clause on a column the query plan changes and even if you have index defined on the field it might not be used. So your query performance can degrade. In addition if you have multiple flags in your search spec then you might end up reaching the search spec length limit (believe me I have personally experienced that).

Tip 2: Take care of history data.

Providing Pre-Default and Post-Default value will take care of new records but you will have to update the old records either through EIM or SQL query. You will have to set the value as N where ever it NULL. Below is an example of SQL Query that you can use:

The above query will update all the records to N where ever it was null.

Tip 3: Provide default value at a Table Level

If you load data from EIM into this particular table then either provide a static value of N inIFB file for this column or provide default value of either Y or N depending on your requirement at the Table itself

Providing a value at Table itself will take care of all the scenarios. Please feel free to add to this list and share more tips if you think I have missed something.

Memory Leaks in Siebel

(8 votes, average: 5.00 out of 5) Viewed : 1,891 times
Written on September 8, 2011 by neel in Downloads, Siebel Administration

This post has been contributed by Timur Vafin. This post deals about What, Why and How of Memory Leaks in Siebel and he has also shared a set of SQL and Perl Script and a tool that could help you uncover possible causes of memory leaks due to not nullifying the objects after use.

I think that many Siebel Administrators know about problem with Siebel process memory leakage when Siebel OS process memory grows constantly and process can not fit to memory boundary (be it LDR_CNTRL environment variable or 2GB process memory limit on 32 bit platform or server resource boundary). As a result of this problem Object Manager process crashes and generates core dump or FDR file. Siebel Server (siebsvc process) restarts this process again but the session of the users becomes invalid and all their unsaved data is lost. They are required to re-login in application. If this is repeated then UNIX OS start swapping process memory to swap device or file and Siebel performance become too slow and the only way to solve this is to restart Siebel Server. What causes Memory Leaks? Configuration: Recursive self joins and complex or wrong expression in calculated fields can result in extensive memory usage and subsequently crashing Siebel Object Manager process(Although this is a rare scenario). Scripting: One main cause of Memory leaks in my experience is badly written scripts that omitGarbage Collection (GC), let me explain what I mean. When we assign something to a variable in eScript Siebel reserves some memory to hold the reference and values of that variable. The amount of memory that is reserved for it depends on the type the variable. The only way to get this memory back is to nullify the object used in the script at the end of the script. Assigning a variable as null notifies Siebel GC to destroy the variable release the memory at the next GC run. For example
var bc = this.GetBusComp(); //siebel reserves some memory for variable bc. bc = null; //now siebel can release the memory assigned to this variable.

If I dont nullify an object and the script is executed too frequently Siebel will keep using more and more memory till the point it runs out of it causing the crash. So, if you have lot badly written scripts without appropriate GC implemented you could run in Memory Leaks. The real embarrassing thing for me is that experienced people know about this problem but sometimes they trying to forget about it. How to find cause of Memory Leaks?

FDR Files: When Siebel Object Manager process crashes, at that time system will generate FDR file in Siebel Server bin directory. You can analyze these FDR files and find out the last steps before crash. Log Files: Log files contain very important information about the crash. Monitor OS process that consumes too much memory and then find the component name from Siebel Log using PID. You can search the log files for lines like
Starting <Component Name> with PID <PID>.

You can find the Log files at the following location UNIX: [Siebel Root]/siebsrvr/enterprises/[Enterprise Name]/[Server Name]/log Windows: [Siebel Root]\siebsrvr\log Siebel SARM: To find out what objects are used frequently by Object Manager you can enable 2nd level SARM logs for some time and analyze it. I will omit the details on this but you can find the most useful information by typing command line sarmquery tips and in Siebel Documentation: Siebel Performance Tuning Guide > Monitoring Siebel Application Performance with Siebel ARM Siebel Performance Tuning Guide > Analyzing Siebel ARM Data How to prevent Siebel Crash from Memory Leaks? Component Parameter: For multithreaded components Oracle has introduced Memory-Based Multithread Component Recycling feature to prevent Siebel Server from crashing due to memory leaks. This feature can be enabled by setting MemoryBasedRecycle parameter as true.

Once this feature is enabled (by setting parameter MemoryBasedRecycle=true) for a component, Siebel Server stops opening new sessions when Object Manager process reach memory limit defined by parameter MemoryLimit (in mega bytes, default 1500) for this process and starts another process to handle requests. It waits until all tasks are completed on problem process and shuts it down. Although this approach doesnt fixes the root cause of the memory leak. More information about this feature you can find in Siebel Documentation:Siebel System Administration Guide > Configuring Siebel Servers > Advanced Configuration Tasks > Configuring Memory-Based Server Component Recycling. Garbage Collection: To overcome the problem of Memory leaks caused because of objects not nullified in script I have come up with set of SQLs and Perl Script that can easily help you to:

1. Analyzes eScript variables that has been opened but not closed (null are
not assigned to variable) in the script 2. Searches for objects that has been opened using the following functions such as GetAssocBusComp, GetPicklistBusComp, this.BusObject, ActiveBusObject, GetBusObject, GetService, NewPropertySet but not nullified 3. Skipped eScript comments in code 4. Takes under consideration multiple variables assignments like : var1 = var2 = var3 = <Something> Furthermore, is you used Oracle Database for Siebel, you can use my tool that I call Siebel Open Variable Analyzer. Ive combined Oracle Instant Client 10g with SQL*Plus,Strawberry perl 5.12, and my perl script. There are steps to use it:

1. Extract SiebelOVAnalyzer.rar to appropriate directory

2. Edit connection information for Oracle Database Server (Siebel Database):

1. tnsnames.ora file in root directory change TNS 2. run.bat file in root directory change LOGIN environment variable:
Siebel Database User that has sse_role \ tblo_role, password, TNS 3. Run run.bat, it will produce out.csv file in root directory 4. Open out.csv in Excel and analyze data for your purposes

So now you have a tool to produce list of variables that you should review in your code. You can download the SiebelOVAAnalyzer tool from the link below http://uploadbox.com/files/82588e5ff8/ Password: siebelunleashed.com Here is the link to download the SQL and Perl script in case if you dont want to download the utility SiebelOVAPerlScript SQL to download eScript from Oracle DB (Siebel Repository) I hope my article will help. Below are some good articles about Memory Leaks on Oracle My Support How To Troubleshoot Memory Leaks on UNIX [ID 477522.1] How To Troubleshoot Memory Leaks on Microsoft Windows [ID 477521.1] How To Analyze the FDR Output in Siebel Versions 7.7.x, 7.8.x and 8. [ID 473939.1]

From Neel: I have tried the utility and it works. Although I had to tweak a few setting to make it work. I will posting an article soon with details of the utility and my experience of using it. Please rate the article and provide your comments.

SortSpec + Expressions = Performance Issue

(9 votes, average: 4.56 out of 5) Viewed : 3,483 times
Written on September 3, 2010 by neel in Case Study, Problem Solutions

This post is about another performance issue I worked upon recently. A particular transaction(button click) was taking around 15-20 seconds to complete and I was asked to see if there is any scope of improvement and try to gain at least 5 seconds from it.

As I had mentioned when it comes to performance issue the first place where we should look is database. So, following the usual drill I fired up my dedicated client with spool enabled. I started going through spool file after executing the culprit transaction and my eyes lit up when I saw a query taking 5 seconds to complete. The usual steps somebody takes after this are Execute this query with explain plan statement and session parameters set Analyze the plan table and look for the bottle neck Try to rectify the problem by applying index or fine tune the query

But my experience save me some time here because as soon as I saw that query had an order by clause on a custom column

I went and checked if there is an index on that column and sure enough there was no index on that column. I went ahead and created an Index in tools and applied the changes and tried once again. Just doing that saved me 4 seconds and the time taken to execute query came down to 1 second. After a bit of prodding here and there I came to know that this table was suppose to have only 5000-10000 records thats why nobody bothered to create an index on that column. Lesson 1: It doesnt matter how many records your table is going to have, if you are applying a SortSpec make sure you have an index on that column.

Then I had a look at detailed logs and I saw that just after the query execution Siebel wasopening a cursor and it took around 7-8 seconds to complete that cursor. I was able to see the following lines over and over in the detailed log file
ObjMgrSqlCursorLog Fetch 5 000000024c813758:0 2010-09-03 07:10:24 Begin: Fetch for Sql Cursor at bde1028 ObjMgrSqlCursorLog Fetch 5 000000024c813758:0 2010-09-03 07:10:24 End: Fetch for Sql

Cursor bde1028 ObjMgrSqlCursorLog Fetch 5 000000024c813758:0 2010-09-03 07:10:24 Begin: Fetch for Sql Cursor at bde1028 ObjMgrSqlCursorLog Fetch 5 000000024c813758:0 2010-09-03 07:10:24 End: Fetch for Sql Cursor bde1028 ObjMgrSqlCursorLog Fetch 5 000000024c813758:0 2010-09-03 07:10:24 Begin: Fetch for Sql Cursor at bde1028 ObjMgrSqlCursorLog Fetch 5 000000024c813758:0 2010-09-03 07:10:24 End: Fetch for Sql Cursor bde1028 ObjMgrSqlCursorLog Fetch 5 000000024c813758:0 2010-09-03 07:10:24 Begin: Fetch for Sql Cursor at bde1028 ObjMgrSqlCursorLog Fetch 5 000000024c813758:0 2010-09-03 07:10:24 End: Fetch for Sql Cursor bde1028 ObjMgrSqlCursorLog Fetch 5 000000024c813758:0 2010-09-03 07:10:24 Begin: Fetch for Sql Cursor at bde1028

This meant that Siebel was performing some operations on the result set returned by the query and that again was resulting in slowing down the performance. After digging down further I was able to find the particular condition that was causing this behavior. In scripting somebody has used following SearchExpr
var searchstr = ([Assign Flag] = N AND [Status] = Open) AND (([SR Owner Id] IS NULL OR [Owner First Name]=SIEBEL) AND InStr([Customer Group],[Employee Group]));

InStr statement in this SearchExpr was forcing Siebel to get the complete result set and then run cursor over it to evaluate the condition (particularly InStr condtion). The reason to use InStr in this case was, Customer Group Field was comma separated field and we needed to see if value of Employee Group field is present in Customer Group or not. The only way to avoid this cursor was to evaluate this condition in a query rather than InStr Expr. I went ahead and changed the InStr condition to following:

AND [Customer Group] LIKE *[Employee Group]*

Like condition gave me the same result. This change added an additional condition in where clause but more importantly removed the cursor and saved precious 7 more seconds and overall performance improvement was about 11 seconds making the transaction to completeunder 10 seconds.

Lesson 2: If you query is going to return a large result set try to avoid calculated fields and functions in the SearchExpr or SearchSpec as it forces to Siebel to open cursors and traverse the complete record set in order to evaluate conditions causing performanceissue.

Siebel 8.0 SARM Enhancements

(3 votes, average: 3.67 out of 5) Viewed : 3,091 times
Written on November 4, 2009 by neel in Siebel 8.0

SARM stands for Siebel Application Response Measurement. It is a framework for capturing Siebel Application performance data within Siebel and Siebel Web Server Extensions (SWSE). There have been several enhancements in Siebel 8.0 SARM such as: SARM memory buffers are now periodically flushed to disk SARM files have a different naming convention which convey clearly the origin of the file SARM Analysis tools have been enhanced

There is not much to talk about other enhancements except SARM Analysis tools. There are 3 tools available to analyze SARM data SARMAnalyzer SARMQuery SARM Diagnostic tool (GUI tool)

SARMAnalyzer: It is the most basic tool that is available to parse SARM file. It is also available in Siebel 7.x version but some additional functionality has been added to it.SARMAnalyzer is also use to decode FDR files. It can convert a SARM File into XML or CSVfile. Explaination about use of SARMAnalyzer is out of scope of this article and will take it up separately. Genreal syntax of using SARMAnalyzer is:
SARMAnalyzer o output file d output format f input file

P.S: Output Format can be either XML or CSV SARMQuery: It is a new tool that has been introduced in Siebel 8.0 though it is available forSiebel 7.x but you have to request it from oracle. It is far more efficient querying tool for command line analysis of SARM files. It has following features Better usability through SQL like queries Better performance Supports macro language allowing re-use of commonly passed parameter

Through SARM Query tool you can filter data, aggregate data, produce histograms Siebel Diagnostic Tool: Only available in Siebel 8.0 it is basically a GUI for accessingSARMQuery tool. It needs Siebel Management Server to work. User will generate a query through the UI of this tool which is converted in SARMQuery by Siebel Management Server which contacts appropriate Siebel Management Agent and requests it to run query. Thats it for enhancements related to SARM

Siebel Application Response Management SARM

(5 votes, average: 4.80 out of 5) Viewed : 3,795 times
Written on May 17, 2008 by neel in Introduction

While Surfing I came across a Blog by a Oracle Employee Chung Wu He has written a really nice post about Siebel Application Response Management . A must read for everybody. Here is what he had to say about it.

Siebel Application Response Measurement (SARM) is a performancetracing framework that was originally introduced in Siebel 7.5. Even though the technology has existed for almost five years, it seems there are still some misconceptions about its design and intended use. Since I was the original product manager for SARM, I guess I can try to offer some explanations. Myth #1 SARM is Siebel ARM

Back was Siebel was an independent company, our strategy to provide Siebel management tools was to instrument the Siebel platform and work with 3rd party ISVs to adapt their tools to work with Siebel. As part of this strategy, we thought it would be a good thing to try to comply with industry standards such as Application Response Measurement (ARM) so that tools that support ARM can be used to monitor and diagnostic Siebel performance. Therefore, it is possible to consume SARM data by using an ARM-compliant tool. However, strictly speaking, SARM is not an implementation of ARM. The problem with standards is that they often have to sacrifice capabilities for compatibility and provide the lowest common denominator solution. We found that ARM, specifically ARM 2.0, was not rich enough to capture Siebel-specific performance data. As a result, we built SARM to capture a superset of the information, and pass a subset of that to the ARM API. Specifically, contextual information such as the names of the Siebel UI views, business components, workflow processes and scripts are not passed through the ARM API, which would make it a bit difficult to tell what goes on in processing transaction requests. In other words, to fully take advantage of the rich information captured by SARM, you need a tool that processes the native SARM data stream. Myth #2 SARM has high overhead The driver behind SARM was the need for a way to identify transaction request performance bottlenecks, especially for interactive user workload. It used to be rather strict-forward to do this in the Siebel 2000 (version 6) days, as Siebel applications were deployed with 2-tier client/server topologies, with direct connections from clients to the database. In Siebel 7, the topology became truly multi-tiered, and with database connection pooling, there was no deterministic way to tie a database transaction to the user request. SARM was intended to be the remedy by providing a way to trace transaction request throughout the Siebel mid-tier. As a performance management tool, the last thing that we needed was having SARM introduce more performance problems. Consequently, we were obsessed in squeezing every last bit of performance out of the tool and making its overhead as low as possible. This was achieved through several means: - Record timing information while doing as little secondary processing as possible in real-time - Use highly optimized buffered I/O to persist performance data - Provide various throttling mechanisms to control the amount of SARM data captured Prior to releasing SARM, we ran SARM through numerous load-testing scenarios. For example, in the Call Center 1 load tests, which simulated hundreds of simultaneous users running against a single Siebel app server, we observed SARM overhead to be less than 3%, well within our product performance requirement. We thought this was a reasonable cost to realize the benefit of having good management data for optimizing the application.

Myth #3 SARM is only for production diagnostics While a lot of the initial discussions about SARM were for performance diagnostics, we have always intended SARM to be a framework that supports the full set of application performance lifecycle activities. SARM really is just a set of timers that measure the timing of transaction requests, as well as the timing within various points in the call graph of the Siebel software stack for processing the requests. SARM doesnt care whether the timing came from actual user operations while theapplication is live or from activities generated from pre-production load tests. While in production, the data that it captures can be used for day-to-day monitoring as well as diagnostics, as well as longer-range capacity management.

Truly Enlightening Will keep an eye on this blog for future posts. It is really nice seeing somebody give back something

Siebel and System performance

(5 votes, average: 4.00 out of 5) Viewed : 2,237 times
Written on May 20, 2010 by neel in Siebel Tools

I have started working on Siebel 8 fairly recently in comparison to many of you. I recently installed Siebel 8 Tools and Dedicated client on a new system and noticed a considerable increase in boot time of my Operating System (Windows XP Professional in case you are wondering). I didnt gave it a lot of thought, until one day I happened to open task manager just after the restarted my system. I noticed that siebel.exe was listed in the list of processes that were running and hogging around 200 MB of my precious RAM.

I had not even touched Siebel till that time. Thats when I realized that there is connectionbetween slow boot time and Siebel installation. While my

system was starting up a dedicated client session was being opened in the background. The only difference between normal session and this particular scenario was that an internet explorer instance was not opening up. They were similar in respect to memory usage and time taken to load the instance in memory. I searched net to see if it was a known problem and is there a solution available. After searching a while I landed on a Siebel blog describing similar problem although with Siebel 7. According to the blog there are two services

1. Adaptive Server Anywhere siebel_local 2. Siebel QuickStart Service

Changing their startup type to Manual should solve the problem. I was not able to findAdaptive Server Anywhere siebel_local service in the services window (may be it is only valid for Siebel 7). I was able to find Siebel QuickStart Service and its startup type was Automatic as expected. So, I changed the type to Manual and just to be very sure that it doesnt start while system is booting I followed steps given below: 1. Go Start Menu and Click Run 2. Type msconfig and press enter. You should be able to see the window shown below 3. Go To Services Tab and uncheck the box against Service labeled Siebel Quick Start Service as shown below

After these steps the boot time of system reduced noticeably and I lived happily ever after(Well atleast for today )

Typecasting variables in ST Engine

(7 votes, average: 4.71 out of 5) Viewed : 985 times

Written on October 19, 2009 by neel in eScript

I think most of Siebel 7.7.x and Siebel 7.8.x applications are ST enabled, by now in readiness to upgrade to Siebel 8.x as ST is the default script engine in Siebel 8.x. You wouldnt want to upgrade to Siebel 8.0 and realize that most of your scripts are failing there. Though most of us have ST engine enabled for our applications but I dont think many of us are completely utilizing its capabilities. One of the main difference between ST and T engine is that in ST we can typecast ourvariables which helps improving performance and better memory managementof application but typecasting of variables is optional not compulsory. So, even if I dont typecast my variables my script will work. This post intends answer questions given below:

1. How do I typecast variables in ST engine?

2. What types are available?

3. Do I really need to typecast variables? 4. Is there any downside of typecasting variables?

How do I typecast variables in ST engine? The syntax of typecasting a variable is as following
var variablename : type; for example var psIn : PropertySet;

In the above example I am typecasting psIn variable to be of type PropertySet. What types are available? Below is the list of types that we can use in ST scripts. (This list may not complete please feel free to add to this list through comments, in case I have missed something.) var bo : BusObject; var bc : BusComp; var ps : PropertySet; var svc : Service; var flag : bool; var chrType : chars;

var intFloat: float; var intNum : Number; var str : String; var boolObj: Boolean;

Do I really need to typecast variable? Syntactically it is not necessary to typecast variables. ST engine can run on script using both typeless variable (using only var statement) and typecast variables (using appropriate type) but to make use of complete capabilities of ST engine you should consider typecasting at least variables that will store objects such as Business Objects, Business Components, Business Service etc. Is there any downside of typecasting variables? Surprisingly the answer of this question is Yes, there is downside. Typecasting variables toString and Number does have an impact as you cannot compare two different data types. For example
var fnum = 10; var snum = 10; if(fnum == snum) return(1); else return(0);

Above statement will return 1 because when you dont typecast your variables then animplicit conversion takes place but if I change my code to:
var fnum : String; fnum = 10; var snum : Number ; sunm = 10; if(fnum == snum) return(1); else return(0);

Then comparison will fail and it will return 0 as you cannot compare a String and a Number type which means that typecasting your variable can cause lot of if conditions to fail. Also it has been observed that typecasting variables to String and Number can haveadverse impact on performance. So, it is better to take middle path which is totypecast variables that will store objects types such as Property Sets, Business Objects and Bus Components and leave your other variables as it is. Please feel free to express your thoughts!