Thursday, August 11, 2022

Looking at the same thing from different angles under different interpretations concluding different results -> Entropy & Information | + Cloud & On-Prem | + A little Farming

Entropy, Information, Cloud & On-Prem, and farming (They look unrelated to each other, don't they? :)

Same thing from different angles, different field motivations, different associations and different thoughts that come to mind... 

In today's blog post, I will try to share some interesting inference, that I made by attending some of Sean Carroll's (my favorite  theoretical physicist and philosopher ) online tutorials about Entropy.. This is what I try, right?.. Trying to get the input from different fields, and use it in different contexts. Since 2013, I have tried to generate unique content, and I hope this blog post too will be in a similar wave length.

This blog post is about an analogy to of the things that I get from  my physics research. (I 'm a physics fan -- for those who don't know it :) An analogy that concentrates on our industry. Actually, my main purpose in this post was to draw attention to the approach of different subfields to information and entropy.  But I can't help myself from thinking that the inferences that I made on this way, may also apply to our Industry( Technology, IT...) as well.. In short; what I want to highlight is; different approaches to the same notion (due to different disciplines)  may bring us a mismatch in associating two subjects together.. 

At the end of this post, I will also try make an analogy to the farming, exactly to the beekeeping :) This agricultural subject came up in our conversations with my friend and brother Barış Saltık, who is a highly respected senior computer engineer.. 

Okay, let's see what I mean by that.. Let's get into physics and communication theory quickly...

Everyone agrees; there's a close relationship between entropy and information. 

However; different people from different sub fields may think the relationship goes in opposite ways.. 

For a physicist; high entropy is associated with the low information. That is to say -> if the entropy is high; we almost don't know anything about that thing (or that system).  In a low entropy configuration, however; we say; we know a lot about that system.

This means; physicists tend to associate high entropy with low information content. (Note that; entropy is a distribution on phase space. (and information is where are you in phase space -- remember Boltzman Entropy ) --)

But! a communication theorist has a completely different notion. Actually it is all mathematically, formally the same, but  for a communication theorist (like Claude Shannon), low entropy corresponds to low information & high entropy corresponds to high information.

See my posts on entropy for getting some background knowledge on this.. (background knowledge for our context) ->

https://ermanarslan.blogspot.com/2020/05/entropy-linux-kernel-csprngs-devurandom.html https://ermanarslan.blogspot.com/2022/04/ebs-poor-performance-in-autoconfig-due.html

Well.. As you see different people from different sub fields think the relationship (between information & entropy) goes in the opposite ways. 

Thanks to Sean Carroll, we are aware of these interesting things :) -- I got all the information about what I mentioned in the paragraph above from Sean Carroll's publications.

As Sean Carroll mentions; they are both perfectly sensible ways of thinking but they are different ways of thinking depending on what you're thinking about..

Well.. I have to thing to add actually.. I know that physicists and communication theorists don't have the same reference points.. . But still yes! For example, when someone says high entropy and when we think of the first thing that comes to mind, we see that difference...

Let's check our world, I mean IT world.. Databases, Systems, Middleware, management, costs, efforts, stuff like that.. What about Cloud & On-premise. Here we are; finding a similar different thing ( or  let's say trying to find a similar thing :).. Remember analogies are always dangerous, but they are also handy :)

Anyways; think about on-prem environment. (cloud ready environment, cloud-like modern on-prem environments are exceptions to this.) If we own the data center, and if we operate in a classical way and if we manage all of the components; we almost always prefer to build (& have) uncomplicated, plain, system architecture. Because; we think it is easy to manage such an architecture, it is easy doing diagnostics there. Moreover, it is not easy to get that knowledge to implement complex systems.. That is; for instance, we have a database and we put all the files (all the files that we read during the day) there as well :) We could position a Hadoop cluster for that task right? or an object storage or a cluster filesystem and do the integration, but it requires extra know-how, effort, and cost (at least for management & ownership). 

So having a complex architecture makes someone with an on-prem point of view (again there are exceptions ->  cloud-ready environments, public cloud-like on-prem environments) think that it is not efficient and preferable. However; for a cloud architect or someone looking from the perspective of the cloud with a cloud-ready or a cloud-native mode; having a complex architecture may be preferable.

It is similar right? In this case, classical on-prem folks may associate that complexity with a not preferred architecture, and as we say, cloud folks, on the other hand; may associate complexity with a preferred architecture..

Lets focus a little more on this to help you understand what I mean. I don't want you to think I am making all these things up :)

In modern Cloud environments (like Oracle Cloud Infrastructure, or Google Cloud Platform), we have the capability to use all the components we want. This really applies all the components, software components, virtual machines, storage servers , load balancers, firewalls, docker containers, Hadoop clusters, managed ETL/ELT processes etc.. you name it.. We consume the products of the capabilities of these components and we do it in various ways. I mean, we can have dedicated resources, or we can have as-a-service solutions. Most of the time, all of these components are managed by the cloud vendors, so we don't need to care the know-how required to keep these components up and running (and up-to-date). Support, diagnostics, patching, building DR environments (and lots of other things) ... We don't need to think about these things at all, because these are just one click away -- of course once you plan your cloud architecture and deploy your cloud resources accordingly.

As you may already know, having these amenities and possibilities save us time and we use that time for improving the technical things that affect the business side of things ( talking about a a good effect of course). 

Well.. Those technical things may be; having a faster deployment process (a quicker deployment) or having a distributed infrastructure that serves users connecting from different continents with the resources in the relevant continent or a true scalable environment right? An auto-scale environment that can scale-in and scale-out automatically for instance.. -- Just think about implementing one of these ones in an on-prem environment.. Complex and hard right? However; in Cloud environments, it is easy (of course if you know what you are doing).

Of course there are other things that I mentioned before.. Loading the files in to the database all the time, really? What about managing them, what about making fast file I/O on a system that is built for database I/O? What about the data life cycle? What about using the expensive database resources for storing files you never read. What about building hadoop clusters? Kubernetes environments? Micro services? Sounds cool but hard right? What about the monitoring of all these stuff? The alert mechanisms? The high-end security? The data flow? ...

I think you get the idea.. So these are not a problem in cloud environments and that's why they are preferred there. 

Actually it is a fact that; the complex architecture that can be built by putting all these stuff (modern stuff) at work occupied by a proper orchestration (I'm talking about something close to being fully managed) is preferred (universally:)! However; the difficulty of implementing and maintaining them in pre-prem environments prevents the preference of such complex architectures in on-prem environments. 

But! as I just mentioned; the situation is different for the cloud. The benefits of complex architectures in Cloud environments can find space to show themselves there.. Complex environments where we position specialized components for exactly what is relevant, are naturally preferred because in the cloud; implementing and maintaining such complex architectures does not bring as much difficulty as on-prem. 

Of course, even in the cloud, complex architectures may bring some difficulties, but these difficulties doesn't affect the decision that much, because their benefits overwrite them...

At the end; we say the almost same thing right?  In the beginning; we said -> "Same thing from different angles, different field motivations, different associations and different thoughts that come to mind... " and at the end; we say -> "Same thing from different environments full of different realities, (again) different motivations and (again) different associations" :)

Just a note before I finish;

Being cloud ready eases the cloud migrations.. I mean, in cloud migration projects, we generally migrate the environment as-is.. After the migration, there are phases to make the environment cloud ready ( and maybe cloud-native).. These things are related with the SW stack mostly, but there are things that need to be done in the infra layer as well and all these things can be deduced from what I wrote above :) Anyways; if it is not a modernized arch, it will not get full benefit from being on cloud, because its cloud footprint won't be in that complex (and modernized) mode at day1.. 

Maybe you already noticed , maybe you didn't.. That 's I would want to point out that; this text seems impartial , but in fact, it tells you be cloud-ready and modernize your whole stack.  It whispers to you; "turn your concentration this way and start getting the benefits".. Sooner or later it will be your choice, anyways..

Before I finish, I want to make one last analogy :) It is in the context of farming - agriculture, - beekeeping.

While bees collect nectar and pollen, they always go to the same flowers at certain times. They have to develop a strategy according to the flower type in their focus. That is; they calibrate their tongue for a particular flower type. So it is difficult for them to collect pollen and nectar from other type of flowers in that process. On the other hand; another hive focuses on another flower type, and for that hive, the flower that the bees I mentioned earlier focus on, seems difficult and impractical, until that hive has to change their flower type. In fact, correct flower (easier ones) type is determined by the habits of the bees. 

However; the future of the hive is not about focusing on easy flowers in the short term. It is about being ready for adaptation according to the amount of nectarine. Of course the speed of that adaptation is also important. Good hives are those which can adapt quickly. + At the end of the day, you produce new hives from successful hives, not from the other ones :)

Tuesday, August 2, 2022

OCI -- Running Core Banking on Cloud (+ Weblogic Cluster-aware Auto-scale configuration)

It is already up in the cloud! We are running Core Banking applications on Oracle Cloud Infrastructure! 

Our solution is almost fully managed.  It is Weblogic cluster-aware + it provides a fully automated scale-out mechanism for both having optimized compute resources and distributing the Weblogic & Http Server-related load across the nodes (with increased fault tolerance as as result of those automatic horizontal compute node expansions). 

Well.. With this solution; the cloud infra (including the Weblogic apps servers (WLS) and Http Servers) of the core banking applications is able to scale-out and scale-in according to the load of the cloud nodes (IAS compute nodes).

In this blog post , I will try to shed a light on the enablement process; the purpose; the motivation, the challenges and the final picture of such an architecture to make you think the things that can be done on Cloud, the benefits of having a cloud-based architecture and the ability to run mission critical applications on Cloud. This is especially for Oracle Cloud.. (We are also a Google Partner and have the ability to build a similar architecture on GCP as well!)

Just for intro; the name of our Core Banking application is Symphony. 

Our purpose -> Having a high available and auto-scale Core Banking environment on Oracle Cloud Infrastructure."

Our motivation-> Leveraging the advance features of Oracle Cloud to build a managed and auto-scale banking environment that is cloud ready and easy to manage.

SCOPE OF THE WORK:

Configure OCI compute and storage resources to support the Core Banking application needs.

Migrate the whole Core Banking environment from on-PREM to OCI (IAS Compute + WLS).

Do the development that is needed for auto scale-out operations.

Do the development that is need for auto scale-in operations.

Do the functional and stability tests.

SOLUTION:

Environment is completely on OCI.

Load Balancers in the forefront.

A 2-node RAC database is in the database tier. (will be replaced by the Oracle Autonomous database soon..)

Application servers are in an instance pool that we defined and configured.

A template image is built for adding a new machine to the managed group when a scale-out operation is triggered (when the load increases, OCI trigger the scale-out, custom code does the rest)

Scale-in operations are also triggered by OCI. However, custom code and a Cloud Function run to remove the configuration of the removed node from the Weblogic Cluster.

Python and Bash scripts do the Weblogic-side of things in the case of  both scale-out and scale-in operations. (Configuring the node manager and the cluster)

ARCHITECTURE:

Having all the stack on OCI Frankfurt Region. ( I can't share our core banking architecture here due to privacy concerns, if you are interested please contact me -> erman.arslan@gtech.com.tr)

By looking at the value of the metrics (such as the CPU utilization) , OCI decides to trigger the scale-out and scale-in events and this process can be tuned according to the needs. Metric can be modified + all these operations can be monitored.

Notification mechanism is also placed for notifying the Cloud admins when a scale-out/in operation is triggered.

The auto-scale solution is fast. For instance, when a scale-out operation is triggered; a node can be added to the Weblogic configuration in almost 5 minutes.

FLOW CHART:

In the following diagram we see the general flow, the flow that enables the solution make automated decisions ( these are made by the auto-scale mechanism) for starting scale out and scale in operations. We also see the built-in monitoring mechanism of OCI that listens for the load of the nodes in the instance pool.. We see, the alarming system that is kicked in when the load level is increased or decreased.

In the left pane, we see the custom code, that adds a new machine, configures the Weblogic and starts (removes when we are scaling in) the managed servers automatically.

The Load Balancer is also integrated and automatically gets the new node to its configuration (to its backend) when we add a node into the cluster. Similarly, load balancer removes the node from its backend when we remove a node due to a scale-in operation.

AUTO-SCALE IN ACTION:

Following output shows the auto-scale side of things. 

Here, we started with 2 nodes around 7 am and then auto-scale mechanism kicked in.

As we had lack of resources, auto-scale mechanism added 2 more nodes to the config at around 11 am.

And then, around 13:15, the load decreased, so the auto-scale mechanism removed a node this time.

Note that, our custom code is integrated to this mechanism, so all the WLS configuration is altered automatically during these things happen.


ROOMS FOR IMPROVEMENT:

Wait for the active application sessions before removing the node from the configuration. (during a SCALE OUT operation)

Optimize the local max JVM count in case we may be using all the JVM processes even though we didn’t have any CPU utilization or load on the server.. (This improvement should be done by the Application Developer Team.. There are also things that should be done by Oracle Development to provide the ability to make the code wait when a scale-in or out is kicked in. )

Replace the database layer with the Oracle Autonomous Database. ( This is already on its way, coming!)

Monday, August 1, 2022

EPM -- SSL/TLS configurations -- java.io.IOException: No self-signed cert in the chain

 You may get  java.io.IOException: No self-signed cert during a proper looking SSL/TLS configuration in EPM environment.. Actually you can get this error in any FMW environment, of course if you do the same mistake, which is to use the wrong versioned orapki tool :)

As you see the error above, using orapki from the wrong directory makes you end up with the exception. In other words; if you use orapki 11.1.1.7 in a 12.* EPM environment, you end up with these types of results.

As an example, I share the following with you.. You may see the correct location of orapki (as an example), deduce its version and understand the sequence of actions (just the wallet ops actually) for a SSL enabled task , by just looking at the following...

/u01/app/oracle/product/12.2.1/oracle_common/bin/orapki wallet create -wallet /home/oracle/ERM/ -pwd complex2022 -auto_login

/u01/app/oracle/product/12.2.1/oracle_common/bin/orapki wallet import_pkcs12 -wallet /home/oracle/ERM -pkcs12file /home/oracle/ERM/SSL/erm.pfx -pkcs12pwd ermpass

/u01/app/oracle/product/12.2.1/oracle_common/bin/orapki wallet add -wallet /home/oracle/ERM/ -trusted_cert -cert "/home/oracle/ERM/SSL/Root-ERM.crt" -pwd "ermpass"

/u01/app/oracle/product/12.2.1/oracle_common/bin/orapki wallet add -wallet /home/oracle/ERM/ -trusted_cert -cert "/home/oracle/ERM/SSL/RSA_ERM_SSL.crt" -pwd "ermpass"

/u01/app/oracle/product/12.2.1/oracle_common/bin/orapki wallet display -wallet /home/oracle/ERM/

Friday, July 29, 2022

Core Banking & Oracle Products

In this post, I will try to give all the Oracle infrastructure components and products that can be positioned for fulfilling the needs in a Core Banking environment.

In a banking environment, the core banking applications (as a software suite) provide all the core banking features including all the banking products, services (loans, trade finance, treasury, payments etc..) and reporting(for basic operations and regulatory requirements)

In this kind of an application environment, which needs high performance and reliability in all the tiers;  the quick look already tells us the core infra can be addressed with Weblogic and Oracle Database.

The application can leverage Weblogic JVMs (Managed Servers) with all the sophisticated functionalities that come with them. This includes, clustering, scale out mechanism and even the auto-scale mechanism (considering the Cloud Platforms)

The database layer should be Oracle. The application can take advantages of the key abilities of Oracle Database and its products/options (Real Application Clusters/RAC, Partitioning, Diagnostics Pack, Tuning Pack, and Database Lifecycle Management) to provide an efficient and high-performance scale-out platform, that is also completely fault tolerant, traceable, fully monitored, and diagnosable. (at all levels)

The Oracle technologies and their areas of use in the context of a Core Banking Software Suite are as follows. 

Database Enterprise Edition: Applications can leverage core Enterprise Edition functionalities and database options of Oracle Database to minimize the downtime and deliver superior performance in the database layer.

Partitioning: In the database layer, partitioning can be used for increasing query performance and easing the data management operations.

Diagnostic Pack: Oracle Database Diagnostic pack can used for having automatic performance diagnostics and monitoring functionalities in the database layer. ADDM and AWR can be used for shedding lights on the complicated performance issues in complex Core Banking database environments. In conjunction with the use of Enterprise Manager; these functionalities delivered with the diagnostic pack can help addressing database performance issues and will let the database administrators discover the causal sequences to many potential causes and effects.

Tuning Pack: Oracle Database Tuning pack can used for ensuring high database query performance. Using real time SQL monitoring feature, SQL Access Advisor and SQL Tuning advisor; SQL layer can be tuned continuously as it will require less effort.. Having a optimized SQL execution makes administrators ensure they have smooth running of their core banking applications.

Real Application Clusters: Having active-active database clusters is vital for ensuring continuity in the database and being aligned with the tight SLAs of Core Banking applications. Real Application Clusters a.k.a RAC option of Oracle Database provides multi-node active-active database clusters. By using RAC option, fault tolerance(along with load balancing) is ensured. RAC is a crucial component for a having maximum availability architecture in the database layer of the Core Banking Applications.

Advanced Compression: Advanced database compression capabilities of Oracle Database can be used for improving database performance and reducing storage cost in the database layer of Symphony. Especially fast-growing database environments can leverage these advanced compression capabilities delivered with this option, to speed up their large database I/Os and minimizing their database footprint.

Database Lifecycle Management: Oracle Database Lifecycle Management pack helps Core Banking Database Administrators to provision and patch multiple Oracle Database easily. Administrators of Core Banking environments with several databases (including PROD, Reporting, TEST, UAT, DEV etc.) can take the advantage of having a managed database lifecycle to eliminate the time-consuming tasks related to patching, configuration management and ongoing change management of Oracle Database environments.

Advanced Security: Core Banking environments are highly regulated environments and most of these regulations are related with the data protection. Using advanced security features (like Transparent Data Encryption and Data Redaction) of Oracle Database, out-of-band access to Core Banking data and proliferation of the sensitive data can be prevented directly.

Database Vault: There are lots of user profiles and personas using Core Banking applications and databases. (Analysts, administrators, developers, operators and so on) Using Oracle Database Vault can be used for implementing separation of duties in the core banking database layer.. It provides a unique way for restrict access to application data by privileged users.

Weblogic Server Enterprise Edition: Core Banking environment can utilize Weblogic Server Enterprise Edition in its middleware. Weblogic server is positioned as the application server, that supports fully clustered java virtual machines on it unified and extensible platform. Weblogic supports developing, deploying, and running enterprise applications, such as Java, for on-premises and cloud.

As mentioned in the intro; Core Banking applications can leverage Weblogic JVMs(Managed Servers) with all the sophisticated functionalities that come with it. This includes, clustering, scale out mechanism and even the auto-scale mechanism (considering the Cloud Platforms)

Data Integrator Enterprise Edition: Oracle Database Integrator a.k.a ODI can be used as the ETL (Extract, Transform Load) tool for providing the data integration processes around (and in) the core banking database environments. Using ODI and its sophisticated graphical interface, all those complex processes can be built easily. Monitoring of the ETL tasks can be done at all levels, change management in ETL process can be done faster and ETL itself can be done faster by leveraging the power of the target databases. ODI provides several connectors for integrating different database and Big Data environments. If needed, it can also expose its services via APIs.

Analytics Publisher: Oracle Analytics Publisher is the reporting tool that can be used within Core Banking Applications. All the reporting activities can be done using this tool. It provides both Desktop and Web interfaces. Oracle Analytics Publisher can used for generating all kinds of reports against almost any data source.

Real Application Testing: Oracle Real Application Testing a.k.a RAT is used for ensuring database performance in the cases of a new (and big) database code deployment, data migrations, database migrations, structural change in the database, database replatforming, database upgrades (and so on.) in  Core Banking environments. It is an Oracle Database product that helps the organizations foresee the effects of those kinds of changes.. To be able to see the performance effect of such a change, all the database workload is captured from the source and then replayed in the target using RAT.. Using the sophisticated reports of the tool, all the necessary analysis can be made, and the necessary improvements can be done before the production iteration.

Golden Gate: Oracle Golden Gate a replication tool, that can replicate, filter, and transform data between databases.. It operates near real time by leveraging its unique CDC features and it is clearly the best way to replicate data between Oracle databases. Golden Gate is used in various scenarios around(and in) Core Banking environments. These scenarios include cross platform data migrations, bi-directional data replications, zero downtime database migrations, zero downtime database upgrades and so on.

Golden Gate can also be positioned in the ETL processes in the relevant contexts when real time data from the source is needed and when there are various data resources to be visited.

Thursday, April 28, 2022

EBS 12.2 -- Using "SOAP" w/ ISG (Integrated SOA Gateway) -- Requires "SOA Suite"..

In EBS 12.2, we need to have SOA Suite installed and configured to be able use SOAP web services.. So don't be surprised. For using the REST Web Services, nothing extra is required, but for SOAP, we need SOA Suite and we need to license it.. 

Actually, it is impossible to miss it, because while you are configuring the ISG using the following MOS document; you will see it in the section named "Section 3.1: Installing Oracle WebLogic Server and Oracle SOA Suite for SOAP Services" under the part named "Configuring Oracle E-Business Suite SOAP Services"

Ref: Installing Oracle E-Business Suite Integrated SOA Gateway, Release 12.2 (Doc ID 1311068.1)

EBS 12.1 customers don't have to worry about that. This requirement of having SOA in place is the result of the technological changes in EBS 12.2 (namely Weblogic.) 

This was the second tip of the day:) (or should I say the first warning of the day:)

EBS 12.2 -- BNE_CREATE_DOC_ERROR, java.lang.NoSuchMethodError for .addToolPack --> "BNE: Enable OOXML Standard"

If you are facing the following issue while using the Journal wizard, (supposing your poi jar and the codes that calls the methods in it, are aligned in terms of patch levels..), just set set the profile option -> "BNE: Enable OOXML Standard" to No, restart Apache for changes to take effect and retest..

I mean ; if you login with sysadmin, connect to General Ledger Expert user - > Journals -> Launch Journal Wizard and you got the following error;

BNE_CREATE_DOC_ERROR Causing below error class java.lang.NoSuchMethodError: org.apache.poi.xssf.usermodel.XSSFWorkbook.addToolPack(Lorg/apache/poi/ss/formula/udf/UDFFinder;) Please contact your system administrator for assistance.

Just a background info for the profile ;

Ref : Oracle Support

Beginning in Release 12.2.5, you can choose to create Oracle Web Applications Desktop Integrator spreadsheets according to the Office Open XML (OOXML) standard, an XML format developed by Microsoft to represent spreadsheets and other types of documents. When using the OOXML format, Oracle Web Applications Desktop Integrator creates the spreadsheet entirely on the Oracle E-Business Suite server, and the completed spreadsheet is then downloaded to the desktop. Upload processing is also performed on the server. With this option, no macros are used during document creation and limited macros are used during upload. Consequently, the Trust access to the VBA project object model security option is not required to work with OOXML documents. Also, because the processing is performed on the server, document creation and upload use minimal desktop resources.

Remember, you can always debug these processes using the following method;

BNE Server Log Filename : BneLogger.log (ensure that file doesn't exist and if it does, delete it)

BNE Server Log Level : TRACE

BNE Server Log Path : free to choose, eg. in the IAS_TOP/Apache/Jserv/logs (use the full path)

-- Restart the Apache Server for changes to take effect.

cd $INST_TOP/admin/scripts/..

$ ./adapcctl.sh stop

$ ./adstpall.sh start

Okay.. This was the quick tip of the day : )

Wednesday, April 20, 2022

EBS / RDBMS -- High Latch Free Waits --> "Result Cache: RC Latch"

I have dealt an interesting performance issue recently.  The environment was an EBS R12 ( 12.2.6 ) .. EBS database was an Oracle 12.1.0.2 running on Solaris SPARC.

The issue was appearing in the office hours. 

Every business day around 9:30 AM, there were Latch Free waits and this situation was making the end user face a performance degradation and complain..

We had the Enterprise Manager, AWR and ASH reports. The cause aboveground was Latch Free waits, but the reason behind was the Result Cache. (Actually the improper use of the  Result Cache...)

If you don't have the necessary background info about the Result Cache, please read the following blog post for a quick enablement-> 

https://ermanarslan.blogspot.com/2019/10/rdbms-things-to-know-about-result-cache.html

(RDBMS -- things to know about the Result Cache / Result Cache : RC latch)

In this case, the following PL/SQLs were waiting on the Result Cache: RC Latch;

*FND_AOLJ_UTIL.is_Valid_ICX(:2,NULL,'Y',TRUE,TRUE,NULL,NULL,NUL)

*BEGIN   fnd_global.bless_next_init('FND_PERMIT_0006');   

 *FND_GLOBAL.APPS_INITIALIZE(    user_id=>:1    ,resp_id=>:2    ,resp_appl_id=

  >:3    ,security_group_id=>:4    ,server_id=>:5);END;

Look like a login issue right? I mean, it looked like, there was a login storm which was expected in the morning and it was the one that triggers the issue. (and actually it was the one that is becoming the victim of it..) Why do I say that? Because I saw those PLSQLs that were used in session validation, apps initialization and so on.. And! we were seeing the issue in the office office around 9 AM..

In these types issues, customers chase the quick wins at first..

So what might be the solution?

*Increasing the Result Cache Size?

*Disabling the custom code? (there was a Custom SSO on the login) 

*Gathering fixed object stats and dictionary stats?  - ref: Some Queries Are Causing Performance Issues in ISG (Doc ID 2396223.1

*Setting some hidden parameters -> alter system set "_optimizer_dsdir_usage_control" = 0;  -- ref: High Latch Free Result Cache RC LATCH On Object Linked Views (Doc ID 2245996.1) 

*Some more hidden parameters -> *alter system set "_optimizer_ads_use_result_cache" = FALSE; High "Latch Free" Waits with Contention on 'Result Cache: RC Latch' when RESULT_CACHE_MODE = MANUAL on Oracle 12c (Doc ID 2002089.1)

*Doing some other improvements -- for decreasing the latching -- moves like changing the cursor_sharing parameter --- not related actually..

*Enabling session trace for EBS users? -- doesn't tell us much in this case.

Log onto System Administrator Responsibility

Navigate: Profile > System

Search for the profile option Initialization SQL Statement - Custom (USER level. )

Enter the following sql statement into the User Level profile option. 

--modify USERID to the actual username of the user.

BEGIN FND_CTL.FND_SESS_CTL('','', '', 'TRUE','','ALTER SESSION SET TRACEFILE_IDENTIFIER='||''''||'USERID' ||''''||' EVENTS ='||''''||' 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12 '||''''); END;

*Patches? -- It was a good try..
Patch 26436717  (Database/RDBMS Home Patch) and Patch 17305006 - SEVERE PERFORMANCE SLOWDOWN WHEN RESULTS CACHE IS THRASHING is needed.
Patch 27508480: CONNECTION LEAKS FROM WSH.SERVLET.REQUESTRATES değerlendirilebilir. 
PAY122:CONNECTION LEAKS WHEN ACCESSING ONLINE W-2 IN 12.2(Patch 22684327:R12.PAY.C) 
Patches 28831943 and 26599059 for FND 
Patches 25969099 and 20141119
BNE Is Leaking Connections In12.2.4 --- AD/TXK 7, ATG 5 And HRMS PC.C.7 (Doc ID 2141923.1)
21771287: CONNECTION LEAKS FROM GWY.JSP - SIMILAR TO BUG 20446583 -- değerlendirilebilir
R12.ATG_PF.C.delta.6 Patch 21900895 or greater has been applied which includes the latest changes for BNE memory allocation.

I could keep going , but actually no need. Well... That's because, we have considered all of the things above and we actually did some of them, but we couldn't get any benefit..

-->This time, we were not looking for a needle in a haystack. (that is actually pretty easy, because a needle and a haystack are very different).. We were looking for a particular needle in a stack of needles :) -- I like this phrase by the way.

We were almost sure that, the solution should be directly related with the result cache or to those (some EBS code) using it.
Disabling the Result Cache in the database level will resolve the issue, but we were not so into that.

What we did was the following; we first made the result cache off by using the bypass mode.
Then we flushed the Result Cache and made in on again.
Once the Result Cache is flushed, we started monitoring it..

For checking the current result cache
-----------------------------------------
SELECT dbms_result_cache.status() FROM dual;

To enable the bypass mode and flush:
-----------------------------------------
BEGIN
   DBMS_RESULT_CACHE.BYPASS(TRUE);
   DBMS_RESULT_CACHE.FLUSH;
END;
/

To disable the bypass mode
-----------------------------------------
exec DBMS_RESULT_CACHE.BYPASS(FALSE);

We saw that the Result cache is occupied by the FND_PROFILE mostly..
There was no space pressure on the cache but things like FND_PROFILE.GET_PROFILE_APPL_ID and FND_PROFILE.GET_PROFILE_ID was there on the top..

Query used for Result cache monitoring:

select substr(name, 1,100) name,
cache_id,
count(*) result_count,
round(avg(scan_count)) avg_scan_count,type,status
from gv$result_cache_objects
where type = 'Result'
group by name, cache_id,type,status

A culprit from the monitoring output:

NAME                                                                            
--------------------------------------------------------------------------------
CACHE_ID                                                                        
--------------------------------------------------------------------------------
RESULT_COUNT AVG_SCAN_COUNT TYPE       STATUS                                   
------------ -------------- ---------- ---------                                
"APPS"."FND_PROFILE"::11."GET_PROFILE_APPL_ID"#32fb3b6bdac49c05 #245            
85njc349fpj4gc54hq8ca2u41q                                                      
         691         272415 Result     Published                                
                                                                                
"APPS"."FND_PROFILE"::11."GET_PROFILE_ID"#32fb3b6bdac49c05 #216                 
6m1zcmdsv8v40c201cvbaa3y8u                                                      
         721         261123 Result     Published                                
                                                                                
"APPS"."FND_PROFILE"::11."GET_LEVEL_ENABLED_FLAG"#ba365d4c80ddb2d5 #275         
4b86jg87f0gkxafawmtmr29dh4                                                      
        4746         139188 Result     Published                                
                                                                                
"APPS"."FND_PROFILE"::11."GET_HIERARCHY_TYPE"#a0e3bfe28f4de20f #326             
1q2vx7pv7jvc18uksjffyf6vb9                                                      
         678         139164 Result     Published                        

Then , we jumped into the code.. The standard code and found that FND_PROFILE was written in a way that is implicitly use the result cache.. We saw the usage of cross-session PLSQL Fuction Result Cache in multiple places of the code. (the RESULT_CACHE Clause) 
Those FND_PROFILE calls were done mostly during the login and we concluded that, when there is a login storm and when there is a DML that may affect the data/FND_PROFILE related data that is already stored in the result cache, those waits for the Result Cache Latch start appearing..
Note that, we also had some cached things that belongs to the WF_CORE, but this wasn't the issue..

Anyways, as as workaround we wrote a script (job, cron job etc.. -- you can think whatever you like) to flush the result cache every morning just before the issue happens.. (The issue was mostly seen after 9 am..)

We could also blacklist the relevant parts of the result cache, as a more elegant workaround.

Blacklisting those caches:

Using the following query, identify the Cache_IDs that has high RESULT_COUNT.

SQL> select substr(name, 1,100) name,
cache_id,
count(*) result_count,
round(avg(scan_count)) avg_scan_count,type,status
from gv$result_cache_objects
where type = 'Result'
group by name, cache_id,type,status

Use Black_list_Add to ban them..

exec dbms_result_cache.Black_List_Add(xxxxxxxxxx, TRUE);

But what about the fix? Well... Fix is in the code.. The code is written such a way to use the Result Cache, but the processes in the ERP changes the data that is cached by the code and that is too bad!

Either the code or the processes (ERP processes that is updating the data cached by FND_PROFILE) should be revisited..

Nevertheless, we have 2 workarounds! :)  Again -> Be careful when using the result cache!

Well.. I can't stop myself to give some background info here.. Here it is ;

Result cache in these kinds of scenarios brings the data faster than the buffer cache, as it has the data in the result format and it just copies it to our session/process 's buffer.

However; if we try to use the result cache in a dynamic environment, things change.
Things change, because the invalidation ( when the data and objects that builds the contents cached in the result cache change) means "Writing the Result Cache"

Writing is not a very bad thing? Yes for 1 write or 10 writes maybe it is so, but consider 1000 concurrent writes..

Why writing to result cache concurrently is a bad thing then?
It is because , the result cache is protected by a single latch.

In order to write to the cache, it is required to get an exclusive latch.
This exclusive latch is need to be get when there is a cache miss or cache invalidation..

So cache hit doesn't require the session to get that exclusive latch.
This exclusive latch, on the other hands; is a single one, and it has no child.
It is basically, when you want to write to cache, you need to get it -> concurrent write access -> Problem
However, if you read the cache (cache hit), you need to get a shared latch -> no contention -> NO Problemo :)

Here is what Oracle Support says about it ->

The result cache was designed to cache small results sets for a short period of time and once it gets full there is an overhead of handling the data in it. When no empty blocks are found in the RC we attempt to make room first by removing any invalids, then requesting a new chunk to be allocated and finally by removing using LRU. Currently, there is a cost associated with making room in a full result cache, which increases with size of the cache, especially for LRU processing and this is unlikely to change.

If you indirectly or directly put an object or let's say a result into the result cache and if the data/object that produces that result is dynamically changing; then guess what?
You will need to write to the cache..

-- By the word directly, I mean using hints -> SELECT /+result_cache/

You will have Result Cache related activity.
You will see a peak for the latch named Result Cache: RC latch.

Okay.. It is a perfect place to end.. See you in the next post :)

Sunday, April 10, 2022

EBS -- poor performance in Autoconfig -- due to Java and unnecessary waits on Syscalls -- FUTEX_WAIT & FUTEX_WAIT_PRIVATE

Recently upgraded an EBS database from 11.2.0.4 to 19C. The source apps tier was an EBS 12.1.3 and the database was an Oracle Ent. Edition 11.2.0.4. Both applications and database was running on Oracle Linux 7 Operating Systems (OEL 7.9). 

Due to the low application version, we took lots of patching actions before doing the actual database upgrade and the multi tenant conversion.

The source environment was a multi-node E-Business Suite. It was consisting of 2 SSO enabled apps nodes (Non-shared Application Filesystem), and a 2-nodes RAC database.

The production iteration was our third iteration in this project (note that we do 3 iterations at least..). 

So we already had perfected our operation. We had a detailed SOP and a Runbook. We had a detailed upgrade schedule and we estimated the duration of the upgrade tasks carefully.

But! the production 19C upgrade took longer than we thought.

The problem was in the execution of adpatch actions and autoconfig.

We had lots of patches to apply to the apps tier nodes and we had to run autoconfig several times just to make the apps tier ready for the 19C upgrade. ( you know these things changes from env to env.. In this env, there were several apps tier patches required and needed to be in place before upgrading the database to 19C and converting it to a multi-tenant  -- 1CDB-1PDB)

The real cause that made the autoconfig and adpatch run slower was an inactive wait.. We kept following the autoconfig logs during those executions for instance... And we saw that autoconfig was waiting even during the JDBC connections.. There were no issues with the database connections but autoconfig was just waiting in these kinds of basic operations and that's why the total run time of autoconfig was extending.. The total duration of an autoconfig was almost 15 mins and this was an issue that can not be ignored.. Adpatch was not doing any better than autoconfig by the way..

Anyways, we used strace to get the system calls of those running java processes.. You know... In apps, we start with sh, we continue with perl and most of the time we end up with java.. :) So we traced the java processes while they were being executed by the autoconfig (or adpatch)

We saw that the java processes were waiting on FUTEX_WAIT system calls while we were seeing those unnecessary waits.. 

Futex / Fast Mutexes are just the locking mechanisms that are used for basic locking, or as a building block for higher-level locking abstractions such as semaphores and POSIX mutexes or condition variables. This is why, we thought that there was probably a contention on a memory location, which was protected by one of those mutexes (operated by calling futexes :)  

Following is from the Man page:

long syscall(SYS_futex, uint32_t *uaddr, int futex_op, uint32_t val, const struct timespec *timeout, /* or: uint32_t val2 */ uint32_t *uaddr2, uint32_t val3);

The futex() system call provides a method for waiting until a certain condition becomes true. It is typically used as a blocking construct in the context of shared-memory synchronization. When using futexes, the majority of the synchronization operations are performed in user space. A user- space program employs the futex() system call only when it is likely that the program has to block for a longer time until the condition becomes true. Other futex() operations can be used to wake any processes or threads waiting for a particular condition.

The uaddr that we saw in the FUTEX_WAIT system calls was always the same, not changing.

So same processes were waiting on FUTEX_WAIT and the uaddr was always the same. .(this might be normal & expected, because of the implementation of virtual memory..)

Note that, I just mentioned FUTEX_WAIT so far but FUTEX_WAIT_PRIVATE is not so different than that. It seems, FUTEX_WAIT_PRIVATE is just the product of an optimization done by linux glibc to make futexes faster when they're not shared between processes. -- so just wanted to shed a light on this one.. Lets continue;

So at first we thought that those FUTEX_WAITs were caused by a contention. In order to see the contention and find the blocker ,we installed "stap" and used the script that was provided by Redhat.. (note that, the problem was on an Oracle Linux but they are almost the same right :)

The installation of stap was a little throublesome, but we installed it and used the procedure given in the Redhat article which is publically available in the following url > 
--IDENTIFYING CONTENDED USER-SPACE LOCKS

Suprisingly, there was no contention reported, even when the autoconfig was waiting for getting an established jdbc connection.

Then, we made a deep dive, checked some futex examples, wrote some code to implement futex waits and guess what we found; the contention was not the only possible cause of futex waits. A poor written code or a blocking task (slow I/O, CPU shortage , high load) could also indirectly cause this kind of an issue.

Okay now; just suppose I m the main thread and your are the child thread.. Now suppose, I ( the main) was just written in such a way that, I just acquire a lock (semaphore, mutex, futex you name it) and then create "you" / the threads and then do some other fast stuff (some things that require I/O) and only then I release that lock. 
Suppose;  you the threads are written in such a way, that you need to get that lock to start doing your actual work. Okay not a dead lock, but it is a lock!

Now suppose those fast stuff that I just mentioned were blocked.. So I m waiting for their return and that's why I don't release the lock.. Well, you will "wait"..

Okay, I need to stop this story telling, because it just started getting weird :) And I felt like we should speed up a bit. Therefore, I am now heading towards the conclusion.

So, we thought that OS or JVM might be the real cause that was making us wait, but we also thought that a poorly written code might be the cause.. So we might need a patch for it. (autoconfig patch, a tech patch or something like that..)

Java thread dump didn't help much. By the way, we got it by following the MOS note below;

*How to Obtain a Thread Dump (Stack Traces) from a Java Process or from a Core File of a Java Process on Linux (Doc ID 1282871.1)

Then, we tried dropping the fs caches of Linux.. Because some example codes, that were written in a way to read some files and import the contents of those files into the database; were running very fast in their very first executions, but they were start waiting on FUTEX_WAIT in their subsequent exeuctions. So, we thought that this might be caused by a misbehaviour of Linux FS caching and we just tried to drop the fs caches and retest.. 

It was a nice try but it didn't solve the issue :)

Okay, I m speeding up!

Well, finally we found the cause..

It was /dev/random & I was there , done that! :)

Read -> https://ermanarslan.blogspot.com/2020/05/entropy-linux-kernel-csprngs-devurandom.html -- this is one my favorites.. "Entropy, Linux Kernel - CSPRNGs, /dev/urandom vs /dev/random and all that"

Some background info about /dev/random and /dev/urandom:

In Linux, we have /dev/urandom and /dev/random for this. These are character devices and they look like files. We read them like we read files and when we read 100 bytes from them, they actually run CSPRNG on the entropy pool and give us the random number we need.

These tools provide us limited and uniform random bytes when we need. Moreover, the source they are fed, is populated by the unpredictable events.

But, as you may ask, we have two devices, right? /dev/random and /dev/urandom.. So which one should be used in which case? This is definitely the question that one may ask.

Well, first describe the difference between these tools, so that maybe we can make a decision depending on those differences.

The main difference between /dev/random and /dev/urandom is that, /dev/random tracks the entproy that we have in the entropy pool and it blocks when the entropy is low. (remember the entropy that I mentioned in the first part of the blog post).. It is basically implemented in a way to block itself when it thinks that the unpredictability is low.

Reference for the above: Erman Arslan's Oracle Blog :)

Entropy and Claude Shannon again! :)


We tested it by providing /dev/urandom using a command line argument to those java programs ..Djava.security.egd=file:/dev/./urandom did the job and we saw that this action cleared the waits.

However; we had to generalize it and somehow made it system-wide. 
We used the following for that ->
  • Open the java.security file of the related JDK/JRE.. (ex: JAVA_HOME/jre/lib/security/java.security)
  • Change the line: "securerandom.source=file:/dev/random" to "securerandom.source=file:/dev/./urandom"
  • Note that, we need to change the line to /dev/./urandom. Otherwise, java ignores it... For instance java ignores /dev/urandom.. (the one without /./ is ignored!) 
  • Save the changes.. 

Okay. That 's it :) This was for all my followers, and those ones who work in Oracle Application Technology & Oracle Linux Support..

I hope it will be useful.. 

Sunday, April 3, 2022

EBS 12.2 -- custom OAF Deployment doesn't realize the new code -- due to misplaced files/codes under OA_HTML

We had an issue with the custom OAF deployment in an newly upgraded EBS 12.2.10 environment.

We just couldn't make the new codes be activated and no matter what we did, the application was still using the old codes and we were not able to deploy the changed OAFs.

Actually, our deployments were fine, but the changes that were supposed to be delivered with those deployment, were not reflected to the system. 

Even when we deleted a custom code from JAVA_TOP, the page that was related with that code was still working without any problems.. So it was a clue.. That is, somehow EBS was getting the code from elsewhere.. Note that, we were facing this issue for almost all custom developments under JAVA_TOP. 

Before finding the real cause, we did the following, but didn't help;

Stopped all the application services, recompiled JSPs, started the application services

Cleared the java cache using Functional administrator

Cleared the browser cache

Cheared any networking cache ( including the Load Balancer)

Then, we saw that there were 2625 classes in the directory named $OA_HTML/WEB-INF/oracle.

The custom classes were also there..

So, we removed; any code (except for _pages) that reside in the directory named $OA_HTML/WEB-INF/oracle; and the issue disappeared.. 

As you may guess; the real cause was the misplacement of code.. 

That is, when the custom classes are deployed to OA_HTML/WEB-INF/oracle, they take precedence over customall,jar generated by adcgnjar under $JAVA_TOP. 

So no matter what we deploy to JAVA_TOP, it doesn't matter.. I mean, if the code we deploy to JAVA_TOP exists in OA_HTML/WEB-INF/oracle then, the code that resides in OA_HTML/WEB-INF/oracle is executed. So we can't see our changes, we can't activate our changes..

That was an interesting issue, and the question "who put the codes there?" -> is still a mystery :)

Erman Arslan's Oracle Forum / March 2022 - "Q & A Series"

This month, we had interesting issues. We were chatty :) and I tried hard to find time to answer all the questions despite the load of my work (leading my department, mission critical support activities & projects + intellectual gymnastics - physics and stuff like that ) ! :)

This month, we (GTech) had also a mission critical EBS 19C database upgrade task. Besides, I had 2 presentations .. One of them was in a physical Oracle event and other one was in online webinar.. So it was a busy month, but things went well, and I am here blogging again :)

Remember, you can ask questions and get remote support using my forum. Just click on the link named "Erman Arslan's Oracle Forum is available now". Click here to ask a question", which is available on the main page of Erman Arslan's Oracle Blog.

-- or just use the direct link:















Come on, let's see what we've been up to in March 2022.

#amaerman

WorkFlow Mailer PROCESS file by big

Rpm 32 bit ebs by satish

Form not open after upgrade to 19c by raiq1

Autoconfig failed, Non supported character set by raiq1

Migrate pluggable database from filesystem to ASM by raiq1

R12.2 Login page freezes by big

memory by Roshan

hcheck error 19c upgrade by raiq1

ap_holds_pkg.insert_single_hold by big

SSL termination - load balancer - R12.2 by satish

DMZ r12.2 admin server by satish

Sizing concurrent manager processes by satish

Migration to new server by satish

Rapidwiz nonshared appltop by satish

Patching actions in shared appltop by satish

Upgrade R12.2.0 to R12.2.10 fresh installation by satish

send email from oracle by Arsalan

RMAN recover error by Roshan

move redolog by big

App and db on single node - migration of ebs to new server by satish

Status diagram by big

Tools for migrations by satish

Workflow System Administrator by big

Rpm 12.1.3 EBS by satish

supplemental log group by Roshan

How to check custom forms in EBS R12.1.3 by soumya

Start Stop Apache by big

Cannot Launch Forms by big

certification OCI by Roshan

JDK for R12.2 by big

oracle cloud by Roshan

RAC node eviction by Roshan

row lock by Roshan

Migration of ebs R12.1.3 by satish

R12.1.3 migration from el5 32 bitto 64bit by satish

audit_file_dest by big