Presentation is loading. Please wait.

Presentation is loading. Please wait.

Royal London Group A group of specialist businesses where the bottom line is always financial sense Oracle Statistics – with a little bit extra on top.

Similar presentations


Presentation on theme: "Royal London Group A group of specialist businesses where the bottom line is always financial sense Oracle Statistics – with a little bit extra on top."— Presentation transcript:

1 Royal London Group A group of specialist businesses where the bottom line is always financial sense Oracle Statistics – with a little bit extra on top Lise Parker Technical Designer Scottish Life – part of The Royal London Group 1

2 Agenda Introduction Some background about my company, me and how we use Oracle 2 Database Statistics What are they and what can they tell you? Bridging The Gap What we’ve done to better understand individual code behaviour The End! Questions?

3 Royal London Group A group of specialist businesses where the bottom line is always financial sense Introduction About Royal London and Scottish Life About Me About the Database and Application 3

4 UK’s largest mutual (customer-owned) Life and Pensions provider Multi-brand business run as separate business units 2,880 * employees, primarily UK-based with main offices in Edinburgh, Wilmslow and London £46.8 billion * of funds under management Around 4 million customers * About Royal London * As at 31 st March Introduction

5 About Scottish Life Founded in 1881, acquired by Royal London in 2001 Pension specialist Internal business users on two UK sites Core business applications primarily developed in-house including secure web application for external customers and business partners 5 Introduction

6 About Me Worked with Oracle databases and tools since 1996 Work within the Technical Architecture & Design team Provide specialised technical support for Scottish Life Oracle development teams covering both database and code 6 Introduction

7 About the Database Main policy administration application uses Oracle 11gR1 database and PL/SQL for business logic Complex application landscape with multiple integrations One production database supporting OLTP during day time and batch during night time – c. 1k concurrent users per hour – c. 1m online transactions per day – c. 350 batch reports per night Multiple concurrent batch streams with complex dependencies 7 Large database interaction variation between online and batch scenarios Introduction

8 About the Applications 8 Windows Web Servers DMZ Internet Internal Network Unix Database Servers Oracle Windows Database Servers MS SQL Windows Application Servers External Users (Financial Advisers, Employers, Employees/ Policyholders) External Business Partners Internal Users Firewall Introduction

9 Royal London Group A group of specialist businesses where the bottom line is always financial sense Database Statistics Why do we need them? What do you get “out the box”? What can they tell us? What else is available? 9

10 Why do we need them? 10 Customers expectations of information accessibility have changed as a result of the internet There’s an expectation to receive information: – via multiple channels – in real-time – quickly The database can be a bottleneck if performance is not understood and managed effectively on an on-going basis Key to ensure that database performance doesn’t constrain our business proposition designs and customer experiences Database Statistics

11 What’s available “out the box” 11 Real time data to historical data AWR Statistics are available as both real time and historical data Cumulative values Metrics Sampled data (ASH) Database Statistics

12 -- Top 10 CPU consumers in the last 5 mins SELECT * FROM (SELECT session_id,session_serial#,COUNT(*) FROM v$active_session_history WHERE session_state = 'ON CPU' AND sample_time > SYSDATE - INTERVAL '5' minute GROUP BY session_id,session_serial# ORDER BY COUNT(*) DESC) WHERE rownum <= 10; -- Top 10 waiting sessions in the last 5 mins SELECT * FROM (SELECT session_id,session_serial#,COUNT(*) FROM v$active_session_history WHERE session_state = 'WAITING' AND sample_time > SYSDATE - INTERVAL '5' minute GROUP BY session_id,session_serial# ORDER BY COUNT(*) DESC) WHERE rownum <= 10; -- Who is the SID? SELECT serial#,username,osuser,machine,program,resource_consumer_group,client_info FROM v$session WHERE sid = &sid; -- What did the SID do? SELECT DISTINCT sql_id,session_serial# FROM v$active_session_history WHERE sample_time > SYSDATE - INTERVAL '5' minute AND session_id = &sid; -- Retrieve the SQL from the Library Cache: SELECT sql_text FROM v$sql WHERE sql_id = '&sqlid'; What can they tell us – real-time? 12 Real time data continuously updated whilst database is open and in use (v$) Database Statistics

13 13 -- Top 10 waiting sessions for a specific time period SELECT * FROM (SELECT session_id,session_serial#,COUNT(*) FROM dba_hist_active_sess_history WHERE session_state = ‘WAITING' AND sample_time BETWEEN TO_DATE('01-june ','dd-mon-yyyy hh24') AND TO_DATE('01-june ','dd-mon-yyyy hh24') GROUP BY session_id,session_serial# ORDER BY COUNT(*) DESC) WHERE rownum <= 10; -- Top 10 CPU consumers for a specific time period SELECT * FROM (SELECT session_id,session_serial#,COUNT(*) FROM dba_hist_active_sess_history WHERE session_state = 'ON CPU' AND sample_time BETWEEN TO_DATE('01-june ','dd-mon-yyyy hh24') AND TO_DATE('01-june ','dd-mon-yyyy hh24') GROUP BY session_id,session_serial# ORDER BY COUNT(*) DESC) WHERE rownum <= 10; -- What did the SID do? SELECT DISTINCT sql_id,session_serial# FROM dba_hist_active_sess_history WHERE sample_time BETWEEN TO_DATE('01-june ', 'dd-mon-yyyy hh24') AND TO_DATE('01-june ', 'dd-mon-yyyy hh24') AND session_id = &sid; -- Retrieve the SQL from the Library Cache SELECT sql_text FROM dba_hist_sqltext WHERE sql_id = '&sqlid'; What can they tell us – historical? Database Statistics Real time data available for set amount of days (DBA_HIST)

14 What else is available? 14 DBMS_APPLICATION_INFO – Oracle package used to record the names of the executing modules or transactions in the database. – These settings are very useful when it comes to tracking performance. – Set MODULE and ACTION sensibly throughout your code structure. Profiling at run time: – Wrap the DBMS_APPLICATION_INFO within a PL/SQL package. – If profiling then record every setting of the MODULE and ACTION in a table. Database Statistics Consider use of DBMS_APPLICATION_INFO in your application designs

15 Royal London Group A group of specialist businesses where the bottom line is always financial sense Bridging The Gap Our problem What we had and what we wanted The additional framework The GUI we have built 15

16 Some examples of questions that we needed to answer: – The marketing department wants to know how long it takes to produce a statement from the web at the busiest time. – How can I decide on what to tune that will reduce the overall batch window? – The batch is starting to take longer and longer to run. What is causing this? Our problem 16 Bridging The Gap Very difficult to identify relevant data from global database statistics

17 PL/SQL SQL What we had and what we wanted 17 PL/SQL SQL Needed statistics relevant to specific business processes Process A Process C Process B Process D Process E Process F Process G Segments SQL statements Transactions CPU I/O ASH AWR Segments SQL statements Transactions CPU I/O ASH AWR PL/SQL SQL Bridging The Gap Process A Process C Process B Process D Process E Process F Process G Segments SQL statements Transactions CPU I/O ASH AWR

18 Application A Process Application C Process Application D Process Application B Process The additional framework 18 Process DB Bridging The Gap Process Statistics Framework PROCESS_MASTER PROCESS_STATS PROCESS_STATS_ ENTRIES PROCESS_STATS_ ENTRIES PROCESS_CONTROL_ PARAMETERS

19 Process Data Analysis Tool 19 Bridging The Gap This slide had a movie showing you our Process Stats GUI tool. Instead I have added a few slides showing you screen dumps of this GUI tool so you still have an idea of how we did it.

20 Process Data Analysis Tool 20

21 Process Data Analysis Tool 21

22 Process Data Analysis Tool 22

23 Process Data Analysis Tool 23

24 Process Data Analysis Tool 24

25 Summary Things to consider: – Invest some time to better understand what Oracle statistics “out the box” can tell you about your database behaviour – Is there anything “extra on top” you could add that would provide additional benefit to your particular environment – How you could design your application code to integrate with the Oracle statistics framework – How you can make the statistics information available to developers to help them improve their query designs 25 Be proactive, not reactive!

26 Royal London Group A group of specialist businesses where the bottom line is always financial sense Any questions? Lise Parker


Download ppt "Royal London Group A group of specialist businesses where the bottom line is always financial sense Oracle Statistics – with a little bit extra on top."

Similar presentations


Ads by Google