SlideShare a Scribd company logo
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

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

PPTX
Debugging PL/SQL with Oracle SQL Developer
Jeff Smith
 
PPTX
PL/SQL All the Things in Oracle SQL Developer
Jeff Smith
 
PPTX
What's New in Oracle SQL Developer for 2018
Jeff Smith
 
PDF
Download full ebook of Oracle Sql Developer Narayanan Ajith instant download pdf
dakorarampse
 
PPTX
Oracle SQL Developer: You're Doing it Wrong!
Jeff Smith
 
PDF
Pl sql student guide v 3
Nexus
 
PPTX
Oracle SQL Developer for SQL Server?
Jeff Smith
 
PPTX
Plsql guide 2
Vinay Kumar
 
PDF
Oracle 11g release 2
Adel Saleh
 
PPTX
Oracle SQL Developer Tips & Tricks
Jeff Smith
 
PDF
Hack your db before the hackers do
fangjiafu
 
PPTX
Oracle institutes in Hyderabad.
sreehari orienit
 
PDF
Database & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdf
InSync2011
 
DOCX
Java full stack1
pravash sahoo
 
DOC
3963066 pl-sql-notes-only
Ashwin Kumar
 
PPT
oracle plsql training | oracle online training | oracle plsql demo | oracle p...
Nancy Thomas
 
DOCX
Oracle PLSQL Training in Chennai, Tambaram
Radiant Business Solutions
 
DOC
DBMS Practical File
Dushmanta Nath
 
PDF
Oracle Sql Developer 21 Database Design And Development Using This Featureric...
kollsiveryu9
 
PPT
Introduction to Standard Query Language.ppt
HajarMeseehYaseen
 
Debugging PL/SQL with Oracle SQL Developer
Jeff Smith
 
PL/SQL All the Things in Oracle SQL Developer
Jeff Smith
 
What's New in Oracle SQL Developer for 2018
Jeff Smith
 
Download full ebook of Oracle Sql Developer Narayanan Ajith instant download pdf
dakorarampse
 
Oracle SQL Developer: You're Doing it Wrong!
Jeff Smith
 
Pl sql student guide v 3
Nexus
 
Oracle SQL Developer for SQL Server?
Jeff Smith
 
Plsql guide 2
Vinay Kumar
 
Oracle 11g release 2
Adel Saleh
 
Oracle SQL Developer Tips & Tricks
Jeff Smith
 
Hack your db before the hackers do
fangjiafu
 
Oracle institutes in Hyderabad.
sreehari orienit
 
Database & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdf
InSync2011
 
Java full stack1
pravash sahoo
 
3963066 pl-sql-notes-only
Ashwin Kumar
 
oracle plsql training | oracle online training | oracle plsql demo | oracle p...
Nancy Thomas
 
Oracle PLSQL Training in Chennai, Tambaram
Radiant Business Solutions
 
DBMS Practical File
Dushmanta Nath
 
Oracle Sql Developer 21 Database Design And Development Using This Featureric...
kollsiveryu9
 
Introduction to Standard Query Language.ppt
HajarMeseehYaseen
 

More from Jeff Smith (20)

PPTX
Oracle REST Data Services: POUG Edition
Jeff Smith
 
PPTX
Oracle SQL Developer Tips and Tricks: Data Edition
Jeff Smith
 
PPTX
Change Management for Oracle Database with SQLcl
Jeff Smith
 
PPTX
RESTful Services for your Oracle Autonomous Database
Jeff Smith
 
PPTX
Oracle SQLcl: Formatting your Query Results
Jeff Smith
 
PPTX
Oracle Database Management REST API
Jeff Smith
 
PPTX
Oracle REST Data Services: Options for your Web Services
Jeff Smith
 
PPTX
Oracle SQL Developer Data Modeler - for SQL Server
Jeff Smith
 
PPTX
REST Enabling your Oracle Database (2018 Update)
Jeff Smith
 
PPTX
Social Media - Why a Database Person Should Care
Jeff Smith
 
PPTX
Oracle SQL Developer Reports
Jeff Smith
 
PPTX
Oracle SQL Developer: 3 Features You're Not Using But Should Be
Jeff Smith
 
PPTX
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
Jeff Smith
 
PPTX
REST Enabling Your Oracle Database
Jeff Smith
 
PPTX
All of the Performance Tuning Features in Oracle SQL Developer
Jeff Smith
 
PPT
If You Oracle Then You Should Twitter Too
Jeff Smith
 
PPTX
SQLcl overview - A new Command Line Interface for Oracle Database
Jeff Smith
 
PPTX
My Favorite Oracle SQL Developer Data Modeler Features
Jeff Smith
 
PPTX
Oracle Database 12c Feature Support in Oracle SQL Developer
Jeff Smith
 
PPTX
Oracle SQL Developer Data Modeler - Version Control Your Designs
Jeff Smith
 
Oracle REST Data Services: POUG Edition
Jeff Smith
 
Oracle SQL Developer Tips and Tricks: Data Edition
Jeff Smith
 
Change Management for Oracle Database with SQLcl
Jeff Smith
 
RESTful Services for your Oracle Autonomous Database
Jeff Smith
 
Oracle SQLcl: Formatting your Query Results
Jeff Smith
 
Oracle Database Management REST API
Jeff Smith
 
Oracle REST Data Services: Options for your Web Services
Jeff Smith
 
Oracle SQL Developer Data Modeler - for SQL Server
Jeff Smith
 
REST Enabling your Oracle Database (2018 Update)
Jeff Smith
 
Social Media - Why a Database Person Should Care
Jeff Smith
 
Oracle SQL Developer Reports
Jeff Smith
 
Oracle SQL Developer: 3 Features You're Not Using But Should Be
Jeff Smith
 
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
Jeff Smith
 
REST Enabling Your Oracle Database
Jeff Smith
 
All of the Performance Tuning Features in Oracle SQL Developer
Jeff Smith
 
If You Oracle Then You Should Twitter Too
Jeff Smith
 
SQLcl overview - A new Command Line Interface for Oracle Database
Jeff Smith
 
My Favorite Oracle SQL Developer Data Modeler Features
Jeff Smith
 
Oracle Database 12c Feature Support in Oracle SQL Developer
Jeff Smith
 
Oracle SQL Developer Data Modeler - Version Control Your Designs
Jeff Smith
 
Ad

Recently uploaded (20)

PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Biography of Daniel Podor.pdf
Daniel Podor
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Ad

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!