
db에 문제가 생겼을 때 바로 그 문제를 확인할 수 있음
select *
from dba_outstanding_alerts;
select file_name from dba_data_Files;
create tablespace ts50
datafile '/home/oracle/ts50.dbf' size 10m;
drop table emp50;
create table emp50
( empno number(10),
ename varchar2(10) )
tablespace ts50;
insert into EMP50 values(1111,'aaa');
insert into emp50
select *
from emp50; -- 에러 날 때까지 반복하기

exec dbms_workload_repository.create_snapshot;
select * from dba_outstanding_alerts;

select *
from dba_thresholds
WHERE warning_operator='GE';
--> 85%가 경고의 기준이고 97%가 위기 메세지의 기준임
BEGIN
DBMS_SERVER_ALERT.SET_THRESHOLD(
metrics_id => DBMS_SERVER_ALERT.TABLESPACE_PCT_FULL,
warning_operator => DBMS_SERVER_ALERT.OPERATOR_GE,
warning_value => '20',
critical_operator => DBMS_SERVER_ALERT.OPERATOR_GE,
critical_value => '50',
observation_period => 1,
consecutive_occurrences => 3,
instance_name => 'PROD',
object_type => DBMS_SERVER_ALERT.OBJECT_TYPE_TABLESPACE,
object_name => 'TS50'
);
END;
/
select reason, message_level from dba_outstanding_alerts;
truncate table emp50;
select * from dba_outstanding_alerts;
select *
from dba_thresholds
WHERE warning_operator='GE';
select * from dba_outstanding_alerts;