Subscribe to Posts by Email

Subscriber Count

    696

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

Performance Troubleshooting Series : Identifying Problematic Sessions or Queries (Preface)

In this part of the series, we will be looking into , how to identify the Problematic Sessions or Queries.

Before beginning, one should distinguish the question here. You may face questions like, and the answer for both is to identify either loaded sessions for a database.

1. Database is/was slow.

2. Our Session/Query is/was slow.

To make it simple, I will stick this two questions for this post now.

Question 1: Database is/was slow

First lets see how to determine is the database currently running slow.

1. AAS:- Average Active Sessions , As written here you can find the AAS as a measurement to understand the database is loaded or not. 

Part 1 and Part 2 of the Series

2.Identify the most resource Consumption processes:-

But if you see the database has load i.e AAS is more then

Part 3 of the series

As by now , you might have determined the database load, by AAS, with yard stick cpu count of the database, if your AAS is less than CPU COUNT then you can simply say that database is not loaded, that means you do not have that many concurrent sessions occupying CPU (leaving other factors like IO/Memory)

Then, why they reporting slow. It might be the case that their specific session or process taking time to complete or waiting or running slow.

So you need to ask few questions now.

1. Provide more details on SID, Machine, SQL statement,, at what time the session logged on.

With the details above you can identify or pin point to session level troubleshooting..

Question 2:- Session / Query Running Slow:-

3. As you identify the session which causing issue, now look at those sessions top events.

There are two Methods and a systematic approach.

Method 1. Session Wait Event Approach:- In this approach we will try to identify from the problematic session what its waiting for , why its waiting, what can be done to resolve the problem.

Method 2. Session SQL ID Run History Approach:- In this approach we shall need to check , if the query for the session that running long has been ran before, if so ran, what is the plan before and what is the plan currently and is there any change, if so any change why it changed what caused to be changed etc.

SQL> select sid,username,status,event,sql_id,prev_sql_id,blocking_session,row_wait_obj# from v$session where sid='';

(you can replace any condition like username, machine in where clause with the information you have got from application teams)

Alternatively, you can find the series of information from v$active_session_history of every second sample for the same session using below query

 

SQL> select sample_time,session_id,username,event,sql_id,sql_id,prev_sql_id,blocking_session,blocking_instance,plan_hash_value from v$active_session_history where session_id='' or username='';

In Next series these methods will be discussed.

-Thanks

GEEKDBA

Comments are closed.