Main Tables Views Materialized Views Indexes Constraints Triggers Procedures Functions Packages Sequences Java Sources Sanity Check Index DDL scrips
Description Columns Primary key Check Constraints Foreign keys Unique Keys Options Indexes Referenced by Triggers Partitions

RHN_CURRENT_ALERTS

Description:

alrts current alert records

DDL script

Columns

NameTypeNullableDefault valueComment
RECIDNUMBER(12)N  
DATE_SUBMITTEDDATEY  
LAST_SERVER_CHANGEDATEY  
DATE_COMPLETEDDATEYto_date('31-12-9999', 'dd-mm-yyyy') 
ORIGINAL_SERVERNUMBER(12)Y  
CURRENT_SERVERNUMBER(12)Y  
TEL_ARGSVARCHAR2(2200)Y  
MESSAGEVARCHAR2(2000)Y  
TICKET_IDVARCHAR2(80)Y  
DESTINATION_NAMEVARCHAR2(50)Y  
ESCALATION_LEVELNUMBER(2)Y0 
HOST_PROBE_IDNUMBER(12)Y  
HOST_STATEVARCHAR2(255)Y  
SERVICE_PROBE_IDNUMBER(12)Y  
SERVICE_STATEVARCHAR2(255)Y  
CUSTOMER_IDNUMBER(12)N  
NETSAINT_IDNUMBER(12)Y  
PROBE_TYPEVARCHAR2(20)Y'none' 
IN_PROGRESSCHAR(1)N1  
LAST_UPDATE_DATEDATEY  
EVENT_TIMESTAMPDATEY  

Primary key:

Constraint NameColumns
RHN_ALRTS_RECID_PKRECID

Options:

OptionSettings
TablespaceDATA_TBS
Index OrganizedNo
Generated by OracleNo
ClusteredNo
NestedNo
TemporaryNo

Indexes:

Index NameTypeUnuquenessColumnsDDL script
RHN_ALRTS_CURRENT_SERVER_IDXNORMALNONUNIQUECURRENT_SERVER DDL script
RHN_ALRTS_CUSTOMER_ID_IDXNORMALNONUNIQUECUSTOMER_ID DDL script
RHN_ALRTS_HOST_PROBE_ID_IDXNORMALNONUNIQUEHOST_PROBE_ID DDL script
RHN_ALRTS_IN_PROGRESS_IDXNORMALNONUNIQUEIN_PROGRESS DDL script
RHN_ALRTS_NETSAINT_ID_IDXNORMALNONUNIQUENETSAINT_ID DDL script
RHN_ALRTS_ORIGINAL_SERVER_IDXNORMALNONUNIQUEORIGINAL_SERVER DDL script
RHN_ALRTS_PROBE_TYPE_IDXNORMALNONUNIQUEPROBE_TYPE DDL script
RHN_ALRTS_RECID_PKNORMALUNIQUERECID DDL script
RHN_ALRTS_SERVICE_PROBE_ID_IDXNORMALNONUNIQUESERVICE_PROBE_ID DDL script
RHN_ALRTS_TICKET_ID_IDXNORMALNONUNIQUETICKET_ID DDL script

Triggers

RHN_CURRENT_ALERTS_MOD_TRIG

Legend: comment 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;