Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Using APEX to Create a Mobile User Interface for Enterprise Manager 12c

1,655 views

Published on

Short version (30 mins) of my presentation about APEX and EM12c. Development demo video and shot animation is not available.

Published in: Technology
  • Be the first to comment

Using APEX to Create a Mobile User Interface for Enterprise Manager 12c

  1. 1. USING APEX TO CREATE A MOBILE USER INTERFACE FOR ENTERPRISE MANAGER 12C Gökhan Atıl Oracle Day İstanbul, 11/11/2014
  2. 2. Gökhan Atıl •DBA Team Lead •10+ years experience •10g/11g/R12 OCP DBA •Oracle Certified Expert on SQL & Exadata •Comptia Linux+ •Blogger (since October 5th, 2008) gokhanatil.com •Co-Founder of Turkey Oracle User Group (TROUG) •Oracle ACE (since October 25th, 2011)
  3. 3. Expert Oracle Enterprise Manager 12c Kellyn Pot'vin Anand Akela Gokhan Atil Bobby Curtis Alex Gorbachev Niall Litchfield Leighton Nelson Pete Sharman June 25 th, 2013
  4. 4. Agenda Enterprise Manager Cloud Control Event Management in EM12c Why did we need a Mobile User Interface? Views and Procedues in EM12c Repository Oracle Application Express Short Story of Building the Application Result What’s Next?
  5. 5. Enterprise Manager Cloud Control 12c •Descendant of Database Console ›Oracle EM Grid Control ›Oracle EM Express •Client-Server Architecture •Provides more than just controlling databases ›Middleware, Storage, Operation System •First product of Oracle Cloud Series (12c) •Basic features are free as long as you purchase of any Oracle software license or Support contract.
  6. 6. Enterprise Manager Cloud Control 12c •Base Framework Features ›Agent Management, Monitoring and Incident Management, My Oracle Support integration... •Base Database Management ›Pluggable Databases, Resource Management, Scheduler Central, Patch Recommendations... •Base Middleware Management ›Only the target home page itself is unlicensed •Base Engineered Systems Management •Server, Storage, and Virtualization Management ›Oracle VM and Guest VM provisioning
  7. 7. Enterprise Manager Cloud Control 12c EM12c Web Interface EM Repository Oracle Management Server EMCLI EM Agent EM Agent EM Agent
  8. 8. Incident Management in EM12c Problems ADR Events Availability Alerts Metric Alerts Job Status Change Compliance Violations User-reported INCIDENT INCIDENT RULES
  9. 9. Why did we need a Mobile User Interface?
  10. 10. Why don’t we use EM12c Mobile Application? EM12c Mobile Helps you to manage Incidents Avaliable for ONLY iPhone Released at February 2012 Hard to Navigate Needs More Features It shouldn’t be hard to develop it!
  11. 11. Here is The Plan: EM12c Web Interface EM Repository Oracle Management Server EMCLI EM Agent EM Agent EM Agent My Mobile Application
  12. 12. Views and Procedures in EM12c Repository •MGMT$TARGET –Target information (name, type, guid, hostname...) •MGMT$INCIDENTS –All incidents (id, summary, severity, owner, status...) •MGMT$PROBLEMS –All problems (id, problem key, summary, status...) •EM_EVENT_MANAGER package –suppress_issue –close_problem You can find more at Oracle Enterprise Manager Cloud Control Documentation
  13. 13. Oracle Application Express •Web Applications with SQL and PL/SQL •Supports Mobile Development using jQuery Mobile •Fully supported, no cost option of the Oracle Database •Installed as part of the standard Oracle Database ›Needs to be upgraded! •Right tool for the job!
  14. 14. Oracle Application Express •Download the APEX (from Oracle.com) •Easy update/installation: $ unzip apex_4.x.x.zip -d /home/oracle $ cd /home/oracle/apex $ sqlplus / as sysdba SQL> @apexins.sql SYSAUX SYSAUX TEMP /i/ SQL> @apxldimg.sql /home/oracle SQL> @apxchpwd.sql
  15. 15. Welcome to Oracle APEX •Login to: http://yourserver:8080/apex/
  16. 16. Preparations •Create A Workspace –Workspace will also create a database user •Give required permissions to schema •Login to Your New Workspace grant EXEMPT ACCESS POLICY to youruser; grant EXECUTE on SYSMAN.EM_EVENT_MANAGER to youruser; grant SELECT on SYSMAN.MGMT$INCIDENTS to youruser; grant SELECT on SYSMAN.MGMT$PROBLEMS to youruser grant SELECT on SYSMAN.MGMT$TARGET to youruser;
  17. 17. Short Story of Building the Application
  18. 18. Architecture of the Application MAIN PAGE (page 1) Button (open incidents) Button (open problems) OPEN INCIDENTS (page 2) List View OPEN PROBLEMS (page 3) List View INCIDENT DETAILS (page 4) Report View Back Button Underlying Problems PROBLEM DETAILS (#5)
  19. 19. Quick Tips for the Application •While Creating The Application we should select jQuery Mobile Smartphone as User Interface! •EM12c Users are also DB Users in Repository, so we can use «database users» for authorization.
  20. 20. Quick Tips for the Application •We can use empty HTML regions to put buttons!
  21. 21. Quick Tips for the Application •ListView is flexible component you can use for Mobile Applications
  22. 22. List Incidents (Page 2) •We can use below query to list open incidents: SELECT i.INCIDENT_ID, i.CREATION_DATE, i.SEVERiTY, t.TARGET_NAME || ': ' || i.SUMMARY_MSG MSG FROM MGMT$INCIDENTS i, MGMT$TARGET t WHERE i.TARGET_GUID= t.TARGET_GUID AND i.OPEN_STATUS = 1 AND i.iS_SUPPRESSED = 0 ORDER BY i.CREATION_DATE DESC; •We need to link to another page from ListView: •The above link will call page 4, and set P4_INCIDENT_ID variable in page 4 to INCIDENT_ID of the selected row. f?p=&APP_ID.:4:&APP_SESSION.::::P4_INCIDENT_ID:&INCIDENT_ID.
  23. 23. List Problems (Page 3) •We can use below query to list open problems: SELECT p.PROBLEM_ID, p.CREATION_DATE, p.SEVERITY, t.TARGET_NAME || ' : ' || p.SUMMARY_MSG MSG FROM MGMT$PROBLEMS p, MGMT$TARGET t WHERE p.TARGET_GUID= t.TARGET_GUID AND p.OPEN_STATUS = 1 AND p.IS_SUPPRESSED = 0 ORDER BY p.CREATION_DATE DESC; •We need to link to another page from ListView: f?p=&APP_ID.:5:&APP_SESSION.::::P5_PROBLEM_ID:&PROBLEM_ID.
  24. 24. Incident Details (page 4) SELECT i.SEVERITY,i.INCIDENT_NUM, t.TARGET_NAME,t.HOST_NAME, i.PRIORITY,i.CREATION_DATE, i.LAST_UPDATED_DATE FROM MGMT$INCIDENTS i, MGMT$TARGET t WHERE i.TARGET_GUID= t.TARGET_GUID AND i.INCIDENT_ID = :P4_INCIDENT_ID;
  25. 25. Development Demo
  26. 26. How About Some Extra? •APEX supports HTML5 Charts, If we create dblinks to our target databases, we may even query ASH to draw nice performance charts.
  27. 27. How About Some Extra? select null, TO_CHAR(sample_time, 'DD HH24:MI') st, avg(CPU) cpu, avg("User I/O") userio, avg(total-CPU-"User I/O"-"System I/O") others FROM (SELECT sample_time, sum(decode(session_state, 'ON CPU', 1, 0)) as CPU, sum(decode(wait_class, 'Scheduler', 1, 0)) as Scheduler, sum(decode(wait_class, 'User I/O', 1, 0)) as "User I/O", sum(decode(wait_class, 'System I/O', 1, 0)) as "System I/O", sum(decode(wait_class, 'Concurrency', 1, 0)) as Concurrency, sum(decode(wait_class, 'Application', 1, 0)) as Application, sum(decode(wait_class, 'Commit', 1, 0)) as Commit, sum(decode(wait_class, 'Configuration', 1, 0)) as Configuration, sum(decode(wait_class, 'Administrative', 1, 0)) as Administrative, sum(decode(wait_class, 'Network', 1, 0)) as Network, sum(decode(wait_class, 'Queueing', 1, 0)) as Queueing, sum(decode(wait_class, 'Other', 1, 0)) as Other, sum(1) total FROM gv$active_session_history@XXXXX WHERE sample_time > sysdate - (1 / 24) GROUP BY sample_time) group by TO_CHAR(sample_time, 'DD HH24:MI') order by 2;
  28. 28. How About Some Extra?
  29. 29. ...with some dedication
  30. 30. Result:
  31. 31. What’s Next? •Assigning Incidents to Users •Reports (Be careful about licensing) •Target Home Pages
  32. 32. ANY QUESTIONS? @gokhanatil http://gokhanatil.com

×