- -- Define variables to hold the values
- VARIABLE old_jqp NUMBER;
- VARIABLE new_jqp NUMBER;
- VARIABLE sleep_time NUMBER;
- -- Store the current value in the variable and set sleep_time and new_jqp
- BEGIN
- :sleep_time := 5;
- :new_jqp := 0;
- SELECT TO_NUMBER(VALUE) INTO :old_jqp FROM v$parameter WHERE name = 'job_queue_processes';
- END;
- /
- prompt CURRENT job_queue_processes VALUE:
- PRINT old_jqp
- prompt Setting job_queue_processes TO:
- PRINT new_jqp
- BEGIN
- -- Set job_queue_processes to 0 using bind variable
- EXECUTE IMMEDIATE 'ALTER SYSTEM SET job_queue_processes='||:new_jqp||' SCOPE=BOTH';
- -- Wait :sleep_time seconds to ensure the change is applied
- DBMS_LOCK.sleep(:sleep_time);
- -- Use the variable to restore the original value using bind variable
- EXECUTE IMMEDIATE 'ALTER SYSTEM SET job_queue_processes='||:old_jqp||' SCOPE=BOTH';
- END;
- /
Recent Pastes