RHNSERVERGROUP
DDL scriptColumns
Name | Type | Nullable | Default value | Comment |
---|
ID | NUMBER(38) | N | | |
NAME | VARCHAR2(64) | N | | |
DESCRIPTION | VARCHAR2(1024) | N | | |
CURRENT_MEMBERS | NUMBER(38) | N | (0) | |
GROUP_TYPE | NUMBER(38) | Y | | |
ORG_ID | NUMBER(38) | N | | |
CREATED | TIMESTAMP(6) WITH LOCAL TIME ZONE | N | (current_timestamp) | |
MODIFIED | TIMESTAMP(6) WITH LOCAL TIME ZONE | N | (current_timestamp) | |
Primary key:
Constraint Name | Columns |
---|
RHN_SERVERGROUP_ID_PK | ID
|
Foreign Keys:
Options:
Option | Settings |
---|
Tablespace | USERS |
Index Organized | No |
Generated by Oracle | No |
Clustered | No |
Nested | No |
Temporary | No |
Indexes:
Referenced by:
Triggers
RHNSERVERGROUP_LOG_TRIG
Legend: string keyword reserved word operator
CREATE TRIGGER
rhnservergroup_log_trig
after insert or update or delete on rhnservergroup
for each row
REFERENCING NEW AS NEW OLD AS OLD
declare
log_id_v number;
tg_op char(1);
begin
log_id_v := logging.get_log_id();
if updating then
if :old.ID lt;gt; :new.ID then raise_application_error(-20298, 'Cannot update column rhnservergroup.ID.'); end if;
tg_op := 'U';
end if;
if deleting then
tg_op := 'D';
insert into rhnservergroup_log (log_id, action, ID, NAME, DESCRIPTION, CURRENT_MEMBERS, GROUP_TYPE, ORG_ID)
values (log_id_v, substr(tg_op, 1, 1), :old.ID, :old.NAME, :old.DESCRIPTION, :old.CURRENT_MEMBERS, :old.GROUP_TYPE, :old.ORG_ID);
else
if inserting then tg_op := 'I'; end if;
insert into rhnservergroup_log (log_id, action, ID, NAME, DESCRIPTION, CURRENT_MEMBERS, GROUP_TYPE, ORG_ID)
values (log_id_v, substr(tg_op, 1, 1), :new.ID, :new.NAME, :new.DESCRIPTION, :new.CURRENT_MEMBERS, :new.GROUP_TYPE, :new.ORG_ID);
end if;
end;
RHN_SERVER_GROUP_CREATION
Legend: string keyword reserved word operator
CREATE TRIGGER
rhn_server_group_creation
AFTER INSERT ON rhnServerGroup
FOR EACH ROW
REFERENCING NEW AS NEW OLD AS OLD
DECLARE
org_admin_group NUMBER;
org_id_val NUMBER;
BEGIN
org_id_val := :new.org_id;
SELECT UG.id INTO org_admin_group
FROM rhnUserGroup UG,
rhnUserGroupType UGT
WHERE UGT.label = 'org_admin'
AND UGT.id = UG.group_type
AND UG.org_id = org_id_val;
EXCEPTION
WHEN NO_DATA_FOUND THEN
rhn_exception.raise_exception_val('no_org_admin_group', org_id_val);
END;
RHN_SERVER_GROUP_MOD_TRIG
Legend: string keyword reserved word operator
CREATE TRIGGER
rhn_server_group_mod_trig
before insert or update on rhnServerGroup
for each row
REFERENCING NEW AS NEW OLD AS OLD
begin
:new.modified := current_timestamp;
end;
RHN_SG_DEL_TRIG
Legend: string keyword reserved word operator
CREATE TRIGGER
rhn_sg_del_trig
before delete on rhnServerGroup
for each row
REFERENCING NEW AS NEW OLD AS OLD
declare
cursor snapshots is
select snapshot_id id
from rhnSnapshotServerGroup
where server_group_id = :old.id
order by snapshot_id;
begin
for snapshot in snapshots loop
update rhnSnapshot
set invalid = lookup_snapshot_invalid_reason('sg_removed')
where id = snapshot.id;
delete from rhnSnapshotServerGroup
where snapshot_id = snapshot.id
and server_group_id = :old.id;
end loop;
end;