Your SlideShare is downloading. ×
0
Copyright © 2013 Apex EvangelistsTroubleshooting APEXApplicationsNienke Gijsen en Roel Hartman
About Roel• Director of APEX Evangelists NL• 20+ years of Oracle Experience• “RoelH” in the APEX Forum• Presenter at KSCOP...
Enterprise Manager
Alert.log• Twee tot drie keer per week• Apex process• ORA-04030: out of process memory when trying to allocate 82456bytes ...
Trace FilePRIVATE HEAP SUMMARY DUMP15 GB total:15 GB commented, 183 KB permanent81 KB free (0 KB in empty extents),15 GB, ...
MetalinkPLSQL Procedure Causing ORA-04030: (pga heap,controlfile i/o buffer) And ORA-04030: (koh-kghu sessi,pmuccst:adt/rec...
Apex Developers• Error log• Tijdstippen onderzoek• Wat doet de get_file?• Wat kan er 16GB groot zijn?
En	  nu?DBA
Troubleshooting APEX ApplicationsDebugging Tracing Logging
Debugging APEX Applications
Debugging APEX Applications• Develop Mode• Runtime Mode• Websheets needs a Development environment !• @apxdvins.sql / @apx...
Debugging Enable - Develop Mode• Application Level Setting
Debugging Enable - Runtime Modebeginwwv_flow_api.set_security_group_id(p_security_group_id=>2616513429239104);! !wwv_flow_...
Debugging - Develop Mode
Debugging - Runtime ModeLEVEL1 ..LEVEL9
Debugging - Instrumentationapex_debug
Remote Debugging• Using SQL Developer
Tracing APEX Applications
Tracing Enable - Develop Mode• Workspace Level Setting (default “Yes”)
Tracing Enable - Runtime Modebeginapex_instance_admin.set_parameter( p_parameter => TRACING_ENABLED, p_value => Y );end;SY...
Tracing - Develop & Runtime ModeDEBUGGING must be enabled as well!
Logging APEX Applications
Logging Enable - Develop Mode• Workspace Level Setting (default “U”)• Application Level Setting (default “Yes”)
Logging Enable - Runtime Mode• Workspace Level Setting (default “U”)beginapex_instance_admin.set_parameter( p_parameter =>...
Logging - Where Is It Going?SELECT apex_view_name, commentsFROM apex_dictionarywhere column_id = 0AND apex_view_name LIKE ...
Logging - How Long Is It In There?• Workspace Level Setting• Develop Mode• Runtime Modebeginapex_instance_admin.set_log_sw...
Logging Examining - Develop Mode
Logging Examining - Runtime Modeselect application_id, page_id, to_char(view_date, DD-MM-YYYY HH24:MI) datetime, log_conte...
The Results• Fluctuating Performance (avg 0.1 - max 1000 sec)• Calls to WWV_FLOW_FILE_MGR.GET_FILE• Used to retrieve image...
The Cause•SELECT ‘<img src=”#WORKSPACE_IMAGES#no_picture.jpg”>’ ...FROM <awesome join>WHERE <more or less restrictions>• C...
The Solution• Moved all images (and CSS / JavaScript) to web server• Replaced ‘<img src=”#WORKSPACE_IMAGES#no_picture.jpg”...
Copyright © 2013 Apex Evangelistshttp://apex-evangelists.comQ& A
roel@apex-evangelists.comhttp://apex-evangelists.com
Upcoming SlideShare
Loading in...5
×

Troubleshooting APEX Performance Issues

1,017

Published on

Real life story about an APEX Application that suffered severe performance issues.

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,017
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
20
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Troubleshooting APEX Performance Issues"

  1. 1. Copyright © 2013 Apex EvangelistsTroubleshooting APEXApplicationsNienke Gijsen en Roel Hartman
  2. 2. About Roel• Director of APEX Evangelists NL• 20+ years of Oracle Experience• “RoelH” in the APEX Forum• Presenter at KSCOPE, OOW, Collaborate, DOAG, UKOUG, ...• Oracle ACE Director• Blog @ http://roelhartman.blogspot.com• Twitter : @RoelH
  3. 3. Enterprise Manager
  4. 4. Alert.log• Twee tot drie keer per week• Apex process• ORA-04030: out of process memory when trying to allocate 82456bytes (pga heap,control file i/o buffer)• ORA-04030: out of process memory when trying to allocate 16328bytes (koh-kghu sessi,pmucalm coll)
  5. 5. Trace FilePRIVATE HEAP SUMMARY DUMP15 GB total:15 GB commented, 183 KB permanent81 KB free (0 KB in empty extents),15 GB, 1 heap: "session heap "declarerc__ number;simple_list__ owa_util.vc_arr;complex_list__ owa_util.vc_arr;beginowa.init_cgi_env(:n__,:nm__,:v__);htp.HTBUF_LEN := -1;null;null;simple_list__(1) := sys.%;simple_list__(2) := dbms_%;simple_list__(3) := utl_%;simple_list__(4) := owa_%;simple_list__(5) := owa.%;simple_list__(6) := htp.%;simple_list__(7) := htf.%;simple_list__(8) := wpg_docload.%;if ((wwv_flow_epg_include_modules.authorize(wwv_flow_file_mgr.get_file) = false) or (owa_match.match_pattern(p_string =>wwv_flow_file_mgr.get_file
  6. 6. MetalinkPLSQL Procedure Causing ORA-04030: (pga heap,controlfile i/o buffer) And ORA-04030: (koh-kghu sessi,pmuccst:adt/record) or ORA-04030: (koh-kghucall ,pmucalm coll)Errors [ID 1325100.1]Solution• Change the page count at the OS level:• $ more /proc/sys/vm/max_map_count$ sysctl -w vm.max_map_count=262144 (256K)
  7. 7. Apex Developers• Error log• Tijdstippen onderzoek• Wat doet de get_file?• Wat kan er 16GB groot zijn?
  8. 8. En  nu?DBA
  9. 9. Troubleshooting APEX ApplicationsDebugging Tracing Logging
  10. 10. Debugging APEX Applications
  11. 11. Debugging APEX Applications• Develop Mode• Runtime Mode• Websheets needs a Development environment !• @apxdvins.sql / @apxdevrm.sql
  12. 12. Debugging Enable - Develop Mode• Application Level Setting
  13. 13. Debugging Enable - Runtime Modebeginwwv_flow_api.set_security_group_id(p_security_group_id=>2616513429239104);! !wwv_flow_api.set_enable_app_debugging(103,1);end;Workspace IDApplication ID1 = ON0 = OFF
  14. 14. Debugging - Develop Mode
  15. 15. Debugging - Runtime ModeLEVEL1 ..LEVEL9
  16. 16. Debugging - Instrumentationapex_debug
  17. 17. Remote Debugging• Using SQL Developer
  18. 18. Tracing APEX Applications
  19. 19. Tracing Enable - Develop Mode• Workspace Level Setting (default “Yes”)
  20. 20. Tracing Enable - Runtime Modebeginapex_instance_admin.set_parameter( p_parameter => TRACING_ENABLED, p_value => Y );end;SYS, SYSTEM, APEX_040200 or APEX_ADMINISTRATOR_ROLE
  21. 21. Tracing - Develop & Runtime ModeDEBUGGING must be enabled as well!
  22. 22. Logging APEX Applications
  23. 23. Logging Enable - Develop Mode• Workspace Level Setting (default “U”)• Application Level Setting (default “Yes”)
  24. 24. Logging Enable - Runtime Mode• Workspace Level Setting (default “U”)beginapex_instance_admin.set_parameter( p_parameter => APPLICATION_ACTIVITY_LOGGING, p_value => U ); -- or [A]lways, [N]everend;• Application Level Setting (default “Yes”)beginwwv_flow_api.set_security_group_id(p_security_group_id=>2616513429239104);!wwv_flow_api.set_logging(103,‘YES’); -- Or ‘NO’ to switch it offend;
  25. 25. Logging - Where Is It Going?SELECT apex_view_name, commentsFROM apex_dictionarywhere column_id = 0AND apex_view_name LIKE %LOG%•
  26. 26. Logging - How Long Is It In There?• Workspace Level Setting• Develop Mode• Runtime Modebeginapex_instance_admin.set_log_switch_interval( p_log_name in ACTIVITY -- or ‘ACCESS’, ‘CLICKTHRU’, ‘DEBUG’, p_log_switch_after_days => 180 ); -- between 1 and 180, default 14end;• Rotating Logs
  27. 27. Logging Examining - Develop Mode
  28. 28. Logging Examining - Runtime Modeselect application_id, page_id, to_char(view_date, DD-MM-YYYY HH24:MI) datetime, log_context, elapsed_time, rows_queriedfrom apex_workspace_activity_logorder by elapsed_time desc
  29. 29. The Results• Fluctuating Performance (avg 0.1 - max 1000 sec)• Calls to WWV_FLOW_FILE_MGR.GET_FILE• Used to retrieve images from the database
  30. 30. The Cause•SELECT ‘<img src=”#WORKSPACE_IMAGES#no_picture.jpg”>’ ...FROM <awesome join>WHERE <more or less restrictions>• Calls WWV_FLOW_FILE_MGR.GET_FILE tons of timeto retrieve ... nothing ....
  31. 31. The Solution• Moved all images (and CSS / JavaScript) to web server• Replaced ‘<img src=”#WORKSPACE_IMAGES#no_picture.jpg”>’with ‘<img src=”/my_img/no_picture.jpg”>’• Now using web server caching• Database isn’t suffering from millions of calls anymore
  32. 32. Copyright © 2013 Apex Evangelistshttp://apex-evangelists.comQ& A
  33. 33. roel@apex-evangelists.comhttp://apex-evangelists.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×