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
4. Alert.log
• Twee tot drie keer per week
• Apex process
• ORA-04030: out of process memory when trying to allocate 82456
bytes (pga heap,control file i/o buffer)
• ORA-04030: out of process memory when trying to allocate 16328
bytes (koh-kghu sessi,pmucalm coll)
13. Debugging Enable - Runtime Mode
begin
wwv_flow_api.set_security_group_id(p_security_group_id=>2616513429239104);! !
wwv_flow_api.set_enable_app_debugging(103,1);
end;
Workspace ID
Application ID
1 = ON
0 = OFF
24. Logging Enable - Runtime Mode
• Workspace Level Setting (default “U”)
begin
apex_instance_admin.set_parameter( p_parameter => 'APPLICATION_ACTIVITY_LOGGING'
, p_value => 'U' ); -- or [A]lways, [N]ever
end;
• Application Level Setting (default “Yes”)
begin
wwv_flow_api.set_security_group_id(p_security_group_id=>2616513429239104);!
wwv_flow_api.set_logging(103,‘YES’); -- Or ‘NO’ to switch it off
end;
25. Logging - Where Is It Going?
SELECT apex_view_name, comments
FROM apex_dictionary
where column_id = 0
AND apex_view_name LIKE '%LOG%'
•
26. Logging - How Long Is It In There?
• Workspace Level Setting
• Develop Mode
• Runtime Mode
begin
apex_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 14
end;
• Rotating Logs
28. Logging Examining - Runtime Mode
select application_id
, page_id
, to_char(view_date, 'DD-MM-YYYY HH24:MI') datetime
, log_context
, elapsed_time
, rows_queried
from apex_workspace_activity_log
order by elapsed_time desc
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. 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 time
to retrieve ... nothing ....
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