Navigation Bar

Friday, August 8, 2025

The Oracle Story

Oracle corporation, initially called Software Development Laboratories, was founded in 1977 by Larry Elison and Bob Miner, computer programmers at Ampex Corporation, an American electronics company along with Ed Oates, Elison's supervisor at Ampex. The idea for the relational database was inspired by a paper by Edgar F Codd that outlined a relational model. They had the vison of making this data management concept commercial as it arranged large amounts of data efficiently and also enabled quick retrieval. Thus the trio started developing the program based on Codds theory and in 1979 the company released Oracle, the earliest commercial relational database program using structured query language. 




Once he learned the skills and concepts for relational databases Larry Ellison began to pursue his dream to start a data management company now know as Oracle. In the early years it was in competition with IBM which was also in the race to develop a relational database at that time. The IBM database is IBM DB2. But of the two Oracle is more widely used and popular.

Its first customer was the US Air Force which used the program at its air force base.

Oracle has grown from its humble beginnings as one of a number of databases available in the 1970s to the overwhelming market leader today.

In 1978 the first Oracle software was born, written in assembly language running on PDP-11 under RSX-11 in 128K memory. The first Oracle version was never released and the implementation separated oracle code from user code. The name Oracle came from the code name of a CIA project that the three original founders Elison, Bob and Ed had worked on in Amex Corporation.



In the year 1979,they offered the first commercial SQL relational database management system. The second version of Oracle released ran on PDP-11 hardware and they named it as Oracle v2 to capture more customers and they starting promoting it on the VAX platform.
In 1984 the database software was ported to the PC platform with the MS-DOS version 4.1.4 running on 512K memory.
In 1985 it was released to operate in client-server mode.

Initial funding was through personal funding of its founders and Venture Capitalists and it went public in 1986 and was then financed through its IPO and since then it has not raised any additional funds through Venture Capitalist or private investors.

In 1987 UNIX-based Oracle applications were introduced and a year later Oracle v6 was released with hot backups, embedded PL/SQL procedural engine within the database and support for row-level locking. In 1988 Oracle induced PL/SQL. The growth in the company led to relocation of the world headquarters to Redwood Shores, California in 1989 and revenues reaching $584 million.

In 1989, Oracle moved its headquarters to Redwood City, California. 

In 1995, Oracle Systems Corporation changes its name to Oracle Corporation and it became the first large software company to report an internet strategy and offered the first 64-bit RDBMS.
In June 1998 Oracle v8 was released with internet technology, support for terabytes of data and SQL object technology. 

In 1998 they announced integrating a JVM with the oracle database and in September of that year Oracle 8i was release, with i standing for internet. 
In 1999 Oracle offered its first DBMS with XML support.

In 2010 Oracle Corporation acquired Sun Microsystems After the merger Oracle owned Sun's hardware product lines as well as Sun's software product lines including the JAVA programming language.
My tryst with JAVA

Oracle Corporation has now diversified into a range of services like Oracle cloud services, Oracle middleware, Oracle Beehive, Financial services, hardware systems etc.
Middleware includes weblogic server which is a J2EE server and Oracle fusion middleware.
Oracle applications include ERP, CRM and Human Capital Management HCM.
Cloud services include SaaS Software as a service, PaaS Platform as a Service, IaaS  Infracture as a Service and DaaS Database as a Service.

More on the history and the growth of the relational database can be found in the articles below

Key Events and Milestones 

Thought for the day
Courage to continue matters more than success or failure.
--Winston Churchill

Oracle Dewdrops - Aug 2025



God's Word for the day
Good things and bad, life and death,
  poverty and wealth, come from the Lord
The Lord's gift remains with the devout,
  and his favor brings lasting success
One becomes rich through diligence and self-denial,
  and the reward awarded to him is this:
When he says, "I have found rest,
  and now I shall feast on my goods!"
He does not know how long it will be
  until he leaves them to others and dies.
Sirach 11:11-13

Jesus said to the devil, "Away with you Satan! for it is written, 
'Worship and Lord your God and serve only Him.'"
Mathew 4:10

Tuesday, August 5, 2025

Oracle News - Aug 2025

Oracle Newsletter 01-Aug-25

Oracle Exadata
Oracle exadata is an enterprise database platform that runs Oracle Database workloads of any scale and criticality with high performance, availability and security. Exadata's scale-out design employs unique optimizations that let transaction processing, analytics, artificial intelligence, and mixed workloads run faster and more efficiently. Consolidating diverse Oracle Database workloads on exadata platforms in enterprise data centers, Oracle Cloud Infrastructure (OCI), and multi cloud environments helps organizations increase operational efficiency, reduce IT administration and lower costs.
More on exadata below

Oracle Exadata 




Oracle Newsletter 27-Aug-25

Oracle Enhances Electronic Data Capture Solution to Streamline Clinical Trials and Help Bring New Therapies to Market Faster


Oracle Newsletter 25-Aug-25

Diebold Nixdorf Optimizes Global Service Delivery with Oracle


Oracle Newsletter 18-Aug-25

Oracle Deploys OpenAI GPT-5 Across Database and Cloud Applications Portfolio


Oracle Newsletter 14-Aug-25

Oracle to Offer Google’s Gemini Models to Customers, Accelerating Enterprises’ Agentic AI Journeys


Oracle Newsletter 14-Aug-25

Oracle Named a Leader in IDC MarketScape Worldwide Hospitality Property Management Systems 2025 Vendor Assessment


Oracle Newsletter 13-Aug-25

NEORide Accelerates Transit Efficiency with Oracle NetSuite for Government


Oracle Newsletter 13-Aug-25

Oracle Ushers in New Era of AI-Driven Electronic Health Records


Oracle Newsletter 12-Aug-25

Cambridge Memorial Hospital Selects Oracle Health EHR to Advance Patient-Centered Care


Oracle Newsletter 08-Aug-25

Oracle Recognized as a Leader in the 2025 Gartner® Magic Quadrant™ for Strategic Cloud Platform Services


Oracle Newsletter 07-Aug-25

Oracle Helps Customers Achieve Extreme Availability and Performance for Mission-Critical and Agentic AI Applications


Oracle Newsletter 06-Aug-25

Introducing Oracle AI World—the next evolution of our flagship live event


Oracle Newsletter 06-Aug-25

Celent Recognizes Oracle for Excellence in Digital Banking Platforms


Oracle Newsletter 05-Aug-25

Selta Square Automates Pharmacovigilance with Oracle Argus


God's Word for the day
There are those who work and struggle and hurry,
    and are so much the more in want
There are others who are slow and need help,
    who lack strength and abound in poverty
but the eyes of the Lord look kindly upon them
    he lifts them out of their lowly condition
and raises up their heads to the amazement of many.
Sirach 11:11-13

Jesus said to the devil, "Again it is written,
'Do not put the Lord your God to the test'"
Mathew 4:7

Friday, August 1, 2025

Jakarta Struts : Implementation of MVC

 The Struts Framework uses the MVC design pattern using a combination of custom JSP tags and a JAVA servlet. 

In this article, I will describe how the Struts Framework maps to each component of the MVC.

From the frontend View page, a request is made for a particular Action.

This request is received from the ActionServlet, which acts as the Controller, and the ActionServlet looks up the requested URI in an XML file and determines the name of the Action Class that will perform the necessary business logic.

The Action class performs its logic on the Model Components associated with the application.

Once the Action classs has completed its processing, it returns control to the ActionServlet. As part of the return, the Action class provides a key that indicates the results of its processing. The ActionServlet uses this key to determine where the results should be forwarded for presentation.

The request is completed when the ActionServlet responds by forwarding the request to the View that was linked to the returned key, and this View presents the results of the Action.

       The MVC Model



The Jakarta Struts architecture using MVC



The Model

The model components of the Struts Framework represent the data objects of the Struts application. They often represent business objects like JavaBeans, Enterprise JavaBeans (EJBs) or object representations of data stored in a relational database. Basically anything that needs to be manipulated and presented to the front end Web application as per the client request.

The View

The view in the Struts Framework is mapped to a JSP that can contain a combination of HTML, JSP and Struts custom tags. JSPs in the Struts Framework act as a presentation layer for the response of a previously executed Controller Action. The JSPs also gather the data from the View and pass it to the Controller for a particular controller action. The Struts View contains several Struts specific tags and classes. The below code snippet contains an example of a struts view.


<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<html:form action="/loginAction.do" name="loginForm" type="com.wrox.loginForm" method="post">
    User Id: <html:text property="username"/><br/>
    Password: <html:password property="password"/><br/>
    <html:submit value="Login"/>
</html:form>

In the sample code above, we can see that several JSP custom tags are being leveraged. The tags are defined in the Struts Framework and provide a loose coupling to the Controller of the Struts application.

The Controller
The controller is the backbone of all Struts applications. It is implemented using org.apache.struts.action.ActionServlet. This servlet receives HTTP service requests and delegates control of each request, based on the URI of the imcoming request, to a user defined org.apache.struts.action.Action class. This Action class is where the model of the application is retrieved and modified. Once the action class has completed its processing, it returns a key to the ActionServlet. This key is used to determine the view that will present the results of the Action class's processing and output. Thus the ActionServlet takes named requests for services and based on these requests creates Action objects to perform the business logic required to complete the service request.


DirectoryContains
/webappThe root directory of the web application. All JSP and HTML files are stored here
/webapp/WEB-INFThis directory contains all resources related to the application that are not in the document root of the application. It is where the web application deployment descriptor is located
/webapp/WEB-INF/classesThis is where the servlet and other classes are located.
/webapp/WEB-INF/libThis directory contains Java Archive (JAR) files that the web application is dependent on


References 


God's Word for the day
Do not find fault before you investigate
  examine first and then criticize
Do not answer before you listen
  and do not interrupt when another is speaking.
Do not argue about a matter that does not concern you
  and do not sit with sinners when they judge a case
Sirach 11:7-9

One does not live by bread alone, 
  but by every word that comes from the mouth of God
Mathew 4:4

Author's Note
Web applications allow compiled classes to be stored in both /WEB-INF/classes and /WEB-INF/lib directories. The class loader will load classes from the /classes directory first, followed by JARs in the /lib directory. It you have duplicate classes in the /classes and /lib directories, the classes in the /classes directory will take precedence.
 -- James Goodwill, Richard Hightower

Monday, July 28, 2025

Oracle Event Tracing and Tkprof

Event tracing in Oracle is a mechanism of capturing information about a particular event or problem in the database such as a database slowness or a performance issue. This trace information that is captured provides valuable diagnostic information that can then be analyzed for trouble shooting, performance tuning, security auditing etc.  This involves the generation of a trace file which is converted into a readable format using the the tkprof utility.

An event id is associated for a particular event which has to be troubleshooted or debugged. Of these, the most important event for a PLSQL developer is the 10046 trace event. The command for generating the oracle trace file is

ALTER SESSION SET EVENTS '10046 trace name context forever, level {N}';

N = 1 - enable the standard SQL_TRACE facility. This is no different than setting SQL_TRACE=true
N = 4 - enable standard SQL_TRACE but also capture bind variable values in the trace file
N = 8 - enable standard SQL_TRACE but also capture wait events at the query level into the trace file
N = 12 - enable standard SQL_TRACE and include both bind variables and waits
N = 32 – Never write row source statistics (STAT lines) to the trace file (equivalent to plan_stat=NEVER)
N = 64 – Row source statistics (STAT lines) are written to the trace file for every minute of DB time consumed by the SQL statement (equivalent to plan_stat=ADAPTIVE) (11.2.0.2/patch 8328200 only).
Level 8 (with waits) is the default choice, because it gives the wait event statistics (Number of Times Waited, Maximum Wait Time and Total Wait Time) for each SQL.

This trace event is very useful for performance troubleshooting, particularly for SQL and PLSQL. It captures information of SQL execution, including wait events, bind variables and execution plans. This data can then be analyzed for identifying performance bottlenecks in SQL and PLSQL code. This event is also useful for monitoring changes to your database schema as it provides information about when and how objects like tables, stored procedures, views, triggers etc have been created.

Additional useful information about tkprof usage can be obtained by typing tkprof (Enter) on the cmd line.

C:\Users\winni>tkprof
Usage: tkprof tracefile outputfile [explain= ] [table= ]
              [print= ] [insert= ] [sys= ] [sort= ]
  table=schema.tablename   Use 'schema.tablename' with 'explain=' option.
  explain=user/password    Connect to ORACLE and issue EXPLAIN PLAN.
  print=integer    List only the first 'integer' SQL statements.
  pdbtrace=user/password   Connect to ORACLE to retrieve SQL trace records.
  aggregate=yes|no
  insert=filename  List SQL statements and data inside INSERT statements.
  sys=no           TKPROF does not list SQL statements run as user SYS.
  record=filename  Record non-recursive statements found in the trace file.
  waits=yes|no     Record summary for any wait events found in the trace file.
  sort=option      Set of zero or more of the following sort options:
    prscnt  number of times parse was called
    prscpu  cpu time parsing
    prsela  elapsed time parsing
    prsdsk  number of disk reads during parse
    prsqry  number of buffers for consistent read during parse
    prscu   number of buffers for current read during parse
    prsmis  number of misses in library cache during parse
    execnt  number of execute was called
    execpu  cpu time spent executing
    exeela  elapsed time executing
    exedsk  number of disk reads during execute
    exeqry  number of buffers for consistent read during execute
    execu   number of buffers for current read during execute
    exerow  number of rows processed during execute
    exemis  number of library cache misses during execute
    fchcnt  number of times fetch was called
    fchcpu  cpu time spent fetching
    fchela  elapsed time fetching
    fchdsk  number of disk reads during fetch
    fchqry  number of buffers for consistent read during fetch
    fchcu   number of buffers for current read during fetch
    fchrow  number of rows fetched
    userid  userid of user that parsed the cursor


From the sort options, two notable attributes for the tkprof for identifying query performance issues are

  • exeela - elapsed time executing. This is useful for identifying dmls (inserts, updates, deletes) taking time. The tkprof output will be sorted on execution time, from highest to lowest.
  • fchela - elapsed time fetching. This is useful for identifying select queries taking time. The tkprof output will be sorted on select fetch time, from highest to lowest.

Below is  an example of tracing a session and using tkprof to analyze the trace file output.  A sample command to sort on query fetches taking time.

tkprof xe_ora_14232_MY_TEST_SESSION.trc xe_ora_14232_MY_TEST_SESSION.txt explain=HR/HR@xepdb1 table=sys.plan_table sys=no waits=yes sort-fchela
Start tracing the session with the following commands. You can give an identifier to the trace file
ALTER SESSION SET EVENTS '10046 trace name context forever, level 8';
ALTER SESSION SET TRACEFILE_IDENTIFIER = "MY_TEST_SESSION_TRACE";
We now create some sample DDL and DML statements.
CREATE TABLE cal_cntr
(
  id NUMBER, 
  cal_date DATE, 
  name VARCHAR2(10)
);

ALTER TABLE EMPLOYEES MODIFY (SALARY NUMBER(22,6));
declare
v_count  number;
emp_id   number := 100;
begin
v_count:=0;
for i in 1..100 loop
   for j in 1..25 loop
   v_count:= v_count+1;
   insert into cal_cntr values (v_count, sysdate-i, 'system');
   end loop;
   v_count:=0;
   for j in 1..25 loop
   v_count:= v_count+1;
   IF emp_id > 206
   THEN
    emp_id := 100;
   END IF; 
   update employees
   set salary = salary * 0.5
   where employee_id = emp_id;
   emp_id := emp_id + 1;
   end loop;
  end loop;
  commit;
  end;
/
We now trace off the session with the following command.
ALTER SESSION SET EVENTS '10046 trace name context off';
We now find the trace file for that session with the following query
SELECT value 
      FROM v$diag_info 
      WHERE name = 'Default Trace File';
E:\INSTALL\21CXE\diag\rdbms\xe\xe\trace\xe_ora_14232_MY_TEST_SESSION.trc
As SYSTEM user you can see the contents of this trace file by running the following query.
SELECT payload
FROM   v$diag_trace_file_contents
WHERE  trace_filename = 'xe_ora_14232_MY_TEST_SESSION.trc'
ORDER BY line_number;
The output of this file is in a non readable format, so we need to run a tkprof on this file to see the output which will show the time statistics, the number or executions, the explain plan of the query etc. 
The statistics displayed in the trace file output are
  • Parse and Execute Fetch Counts
  • CPU and Elapsed Times
  • Number of rows processed
  • Misses on the library cache
  • Username under which each parse occurred.
  • Each commit and rollback

Below is the tkprof command for the same.
tkprof xe_ora_14232_MY_TEST_SESSION.trc xe_ora_14232_MY_TEST_SESSION.txt explain=HR/HR@xepdb1 table=sys.plan_table sys=no waits=yes
A sample of the data of the tkprof output is below which shows the DMLs and DDLs executed during the time of the session tracing.
:TKPROF: Release 21.0.0.0.0 - Development on Wed Jul 16 17:21:46 2025

Copyright (c) 1982, 2021, Oracle and/or its affiliates.  All rights reserved.

Trace file: xe_ora_14232_MY_TEST_SESSION.trc
Sort options: default

********************************************************************************
count    = number of times OCI procedure was executed
cpu      = cpu time in seconds executing 
elapsed  = elapsed time in seconds executing
disk     = number of physical reads of buffers from disk
query    = number of buffers gotten for consistent read
current  = number of buffers gotten in current mode (usually for update)
rows     = number of rows processed by the fetch or execute call
********************************************************************************

..........
..........
..........
..........
..........
..........


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse       11      0.00       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       12      0.00       0.00          0          0          0           0

Misses in library cache during parse: 11
Optimizer mode: ALL_ROWS
Parsing user id: 109  

Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  SQL*Net message to client                      13        0.00          0.00
  SQL*Net message from client                    13       98.61        184.67
  SQL*Net break/reset to client                  24        0.00          0.00
  PGA memory operation                            1        0.00          0.00
********************************************************************************

declare
v_count  number;
emp_id   number := 100;
begin
v_count:=0;
for i in 1..100 loop
   for j in 1..25 loop
   v_count:= v_count+1;
   insert into cal_cntr values (v_count, sysdate-i, 'system');
   end loop;
   v_count:=0;
   for j in 1..25 loop
   v_count:= v_count+1;
   IF emp_id > 206
   THEN
    emp_id := 100;
   END IF; 
   update employees
   set salary = salary *2
   where employee_id = emp_id;
   emp_id := emp_id + 1;
   end loop;
  end loop;
  commit;
  end;

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        2      0.04       0.08          0         59          0           0
Execute      2      0.60       0.66          0          0          2           1
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        4      0.64       0.75          0         59          2           1

Misses in library cache during parse: 2
Optimizer mode: ALL_ROWS
Parsing user id: 109  

Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  SQL*Net break/reset to client                   2        0.00          0.00
  SQL*Net message to client                       2        0.00          0.00
  SQL*Net message from client                     2       24.26         32.25
  log file sync                                   1        0.00          0.00
  PGA memory operation                            1        0.00          0.00
********************************************************************************

SQL ID: byz7g33mj9zcu Plan Hash: 0

INSERT INTO CAL_CNTR 
VALUES
 (:B2 , SYSDATE-:B1 , 'system')


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        2      0.00       0.00          0          0          0           0
Execute   3050      0.25       0.56        196         29      12518        3050
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total     3052      0.25       0.56        196         29      12518        3050

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 109     (recursive depth: 1)
Number of plan statistics captured: 2

Rows (1st) Rows (avg) Rows (max)  Row Source Operation
---------- ---------- ----------  ---------------------------------------------------
         0          0          0  LOAD TABLE CONVENTIONAL  CAL_CNTR (cr=1 pr=4 pw=0 time=47016 us starts=1)


Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  Disk file operations I/O                        2        0.00          0.00
  db file sequential read                       110        0.02          0.30
  db file scattered read                          3        0.01          0.02
********************************************************************************

SQL ID: 0jwztfffy5n3t Plan Hash: 751015319

UPDATE EMPLOYEES SET SALARY = SALARY *2 
WHERE
 EMPLOYEE_ID = :B1 


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        2      0.00       0.00          0          0          0           0
Execute   3036      0.88       1.16         12       6228      12683        3035
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total     3038      0.88       1.16         12       6228      12683        3035

Misses in library cache during parse: 2
Misses in library cache during execute: 2
Optimizer mode: ALL_ROWS
Parsing user id: 109     (recursive depth: 1)
Number of plan statistics captured: 2

Rows (1st) Rows (avg) Rows (max)  Row Source Operation
---------- ---------- ----------  ---------------------------------------------------
         0          0          0  UPDATE  EMPLOYEES (cr=14 pr=4 pw=0 time=60559 us starts=1)
         1          1          1   INDEX UNIQUE SCAN EMP_EMP_ID_PK (cr=2 pr=0 pw=0 time=19 us starts=1 cost=1 size=8 card=1)(object id 75845)


Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  db file sequential read                        10        0.01          0.04
  Disk file operations I/O                        1        0.00          0.00
  db file scattered read                          1        0.01          0.01
********************************************************************************

SQL ID: 9dck4bumgswqv Plan Hash: 0

..........
..........
..........
..........
..........
..........

SQL ID: cd2dpuw5ucc8c Plan Hash: 0

ALTER TABLE EMPLOYEES MODIFY (SALARY NUMBER(20,5))


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.03          0          4          0           0
Execute      1      0.03       0.11          0          2          4           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.03       0.15          0          6          4           0

Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 109  

Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  Compression analysis                            9        0.00          0.00
  SQL*Net message to client                       1        0.00          0.00
  SQL*Net message from client                     1        4.23          4.23
********************************************************************************

..........
..........
..........
..........
..........
..........


********************************************************************************

OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse       22      0.09       0.18          0        101          0           0
Execute     12      1.74       1.91          0        224          6           1
Fetch        7      0.01       0.01          0        286          0          39
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total       41      1.85       2.11          0        611          6          40

Misses in library cache during parse: 21
Misses in library cache during execute: 6

Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  SQL*Net message to client                      29        0.00          0.00
  SQL*Net message from client                    29       98.61        258.41
  SQL*Net break/reset to client                  29        0.00          0.00
  PGA memory operation                          716        0.00          0.04
  Compression analysis                            9        0.00          0.00
  log file sync                                   1        0.00          0.00


OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse      259      0.17       0.22          0        248          0           0
Execute  10300      1.75       2.87        336       7106      29244        9323
Fetch     1765      0.08       0.15          7       3661          0        2798
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total    12324      2.01       3.25        343      11015      29244       12121

Misses in library cache during parse: 123
Misses in library cache during execute: 113

Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  PGA memory operation                           70        0.00          0.00
  Disk file operations I/O                        4        0.00          0.00
  db file sequential read                       199        0.02          0.70
  db file scattered read                          6        0.01          0.03

   34  user  SQL statements in session.
  238  internal SQL statements in session.
  272  SQL statements in session.
    0  statements EXPLAINed in this session.
********************************************************************************
Trace file: xe_ora_14232_MY_TEST_SESSION.trc
Trace file compatibility: 12.2.0.0
Sort options: default

       1  session in tracefile.
      34  user  SQL statements in trace file.
     238  internal SQL statements in trace file.
     272  SQL statements in trace file.
     152  unique SQL statements in trace file.
   26640  lines in trace file.
     264  elapsed seconds in trace file.

We can also use the dbms_monitor oracle package to enable and disable the tracing.
For this we grant execute on DBMS_MONITOR package as SYS user

GRANT EXECUTE ON DBMS_MONITOR TO HR;

Below are a list of commands that can be used to trace using DBMS_MONITOR
EXEC DBMS_MONITOR.session_trace_enable;
EXEC DBMS_MONITOR.session_trace_enable(waits=>TRUE, binds=>FALSE);
EXEC DBMS_MONITOR.session_trace_disable;

EXEC DBMS_MONITOR.session_trace_enable(session_id=>9, serial_num=>62220);
EXEC DBMS_MONITOR.session_trace_enable(session_id =>9, serial_num=>62220, waits=>TRUE, binds=>FALSE);
EXEC DBMS_MONITOR.session_trace_disable(session_id=>9, serial_num=>62220);

EXEC DBMS_MONITOR.client_id_trace_enable(client_id=>'test');
EXEC DBMS_MONITOR.client_id_trace_enable(client_id=>'test', waits=>TRUE, binds=>FALSE);
EXEC DBMS_MONITOR.client_id_trace_disable(client_id=>'test');

EXEC DBMS_MONITOR.serv_mod_act_trace_enable(service_name=>'xe', module_name=>'test_trace', action_name=>'running');
EXEC DBMS_MONITOR.serv_mod_act_trace_enable(service_name=>'xe', module_name=>'test_trace', action_name=>'running', waits=>TRUE, binds=>FALSE);
EXEC DBMS_MONITOR.serv_mod_act_trace_disable(service_name=>'xe', module_name=>'test_trace', action_name=>'running');

References 
SQL trace, 10046, trcsess and tkprof in Oracle
Performance Tuning Basics 5 : Trace and TKPROF – Part 1: Trace

God's Word for the day

The poor are honored for their knowledge,                                                                                                 
  While the rich are honored for their wealth.                                                                                              
One who is honored in poverty, how much more in wealth,                                                                       
  And one who is dishonored in wealth, how much more in poverty.                                                          
Sirach 10:30-31

Appendix

A list of Oracle events and their usage is given below

10000 control file debug event, name 'control_file'
10001 control file crash event1
10002 control file crash event2
10003 control file crash event3
10004 control file crash event4
10005 trace latch operations for debugging
10006 testing - block recovery forced
10007 log switch debug crash after new log select, thread %s
10008 log switch debug crash after new log header write, thread %s
10009 log switch debug crash after old log header write, thread %s
10010 Begin Transaction
10011 End Transaction
10012 Abort Transaction
10013 Instance Recovery
10014 Roll Back to Save Point
10015 Undo Segment Recovery
10016 Undo Segment extend
10017 Undo Segment Wrap
10018 Data Segment Create
10019 Data Segment Recovery
10020 partial link restored to linked list (KSG)
10021 latch cleanup for state objects (KSS)
10022 trace ktsgsp
10023 Create Save Undo Segment
10024 Write to Save Undo
10025 Extend Save Undo Segment
10026 Apply Save Undo
10027 latch cleanup for enqueue locks (KSQ)
10028 latch cleanup for enqueue resources (KSQ)
10029 session logon (KSU)
10030 session logoff (KSU)
10031 row source debug event (R*)
10032 sort end (SOR*)
10035 parse SQL statement (OPIPRS)
10036 create remote row source (QKANET)
10037 allocate remote row source (QKARWS)
10038 dump row source tree (QBADRV)
10039 type checking (OPITCA)
10040 dirty cache list
10041 dump undo records skipped
10042 trap error during undo application
10044 free list undo operations
10045 "free list update operations - ktsrsp, ktsunl"
10046 enable SQL statement timing
10047 trace switching of sessions
10048 Undo segment shrink
10049 protect library cache memory heaps
10050 sniper trace
10051 trace OPI calls
10052 don't clean up obj$
10053 CBO Enable optimizer trace
10054 trace UNDO handling in MLS
10055 trace UNDO handing
10056 dump analyze stats (kdg)
10057 suppress file names in error messages
10058 use table scan cost in tab$.spare1
10060 CBO Enable predicate dump
10061 disable SMON from cleaning temp segment
10062 disable usage of OS Roles in osds
10063 disable usage of DBA and OPER privileges in osds
10064 "thread enable debug crash level %s, thread %s"
10065 limit library cache dump information for state object dump
10066 simulate failure to verify file
10067 force redo log checksum errors - block number
10068 force redo log checksum errors - file number
10069 Trusted Oracle test event
10070 force datafile checksum errors - block number
10071 force datafile checksum errors - file number
10072 protect latch recovery memory
10073 have PMON dump info before latch cleanup
10074 default trace function mask for kst
10075 CBO Disable outer-join to regular join conversion
10076 CBO Enable cartesian product join costing
10077 CBO Disable view-merging optimization for outer-joins
10078 CBO Disable constant predicate elimination optimization
10080 dump a block on a segment list which cannot be exchanged
10081 segment High Water Mark has been advanced
10082 free list head block is the same as the last block
10083 a brand new block has been requested from space management
10084 free list becomes empty
10085 free lists have been merged
10086 CBO Enable error if kko and qka disagree on oby sort
10087 disable repair of media corrupt data blocks
10088 CBO Disable new NOT IN optimization
10089 CBO Disable index sorting
10090 invoke other events before crash recovery
10091 CBO Disable constant predicate merging
10092 CBO Disable hash join
10093 CBO Enable force hash joins
10094 before resizing a data file
10095 dump debugger commands to trace file
10096 after the cross instance call when resizing a data file
10097 after generating redo when resizing a data file
10098 after the OS has increased the size of a data file
10099 after updating the file header with the new file size
10100 after the OS has decreased the size of a data file
10101 atomic redo write recovery
10102 switch off anti-joins
10103 CBO Disable hash join swapping
10104 dump hash join statistics to trace file
10105 CBO Enable constant pred trans and MPs w WHERE-clause
10106 CBO Disable evaluating correlation pred last for NOT IN
10107 CBO Always use bitmap index
10108 CBO Don't use bitmap index
10109 CBO Disable move of negated predicates
10110 CBO Try index rowid range scans
10111 Bitmap index creation switch
10112 Bitmap index creation switch
10113 Bitmap index creation switch
10114 Bitmap index creation switch
10115 CBO Bitmap optimization use maximal expression
10116 CBO Bitmap optimization switch
10117 CBO Disable new parallel cost model
10118 CBO Enable hash join costing
10119 QKA Disable GBY sort elimination
10120 CBO Disable index fast full scan
10121 CBO Don't sort bitmap chains
10122 CBO disable count(col) => count(*) transformation
10123 QKA Disable Bitmap And-EQuals
10145 test auditing network errors
10146 enable Oracle TRACE collection
10200 block cleanout
10201 consistent read undo application
10202 consistent read block header
10203 consistent read buffer status
10204 signal recursive extend
10205 row cache debugging
10206 transaction table consistent read
10207 consistent read transactions' status report
10208 consistent read loop check
10209 enable simulated error on control file
10210 check data block integrity
10211 check index block integrity
10212 check cluster integrity
10213 crash after control file write
10214 simulate write errors on control file
10215 simulate read errors on control file
10216 dump control file header
10217 debug sequence numbers
10218 dump uba of applied undo
10219 monitor multi-pass row locking
10220 show updates to the transaction table
10221 show changes done with undo
10222 row cache
10223 transaction layer - turn on verification codes
10226 trace CR applications of undo for data operations
10227 verify (multi-piece) row structure
10228 trace application of redo by kcocbk
10230 check redo generation by copying before applying
10231 skip corrupted blocks on _table_scans_
10232 dump corrupted blocks symbolically when kcbgotten
10233 skip corrupted blocks on index operations
10234 trigger event after calling kcrapc to do redo N times
10235 check memory manager internal structures
10236 library cache manager
10237 simulate ^C (for testing purposes)
10238 instantiation manager
10239 multi-instance library cache manager
10240 dump dba's of blocks that we wait for
10241 dump SQL generated for remote execution (OPIX)
10243 simulated error for test %s of K2GTAB latch cleanup
10244 make tranids in error msgs print as 0.0.0 (for testing)
10245 simulate lock conflict error for testing PMON
10246 print trace of PMON actions to trace file
10247 Turn on scgcmn tracing. (VMS ONLY)
10248 turn on tracing for dispatchers
10249 turn on tracing for multi-stated servers
10250 Trace all allocate and free calls to the topmost SGA heap
10251 check consistency of transaction table and undo block
10252 simulate write error to data file header
10253 simulate write error to redo log
10254 trace cross-instance calls
10256 turn off multi-threaded server load balancing
10257 trace multi-threaded server load balancing
10258 force shared servers to be chosen round-robin
10259 get error message text from remote using explicit call
10260 Trace calls to SMPRSET (VMS ONLY)
10261 Limit the size of the PGA heap
10262 Don't check for memory leaks
10263 Don't free empty PGA heap extents
10264 Collect statistics on context area usage (x$ksmcx)
10265 Keep random system generated output out of error messages
10266 Trace OSD stack usage
10267 Inhibit KSEDMP for testing
10268 Don't do forward coalesce when deleting extents
10269 Don't do coalesces of free space in SMON
10270 Debug shared cursors
10271 distributed transaction after COLLECT
10272 distributed transaction before PREPARE
10273 distributed transaction after PREPARE
10274 distributed transaction before COMMIT
10275 distributed transaction after COMMIT
10276 distributed transaction before FORGET
10277 Cursor sharing (or not) related event (used for testing)
10281 maximum time to wait for process creation
10282 Inhibit signalling of other backgrounds when one dies
10286 Simulate control file open error
10287 Simulate archiver error
10288 Do not check block type in ktrget
10289 Do block dumps to trace file in hex rather than fromatted
10290 kdnchk - checkvalid event - not for general purpose use.
10291 die in dtsdrv to test controlfile undo"
10292 dump uet entries on a 1561 from dtsdrv"
10293 dump debugging information when doing block recovery"
10294 enable PERSISTENT DLM operations on non-compliant systems"
10300 disable undo compatibility check at database open
10301 Enable LCK timeout table consistency check"
10320 Enable data layer (kdtgrs) tracing of space management calls"
10352 report direct path statistics
10353 number of slots
10354 turn on direct read path for parallel query
10355 turn on direct read path for scans
10356 turn on hint usage for direct read
10357 turn on debug information for direct path
10374 parallel query server interrupt (validate lock value)
10375 turn on checks for statistics rollups
10376 turn on table queue statistics
10377 turn off load balancing
10379 direct read for rowid range scans (unimplemented)
10380 kxfp latch cleanup testing event
10381 kxfp latch cleanup testing event
10382 parallel query server interrupt (reset)
10383 auto parallelization testing event
10384 parallel dataflow scheduler tracing
10385 parallel table scan range sampling method
10386 parallel SQL hash and range statistics
10387 parallel query server interrupt (normal)
10388 parallel query server interrupt (failure)
10389 parallel query server interrupt (cleanup)
10390 Trace parallel query slave execution
10391 trace rowid range partitioning
10392 parallel query debugging bits
10393 print parallel query statistics
10394 allow parallelization of small tables
10395 adjust sample size for range table queues
10396 circumvent range table queues for queries
10397 suppress verbose parallel coordinator error reporting
10398 enable timeouts in parallel query threads
10399 use different internal maximum buffer size
10400 turn on system state dumps for shutdown debugging
10500 turn on traces for SMON
10510 turn off SMON check to offline pending offline rollbacksegment
10511 turn off SMON check to cleanup undo dictionary
10512 turn off SMON check to shrink rollback segments
10600 check cursor frame allocation
10602 cause an access violation (for testing purposes)
10603 cause an error to occur during truncate (for testing purposes)
10604 trace parallel create index
10605 enable parallel create index by default
10606 trace parallel create index
10607 trace index rowid partition scan
10608 trace create bitmap index
10610 trace create index pseudo optimizer
10666 Do not get database enqueue name
10667 Cause sppst to check for valid process ids
10690 Set shadow process core file dump type (Unix only)
10691 Set background process core file type (Unix only)
10700 Alter access violation exception handler
10701 Dump direct loader index keys
10702 Enable histogram data generation
10703 Simulate process death during enqueue get
10704 Print out information about what enqueues are being obtained
10706 Print out information about instance lock manipulation
10707 Simulate process death for instance registration
10708 Print out Tracing information for skxf multi instance comms
10709 enable parallel instances in create index by default
10710 trace bitmap index access
10711 trace bitmap index merge
10712 trace bitmap index or
10713 trace bitmap index and
10714 trace bitmap index minus
10715 trace bitmap index conversion to rowids
10800 disable Smart Disk scan
10801 enable Smart Disk trace
10802 reserved for Smart Disk
10803 write timing statistics on OPS recovery scan
10804 reserved for ksxb
10805 reserved for row source sort
10900 extent manager fault insertion event #%s
10924 import storage parse error ignore event
10925 trace name context forever
10926 trace name context forever
10927 trace name context forever
10928 trace name context forever
10999 do not get database enqueue name
References 
For trace Event Numbers

Saturday, July 19, 2025

ASM Cluster File System (ACFS)

 Prior to Oracle 11.2, ASM was used to store database related files, but was not suitable to act as a general purpose file system to store Oracle binaries, core dump files, parameter or trade files. With the introduction of grid infrastructure in Oracle 11.2, ACFS also got introduced as part of grid. ACFS is a POSIX compliant general purpose cluster file system built on top of the ASM Dynamic Volume Manager (ADVM). ADVM provides so called volumes on which the ACFS can be created. An ADVM volume is created as part of an ASM disk group. Volumes are not partitioned which is equivalent to using LVM in a linux system. 

In addition to using ACFS for shared Oracle Homes, it is used to store application data that previously could not be stored in ASM. For instance, external tables refer to directory files to load data from the file system to the database. If this directory file exists on the file system on the first node, a user trying to access the external table from the third node will not be able to do it. If we move this file to a directory on the ACFS mount, this problem is solved as the ACFS mounts are shared across all nodes.

Creating an ACFS using ACMCA

First create a diskgroup as described in the blog below.

Adding a new Shared disk group in RAC in VM Workstation 10

The diskgroup can then be used to store an ADVM volume. 
In the Volumes tab, click on the CREATE button.

In the new screen that comes, we specify a name for the ADVM (DGVOL1) and place the diskgroup we created on this volume. Unlike a classical LVM on a linux file system, we do not have to partition the volume It can be dynamically resized. You can optionally specify a stripe width and also the number of volumes in the stripe set. By default these default to 128K and 4. On clicking OK, ASCMA creates the volume and displays it on the overview screen. This volume needs an ACFS file system.

Click on the ASM cluster file system tab. Here the user has two options. Either specify the ACFS home as a shared home for the Oracle RDBMS installation for which 4.6 GB is required or create a general purpose file system. When creating a general purpose file system, you have to specify a mount point. The ACFS will be mounted on the cluster node. Here you have the option of registering the mount point. If you register the mount point, the file system is mounted automatically when the grid infrastructure starts. If you do not register the mount point it can always be done later.

Creating and mounting an ACFS using the command line
sqlplus / as sysasm
SQL> CREATE DISKGROUP DG2 EXTERNAL REDUNDANCY DISK 'ORCL:DG2';
Diskgroup created. 

Using the ALTER DISKGROUP cmd you can set the attributes like compatible.asm and compatible.advm based on the version of oracle.

Mount the diskgroup on all the nodes with the following command

$ srvctl start diskgroup –g DG2
Once the diskgroup is created, you can create an ADVM volume and add it to the diskgroup created with the following command.
SQL> Alter diskgroup DG2 add volume VOL2 size 1G mirror strip _width 128k stripe_columns 4;
You can see the details of the volume created from the v$asm_volume view. This view will give the details of the volume device created. Lets say it is /dev/asm/VOL2-777 and the volumne_name is ACFSDGVOL2
 SQL} SELECT volume_name, state, volume_device FROM V$ASM_VOLUME 
     WHERE volume_name ='ACFSDGVOL2';
volume_namestatevolume_device
ACFSDGVOL2ENABLED/dev/asm/VOL2-777

You can also get the volume device information using asmcmd

ASMCMD> volinfo -a
Diskgroup Name: DATA1
         Volume Name: ACFSDGVOL2
         Volume Device: /dev/asm/VOL2-777
         State: ENABLED
         Size (MB): 5120
         Resize Unit (MB): 32
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage:
         Mountpath:
The next step is to create a filesystem on the volume just created.
$/sbin/mkfs -t acfs /dev/asm/VOL2-777
We then create a mount point to mount the file system.
$mkdir $ORACLE_BASE/acfsmounts
$mkdir $ORACLE_BASE/acfsmounts/dg2_vol2
Login as root user to mount the filesystem created on the mount point.
$mount –t acfs  /dev/asm/VOL2-777  /u01/app/oracle/acfsmounts/dg2_vol2
You can register the acfs with the mount registry with the following command.
$ /sbin/acfsutil  registry  –a  /dev/asm/VOL2-777   /u01/app/oracle/acfsmounts/dg2_vol2
You can view the details of the filesystem created with the following command.
$ /sbin/acfsutil info fs
This filesystem can then be used like any normal linux filesystem. df -k will give the details of the filesystem and the mountpoint. Any directories or files created in the filesystem can be accessed on all other nodes of this filesystem.
Once the filesystem is created and mounted, ensure that the permissions are set to allow access to the filesystem for the appropriate users.
# chown -R oracle:dba /u01/app/oracle/acfsmounts/dg2_vol2
You can create a test file and check if it is accessible on the other node. For instance, on node 1, create a file as follows
# echo “Testing ACFS file system” > /u01/app/oracle/acfsmounts/dg2_vol2/acfsfile.txt
You can access this file on Node 2 as follows
# cat /u01/app/oracle/acfsmounts/dg2_vol2/acfsfile.txt.
The output will be
# Testing ACFS file system

References
God's Word for the day
The wisdom of the humble lifts their head high
  and seats them among the great
Do not praise individuals for their good looks
  or loathe anyone for appearances alone
The bee is small among flying creatures
  but what it produces is the best of sweet things
Do not boast about wearing fine clothes
  and do not exalt yourself when you are honored.
For the works of the Lord are wonderful
  and his works are concealed from humankind.
Sirach 11:1-4

Thursday, July 10, 2025

Oracle Dewdrops - Jul 2025

           The kingdom of God is like a mustard seed that someone took and sowed in the garden.  

It grew and became like a tree and the birds of the air made nests in its branches.

Luke 13: 18-19


Dewdrop #85 22-Jul-25

ASM Cluster File System (ACFS)


Dewdrop #83 07-Jul-25

Oracle Event Tracing and Tkprof


Dewdrop #80 03-Jul-25

Indexes in Oracle


Dewdrop #79 03-Jul-25

To add a datafile to a tablespace


God's Word for the day
Do not make a display of your wisdom when you do your work 
    And do not boast when you are in need 
Better is the worker who has goods in plenty 
   than the boaster who lacks bread.
Sirach 10:26-27