Solved

ORACLE TUNING

Posted on 2006-06-13
7
760 Views
Last Modified: 2012-08-14
WE HAVE AN APP USING ORACLE 9 WHICH HAS BEEN RUNNING FOR 3/4 YEARS FINE
NOW USERS ARE EXPERIENCING SLOW RESPONSES INTERMITTENTLY
WE THINK EITHER
ORACLE DATABASE NEEDS TO RUN SOME TUNING PROGRAM "COMPUTE STATISTICS??" AS NOW DATA HAS EXPANDED TO A POINT TO MAKE ORACLE INEFFICIENT.CAN SOMEONE TELL US MORE INFO ON THIS


OR
USER VIA A USER REPORTING TOOL IS HITTING TABLE WITH INEFFICIENT QUERY.
WE HAVE FOUND THE V$SQL TABLE WHICH LISTS QUERIES AND TIME TAKEN. HOWEVER CAN WE ALSO FIND THE USER WHO HAS RUN THIS QUERY.

ALSO NOTE WE USE mlogs TO PROVIDE AN AUDIT OF MOST OF OUR TABLES
THANKS IN ANTISCIPATION
0
Comment
Question by:kevincox29
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 16

Accepted Solution

by:
MohanKNair earned 64 total points
ID: 16894563
The increase in Data volume and the number of transactions is one reason for slow response. Allocate more RAM, CPU etc.
Identify resource consuming queries and tune them. This will free the server a lot.
0
 
LVL 19

Expert Comment

by:actonwang
ID: 16894695
>> HOWEVER CAN WE ALSO FIND THE USER WHO HAS RUN THIS QUERY.

use this to see which sql user is currently using:

select s.username,l.sql_text
from v$session s, v$sql l
where s.sql_address = l.address and s.sql_hash_value = l.hash_value
/

For all sqls user  has executed, you have to either (1) audit (2) enable user trace.

Acton
0
 
LVL 19

Assisted Solution

by:actonwang
actonwang earned 62 total points
ID: 16894729
>>ORACLE DATABASE NEEDS TO RUN SOME TUNING PROGRAM "COMPUTE STATISTICS??"
    if your data is volitle and been changed often lately, you'd have to use DBMS_STAS to update your statistics.
    you use GATHER_SCHEMA_STATS or GATHER_DATABASE_STATS to update your statistics.

    details see:
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_stats2.htm#1000574
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 35

Assisted Solution

by:johnsone
johnsone earned 62 total points
ID: 16895249
actonwang's query will show you who is currently running the query, this query will show you who ran it first:

select s.username,l.sql_text
from dba_users s, v$sql l
where s.user_id = l.parsing_user_id
/

This may be more helpful, as the query may not be currently running.
0
 
LVL 1

Assisted Solution

by:primusmagestri
primusmagestri earned 62 total points
ID: 16896093
I hope actonwang doesn't mind me dropping in and actually giving you a script to gather 10% estimated statistics on your whole schema... just log on to your schema and run:

set echo on feedback on timin on
exec dbms_stats.gather_schema_stats(ownname=>USER,cascade=>TRUE,ESTIMATE_PERCENT=>10,METHOD_OPT=>'FOR COLUMNS SIZE 75');

now, this may cut you some slack if tables in your schema are reasonably loaded and statistics are not gathered from time to time. but you really need to identify the hot spots in your application, see what's really working with bad performance; there must be some actions that take long to complete. gather these problematic scenarios and follow the same steps with sql tracing set on.
1.issue statement alter system flush shared_pool (clears all the statements cached on the instance, to get a cleaner view)
2.set the sql trace (if you can tap into your application or just reproduce the queries in some test application, set this sql tracing per session, not the whole instance - just issue the statement "alter session set sql_trace=true". otherwise, you need to set it on the instance itself with a line in your init.ora file: sql_trace=true)
3.run your queries
4.look into a dynamic performance view offered by Oracle: select * from v$sql_plan - you'll see some groups of records for your queries, that's the execution plan. there will be several operations for each query and you need to look first to see if your tables are accessed in a non-performant way - operation = TABLE ACCESS option = FULL - this should not appear for heavily loaded tables. also, for partitioned tables you should also see operation PARTITION RANGE with option ITERATOR not ALL.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20294287
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question