Solved

ORACLE TUNING

Posted on 2006-06-13
7
755 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
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 34

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
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 explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now