本文主要是介绍DBA_AUTOTASK_WINDOW_CLIENTS 每晚10点数据库繁忙,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
for SID in `ps -ef | grep pmon | grep -v grep | grep -v ASM | cut -d"_" -f3,4 `
for SID in PDB PDB1 PDB2
do
sqlplus -s ' / as sysdba' <<EOF
alter session set container=$SID;
select * from DBA_AUTOTASK_WINDOW_CLIENTS;
/
begin
dbms_scheduler.disable(name => 'MONDAY_WINDOW');
dbms_scheduler.set_attribute(
name => 'MONDAY_WINDOW',
attribute => 'REPEAT_INTERVAL',
value => 'freq=daily;byday=MON; byhour=22;byminute=40; bysecond=0');
dbms_scheduler.enable(name => 'MONDAY_WINDOW');
end;
/
begin
dbms_scheduler.disable(name => 'TUESDAY_WINDOW');
dbms_scheduler.set_attribute(
name => 'TUESDAY_WINDOW',
attribute => 'REPEAT_INTERVAL',
value => 'freq=daily;byday=TUE; byhour=22;byminute=40; bysecond=0');
dbms_scheduler.enable(name => 'TUESDAY_WINDOW');
end;
/
begin
dbms_scheduler.disable(name => 'WEDNESDAY_WINDOW');
dbms_scheduler.set_attribute(
name => 'WEDNESDAY_WINDOW',
attribute => 'REPEAT_INTERVAL',
value => 'freq=daily;byday=WED; byhour=22;byminute=40; bysecond=0');
dbms_scheduler.enable(name => 'WEDNESDAY_WINDOW');
end;
/
begin
dbms_scheduler.disable(name => 'THURSDAY_WINDOW');
dbms_scheduler.set_attribute(
name => 'THURSDAY_WINDOW',
attribute => 'REPEAT_INTERVAL',
value => 'freq=daily;byday=THU; byhour=22;byminute=40; bysecond=0');
dbms_scheduler.enable(name => 'THURSDAY_WINDOW');
end;
/
begin
dbms_scheduler.disable(name => 'FRIDAY_WINDOW');
dbms_scheduler.set_attribute(
name => 'FRIDAY_WINDOW',
attribute => 'REPEAT_INTERVAL',
value => 'freq=daily;byday=FRI; byhour=22;byminute=40; bysecond=0');
dbms_scheduler.enable(name => 'FRIDAY_WINDOW');
end;
/
select * from DBA_AUTOTASK_WINDOW_CLIENTS;
/
EOF
done
这篇关于DBA_AUTOTASK_WINDOW_CLIENTS 每晚10点数据库繁忙的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!