?
Solved

ORACLE TUNING

Posted on 2006-06-13
7
Medium Priority
?
762 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 256 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 248 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Assisted Solution

by:johnsone
johnsone earned 248 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 248 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and theā€¦
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Suggested Courses

765 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