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 #'