RHN_CURRENT_ALERTS
Description:
alrts current alert records
DDL scriptColumns
| Name | Type | Nullable | Default value | Comment |
|---|
| RECID | NUMBER(12) | N | | |
| DATE_SUBMITTED | DATE | Y | | |
| LAST_SERVER_CHANGE | DATE | Y | | |
| DATE_COMPLETED | DATE | Y | to_date('31-12-9999', 'dd-mm-yyyy') | |
| ORIGINAL_SERVER | NUMBER(12) | Y | | |
| CURRENT_SERVER | NUMBER(12) | Y | | |
| TEL_ARGS | VARCHAR2(2200) | Y | | |
| MESSAGE | VARCHAR2(2000) | Y | | |
| TICKET_ID | VARCHAR2(80) | Y | | |
| DESTINATION_NAME | VARCHAR2(50) | Y | | |
| ESCALATION_LEVEL | NUMBER(2) | Y | 0 | |
| HOST_PROBE_ID | NUMBER(12) | Y | | |
| HOST_STATE | VARCHAR2(255) | Y | | |
| SERVICE_PROBE_ID | NUMBER(12) | Y | | |
| SERVICE_STATE | VARCHAR2(255) | Y | | |
| CUSTOMER_ID | NUMBER(12) | N | | |
| NETSAINT_ID | NUMBER(12) | Y | | |
| PROBE_TYPE | VARCHAR2(20) | Y | 'none' | |
| IN_PROGRESS | CHAR(1) | N | 1
| |
| LAST_UPDATE_DATE | DATE | Y | | |
| EVENT_TIMESTAMP | DATE | Y | | |
Primary key:
| Constraint Name | Columns |
|---|
| RHN_ALRTS_RECID_PK | RECID
|
Options:
| Option | Settings |
|---|
| Tablespace | DATA_TBS |
| Index Organized | No |
| Generated by Oracle | No |
| Clustered | No |
| Nested | No |
| Temporary | No |
Indexes:
Triggers
RHN_CURRENT_ALERTS_MOD_TRIG
Legend: string keyword reserved word operator
CREATE TRIGGER
rhn_current_alerts_mod_trig
before insert or update on rhn_current_alerts
referencing new as new old as old
for each row
REFERENCING NEW AS NEW OLD AS OLD
declare
msg varchar2(200);
date_completed_is_null exception;
date_completed_is_not_null exception;
begin
if :new.in_progress=0 and :new.date_completed is null
then
if ( updating( 'in_progress' ) and updating( 'date_completed') )
or inserting
then
raise date_completed_is_null;
elsif updating( 'in_progress' )
then
:new.date_completed:=sysdate;
else
:new.in_progress:=1;
end if;
elsif :new.in_progress=1 and :new.date_completed is not null
then
if ( updating( 'in_progress' ) and updating( 'date_completed') )
or inserting
then
raise date_completed_is_not_null;
elsif updating( 'in_progress' )
then
:new.date_completed:=null;
else
:new.in_progress:=0;
end if;
end if;
exception
when date_completed_is_null then
msg:='date_completed is null while in_progress=0';
raise_application_error (-20012,msg);
when date_completed_is_not_null then
msg:='date_completed is not null while in_progress=1';
raise_application_error (-20012,msg);
when others then
raise;
end;