The reason why the Oracle task process is not executed after it is submitted
/* Run the following command in SQL * Plus */
-- Check steps when the task is not running
-- 1. Check whether the instance session is restricted
Select instance_name, logins from v $ instance;
-- If logins = RESTRICTED is prompted, execute
Alter system disable restricted session;
-- 2. Ensure that job_queue_processes> 0
Show parameter job_queue_processes;
-- 3. Check whether the task is still running
Select * from dba_jobs_running;
The problem I encountered is that the previously submitted task is still running, so I will not execute the same task again. The number of concurrent task execution processes set by Oracle is limited. Therefore, when the last submitted task is not completed, the task submitted again can only wait in the queue and will not be executed directly.
I wrote a view to conveniently query the currently executed tasks.
-- Query running tasks
/* Grant user permissions under sys logon.
Grant select on dba_jobs_running to a2admin;
Grant select on v _ $ session to a2admin;
*/
Create or replace view job_run_view
As
Select. job,. sid, B. SERIAL #,. failures,. last_date,. this_date,. instance from dba_jobs_running a, v $ session B where. sid = B. sid order by 1;
To disable the task process, run the following code to replace sid and serial #
-- Disable process sid, serial #, and replace it with the corresponding value
-- Alter system kill session 'sid, serial ';