-
Notifications
You must be signed in to change notification settings - Fork 5
/
disable_rm.sql
51 lines (41 loc) · 1.83 KB
/
disable_rm.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
-- run ./cage_check.sh first and take note of current RESOURCE_PLAN in
-- in case you want to revert to previous settings
--
-- NOTE: the script will only modify on current instance
-- you can also set the CPU_COUNT or just hit ENTER to use current settings
-- the rest of script will just disable the scheduler windows
COLUMN name NEW_VALUE _instname NOPRINT
select instance_name name from v$instance;
spool disable_rm.log
show parameter resource_manager_plan
alter system set resource_manager_plan='' scope=both sid='&_instname';
show parameter cpu_count
alter system set cpu_count=&CPU_COUNT scope=both sid='&_instname';
select '--------------- BEFORE ---------------' from dual;
set echo on
set lines 300
col window_name format a17
col RESOURCE_PLAN format a25
col LAST_START_DATE format a50
col duration format a15
col enabled format a5
select window_name, RESOURCE_PLAN, LAST_START_DATE, DURATION, enabled from DBA_SCHEDULER_WINDOWS;
execute dbms_scheduler.set_attribute('MONDAY_WINDOW','RESOURCE_PLAN','');
execute dbms_scheduler.set_attribute('TUESDAY_WINDOW','RESOURCE_PLAN','');
execute dbms_scheduler.set_attribute('WEDNESDAY_WINDOW','RESOURCE_PLAN','');
execute dbms_scheduler.set_attribute('THURSDAY_WINDOW','RESOURCE_PLAN','');
execute dbms_scheduler.set_attribute('FRIDAY_WINDOW','RESOURCE_PLAN','');
execute dbms_scheduler.set_attribute('SATURDAY_WINDOW','RESOURCE_PLAN','');
execute dbms_scheduler.set_attribute('SUNDAY_WINDOW','RESOURCE_PLAN','');
execute DBMS_AUTO_TASK_ADMIN.DISABLE;
set echo off
select '--------------- AFTER ---------------' from dual;
set lines 300
col window_name format a17
col RESOURCE_PLAN format a25
col LAST_START_DATE format a50
col duration format a15
col enabled format a5
select window_name, RESOURCE_PLAN, LAST_START_DATE, DURATION, enabled from DBA_SCHEDULER_WINDOWS;
spool off
exit