1、Alex Nuijten&Roel HartmanAPEX,ORDS&JRDVWho are we?multiple(dozens)of APEX Application instancesMonitoring an APEX SaaS solution Multiple databases Multiple APEX Instances Multiple APEX WorkspacesAgents&MonitorAgents&MonitorAgents&MonitorAgents&MonitorEvery 10 minutes Gather info Post to Monitor dbms
2、_scheduler.create_job(job_name =SEND_LOG_DATA,job_type =STORED_PROCEDURE,job_action =SEND.ACTIVITY_LOG,number_of_arguments=0,start_date =null,repeat_interval =FREQ=MINUTELY;INTERVAL=10,end_date =null,enabled =FALSE,auto_drop =FALSE,comments =);Agents&MonitorEvery 10 minutes Gather info select json_o
3、bject(key server value sys_context(USERENV,SERVER_HOST),key database value sys_context(USERENV,DB_NAME),key data value(select json_arrayagg(json_object(key application_id value p.application_id,key application_name value p.application_name,key page_id value p.page_id,key page_name value p.page_name,
4、key userid value a.userid,key session_id value a.session_id,key time_stamp value a.time_stamp,key elap value a.elap,key sqlerrm value coalesce(a.sqlerrm,(select max(m.message)from apex_debug_messages m where m.message_level=1 and m.session_id=a.session_id and m.application_id=a.flow_id and m.page_id
5、=a.step_id ),key num_rows value a.num_rows,key component_name value ponent_name,key ir_search value a.ir_search )returning clob)from apex_activity_log a join apex_application_pages p on a.flow_id=p.application_id and a.step_id=p.page_id where time_stamp l_start_date ),.many more lines.Agents&Monitor
6、Every 10 minutes Gather info Post to Monitor l_clob:=apex_webservice.make_rest_request(p_url =/ords/apexmonitor/logging/activity,p_http_method=POST,p_body =l_log_data_clob );Agents&MonitorEvery 10 minutes Gather info Post to Monitor Agents&MonitorAgents&MonitorORDS Module begin receive.activity_log(