Copyright © 2019 Oracle and/or its affiliates. All rights reserved. |
Debugging PL/SQL with SQL Developer
Jeff Smith
Senior Principal Product Manager
Jeff.d.smith@oracle.com || @thatjeffsmith
Database Tools, Oracle Corp
1
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Not Just THAT SQLDev Guy…
• Database Development Tools team
• Product manager/story teller
• I bother help people online, everywhere
• Contact me for a free remote presentation for your group/company
– Jeff.d.smith@oracle.com
– @thatjeffsmith
– https://www.thatjeffsmith.com
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
thatJeffSmith on
• 60+ Videos
• Feature demos
• Tips & Tricks
• Short & Long Form
– SQL Developer
– SQLcl
– Data Modeler
– ORDS
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
5
SQL Developer Snapshot
Time Tested
Launched in
2005
An Industry Standard
5M+ Oracle DBAs
& Developers
Always Improving
Quarterly
Releases
4
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Project Raptor
 Early Adopter on OTN
2005
1.1
 File Based PL/SQL editing
 Reports
 Ships with 11gR1
1.5.x
 Localizations -
Japanese, Spanish,
Italian, German, French,
Portuguese, Chinese, &
Koreans
 Ships with 11gR2
SQLDev v1.0
 SQL Worksheet
 Procedure Editor
 The world takes notice!
1.5
 Schema Copy/Diff/Export
 Thick connections
 Versioning
 TimesTen
2.1
 Unit Testing
 Data Modeler Viewer
 Unshared SQL Worksheets
2007 201020092006
3.0
 Full Data Modeler
 View > DBA
 SQL Tuning Advisor
 Query Builder
2008 2011 2012
3.1
 New Database DIFF
 PDF Reports
 RMAN
 Data Pump
2013
3.2
 APEX Listener / ORDS
Support
 Database 12c Support
 Schema Service Support
4.0
 Java 7
 ASH/AWR/ADDM
 Color Coded Connections
 Command line Interface
4.0.3
 Optimized Code Insight
 Oracle Big Data Appliance
2014 2015 2016
4.1
 ORDS Included/Full GUI
 instance Viewer
 SQLcl
 Copy PDB to DBaaS
 Larry live demos PDB relocate @ OOW
4.2
 Real Time SQL Monitoring
 Top SQL Report
 Formatter & Other Editor Enhancements
 Easier RESTful Services Development
2017
SQLcl
 New CLI
 Modern SQL*Plus
Release History
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
2017
2017.2
 Bug Fixes
 Sharding
 Data Guard
17.3 & 17.4
 Bug Fixes
Quarterly Releases!!!
2018
Release History
18.1
 Autonomous Data Warehouse Support
 New Welcome Screen/Connections
 SQL Injection Detection
 PL/Scope SQL Statement Support
 Better Formatting
18.2 & 3
 PL/SQL Injection
Detection
 Cloud data Loads
 SQL Developer
Web
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
What does ‘debug’ mean?
 Run and watch?
 dbms/owa OUTPUT?
 Stare at your code until you decide to get coffee?
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
 after
 code++
 observe
 clean up
DBMS/OWA_OUTPUT is not ‘bad’
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
 Coming?
 Going?
 Pause/Poke
 Play with what-if scenarios
Interactive, step-by-step experience with your code
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
The PL/SQL Debugger
 SYS.DBMS_DEBUG_JDWP
 Native SQL Developer tooling
 $0.00
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
A Tale of Two Debugging Methods
 LOCAL
Code/Session originates from SQL Developer
 REMOTE aka EXTERNAL aka Just in Time
Session kicks off and runs from your program, which then connects back
down to SQL Developer for you to debug
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
 Required PRIVS: DEBUG CONNECT SESSION &
EXECUTE for PL/SQL
 12c+ : Access Control Lists (Fine Grained Access)
 Open Code/Object in a code editor
 Compile for DEBUG
 Click the big ‘Bug’ button
Local Debugging
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
What happens next
 the DATABASE will CONNECT to your Machine
 not CLIENT => SERVER but SERVER => CLIENT
 ACL in 12c+ allows the DB to reach out on the network
 if this is a bridge too far…
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
DBMS_DEBUG (PROBE API)
DatabaseDebuggerDisableJDWP=true
CLIENT => SERVER
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
 Not officially supported
 Not as feature rich
 External debugging won’t work
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
 Set a Breakpoint! OR
 Configure Preferences
 Start Debugging: Step Over
Some Tips
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Breakpoints
‘stops’ execution on a
specific line
OR
If a condition is met
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Step Over vs Step Into
 Step Over – Executes line 51, goes to line 54
 Step Into – Opens program at line 51 for debugging
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Where do we go?
Where do we go now?
Where do we go?
Oh, oh
Where do we go?
(Where do we go now?)
Mind the Call Stack
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Remote/External Debugging – cue APEX!
 APEX runs, calls PL/SQL
 hits breakpoint
 SQLDev takes over
 do debugging
 control back to APEX
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Listen for Debug Requests
SQL Developer Client Machine IP
Make sure SQL Dev is listening when APEX rings the door bell
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Setup Debugger in your Application
execute DBMS_DEBUG_JDWP.CONNECT_TCP(‘sqldev-IP’, port);
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Remember to set a breakpoint!
Executable lines of code
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Run your APEX App
 Session trips breakpoint
APEX will ‘hang’
 SQL Developer will
‘blink’ to life
 Start debugging!
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Debug!

More Related Content

PDF
Back to the future with C++ and Seastar
PDF
Introducing DataFrames in Spark for Large Scale Data Science
PPTX
Oracle REST Data Services: Options for your Web Services
DOC
SAP ABAP Resume
PPTX
Oracle apex training
PDF
PySpark Programming | PySpark Concepts with Hands-On | PySpark Training | Edu...
ODP
Presto
PDF
Technical Overview of CDS View – SAP HANA Part I
Back to the future with C++ and Seastar
Introducing DataFrames in Spark for Large Scale Data Science
Oracle REST Data Services: Options for your Web Services
SAP ABAP Resume
Oracle apex training
PySpark Programming | PySpark Concepts with Hands-On | PySpark Training | Edu...
Presto
Technical Overview of CDS View – SAP HANA Part I

What's hot (20)

PPTX
Oracle Forms to APEX conversion tool
PDF
Continuous Data Replication into Cloud Storage with Oracle GoldenGate
DOCX
Miniproject on Employee Management using Perl/Database.
PDF
Building a SIMD Supported Vectorized Native Engine for Spark SQL
PDF
Using Apache Calcite for Enabling SQL and JDBC Access to Apache Geode and Oth...
PPTX
Programming in Spark using PySpark
DOCX
Calculation commands in essbase
PPT
Designing Scalable Data Warehouse Using MySQL
PPTX
Spark Workshop
PPTX
How WillScot-Mobile Mini Utilized Enterprise Data Management for Business Tra...
PDF
How to use source control with apex?
PPTX
Presto: SQL-on-anything
PPTX
AX 2012: All About Lookups!
PPTX
Oracle eBS Overview.pptx
PDF
Optimizing S3 Write-heavy Spark workloads
PDF
Snowflake Data Governance
PDF
Oracle APEX, Oracle Autonomous Database, Always Free Oracle Cloud Services
PDF
Simplify CDC Pipeline with Spark Streaming SQL and Delta Lake
PPTX
Tuning and Debugging in Apache Spark
PDF
監査ログをもっと身近に!〜統合監査のすすめ〜
Oracle Forms to APEX conversion tool
Continuous Data Replication into Cloud Storage with Oracle GoldenGate
Miniproject on Employee Management using Perl/Database.
Building a SIMD Supported Vectorized Native Engine for Spark SQL
Using Apache Calcite for Enabling SQL and JDBC Access to Apache Geode and Oth...
Programming in Spark using PySpark
Calculation commands in essbase
Designing Scalable Data Warehouse Using MySQL
Spark Workshop
How WillScot-Mobile Mini Utilized Enterprise Data Management for Business Tra...
How to use source control with apex?
Presto: SQL-on-anything
AX 2012: All About Lookups!
Oracle eBS Overview.pptx
Optimizing S3 Write-heavy Spark workloads
Snowflake Data Governance
Oracle APEX, Oracle Autonomous Database, Always Free Oracle Cloud Services
Simplify CDC Pipeline with Spark Streaming SQL and Delta Lake
Tuning and Debugging in Apache Spark
監査ログをもっと身近に!〜統合監査のすすめ〜
Ad

Similar to Debugging PL/SQL from your APEX Applications with Oracle SQL Developer (20)

PPTX
PL/SQL All the Things in Oracle SQL Developer
PPTX
Oracle SQL Developer: You're Doing it Wrong!
PPTX
What's New in Oracle SQL Developer for 2018
PPTX
Oracle SQL Developer Tips & Tricks
PPTX
Oracle SQL Developer: 3 Features You're Not Using But Should Be
PPTX
Debugging PL/SQL with Oracle SQL Developer
PPTX
All of the Performance Tuning Features in Oracle SQL Developer
PPTX
Oracle Database 12c Feature Support in Oracle SQL Developer
PPTX
Oracle SQL Developer Reports
PPTX
Oracle SQL Developer for SQL Server?
PPTX
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
PPTX
Oracle SQL Developer for the DBA
PPTX
Database as a Service, Collaborate 2016
PPTX
Big Data Management System: Smart SQL Processing Across Hadoop and your Data ...
PPTX
SQLcl overview - A new Command Line Interface for Oracle Database
PDF
Oracle Warehouse Builder to Oracle Data Integrator 12c Migration Utility
PPTX
Oracle database 12c_and_DevOps
PPTX
REST Enabling your Oracle Database (2018 Update)
PPTX
Mastering DevOps with Oracle
PL/SQL All the Things in Oracle SQL Developer
Oracle SQL Developer: You're Doing it Wrong!
What's New in Oracle SQL Developer for 2018
Oracle SQL Developer Tips & Tricks
Oracle SQL Developer: 3 Features You're Not Using But Should Be
Debugging PL/SQL with Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL Developer
Oracle Database 12c Feature Support in Oracle SQL Developer
Oracle SQL Developer Reports
Oracle SQL Developer for SQL Server?
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
Oracle SQL Developer for the DBA
Database as a Service, Collaborate 2016
Big Data Management System: Smart SQL Processing Across Hadoop and your Data ...
SQLcl overview - A new Command Line Interface for Oracle Database
Oracle Warehouse Builder to Oracle Data Integrator 12c Migration Utility
Oracle database 12c_and_DevOps
REST Enabling your Oracle Database (2018 Update)
Mastering DevOps with Oracle
Ad

More from Jeff Smith (15)

PPTX
Oracle REST Data Services: POUG Edition
PPTX
Oracle SQL Developer Tips and Tricks: Data Edition
PPTX
Change Management for Oracle Database with SQLcl
PPTX
RESTful Services for your Oracle Autonomous Database
PPTX
Oracle SQLcl: Formatting your Query Results
PPTX
Oracle Database Management REST API
PPTX
Oracle SQL Developer Data Modeler - for SQL Server
PPTX
Social Media - Why a Database Person Should Care
PPTX
REST Enabling Your Oracle Database
PPT
If You Oracle Then You Should Twitter Too
PPTX
My Favorite Oracle SQL Developer Data Modeler Features
PPTX
Oracle SQL Developer Data Modeler - Version Control Your Designs
PPTX
Dimensional modeling in oracle sql developer
PPTX
Oracle SQL Developer version 4.0 New Features Overview
PPTX
Oracle SQL Developer Top 10 Tips & Tricks
Oracle REST Data Services: POUG Edition
Oracle SQL Developer Tips and Tricks: Data Edition
Change Management for Oracle Database with SQLcl
RESTful Services for your Oracle Autonomous Database
Oracle SQLcl: Formatting your Query Results
Oracle Database Management REST API
Oracle SQL Developer Data Modeler - for SQL Server
Social Media - Why a Database Person Should Care
REST Enabling Your Oracle Database
If You Oracle Then You Should Twitter Too
My Favorite Oracle SQL Developer Data Modeler Features
Oracle SQL Developer Data Modeler - Version Control Your Designs
Dimensional modeling in oracle sql developer
Oracle SQL Developer version 4.0 New Features Overview
Oracle SQL Developer Top 10 Tips & Tricks

Recently uploaded (20)

PPTX
The various Industrial Revolutions .pptx
PPT
What is a Computer? Input Devices /output devices
PPTX
Microsoft Excel 365/2024 Beginner's training
PDF
Consumable AI The What, Why & How for Small Teams.pdf
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PPTX
Configure Apache Mutual Authentication
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PDF
A proposed approach for plagiarism detection in Myanmar Unicode text
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
UiPath Agentic Automation session 1: RPA to Agents
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
Abstractive summarization using multilingual text-to-text transfer transforme...
PDF
Two-dimensional Klein-Gordon and Sine-Gordon numerical solutions based on dee...
DOCX
search engine optimization ppt fir known well about this
PPTX
Modernising the Digital Integration Hub
PPT
Geologic Time for studying geology for geologist
PPTX
Chapter 5: Probability Theory and Statistics
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
STKI Israel Market Study 2025 version august
The various Industrial Revolutions .pptx
What is a Computer? Input Devices /output devices
Microsoft Excel 365/2024 Beginner's training
Consumable AI The What, Why & How for Small Teams.pdf
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Configure Apache Mutual Authentication
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
A proposed approach for plagiarism detection in Myanmar Unicode text
1 - Historical Antecedents, Social Consideration.pdf
UiPath Agentic Automation session 1: RPA to Agents
A review of recent deep learning applications in wood surface defect identifi...
Abstractive summarization using multilingual text-to-text transfer transforme...
Two-dimensional Klein-Gordon and Sine-Gordon numerical solutions based on dee...
search engine optimization ppt fir known well about this
Modernising the Digital Integration Hub
Geologic Time for studying geology for geologist
Chapter 5: Probability Theory and Statistics
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
STKI Israel Market Study 2025 version august

Debugging PL/SQL from your APEX Applications with Oracle SQL Developer

  • 1. Copyright © 2019 Oracle and/or its affiliates. All rights reserved. | Debugging PL/SQL with SQL Developer Jeff Smith Senior Principal Product Manager [email protected] || @thatjeffsmith Database Tools, Oracle Corp 1
  • 2. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Not Just THAT SQLDev Guy… • Database Development Tools team • Product manager/story teller • I bother help people online, everywhere • Contact me for a free remote presentation for your group/company – [email protected] – @thatjeffsmith – https://www.thatjeffsmith.com
  • 3. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | thatJeffSmith on • 60+ Videos • Feature demos • Tips & Tricks • Short & Long Form – SQL Developer – SQLcl – Data Modeler – ORDS
  • 4. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
  • 5. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 5 SQL Developer Snapshot Time Tested Launched in 2005 An Industry Standard 5M+ Oracle DBAs & Developers Always Improving Quarterly Releases 4
  • 6. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Project Raptor  Early Adopter on OTN 2005 1.1  File Based PL/SQL editing  Reports  Ships with 11gR1 1.5.x  Localizations - Japanese, Spanish, Italian, German, French, Portuguese, Chinese, & Koreans  Ships with 11gR2 SQLDev v1.0  SQL Worksheet  Procedure Editor  The world takes notice! 1.5  Schema Copy/Diff/Export  Thick connections  Versioning  TimesTen 2.1  Unit Testing  Data Modeler Viewer  Unshared SQL Worksheets 2007 201020092006 3.0  Full Data Modeler  View > DBA  SQL Tuning Advisor  Query Builder 2008 2011 2012 3.1  New Database DIFF  PDF Reports  RMAN  Data Pump 2013 3.2  APEX Listener / ORDS Support  Database 12c Support  Schema Service Support 4.0  Java 7  ASH/AWR/ADDM  Color Coded Connections  Command line Interface 4.0.3  Optimized Code Insight  Oracle Big Data Appliance 2014 2015 2016 4.1  ORDS Included/Full GUI  instance Viewer  SQLcl  Copy PDB to DBaaS  Larry live demos PDB relocate @ OOW 4.2  Real Time SQL Monitoring  Top SQL Report  Formatter & Other Editor Enhancements  Easier RESTful Services Development 2017 SQLcl  New CLI  Modern SQL*Plus Release History
  • 7. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 2017 2017.2  Bug Fixes  Sharding  Data Guard 17.3 & 17.4  Bug Fixes Quarterly Releases!!! 2018 Release History 18.1  Autonomous Data Warehouse Support  New Welcome Screen/Connections  SQL Injection Detection  PL/Scope SQL Statement Support  Better Formatting 18.2 & 3  PL/SQL Injection Detection  Cloud data Loads  SQL Developer Web
  • 8. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | What does ‘debug’ mean?  Run and watch?  dbms/owa OUTPUT?  Stare at your code until you decide to get coffee?
  • 9. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |  after  code++  observe  clean up DBMS/OWA_OUTPUT is not ‘bad’
  • 10. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |  Coming?  Going?  Pause/Poke  Play with what-if scenarios Interactive, step-by-step experience with your code
  • 11. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | The PL/SQL Debugger  SYS.DBMS_DEBUG_JDWP  Native SQL Developer tooling  $0.00
  • 12. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | A Tale of Two Debugging Methods  LOCAL Code/Session originates from SQL Developer  REMOTE aka EXTERNAL aka Just in Time Session kicks off and runs from your program, which then connects back down to SQL Developer for you to debug
  • 13. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |  Required PRIVS: DEBUG CONNECT SESSION & EXECUTE for PL/SQL  12c+ : Access Control Lists (Fine Grained Access)  Open Code/Object in a code editor  Compile for DEBUG  Click the big ‘Bug’ button Local Debugging
  • 14. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | What happens next  the DATABASE will CONNECT to your Machine  not CLIENT => SERVER but SERVER => CLIENT  ACL in 12c+ allows the DB to reach out on the network  if this is a bridge too far…
  • 15. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | DBMS_DEBUG (PROBE API) DatabaseDebuggerDisableJDWP=true CLIENT => SERVER
  • 16. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |  Not officially supported  Not as feature rich  External debugging won’t work
  • 17. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 18. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 19. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |  Set a Breakpoint! OR  Configure Preferences  Start Debugging: Step Over Some Tips
  • 20. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Breakpoints ‘stops’ execution on a specific line OR If a condition is met
  • 21. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Step Over vs Step Into  Step Over – Executes line 51, goes to line 54  Step Into – Opens program at line 51 for debugging
  • 22. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Where do we go? Where do we go now? Where do we go? Oh, oh Where do we go? (Where do we go now?) Mind the Call Stack
  • 23. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Remote/External Debugging – cue APEX!  APEX runs, calls PL/SQL  hits breakpoint  SQLDev takes over  do debugging  control back to APEX
  • 24. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Listen for Debug Requests SQL Developer Client Machine IP Make sure SQL Dev is listening when APEX rings the door bell
  • 25. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Setup Debugger in your Application execute DBMS_DEBUG_JDWP.CONNECT_TCP(‘sqldev-IP’, port);
  • 26. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Remember to set a breakpoint! Executable lines of code
  • 27. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Run your APEX App  Session trips breakpoint APEX will ‘hang’  SQL Developer will ‘blink’ to life  Start debugging!
  • 28. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Debug!