This document provides instructions for using the gdb debugger to profile C function sequences in Oracle. It outlines the goals of learning how to use gdb for profiling and lists prerequisites. It then provides step-by-step instructions for tracing an Oracle query using native Oracle tracing mechanisms and the Linux strace utility to include system call information.
Introduction to MySQL Query Tuning for Dev[Op]sSveta Smirnova
To get data, we query the database. MySQL does its best to return requested bytes as fast as possible. However, it needs human help to identify what is important and should be accessed in the first place.
Queries, written smartly, can significantly outperform automatically generated ones. Indexes and Optimizer statistics, not limited to the Histograms only, help to increase the speed of the query a lot.
In this session, I will demonstrate by examples of how MySQL query performance can be improved. I will focus on techniques, accessible by Developers and DevOps rather on those which are usually used by Database Administrators. In the end, I will present troubleshooting tools which will help you to identify why your queries do not perform. Then you could use the knowledge from the beginning of the session to improve them.
Talk at "Istanbul Tech Talks" in Istanbul, April, 17, 2018. http://www.istanbultechtalks.com/
In this talk I will show how to get started with MySQL Query Tuning. I will make short introduction into physical table structure and demonstrate how it may influence query execution time. Then we will discuss basic query tuning instruments and techniques, mainly EXPLAIN command with its latest variations. You will learn how to understand its output and how to rewrite query or change table structure to achieve better performance.
Tutorial which I presented at Percona Live 2018 conference (https://www.percona.com/live/18/sessions/mysql-performance-schema-in-action) together with Alexander Rubin.
====
Performance Schema in MySQL is maturing from version to version. It includes extended lock instrumentation, memory usage statistics, new tables for server variables, first time ever instrumentation for user variables, prepared statements and stored routines.
Version 8.0 adds additional variables, replication, error messages, data locks instrumentation. A lot! Amazing! And complicated!
In this tutorial, we will try all these instruments out. We will provide a test environment and a few typical problems that would be difficult to solve before MySQL 5.7. Just few examples:
- "Where is memory going?"
- "Why are these queries hanging?"
- "How huge is the overhead of my stored procedures?"
- "Why are queries waiting for metadata locks?"
You will not only learn how to collect and use this information but will gain practical experience with it. You will also learn many details on how to setup Performance Schema.
Introduction to MySQL Query Tuning for Dev[Op]sSveta Smirnova
To get data, we query the database. MySQL does its best to return requested bytes as fast as possible. However, it needs human help to identify what is important and should be accessed in the first place.
Queries, written smartly, can significantly outperform automatically generated ones. Indexes and Optimizer statistics, not limited to the Histograms only, help to increase the speed of the query a lot.
In this session, I will demonstrate by examples of how MySQL query performance can be improved. I will focus on techniques, accessible by Developers and DevOps rather on those which are usually used by Database Administrators. In the end, I will present troubleshooting tools which will help you to identify why your queries do not perform. Then you could use the knowledge from the beginning of the session to improve them.
Talk at "Istanbul Tech Talks" in Istanbul, April, 17, 2018. http://www.istanbultechtalks.com/
In this talk I will show how to get started with MySQL Query Tuning. I will make short introduction into physical table structure and demonstrate how it may influence query execution time. Then we will discuss basic query tuning instruments and techniques, mainly EXPLAIN command with its latest variations. You will learn how to understand its output and how to rewrite query or change table structure to achieve better performance.
Tutorial which I presented at Percona Live 2018 conference (https://www.percona.com/live/18/sessions/mysql-performance-schema-in-action) together with Alexander Rubin.
====
Performance Schema in MySQL is maturing from version to version. It includes extended lock instrumentation, memory usage statistics, new tables for server variables, first time ever instrumentation for user variables, prepared statements and stored routines.
Version 8.0 adds additional variables, replication, error messages, data locks instrumentation. A lot! Amazing! And complicated!
In this tutorial, we will try all these instruments out. We will provide a test environment and a few typical problems that would be difficult to solve before MySQL 5.7. Just few examples:
- "Where is memory going?"
- "Why are these queries hanging?"
- "How huge is the overhead of my stored procedures?"
- "Why are queries waiting for metadata locks?"
You will not only learn how to collect and use this information but will gain practical experience with it. You will also learn many details on how to setup Performance Schema.
Demo on Performance Schema which I performed at DevOps Stage conference in Kiev on October 13, 2018. More at https://devopsstage.com/stranitsa-spikera/sveta-smirnova/
How to migrate from MySQL to MariaDB without tearsSveta Smirnova
Presented at MariaDB Server Fest 2020: https://mariadb.org/fest2020/migrate-mysql/
MariaDB is a drop-in replacement for MySQL. Initial migration is simple: start MariaDB over the old MySQL datadir.
Later your application may notice that some features work differently than with MySQL. These are MariaDB improvements, so this is good and, likely the reason you migrated.
In this session, I will focus on the differences affecting application performance and behavior. In particular, features sharing the same name, but working differently.
Introduction into MySQL Query Tuning for Dev[Op]sSveta Smirnova
Percona Live Online 2021 talk: https://www.percona.com/resources/videos/introduction-mysql-query-tuning-for-devops
In this talk I will show how to get started with MySQL Query Tuning. I will make a short introduction into physical table structure and demonstrate how it may influence query execution time.
Then we will discuss basic query tuning instruments and techniques, mainly EXPLAIN command with its latest variations. You will learn how to understand its output and how to rewrite queries or change table structure to achieve better performance.
Percona Live 2016 (https://www.percona.com/live/data-performance-conference-2016/sessions/why-use-explain-formatjson). Although EXPLAIN FORMAT=JSON was first presented a long time ago, there still aren't many resources that explain how and why to use it. The most advertised feature is visual EXPLAIN in MySQL Workbench, but this format can do more than create nice pictures. It prints additional information that can't be found in good old tabular EXPLAIN, and can help to solve many tricky performance issues. In this session, I will not only describe which additional information we can get with the new syntax, but also provide examples showing how to use it to diagnose production issues.
Top 10 Mistakes When Migrating From Oracle to PostgreSQLJim Mlodgenski
As more and more people are moving to PostgreSQL from Oracle, a pattern of mistakes is emerging. They can be caused by the tools being used or just not understanding how PostgreSQL is different than Oracle. In this talk we will discuss the top mistakes people generally make when moving to PostgreSQL from Oracle and what the correct course of action.
How to Avoid Pitfalls in Schema Upgrade with GaleraSveta Smirnova
Galera Cluster for MySQL is a 100% synchronized cluster in regards to data modification operations (DML). It is ensured by the optimistic locking model and ability to rollback a transaction, which cannot be applied on all nodes. However, schema changes (DDL operations) are not transactional in MySQL, which adds complexity when you need to perform an upgrade or change schema of the database.
Changes made by DDL may affect results of the queries. Therefore all modifications must replicate on all nodes prior next data access. For operations which run momentarily it can be easily achieved, but schema changes may take hours to apply. Therefore in addition to safest synchronous blocking schema upgrade method TOI Galera also supports more relaxed, thought not safe, method RSU.
In her talk Sveta will describe which pitfalls you can hit while performing the change using one or another method, why and how to avoid them.
Presented at MariaDB Day Brussels 0202 2020: https://mariadb.org/mariadb-day-brussels-0202-2020-provisional-schedule/
This slide deck describes the Flexviews materialized view toolkit for MySQL:
http://flexvie.ws
Learn how to use incrementally refreshable materialized views, and how they can improve your performance.
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB ClusterSveta Smirnova
Percona XtraDB Cluster (PXC) is a 100% synchronized cluster in regards to DML operations. It is ensured by the optimistic locking model and ability to rollback transaction which cannot be applied on all nodes. However, DDL operations are not transactional in MySQL. This adds complexity when you need to change the schema of the database.
Changes made by DDL may affect the results of the queries. Therefore all modifications must replicate on all nodes prior to the next data access. For operations that run momentarily, it can be easily achieved, but schema changes may take hours to apply. Therefore in addition to the safest synchronous blocking schema upgrade method: TOI, - PXC supports more relaxed, though not safe, method RSU.
RSU: Rolling Schema Upgrade is advertised to be non-blocking. But you still need to take care of updates, running while you are performing such an upgrade. Surprisingly, even updates on not related tables and schema can cause RSU operation to fail.
In this talk, I will uncover nuances of PXC schema upgrades and point to details you need to take special care about.
Further Information
Schema change is a frequent task, and many do not expect any surprises with it. However, the necessity to replay the changes to all synchronized nodes adds complexity. I made a webinar on a similar topic which was recorded and available for replay. Now I have found that I share a link to the webinar to my Support customers approximately once per week. Not having a good understanding of how schema change works in the cluster leads to lockups and operation failures. This talk will provide a checklist that will help to choose the best schema change method.
Presented at Percona Live Online: https://perconaliveonline2020.sched.com/event/ePm2/how-to-avoid-pitfalls-in-schema-upgrade-with-percona-xtradb-cluster
Performance Schema for MySQL TroubleshootingSveta Smirnova
Percona Live (https://www.percona.com/live/data-performance-conference-2016/sessions/performance-schema-mysql-troubleshooting)
The performance schema in MySQL version 5.6, released in February, 2013, is a very powerful tool that can help DBAs discover why even the trickiest performance issues occur. Version 5.7 introduces even more instruments and tables. And while all these give you great power, you can get stuck choosing which instrument to use.
In this session, I will start with a description of a typical problem, then guide you how to use the performance schema to find out what causes the issue, the reason for unwanted behavior and how the received information can help you solve a particular problem.
Traditionally, performance schema sessions teach what is in contained in tables. I will, in contrast, start from a performance issue, then demonstrate which instruments and tables can help solve it. We will discuss how to setup the performance schema so that it has minimal impact on your server.
You need to investigate some performance issues on an Oracle database, but you have no access to Oracle Enterprise Manager (OEM), or what is worse, not even to SQL*Plus. Where do you start? What is the first query you ask the DBA to execute for you? What is your second and third? Do you request an AWR report? For which snapshots? This scenario is not uncommon or unheard, it happens often to 3rd party consultants, or even to internal DBAs and Developers when the administration of the database has been subcontracted and access has been restricted.
Performance is not the only case where you may need to reach a database and struggle with access; doing a database health-check or collecting historical performance for a capacity planning exercise may face the same issues. What you wish you had is access to a restricted SQL*Plus account, even if remote, and a toolset to collect as much information as possible from the database of interest; or to ask a DBA with access to this database to simply run this toolset and give you back all the output so you can find answers to most of your questions.
eDB360 is a free tool that installs nothing on the database, executes through a SQL*Plus connection, and produces a zip file with a comprehensive report that provides a 360-degree view of an Oracle database. This session is about edb360. It covers what is included on its output, how you execute this tool, and how it can be used to gain a fair understanding of an Oracle database. This session is for DBAs, Developers and Consultants.
Benefits:
1. Learn how to get a fair 360-degree view of a database
2. Gather enough database information to start a health-check
3. Learn which performance to collect for a sizing exercise
Demo on Performance Schema which I performed at DevOps Stage conference in Kiev on October 13, 2018. More at https://devopsstage.com/stranitsa-spikera/sveta-smirnova/
How to migrate from MySQL to MariaDB without tearsSveta Smirnova
Presented at MariaDB Server Fest 2020: https://mariadb.org/fest2020/migrate-mysql/
MariaDB is a drop-in replacement for MySQL. Initial migration is simple: start MariaDB over the old MySQL datadir.
Later your application may notice that some features work differently than with MySQL. These are MariaDB improvements, so this is good and, likely the reason you migrated.
In this session, I will focus on the differences affecting application performance and behavior. In particular, features sharing the same name, but working differently.
Introduction into MySQL Query Tuning for Dev[Op]sSveta Smirnova
Percona Live Online 2021 talk: https://www.percona.com/resources/videos/introduction-mysql-query-tuning-for-devops
In this talk I will show how to get started with MySQL Query Tuning. I will make a short introduction into physical table structure and demonstrate how it may influence query execution time.
Then we will discuss basic query tuning instruments and techniques, mainly EXPLAIN command with its latest variations. You will learn how to understand its output and how to rewrite queries or change table structure to achieve better performance.
Percona Live 2016 (https://www.percona.com/live/data-performance-conference-2016/sessions/why-use-explain-formatjson). Although EXPLAIN FORMAT=JSON was first presented a long time ago, there still aren't many resources that explain how and why to use it. The most advertised feature is visual EXPLAIN in MySQL Workbench, but this format can do more than create nice pictures. It prints additional information that can't be found in good old tabular EXPLAIN, and can help to solve many tricky performance issues. In this session, I will not only describe which additional information we can get with the new syntax, but also provide examples showing how to use it to diagnose production issues.
Top 10 Mistakes When Migrating From Oracle to PostgreSQLJim Mlodgenski
As more and more people are moving to PostgreSQL from Oracle, a pattern of mistakes is emerging. They can be caused by the tools being used or just not understanding how PostgreSQL is different than Oracle. In this talk we will discuss the top mistakes people generally make when moving to PostgreSQL from Oracle and what the correct course of action.
How to Avoid Pitfalls in Schema Upgrade with GaleraSveta Smirnova
Galera Cluster for MySQL is a 100% synchronized cluster in regards to data modification operations (DML). It is ensured by the optimistic locking model and ability to rollback a transaction, which cannot be applied on all nodes. However, schema changes (DDL operations) are not transactional in MySQL, which adds complexity when you need to perform an upgrade or change schema of the database.
Changes made by DDL may affect results of the queries. Therefore all modifications must replicate on all nodes prior next data access. For operations which run momentarily it can be easily achieved, but schema changes may take hours to apply. Therefore in addition to safest synchronous blocking schema upgrade method TOI Galera also supports more relaxed, thought not safe, method RSU.
In her talk Sveta will describe which pitfalls you can hit while performing the change using one or another method, why and how to avoid them.
Presented at MariaDB Day Brussels 0202 2020: https://mariadb.org/mariadb-day-brussels-0202-2020-provisional-schedule/
This slide deck describes the Flexviews materialized view toolkit for MySQL:
http://flexvie.ws
Learn how to use incrementally refreshable materialized views, and how they can improve your performance.
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB ClusterSveta Smirnova
Percona XtraDB Cluster (PXC) is a 100% synchronized cluster in regards to DML operations. It is ensured by the optimistic locking model and ability to rollback transaction which cannot be applied on all nodes. However, DDL operations are not transactional in MySQL. This adds complexity when you need to change the schema of the database.
Changes made by DDL may affect the results of the queries. Therefore all modifications must replicate on all nodes prior to the next data access. For operations that run momentarily, it can be easily achieved, but schema changes may take hours to apply. Therefore in addition to the safest synchronous blocking schema upgrade method: TOI, - PXC supports more relaxed, though not safe, method RSU.
RSU: Rolling Schema Upgrade is advertised to be non-blocking. But you still need to take care of updates, running while you are performing such an upgrade. Surprisingly, even updates on not related tables and schema can cause RSU operation to fail.
In this talk, I will uncover nuances of PXC schema upgrades and point to details you need to take special care about.
Further Information
Schema change is a frequent task, and many do not expect any surprises with it. However, the necessity to replay the changes to all synchronized nodes adds complexity. I made a webinar on a similar topic which was recorded and available for replay. Now I have found that I share a link to the webinar to my Support customers approximately once per week. Not having a good understanding of how schema change works in the cluster leads to lockups and operation failures. This talk will provide a checklist that will help to choose the best schema change method.
Presented at Percona Live Online: https://perconaliveonline2020.sched.com/event/ePm2/how-to-avoid-pitfalls-in-schema-upgrade-with-percona-xtradb-cluster
Performance Schema for MySQL TroubleshootingSveta Smirnova
Percona Live (https://www.percona.com/live/data-performance-conference-2016/sessions/performance-schema-mysql-troubleshooting)
The performance schema in MySQL version 5.6, released in February, 2013, is a very powerful tool that can help DBAs discover why even the trickiest performance issues occur. Version 5.7 introduces even more instruments and tables. And while all these give you great power, you can get stuck choosing which instrument to use.
In this session, I will start with a description of a typical problem, then guide you how to use the performance schema to find out what causes the issue, the reason for unwanted behavior and how the received information can help you solve a particular problem.
Traditionally, performance schema sessions teach what is in contained in tables. I will, in contrast, start from a performance issue, then demonstrate which instruments and tables can help solve it. We will discuss how to setup the performance schema so that it has minimal impact on your server.
You need to investigate some performance issues on an Oracle database, but you have no access to Oracle Enterprise Manager (OEM), or what is worse, not even to SQL*Plus. Where do you start? What is the first query you ask the DBA to execute for you? What is your second and third? Do you request an AWR report? For which snapshots? This scenario is not uncommon or unheard, it happens often to 3rd party consultants, or even to internal DBAs and Developers when the administration of the database has been subcontracted and access has been restricted.
Performance is not the only case where you may need to reach a database and struggle with access; doing a database health-check or collecting historical performance for a capacity planning exercise may face the same issues. What you wish you had is access to a restricted SQL*Plus account, even if remote, and a toolset to collect as much information as possible from the database of interest; or to ask a DBA with access to this database to simply run this toolset and give you back all the output so you can find answers to most of your questions.
eDB360 is a free tool that installs nothing on the database, executes through a SQL*Plus connection, and produces a zip file with a comprehensive report that provides a 360-degree view of an Oracle database. This session is about edb360. It covers what is included on its output, how you execute this tool, and how it can be used to gain a fair understanding of an Oracle database. This session is for DBAs, Developers and Consultants.
Benefits:
1. Learn how to get a fair 360-degree view of a database
2. Gather enough database information to start a health-check
3. Learn which performance to collect for a sizing exercise
SQLT XPLORE: The SQLT XPLAIN hidden childCarlos Sierra
Have you ever been in a situation where after a database upgrade one or two SQL statements start performing poorly? If you have then maybe you have tested the performance of these queries by setting your Optimizer to the pre-upgrade release, and discovered the performance was restored. What do you do next? SQLT XPLORE (the hidden child of SQLTXPLAIN) can give you some answers to this problem.
SQLT XPLORE uses brute force analysis to explore some aspects of a SQL statement. The typical case is this: A SQL statement has a performance regression after a database software upgrade. Setting Optimizer Features to the pre-upgrade release causes the performance of the SQL to be restored, so there is a high level of confidence the root cause of the regression was a change to the Optimizer. Since setting the Optimizer to a pre-upgrade release is not a solution but a workaround, the problem becomes "How to find which particular change on the CBO is causing the regression of this particular SQL?". SQLT XPLORE was designed and built to help answer this difficult question. This session covers SQLT XPLORE under the hood, and all the benefits an expert DBA can obtain of its use. Keep in mind that SQLT XPLORE, which is packaged within SQLT, is a free multi-use tool!
SQL Tuning made easier with SQLTXPLAIN (SQLT)Carlos Sierra
If you have experienced the frustration of dealing with an application transaction that takes too long to execute, and which may be affecting your company's business, then it is possible you have one or more SQL statements that may need some performance tuning. This session covers capabilities, installation and use of the free SQL Tuning tool: SQLTXPLAIN.
This session is an introduction to SQLTXPLAIN (SQLT) as a tool to aid in the complex task of SQL Tuning. It assumes nothing. From what is SQLT and its features, to how it is implemented and used, this presentation gives you a good idea how you can benefit of this free tool. As an additional value, since Oracle Support has been requesting the output of this tool on most Query Tuning Service Requests (SR), by learning how to use the right SQLT method, you may help to expedite the resolution of your own SR! During this session you will see how SQLT is installed and how the most common methods - XTRACT and XECUTE are used. A navigation through the main output is also part of this SQLT introductory session.
If you are a DBA that besides many other things is also responsible of Performance issues, or you are a Developer that has to find answers when a SQL performs poorly, you may consider attending this session. SQL Tuning is complex, so simply by collecting the right information on a timely manner is a big help. Nothing to lose when a free tool is available for you to try and use. No strings attached!
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...Carlos Sierra
Adaptive Cursor Sharing (ACS) is a feature available since 11g. It is enabled by default. ACS can help to generate multiple non-persistent Optimal Execution Plans for a given SQL. But it requires a sequence of events for it to get truly activated. This presentation describes what is ACS, when it is used and when it is not. Then it demonstrates ACS capabilities and limitations with a live demo.
This session is about: How Adaptive Cursor Sharing (ACS) actually works. How a bind sensitive cursor becomes bind aware. What are those "ACS buckets". How the "Selectivity Profile" works. Why sometimes your SQL becomes bind aware and why sometimes it does not. How is that ACS interacts with SQL Plan Management (SPM). These and other questions about ACS are answered in detail.
Some live demonstrations are used to illustrate the ramp-up process on ACS and how some child cursors are created then flagged as non-shareable. You will also "see" how the ACS Selectivity Profile is adapted as new executions make use of predicates with new Selectivities. ACS promotes Plan Flexibility while SPM promotes Plan Stability. Understanding how these duo interacts becomes of great value when some gentle intervention is needed to restore this delicate balance.
This session is for those Developers and DBAs that "need" to understand how things work. ACS can be seen as a back-box; or you can "look" inside and understand how it actually works. If you are curious about the ACS functionality, then this Session brings some light. Consider this session only if you are pretty familiar with Cursor Sharing, Binds, Plan Stability and Plan Flexibility.
Using SQL Plan Management (SPM) to balance Plan Flexibility and Plan StabilityCarlos Sierra
Have you been in a situation where an Execution Plan changes unexpectedly? Have you been asked to "fix" a Plan Stability issue? If you have, then you may have heard of Adaptive Cursor Sharing (ACS) and SQL Plan Baselines.
SQL Plan Management (SPM) can be explained as a collection of three functions: SQL Plan Baseline (SPB) creation, Plan selection and Plan Evolution. This session is about understanding all 3 major components of SPM and learning how we can use this technology to input a set of Flexible Plans created by Adaptive Cursor Sharing (ACS) and make them more steady.
ACS and SPM actually work really well together. Understanding their complex relationship is key to balance the yin and yang of Plan Flexibility and Plan Stability on an Oracle Database (11g or higher). This Session shows how these duo (ACS and SPM) can do great things if you make them work together as a team.
As a Developer or a DBA, if you need to know more about Execution Plan Stability, this session may provide you with some valuable insight. Some tools to transport a Plan from one system to another, or to simply create a SQL Plan Baseline from different sources are also presented.
How a Developer can Troubleshoot a SQL performing poorly on a Production DBCarlos Sierra
This session is about some free small scripts you can execute from SQL*Plus, which provide you with some basics about a SQL statement, like the Execution Plan from multiple child cursors, their SQL Monitor report if your site has the Tuning Pack, and some useful Active Session History (ASH) summaries for your SQL if your site has the Diagnostics Pack. And if you have neither the Tuning nor the Diagnostics Pack then you may want to learn about some alternatives to collect important performance metrics.
You need to investigate some performance issues on an Oracle database, but you have no access to Oracle Enterprise Manager (OEM), or what is worse, not even to SQL*Plus. Where do you start? What is the first query you ask the DBA to execute for you? What is your second and third? Do you request an AWR report? For which snapshots? This scenario is not uncommon or unheard, it happens often to 3rd party consultants, or even to internal DBAs and Developers when the administration of the database has been subcontracted and access has been restricted.
Performance is not the only case where you may need to reach a database and struggle with access; doing a database health-check or collecting historical performance for a capacity planning exercise may face the same issues. What you wish you had is access to a restricted SQL*Plus account, even if remote, and a toolset to collect as much information as possible from the database of interest; or to ask a DBA with access to this database to simply run this toolset and give you back all the output so you can find answers to most of your questions.
eDB360 is a free tool that installs nothing on the database, executes through a SQL*Plus connection, and produces a zip file with a comprehensive report that provides a 360-degree view of an Oracle database. This session is about edb360. It covers what is included on its output, how you execute this tool, and how it can be used to gain a fair understanding of an Oracle database. This session is for DBAs, Developers and Consultants.
Benefits:
1. Learn how to get a fair 360-degree view of a database
2. Gather enough database information to start a health-check
3. Learn which performance to collect for a sizing exercise
Porting NetBSD to the open source LatticeMico32 CPUYann Sionneau
In this talk I gave at EHSM 2014 event ( http://ehsm.eu ) I am explaining what a MMU is and how it works. I then explain how I ported NetBSD (and EdgeBSD which is a fork of NetBSD) on this open source LM32 CPU in which I added an MMU.
MeetBSDCA 2014 Performance Analysis for BSD, by Brendan Gregg. A tour of five relevant topics: observability tools, methodologies, benchmarking, profiling, and tracing. Tools summarized include pmcstat and DTrace.
Many JavaScript roles are advertised as "Full Stack", but what does that really mean?
This talk takes a look at what could be meant by a stack and discusses the reasons to focus on first-principles rather than specific technologies.
In this talk I present a regular Lucee CFML script, which was written to import several records into a database and performance tune it step by step. You will be amazed of what is possible. The code examples can be downloaded here: http://www.rasia.ch/downloads/performance-tuning-through-iterations-code.zip
StHack 2013 - Florian "@agixid" Gaultier No SQL injection but NoSQL injectionStHack
La mouvance NoSQL fait de plus en plus parler d'elle. La plupart du temps open source, les implémentations sont nombreuses et offrent des alternatives intéressantes à la rigidité du SQL. Malheureusement ces diverses solutions NoSQL (MongoDB, CouchDB, Cassandra...) débarquent avec NoSecurity. Nous verrons que, tout comme le SQL, une mauvaise utilisation des clients/drivers peut avoir des conséquences tout aussi critique, si ce n'est plus...
Beyond PHP - it's not (just) about the codeWim Godden
Most PHP developers focus on writing code. But creating Web applications is about much more than just writing PHP. Take a step outside the PHP cocoon and into the big PHP ecosphere to find out how small code changes can make a world of difference on servers and network. This talk is an eye-opener for developers who spend over 80% of their time coding, debugging and testing.
Any DBA from beginner to advanced level, who wants to fill in some gaps in his/her knowledge about Performance Tuning on an Oracle Database, will benefit from this workshop.
Using SQL Plan Management (SPM) to Balance Plan Flexibility and Plan StabilityEnkitec
This presentation is about understanding all 3 components of SPM and how we can use this technology to efficiently migrate "good" Execution Plans from one Release to another, or from one System to another.
If you’re building Oracle APEX applications, there’s a good chance that they are business-centric applications that will mostly be used by employees of your organization. The main goal of the user interface of these applications is to be functional and intuitive, not flashy and eccentric. Throw in the challenges of cross-browser compatibility and mobile support, and designing a user interface gets pretty complex. This session will outline some techniques and tools that can be applied when designing user interfaces for these business-centric applications. All solutions will be presented in a format that does not require advanced graphics design experience.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
2. `whoami`
• Frits
Hoogland
• Working
with
Oracle
products
since
1996
!
• Blog:
hKp://fritshoogland.wordpress.com
• TwiKer:
@fritshoogland
• Email:
frits.hoogland@enkitec.com
• Oracle
ACE
Director
• OakTable
Member
2
3. Goals
&
prerequisites
• Goal:
learn
aKendees
about
using
gdb
for
profiling
C
funcXon
sequences.
!
• Prerequisites:
– Understanding
of
(internal)
execuXon
of
C
programs.
– Understanding
of
Oracle
tracing
mechanisms.
3
4. Copy
the
virtual
box
VM
• The
virtual
box
importable
appliance
should
be
distributed
(USB
HDD/Thumbdrive)
!
• See
handout
for
virtual
machine/appliance
instrucXons
and
requirements.
4
5. 1.
Tracing
• In
order
to
troubleshoot
a
situaXon,
the
right
tool
needs
to
be
selected.
– Depending
on
that
outcome,
further
invesXgaXon
can
be
done,
possibly
at
different
layers
with
different
tools.
!
• The
most
logical
way
to
start
troubleshoot
Oracle
database
processing
is
using
the
wait
interface
and
database
staXsXcs.
5
6. 1.
Tracing
• Hands
on:
– logon
to
the
VM
as
oracle
– logon
to
Oracle:
rs ts/ts@//localhost/v11204!
!
– trace
‘select
count(*)
from
t2’:
select count(*) from t2; --this is prewarming the caching of the VM disk !
alter session set events ‘sql_trace level 8’; !
select count(*) from t2; !
alter session set events ‘sql_trace off’;
6
7. 1.
Tracing
• Copy
the
resulXng
trace
file
to
~/1.trc
– When
looking
in
the
trace
file
• if
you’ve
got
a
fast
disk
• a
low
#
of
‘direct
path
read’
waits
is
visible
!
– Look
at
waits
+
fetch
line
(p+cr)
7
8. 1.
Tracing
• What
is
happening?
• Obviously,
there
is
PIO
informaXon
missing.
!
• The
next
logical
step
is
to
include
system
call
(regular
IO
is
done
using
a
system
call)
informaXon
with
the
trace
informaXon.
8
9. 1.
Tracing
• This
is
done
using
the
linux
uXlity
‘strace’.
!
• First
flush
the
buffer
cache:
sq!
alter system flush buffer_cache;!
!
• Then
start
a
sqlplus
session
to
trace:
rs ts/ts@//localhost/v11204!
!
• Start
a
root
(shell)
session
9
10. 1.
Tracing
• Enable
sql_trace
at
level
8
in
the
sqlplus
session:
alter session set events ‘sql_trace level 8’!
!
• Find
the
foreground
in
the
root
session:
ps -ef | grep [L]OCAL=NO!
!
• And
strace
it
with
verbosity
on
the
write
call:
strace -e write=all -e all -p PID -o ~oracle/2.trc!
!
• Start
a
root
(shell)
session.
10
11. 1.
Tracing
• Now
execute
the
count(*)
again
in
the
sqlplus
session.
select count(*) from t2;!
!
• Aoer
the
count(*)
is
finised,
press
CTRL-‐c
in
the
strace
session.
!
• And
exit
the
sqlplus
session.
exit
11
12. 1.
Tracing
• Now
open
the
strace
file
in
the
oracle
session:
less 2.trc!
!
• And
skip
to
the
start
of
the
execuXon
of
the
count(*)
statement:
/count
12
16. 1.
Tracing
• So,
it
looks
like
when
IOs
are
reaped*,
Oracle
registers
a
wait.
!
• But
that
isn’t
consistent
with
the
low
number
of
‘direct
path
read’
waits…
!
• Let’s
look
further
in
2.trc
to
the
AIO
calls:
16
18. 1.
Tracing
• Okay,
for
some
reason:
• some
reaped
IOs
do
result
in
a
wait
line,
• and
some
other’s
do
not.
!
• We
can
safely
assume
it
has
to
do
with
the
IO
speed,
but
how
is
the
decision
made?
18
19. 1.
Tracing
• In
order
to
find
out,
we
need
to
look
at
the
sequence
of
funcXon
calls
in(side)
the
database.
This
is
done
using
gdb.
!
• Create
a
root
(shell)
session
for
gdb,
and
an
oracle
(shell)
session
for
sqlplus
(rs
ts/ts@//
localhost/v11204).
19
20. 1.
Tracing
• In
the
root
session
• grep
the
PID
of
the
foreground
session:
ps -ef | grep [L]OCAL=NO!
!
• AKach
to
the
session
with
gdb:
gdb -p PID!
!
• Enter
the
commands
on
the
next
slide
in
gdb:
20
21. 1.
Tracing
set pagination off!
set logging file /home/oracle/3.trc!
set logging on!
break io_submit!
break 'io_getevents@plt'!
rbreak ^kslwt[be]ctx!
commands 1-4!
c!
end
21
22. 1.
Tracing
• This
has
set
4
breakpoints
in
gdb:
!
(gdb) info break!
Num Type Disp Enb Address What!
1 breakpoint keep y 0x00007fcaa5083660 <io_submit>!
c!
2 breakpoint keep y 0x00000000009e5b58 <io_getevents@plt>!
c!
3 breakpoint keep y 0x0000000008c18680 <kslwtbctx+4>!
c!
4 breakpoint keep y 0x0000000008c1f92c <kslwtectx+4>!
c
22
23. 1.
Tracing
• In
gdb,
issue
‘c’
to
conXnue
the
foreground
session:
!
• In
sqlplus,
execute:
select count(*) from t2;
23
24. 1.
Tracing
• Once
the
select
count(*)
is
ready:
• Stop
gdb
(CTRL-‐c,
q)
• Exit
sqlplus,
and
read
3.trc
using
less:
less 3.trc
24
25. 1.
Tracing
Breakpoint 5, 0x0000000007cfb4f2 in kslwtectx ()!
!
Breakpoint 4, 0x0000000007cf47b6 in kslwtbctx ()!
!
Breakpoint 5, 0x0000000007cfb4f2 in kslwtectx ()!
!
Breakpoint 1, 0x00007fa883926660 in io_submit () from /lib64/libaio.so.1!
!
Breakpoint 1, 0x00007fa883926660 in io_submit () from /lib64/libaio.so.1!
!
Breakpoint 2, 0x000000000082d7d8 in io_getevents@plt ()!
!
Breakpoint 1, 0x00007fa883926660 in io_submit () from /lib64/libaio.so.1!
!
Breakpoint 1, 0x00007fa883926660 in io_submit () from /lib64/libaio.so.1!
!
Breakpoint 2, 0x000000000082d7d8 in io_getevents@plt ()
25
26. 1.
Tracing
• This
shows:
• Oracle
ending
the
Xming
of
a
wait
(kslwtectx())
• Then
another
wait
is
encountered
(kslwtbctx()-‐
kslwtectx())
• Then
IOs
are
submiKed
(io_submit())
and
IOs
are
reaped
(io_getevents())
• In
this
example:
without
a
wait
event!
26
27. 1.
Tracing
• In
my
case,
I
didn’t
get
a
single
wait
accompanying
IO
(io_submit()-‐io_getevents())
because
I
turned
virtual
box
disk
caching
on.
!
• Let’s
slow
the
IOs
down
to
get
the
‘direct
path
read’
waits
back.
27
28. 1.
Tracing
• Startup
a
sqlplus
session
again
(as
oracle).
rs ts/ts@//localhost/v11204!
!
• (as
root)
Now
setup
IO
throKling
using
cgroups:
mkdir -p /cgroup/blkio!
mount -t cgroup -o blkio none /cgroup/blkio!
cgcreate -g blkio:/iothrottle!
cgset -r blkio.throttle.read_iops_device="8:0 1" iothrottle
28
29. 1.
Tracing
• Find
the
PID
of
the
server
process:
ps -ef | grep [L]OCAL=NO!
!
• And
throKle
the
Oracle
process:
echo PID > /cgroup/blkio/iothrottle/tasks!
!
• Enter
gdb
again,
and
setup
the
breakpoints
gdb -p PID
29
30. 1.
Tracing
set pagination off!
set logging file /home/oracle/4.trc!
set logging on!
break io_submit!
break 'io_getevents@plt'!
rbreak ^kslwt[be]ctx!
commands 1-4!
c!
end
30
31. 1.
Tracing
• Make
the
server
session
runnable
again
in
gdb
by
execuXng
‘c’
for
conXnue.
• Now
run
the
query
again:
select count(*) from t2;!
!
• Once
the
query
is
finished,
quit
gdb
again
(CTRL-‐
c
and
q),
quit
sqlplus,
and
look
in
4.trc
with
less.
31
32. 1.
Tracing
Breakpoint 5, 0x0000000007cfb4f2 in kslwtectx ()!
Breakpoint 4, 0x0000000007cf47b6 in kslwtbctx ()!
Breakpoint 5, 0x0000000007cfb4f2 in kslwtectx ()!
Breakpoint 4, 0x0000000007cf47b6 in kslwtbctx ()!
Breakpoint 5, 0x0000000007cfb4f2 in kslwtectx ()!
Breakpoint 1, 0x00007f40a05c3660 in io_submit () from /lib64/libaio.so.1!
Breakpoint 1, 0x00007f40a05c3660 in io_submit () from /lib64/libaio.so.1!
Breakpoint 2, 0x000000000082d7d8 in io_getevents@plt ()!
Breakpoint 2, 0x000000000082d7d8 in io_getevents@plt ()!
Breakpoint 4, 0x0000000007cf47b6 in kslwtbctx ()!
Breakpoint 2, 0x000000000082d7d8 in io_getevents@plt ()!
Breakpoint 5, 0x0000000007cfb4f2 in kslwtectx ()!
Breakpoint 1, 0x00007f40a05c3660 in io_submit () from /lib64/libaio.so.1!
Breakpoint 2, 0x000000000082d7d8 in io_getevents@plt ()!
Breakpoint 2, 0x000000000082d7d8 in io_getevents@plt ()!
Breakpoint 4, 0x0000000007cf47b6 in kslwtbctx ()!
Breakpoint 2, 0x000000000082d7d8 in io_getevents@plt ()!
Breakpoint 5, 0x0000000007cfb4f2 in kslwtectx ()
32
33. 1.
Tracing
• This
is
the
end
of
chapter
1.
• In
this
chapter
you
have
learned:
• How
to
start
a
sql_trace
• How
to
combine
strace
with
sql_trace
• How
to
use
gdb
to
break
and
conXnue
on
C
funcXons,
in
order
to
profile.
33
34. 2.
strace
• strace
shows
(only)
system
calls.
• This
means
calls
which
require
kernel
interacXon
from
the
user
land
process.
• Things
like:
disk
I/O,
network
I/O,
allocaXon
and
release
of
memory,
IPC,
etc.
!
• Normal
data
processing
in
Oracle
happens
in
“userland”,
thus
is
not
visible
with
strace.
34
35. 2.
strace
• The
combinaXon
of
strace
+
sql_trace
is
powerful,
and
gives
more
insight.
• In
our
example,
it
shows
some
I/Os
indeed
are
not
instrumented.
!
• strace
shows
the
result
of
the
system
call
(!)
• This
means
it
shows
the
return
code
of
the
call.
35
37. 2.
strace
• A
lesser
known
‘feature’
of
strace
is
it
can
leave
out
system
calls.
• This
is
how
a
sql_trace
at
level
8
plus
strace
looks
like
on
an
IO
thro(led
process
37
38. 2.
strace
• strace
does
not
leave
out
system
calls!
• There
is
a
shortcut/opXmisaXon
in
libaio
to
prevent
the
call
io_getevents
from
becoming
a
system
call.
• This
is
possible
because
the
IO
results
are
available
in
userspace.
• Want
to
know
more
about
this?
See:
hKp://
fritshoogland.wordpress.com/2014/03/11/
linux-‐strace-‐doesnt-‐lie-‐aoer-‐all/
38
40. 2.
strace
• This
is
how
it
looks
like
when
the
same
is
done
using
gdb:
40
41. 2.
strace
Breakpoint 5, 0x0000000007cfb4f2 in kslwtectx ()!
Breakpoint 4, 0x0000000007cf47b6 in kslwtbctx ()!
Breakpoint 5, 0x0000000007cfb4f2 in kslwtectx ()!
Breakpoint 4, 0x0000000007cf47b6 in kslwtbctx ()!
Breakpoint 5, 0x0000000007cfb4f2 in kslwtectx ()!
Breakpoint 1, 0x00007f40a05c3660 in io_submit () from /lib64/libaio.so.1!
Breakpoint 1, 0x00007f40a05c3660 in io_submit () from /lib64/libaio.so.1!
Breakpoint 2, 0x000000000082d7d8 in io_getevents@plt ()!
Breakpoint 2, 0x000000000082d7d8 in io_getevents@plt ()!
Breakpoint 4, 0x0000000007cf47b6 in kslwtbctx ()!
Breakpoint 2, 0x000000000082d7d8 in io_getevents@plt ()!
Breakpoint 5, 0x0000000007cfb4f2 in kslwtectx ()!
Breakpoint 1, 0x00007f40a05c3660 in io_submit () from /lib64/libaio.so.1!
Breakpoint 2, 0x000000000082d7d8 in io_getevents@plt ()!
Breakpoint 2, 0x000000000082d7d8 in io_getevents@plt ()!
Breakpoint 4, 0x0000000007cf47b6 in kslwtbctx ()!
Breakpoint 2, 0x000000000082d7d8 in io_getevents@plt ()!
Breakpoint 5, 0x0000000007cfb4f2 in kslwtectx ()
41
42. 2.
strace
• With
strace,
we
see:
• single
io_submit()
• followed
by
a
single
io_getevents()
!
• With
gdb,
we
see:
• single
io_submit()
• followed
by
3
io_getevents()
calls.
42
43. 2.
strace
• IMPORTANT!
– With
strace,
system
calls
are
shown.
– With
write
output,
we
see
the
Oracle
wait
events
– When
waits
follow
a
system
call
or
system
calls,
we
can
assume
the
wait
is
Xming
of
that.
!
• There
is
no
way
to
tell
what
the
wait
did
actually
Xme!!
43
44. 2.
strace
• This
is
the
end
of
chapter
2.
• In
this
chapter
you
have
learned:
• What
strace
does.
• What
limitaXon
strace
has
(no
user
land).
• That
strace
can’t
tell
you
what
a
wait
event
actually
did
Xme.
• That
it
can
leave
out
system
calls.
44
45. 3.
gdb
theory
• gdb
is
the
GNU
debugger.
• hKp://www.sourceware.org/gdb/
• DescripXon
from
the
website:
!
GDB can do four main kinds of things (plus other things in support of these) to help you catch
bugs in the act:
•
Start your program, specifying anything that might affect its behavior.
•
Make your program stop on specified conditions.
•
Examine what has happened, when your program has stopped.
•
Change things in your program, so you can experiment with correcting the effects of one bug
and go on to learn about another.
!
The program being debugged can be written in Ada, C, C++, Objective-C, Pascal (and many other
languages). Those programs might be executing on the same machine as GDB (native) or on
another machine (remote). GDB can run on most popular UNIX and Microsoft Windows variants.
! 45
46. 3.
gdb
theory
• For
profiling,
we
use
the
‘make
your
program
stop
on
specified
condiXons’.
• However,
we
just
use
the
stop
noXficaXon,
and
make
the
process
conXnue.
!
• To
make
full
use
of
the
gdb
funcXonality,
the
executable
needs
to
be
compiled
with
the
‘-‐g’
flag
to
include
debug
informaXon.
46
47. 3.
gdb
theory
• By
default,
executables
do
not
have
debug
informaXon
added.
!
• Debug
informaXon
makes
it
able
to
relate
C-‐code
lines
to
steps
of
execuXon
of
the
executable.
!
• As
you
might
expect
at
this
point:
Oracle
doesn’t
include
this
informaXon.
47
48. 3.
gdb
theory
• So…why
talk
about
gdb
and
Oracle
then?
• Of
course
we
sXll
can
use
it,
that
is
what
this
talk
about.
!
• Oracle
on
linux
is
an
‘ELF’
executable.
!
[oracle@ol65vm [v11204] bin]$ file oracle!
oracle: setuid setgid ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
48
49. 3.
gdb
theory
• It
says
‘not
stripped’
• Which
means
funcXon
symbolic
informaXon
is
NOT
removed.
!
• It
is
dynamically
linked!
• An
executable
has
to
symbolically
call
funcXons
in
a
library.
49
51. 3.
gdb
theory
• In
order
to
call
a
funcXon
in
a
library,
it
needs
to
be
defined
somewhere
in
the
executable:
• Procedure
Linkage
Table
(plt).
• Libraries
and
funcXons
are
lazy
loaded.
!
[oracle@ol65vm [v11204] bin]$ readelf -a oracle | grep io_getevents!
00000b5de698 00fc00000007 R_X86_64_JUMP_SLO 0000000000000000 io_getevents + 0!
252: 0000000000000000 0 FUNC WEAK DEFAULT UND io_getevents@LIBAIO_0.4 (11)!
633326: 0000000000000000 0 FUNC WEAK DEFAULT UND io_getevents@@LIBAIO_0.4
51
52. 3.
gdb
theory
• The
reason
for
showing
the
plt:
!
• The
funcXons
in
a
dynamically
linked
executable
can
only
be
called
by
name.
!
• So
the
library
is
free
to
have
the
funcXon
at
any
offset.
52
53. 3.
gdb
theory
• FuncXons
in
an
executable
can
be
found
using
‘nm’,
if
it’s
not
stripped:
!
[oracle@ol65vm [v11204] bin]$ nm -a oracle | grep kslwtbctx$!
0000000008c1867c T kslwtbctx!
53
54. 3.
gdb
theory
• Again:
I
don’t
suspect
Oracle
to
ever
release
the
debug
symbols
for
the
Oracle
executable.
• Because
it
would
reveal
source
code.
• This
also
means
that
gdb
does
not
understand
the
funcXon
call
arguments.
!
• But
Linux
is
open
source!
54
55. 3.
gdb
theory
• Oracle
linux
has
a
complete
repository
with
the
operaXng
system
and
uXliXes
compiled
with
debug
symbols:
the
debug
info
packages.
• hKps://oss.oracle.com/ol6/debuginfo
!
• For
the
sake
of
this
course,
I
created
a
directory
~root/debuginfo_rpms
in
which
the
relevant
debuginfo
rpms
are
put.
55
56. 3.
gdb
theory
• Install
the
debug
info
packages
from
that
directory:
[oracle@ol65vm [] ~]$ su -!
Password: !
[root@ol65vm ~]# cd ~/debuginfo_rpms/!
[root@ol65vm debuginfo_rpms]# yum localinstall *!
Setting up Local Package Process!
Examining glibc-debuginfo-2.12-1.132.el6.x86_64.rpm: glibc-
debuginfo-2.12-1.132.el6.x86_64!
…!
Total size: 54 M!
Installed size: 54 M!
Is this ok [y/N]: y!
…
56
57. 3.
gdb
theory
• Verify
the
installed
debug
info
packages:
[root@ol65vm debuginfo_rpms]# rpm -qa | grep debuginfo!
!
glibc-debuginfo-common-2.12-1.132.el6.x86_64!
libaio-debuginfo-0.3.107-10.el6.x86_64!
glibc-debuginfo-2.12-1.132.el6.x86_64
57
58. 3.
gdb
theory
• Now
let’s
setup
a
normal
database
connecXon
again:
[oracle@ol65vm [v11204] bin]$ rs ts/ts@//localhost/v11204!
!
• Find
the
PID
of
the
server
process
in
a
root
session,
and
aKach
to
it
with
gdb
again:
[root@ol6vm ~]# ps -ef | grep [L]OCAL=NO!
oracle 2657 1 0 02:22 ? 00:00:00 oraclev11204 (LOCAL=NO)!
[root@ol6vm ~]# gdb -p 2657
58
59. 3.
gdb
theory
• Enter
the
following
in
the
gdb
session:
set pagination off!
break io_submit!
break io_getevents_0_4!
c!
!
• This
makes
the
sqlplus
session
runnable
again.
select count(*) from t2;
59
60. 3.
gdb
theory
• Because
we
didn’t
specify
conXnue
as
acXon
with
a
break,
gdb
breaks
execuXon.
• Look
what
gdb
tells
you
with
io_submit():
Breakpoint 1, io_submit (ctx=0x7ff8b626c000, nr=1, iocbs=0x7fffa5c31a80) at
io_submit.c:23!
23!io_syscall3(int, io_submit, io_submit, io_context_t, ctx, long, nr,
struct iocb **, iocbs)!
• conXnue
unXl
you
get
a
io_getevents():
Breakpoint 2, io_getevents_0_4 (ctx=0x7ff8b626c000, min_nr=2, nr=128,
events=0x7fffa5c37b68, timeout=0x7fffa5c38b70) at io_getevents.c:46!
46!! if (ring==NULL || ring->magic != AIO_RING_MAGIC)
60
61. 3.
gdb
theory
• Using
the
debug
info
package,
gdb
can
interpret
system
calls
arguments
for
which
the
debug
informaXon
has
been
installed!
• This
allows
you
to
see
quite
a
lot.
!
• Important:
gdb
breaks
if
the
funcXon
is
entered.
This
means
we
can
not
read
the
return
code
of
the
funcXon
we
are
breaking
on!
• io_getevents()
returns
ready
IOs.
61
62. 3.
gdb
theory
• Quit
the
gdb
(root)
session
(q).
• Quit
the
sqlplus
(oracle)
session.
!
• In
the
oracle
session:
cd ~/gdb_macros!
sq!
@create_pw!
@create_pl!
exit
62
63. 3.
gdb
theory
• Now
setup
a
normal
oracle
connecXon
again:
rs ts/ts@//localhost/v11204!
!
• And
setup
a
gdb
session
from
~oracle/
gdb_macros
and
aKach
to
the
oracle
session:
cd ~oracle/gdb_macros!
ps -ef | grep [L]OCAL=NO!
gdb -p PID
63
64. 3.
gdb
theory
• Now
use
some
already
prepared
gdb
macros:
source pstruct.gdb!
source paio.gdb!
source pw.gdb!
c!
!
• And
start
‘select
count(*)
from
t2;’
from
the
sqlplus
session.
64
65. 3.
gdb
theory
• Now
look
what
is
visible
with
the
three
gdb
macros:
kslwtectx -- Previous wait time: 74621038: SQL*Net message from client!
opiosq0 -- parse!
kksfbc -- V$SQL.ADDRESS: 78d7a6d8!
opiexe -- execute!
kslwtbctx!
kslwtectx -- Previous wait time: 1195: SQL*Net message to client!
opifch2 -- fetch!
kslwtbctx!
io_submit - 1,58f5c000 - nr,ctx!
fd: 256, nbytes: 1!
io_getevents - 1,58f5c000 - minnr,ctx,timeout: $1 = {tv_sec = 10, tv_nsec = 0}!
kslwtectx -- Previous wait time: 70121: Disk file operations I/O!
65
67. 3.
gdb
theory
• This
is
the
end
of
chapter
3.
• In
this
chapter
you
have
learned:
• What
gdb
is.
• What
debug
symbols
are
and
how
to
get
them.
• What
stripped
and
not
stripped
means.
• oracle
as
dynamically
linked
executable.
• procedure
linkage
table
and
finding
funcXons
• how
to
break
on
funcXons
67
68. 3.
gdb
theory
• The
breaking
in
gdb
happens
on
entering
a
funcXon
call.
• The
existence
of
gdb
macro’s
created
by
Enkitec
to
obtain
more
informaXon.
68
69. 4.
gdb
lab
• What
does
the
wait
event
‘direct
path
read’
mean
• Enable
synchronous
IO
for
the
database
now.
• filesystemio_opXons=‘none’
• Now
trace
the
‘select
count(*)
from
t2’
again
with
gdb.
• What
wait
event
indicates
IO
now?
What
does
the
wait
event
Xme?
• Turn
on
asynchronous
IO
again
when
finished.
69
70. 4.
gdb
lab
• What
does
asynchronous
IO
mean
for
IO
calls?
• Synchronous
IO
is
done
with
the
pread()
call.
• Asynchronous
IO
is
done
with
the
calls
io_submit()
and
io_getevents().
• Flush
the
buffer
cache.
• Trace
the
‘select
count(*)
from
t2’
with
gdb.
• What
IO
calls
are
done?
70
71. 4.
gdb
lab
• What
does
SIO
mean
for
the
dbwr
wait
events?
• Enable
synchronous
IO
for
the
database
now.
• filesystemio_opXons=‘none’
• The
dbwr
has
a
disXnct
write
wait
event.
• Trace
the
dbwr
(set
db_writer_processes
to
1
if
there
are
mulXple)
with
gdb.
• Create
a
table,
insert
a
row,
commit
and
issue
‘alter
system
checkpoint’.
• Turn
on
asynchronous
IO
again
when
finished.
71
72. 5.
Extra
• How
to
find
funcXon
names?
– perf
• Show
how
some
of
the
gdb
macro’s
are
made.
• Explain
using
registers
to
find
funcXon
call
arguments.
72