Oracle performance problem diagnosis example

Source: Internet
Author: User
As soon as I opened the database and did nothing, I found that the hard drive lights went viral. Why? It is preliminarily determined that Oracle's scheduled task is running, but which one is running?

As soon as I opened the database and did nothing, I found that the hard drive lights went viral. Why? It is preliminarily determined that Oracle's scheduled task is running, but which one is running?

As soon as I opened the database and did nothing, I found that the hard drive lights went viral. Why? It is preliminarily determined that Oracle's scheduled task is running, but it is unknown which one is running.

Therefore, the first step is to determine what the background is running:
Select * from v $ session_longops where sofar <> totalwork

Most of the information, including:
1. session information: sid, serial #
2. Execution content: target_desc
3. Execution progress: sofar/totalwork
4. Start Time: start_time
5. Execution User: username
6. SQL information: SQL _id, SQL _address, SQL _hash_value

Based on the above content, I can force stop this SQL statement, but I have to find out the source, that is, the "owner"-who has executed this SQL statement.

Therefore, the second step is to execute the user to find the corresponding scheduled task or job under the user according to the fifth point above:

1. job:
Select * from user_jobs
2. scheduled tasks:
Select * from user_scheduler_jobs;

Here I know the initiator and the specific execution point.
The next thing is simple. First confirm what the scheduled processing is. If it is useless or irrelevant to the current environment, close the job or schedule the task:
Exec dbms_job.broken (21, true );
Or
Exec dbms_scheduler.disable ('Auto _ SPACE_ADVISOR_JOB '); -- this is an example

Of course, sometimes it's okay not to close it directly. You have to check why such a large disk scan occurs. At this time, we should look at the SQL Execution Plan, find out the cause, and then optimize it. This time, the cause of my local issue is actually very simple, because the index is not specified during the dmp import, and the index is processed in the background by a full table scan, resulting in this situation.

Finally, we can stop the ongoing process by doing the following:
Alter system kill session 'sid, serial #'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.