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

What's hot (20)

PDF
Open Policy Agent
Torin Sandall
 
PDF
RESTful Web Services
Christopher Bartling
 
PDF
Operationalizing Multi Cluster Istio_ Lessons Learned and Developing Ambient ...
MichaelOLeary82
 
PPTX
ShEx vs SHACL
Jose Emilio Labra Gayo
 
PDF
Http methods
maamir farooq
 
PDF
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...
Altinity Ltd
 
PDF
Intro to Neo4j and Graph Databases
Neo4j
 
PPTX
APEX Themes and Templates
InSync Conference
 
PPT
Web Application Deployment
elliando dias
 
PDF
Mind Your Business. And Its Logic
Vladik Khononov
 
PDF
Unveiling etcd: Architecture and Source Code Deep Dive
Chieh (Jack) Yu
 
PDF
Neo4j in Depth
Max De Marzi
 
PDF
Istio's mixer policy enforcement with custom adapters (cloud nativecon 17)
Torin Sandall
 
PPT
REST Introduction.ppt
KGSCSEPSGCT
 
PPTX
Proj4를 이용한 좌표계 변환
BJ Jang
 
PDF
REST: From GET to HATEOAS
Jos Dirksen
 
PPTX
Inference on the Semantic Web
Myungjin Lee
 
PDF
Webinar: Working with Graph Data in MongoDB
MongoDB
 
PDF
Linked Data의 RDF 어휘 이해하고 체험하기 - FOAF, SIOC, SKOS를 중심으로 -
Dongbum Kim
 
PDF
GraphQL Fundamentals
Virbhadra Ankalkote
 
Open Policy Agent
Torin Sandall
 
RESTful Web Services
Christopher Bartling
 
Operationalizing Multi Cluster Istio_ Lessons Learned and Developing Ambient ...
MichaelOLeary82
 
ShEx vs SHACL
Jose Emilio Labra Gayo
 
Http methods
maamir farooq
 
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...
Altinity Ltd
 
Intro to Neo4j and Graph Databases
Neo4j
 
APEX Themes and Templates
InSync Conference
 
Web Application Deployment
elliando dias
 
Mind Your Business. And Its Logic
Vladik Khononov
 
Unveiling etcd: Architecture and Source Code Deep Dive
Chieh (Jack) Yu
 
Neo4j in Depth
Max De Marzi
 
Istio's mixer policy enforcement with custom adapters (cloud nativecon 17)
Torin Sandall
 
REST Introduction.ppt
KGSCSEPSGCT
 
Proj4를 이용한 좌표계 변환
BJ Jang
 
REST: From GET to HATEOAS
Jos Dirksen
 
Inference on the Semantic Web
Myungjin Lee
 
Webinar: Working with Graph Data in MongoDB
MongoDB
 
Linked Data의 RDF 어휘 이해하고 체험하기 - FOAF, SIOC, SKOS를 중심으로 -
Dongbum Kim
 
GraphQL Fundamentals
Virbhadra Ankalkote
 

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
 
Ad

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
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
Python basic programing language for automation
DanialHabibi2
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 

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!