rem ----------------------------------------------------------------------------
rem File:        $RCSfile: jr_dep.sql $
rem Author:      $Author: amacmill $
rem Date:        $Date: 1998/12/14 10:57:40 $
rem Version:     $Revision: 1.3 $
rem Status:      $State: Exp $
rem Locked_by:   $Locker:  $
rem Description: <Enter global description here>
rem Notes:       <Global notes>
rem RealAuth:    <Full real name of code author>
rem IncepDate:   <nnth Xxxember 1998>
rem Copyright:   (c) Oracle Corporation 1998.  All Rights Reserved.
rem ----------------------------------------------------------------------------
rem
rem                    Repository Dependency Schema
rem                    ----------------------------
rem Note: additional schema constraints are defined in jrv_dep.sql and
rem jrs_dep.sql.
rem
rem ----------------------------------------------------------------------------
rem

rem ---------------------------------------------------------------------------+
prompt Table : sdd_dpnd_dar_result
rem ---------------------------------------------------------------------------+
rem

create table sdd_dpnd_dar_result
( object_name       varchar2(256)
 ,object_path       varchar2(256)
 ,object_id         number
 ,usage             varchar2(1)
 ,context           varchar2(1)
 ,type              varchar2(48)
 ,ref_obj_name      varchar2(256)
 ,ref_obj_path      varchar2(256)
 ,ref_obj_id        number
 ,fol_irid          number
)
/
comment on table  sdd_dpnd_dar_result is 'Results table used by dependency analysis report - not persisted #repos_pragma{is_system=true}';
comment on column sdd_dpnd_dar_result.usage is 'Indicates whether the dependency is for a client or supplier';
comment on column sdd_dpnd_dar_result.context is 'Indicates within which context the dependency applies';

-- check constraints for domains

-- sdd_dpnd_dar_chk_usage
alter table sdd_dpnd_dar_result add constraint sdd_dpnd_dar_chk_usage
check (usage in ('U', 'B'))
/

-- sdd_dpnd_dar_chk_context
alter table sdd_dpnd_dar_result add constraint sdd_dpnd_dar_chk_context
check (context in ('I', 'O', 'M'))
/

rem ---------------------------------------------------------------------------+
prompt Table : sdd_dpnd_query_result
rem ---------------------------------------------------------------------------+
rem
create table sdd_dpnd_query_in_wa (
    dependency_irid       number               not null
  , end_type_id           number
  , end_irid              number
  , end_ivid              number
  , end_parent_ivid       number
  , name_irid             number
  , name_ivid             number
  , name_domain_irid      number
  , name_type_id          number
  , accessible            varchar2(1)
  , principal_name        varchar2(1)
  , workarea              number
)
/
comment on table  sdd_dpnd_query_in_wa is 'The in workarea result of a dependency query - not persisted #repos_pragma{is_system=true}';

create index ind_dp_qinwa_end on
sdd_dpnd_query_in_wa (end_irid)
/

create index ind_dp_qinwa_name on
sdd_dpnd_query_in_wa (name_irid)
/

create table sdd_dpnd_query_out_of_wa (
    dependency_irid       number               not null
  , end_type_id           number
  , end_irid              number
  , end_ivid              number
  , end_parent_ivid       number
  , name_irid             number
  , name_ivid             number
  , name_domain_irid      number
  , name_type_id          number
  , accessible            varchar2(1)
  , principal_name        varchar2(1)
)
/
comment on table  sdd_dpnd_query_out_of_wa is 'The out of workarea result of a dependency query  - not persisted #repos_pragma{is_system=true}';

create index ind_dp_qowa_name on
sdd_dpnd_query_out_of_wa (name_irid)
/

create table sdd_dpnd_query_out_of_repos (
    dependency_irid       number               not null
  , end_type_id           number
  , end_irid              number
  , end_ivid              number
  , end_parent_ivid       number
  , name_irid             number
  , name_ivid             number
  , name_domain_irid      number
  , name_type_id          number
  , accessible            varchar2(1)
  , principal_name        varchar2(1)
)
/
comment on table  sdd_dpnd_query_out_of_repos is 'The out of repos result of a dependency query - not persisted #repos_pragma{is_system=true}';


rem ---------------------------------------------------------------------------+
prompt Table : sdd_dependency_types
rem ---------------------------------------------------------------------------+
rem
create table sdd_dependency_types (
  irid                     number		                     not null
, ivid                     number		                     not null
, type                     varchar2(256)                 not null
, system_flag              varchar2(1)                   not null
, transitive               varchar2(1)   default 'N'     not null
, number_of_times_modified number        default 0       not null
, date_created             date          default sysdate not null
, created_by               varchar2(30)  default user    not null
, date_changed             date
, changed_by               varchar2(30)
, subtype                  varchar2(256)
)
/

comment on table  sdd_dependency_types            is 'A type of dependency #repos_pragma{is_system=true}';
comment on column sdd_dependency_types.transitive is 'Indicates whether the type of dependency is transitive';

-- sdd_depen_type_pk
alter table sdd_dependency_types add constraint sdd_depen_type_pk
primary key (irid)
/

-- sdd_depen_type_uk
alter table sdd_dependency_types add constraint sdd_depen_type_uk
unique (type, subtype)
/

-- sdd_deptype_chk_tra_flag
alter table sdd_dependency_types add constraint sdd_deptype_chk_tra_flag
check (transitive  in ('Y', 'N'))
/


prompt Table: sdd_dependency_types, populating with instance data

insert into sdd_dependency_types (irid, ivid, type, system_flag)          values (415838727997814959966982439645497401, 415838727997819682333465309290711097, 'Uses', 'Y');
insert into sdd_dependency_types (irid, ivid, type, subtype, system_flag) values (415838727997824404699948178935924793, 415838727997829127066431048581138489, 'Uses',      'Include',   'Y');
insert into sdd_dependency_types (irid, ivid, type, subtype, system_flag) values (415838727997833849432913918226352185, 415838727997838571799396787871565881, 'Uses',      'Call',      'Y');
insert into sdd_dependency_types (irid, ivid, type, subtype, system_flag) values (415838727997843294165879657516779577, 415838727997848016532362527161993273, 'Uses',      'Extend',    'Y');
insert into sdd_dependency_types (irid, ivid, type, subtype, system_flag) values (415838727997852738898845396807206969, 415838727997857461265328266452420665, 'Uses',      'Implement', 'Y');
insert into sdd_dependency_types (irid, ivid, type, subtype, system_flag) values (415838727997862183631811136097634361, 415838727997866905998294005742848057, 'Uses',      'Throw',     'Y');
insert into sdd_dependency_types (irid, ivid, type, subtype, system_flag) values (415838727997871628364776875388061753, 415838727997876350731259745033275449, 'Uses',      'Instantiate', 'Y');
insert into sdd_dependency_types (irid, ivid, type, subtype, system_flag) values (415838727997881073097742614678489145, 415838727997885795464225484323702841, 'Uses',      'Select',     'Y');
insert into sdd_dependency_types (irid, ivid, type, subtype, system_flag) values (415838727997890517830708353968916537, 415838727997895240197191223614130233, 'Uses',      'Insert',     'Y');
insert into sdd_dependency_types (irid, ivid, type, subtype, system_flag) values (415838727997899962563674093259343929, 415838727997904684930156962904557625, 'Uses',      'Update',     'Y');
insert into sdd_dependency_types (irid, ivid, type, subtype, system_flag) values (415838727997909407296639832549771321, 415838727997914129663122702194985017, 'Uses',      'Delete',     'Y');
insert into sdd_dependency_types (irid, ivid, type, subtype, system_flag) values (2086767142418059581928845640192082223, 2086767143037029601571535777641644335, 'Uses',      'Alter',      'Y');
insert into sdd_dependency_types (irid, ivid, type, subtype, system_flag) values (2086767142727544591750190708916863279, 2086767143346514611392880846366425391, 'Uses',      'Drop',       'Y');
insert into sdd_dependency_types (irid, ivid, type, system_flag)          values (415838727997918852029605571840198713, 415838727997923574396088441485412409, 'Provides', 'Y');
insert into sdd_dependency_types (irid, ivid, type, subtype, system_flag) values (415838727997928296762571311130626105, 415838727997933019129054180775839801, 'Provides', 'Principal', 'Y');

create or replace trigger sdd_dependency_types_audit
  before update on sdd_dependency_types
  for each row
  begin
    jr_audit.pre_update( :new.number_of_times_modified, :new.date_changed, :new.changed_by);
  end;
/

rem ---------------------------------------------------------------------------+
prompt Table : sdd_depend_statuses
rem ---------------------------------------------------------------------------+
rem
create table sdd_depend_statuses (
  status                   varchar2(1)                   not null
, description              varchar2(256)                 not null
, system_flag              varchar2(1)                   not null
, number_of_times_modified number        default 0       not null
, date_created             date          default sysdate not null
, created_by               varchar2(30)  default user    not null
, date_changed             date
, changed_by               varchar2(30)
)
/

comment on table sdd_depend_statuses is 'Dependency statuses #repos_pragma{is_system=true}';

-- sdd_depend_status_pk
alter table sdd_depend_statuses add constraint sdd_depend_status_pk
primary key (status)
/

prompt Table: sdd_depend_statuses, populating with instance data

insert into sdd_depend_statuses (status, description, system_flag) values ('C',  'Certain',   'Y');
insert into sdd_depend_statuses (status, description, system_flag) values ('P',  'Permanent', 'Y');
insert into sdd_depend_statuses (status, description, system_flag) values ('E',  'Excluded',  'Y');
insert into sdd_depend_statuses (status, description, system_flag) values ('T',  'Tentative', 'Y');

create or replace trigger sdd_depend_statuses_audit
  before update on sdd_depend_statuses
  for each row
  begin
    jr_audit.pre_update( :new.number_of_times_modified, :new.date_changed, :new.changed_by);
  end;
/

rem ---------------------------------------------------------------------------+
prompt Table : sdd_dependencies
rem ---------------------------------------------------------------------------+
rem
create table sdd_dependencies (
  irid                     number		                    not null
, ivid                     number                       not null
, dependency_type_irid     number                       not null
, supplier_irid            number                       not null
, supplier_ivid            number                       not null
, supplier_type_id         number                       not null
, client_irid              number                       not null
, client_ivid              number                       not null
, client_type_id           number                       not null
, status                   varchar2(1)  default 'C'     not null
, number_of_times_modified number       default 0       not null
, date_created             date         default sysdate not null
, created_by               varchar2(30) default user    not null
, date_changed             date
, changed_by               varchar2(30)
, remark                   varchar2(70)
, copy_on_version          varchar2(1)
, copy_on_copy             varchar2(1)
, supplier_parent_ivid     number
, client_parent_ivid       number
, purge_candidate          varchar2(1)
)
/

comment on table  sdd_dependencies is 'Dependencies #repos_pragma{is_system=true}';

comment on column sdd_dependencies.status is
  'Indicates whether dependency is C - certain, P - permanent, E - excluded, T - tentative.';

-- sdd_dependencies_pk
alter table sdd_dependencies add constraint sdd_dependencies_pk
primary key (irid)
/

-- sdd_deps_to_type_fk
alter table sdd_dependencies add constraint sdd_deps_to_type_fk
foreign key (dependency_type_irid) references sdd_dependency_types
/

-- sdd_depen_to_status_fk
alter table sdd_dependencies add constraint sdd_depen_to_status_fk
foreign key (status) references sdd_depend_statuses
/

-- sdd_deps_client_type_id_fk
alter table sdd_dependencies add constraint sdd_deps_client_type_id_fk
foreign key (client_type_id) references i$rm_element_types
/

-- sdd_deps_supplier_type_id_fk
alter table sdd_dependencies add constraint sdd_deps_supplier_type_id_fk
foreign key (supplier_type_id) references i$rm_element_types
/

-- sdd_depen_chk_status_flag
alter table sdd_dependencies add constraint sdd_depen_chk_status_flag
check (status in ('C', 'P', 'E', 'T'))
/

-- sdd_depen_chk_cpyver
alter table sdd_dependencies add constraint sdd_depen_chk_cpyver
check (copy_on_version in ('Y', 'N'))
/

-- sdd_depen_chk_cpycpy
alter table sdd_dependencies add constraint sdd_depen_chk_cpycpy
check (copy_on_copy in ('Y', 'N'))
/

-- sdd_depend_uk
alter table sdd_dependencies add constraint sdd_depend_uk
unique (supplier_irid, supplier_ivid, client_irid, client_ivid,
supplier_type_id, client_type_id, dependency_type_irid)
/

create index ind_dp_client on
sdd_dependencies (client_irid, client_ivid)
/

create index ind_dp_supplier on
sdd_dependencies (supplier_irid, supplier_ivid)
/

create index ind_dp_purcand on
sdd_dependencies (purge_candidate)
/

create index ind_dp_dpnd_type on
sdd_dependencies (dependency_type_irid)
/

create index ind_dp_status on
sdd_dependencies (status)
/

create index ind_dp_client_ivid on
sdd_dependencies (client_ivid)
/

create index ind_dp_supplier_ivid on
sdd_dependencies (supplier_ivid)
/

create index ind_dp_client_pivid on
sdd_dependencies (client_parent_ivid)
/

create index ind_dp_supplier_pivid on
sdd_dependencies (supplier_parent_ivid)
/

create index ind_dp_stype_id on 
sdd_dependencies (supplier_type_id)
/

create index ind_dp_ctype_id on 
sdd_dependencies (client_type_id)
/

create or replace trigger sdd_dependencies_audit
  before update on sdd_dependencies
  for each row
  begin
    jr_audit.pre_update( :new.number_of_times_modified, :new.date_changed, :new.changed_by);
  end;
/

rem ---------------------------------------------------------------------------+
prompt Table : sdd_global_name_domains
rem ---------------------------------------------------------------------------+
rem
create table sdd_global_name_domains (
  irid                      number		                    not null
, ivid                      number		                    not null
, name                      varchar2(256)                 not null
, system_flag               varchar2(1)                   not null
, number_of_times_modified  number        default 0       not null
, date_created              date          default sysdate not null
, created_by                varchar2(30)  default user    not null
, date_changed              date
, changed_by                varchar2(30)
)
/

comment on table  sdd_global_name_domains is
  'Scoper for names in the global namespace #repos_pragma{is_system=true}';
comment on column sdd_global_name_domains.name is
  'Examples of domain names could be Java class name, Java method name, SQL Table, SQL Column etc';

-- sdd_gns_domain_pk
alter table sdd_global_name_domains add constraint sdd_gns_domain_pk
primary key (irid)
/

-- sdd_gns_domain_uk
alter table sdd_global_name_domains add constraint sdd_gns_domain_uk
unique (name)
/

rem ---------------------------------------------------------------------------+
prompt Table : sdd_nls_global_name_domains
rem ---------------------------------------------------------------------------+
rem
create table sdd_nls_global_name_domains (
  irid                      number		                    not null
, ivid                      number		                    not null
, nls_name                  varchar2(256)                 not null
, nls_plural_name           varchar2(256)                 not null
, nls_lang                  varchar2(3)                   not null
, gnd_irid                  number                        not null
, number_of_times_modified  number        default 0       not null
, date_created              date          default sysdate not null
, created_by                varchar2(30)  default user    not null
, date_changed              date
, changed_by                varchar2(30)
)
/

comment on table sdd_nls_global_name_domains is 'NLS Properties for Global Name Domains #repos_pragma{is_system=true}';

-- sdd_nlsgnd_pk
alter table sdd_nls_global_name_domains add constraint sdd_nlsgnd_pk
primary key (irid)
/

-- sdd_nlsgnd_gnd_fk
alter table sdd_nls_global_name_domains add constraint sdd_nlsgnd_gnd_fk
foreign key (gnd_irid) references sdd_global_name_domains
on delete cascade
/

prompt Tables : sdd_global_name_domains and sdd_nls_global_name_domains, populating with instance data
insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727997937741495537050421053497 ,    415838727997942463862019920066267193
, 'AL_EVENT',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727997956630961468529001908281 ,    415838727997961353327951398647121977
, 'JAVA_FIELD',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727997975520427400007582763065 ,    415838727997980242793882877227976761
, 'JAVA_METHOD',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727997994409893331486163617849 ,    415838727997999132259814355808831545
, 'JAVA_TYPE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998013299359262964744472633 ,    415838727998018021725745834389686329
, 'DATABASE_LINK',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  474092531114559703802358424510416953, 474092531114564426168841294155630649
, 'DATABASE_OUTLINE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  474092531114569148535324163800844345, 474092531114573870901807033446058041
, 'DATABASE_CONTEXT',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  474092531114578593268289903091271737, 474092531114583315634772772736485433
, 'DATABASE_DIMENSION',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  474092531114588038001255642381699129, 474092531114592760367738512026912825
, 'DATABASE_INDEXTYPE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998032188825194443325327417 ,    415838727998036911191677312970541113
, 'PLSQL_MODULE_PACKAGE_BODY',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998051078291125921906182201 ,    415838727998055800657608791551395897
, 'PLSQL_MODULE_PACKAGE_CURSOR',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998069967757057400487036985 ,    415838727998074690123540270132250681
, 'PLSQL_MODULE_PACKAGE_SPEC',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998088857222988879067891769 ,    415838727998093579589471748713105465
, 'PLSQL_MODULE_PACKAGE_SUBTYPE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998107746688920357648746553 ,    415838727998112469055403227293960249
, 'PLSQL_MODULE_PACKAGE_TYPE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998126636154851836229601337 ,    415838727998131358521334705874815033
, 'PLSQL_MODULE_PACKAGE_VARIABLE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998145525620783314810456121 ,    415838727998150247987266184455669817
, 'PLSQL_MODULE_SUBROUTINE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998164415086714793391310905 ,    415838727998169137453197663036524601
, 'PLSQL_MODULE_TRIGGER',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998183304552646271972165689 ,    415838727998188026919129141617379385
, 'FORMS_ALERT',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998202194018577750553020473 ,    415838727998206916385060620198234169
, 'FORMS_BLOCK',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998221083484509229133875257 ,    415838727998225805850992098779088953
, 'FORMS_CANVAS',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998239972950440707714730041 ,    415838727998244695316923577359943737
, 'FORMS_EDITOR',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998258862416372186295584825 ,    415838727998263584782855055940798521
, 'FORMS_ITEM',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998277751882303664876439609 ,    415838727998282474248786534521653305
, 'FORMS_GRAPHIC',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998296641348235143457294393 ,    415838727998301363714718013102508089
, 'FORMS_LOV',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998315530814166622038149177 ,    415838727998320253180649491683362873
, 'FORMS_OBJECT_GROUP',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998334420280098100619003961 ,    415838727998339142646580970264217657
, 'FORMS_FORM_PARAMETER',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998353309746029579199858745 ,    415838727998358032112512448845072441
, 'FORMS_MENU',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998372199211961057780713529 ,    415838727998376921578443927425927225
, 'FORMS_MENU_ITEM',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998391088677892536361568313 ,    415838727998395811044375406006782009
, 'FORMS_FORM_MODULE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998409978143824014942423097 ,    415838727998414700510306884587636793
, 'FORMS_PROGRAM_UNIT_BODY',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998428867609755493523277881 ,    415838727998433589976238363168491577
, 'FORMS_PROGRAM_UNIT_FUNC',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998447757075686972104132665 ,    415838727998452479442169841749346361
, 'FORMS_PROGRAM_UNIT_PROC',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998466646541618450684987449 ,    415838727998471368908101320330201145
, 'FORMS_PROGRAM_UNIT_SPEC',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998485536007549929265842233 ,    415838727998490258374032798911055929
, 'FORMS_PROPERTY_CLASS',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998504425473481407846697017 ,    415838727998509147839964277491910713
, 'FORMS_RECORD_GROUP',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998523314939412886427551801 ,    415838727998528037305895756072765497
, 'FORMS_REPORT',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998542204405344365008406585 ,    415838727998546926771827234653620281
, 'FORMS_TRIGGER',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998561093871275843589261369 ,    415838727998565816237758713234475065
, 'FORMS_TAB_PAGE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998579983337207322170116153 ,    415838727998584705703690191815329849
, 'FORMS_VISUAL_ATTRIBUTE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998598872803138800750970937 ,    415838727998603595169621670396184633
, 'FORMS_WINDOW',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998617762269070279331825721 ,    415838727998622484635553148977039417
, 'FORMS_RELATION',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998636651735001757912680505 ,    415838727998641374101484627557894201
, 'LIBRARY_LIBRARY_MODULE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998655541200933236493535289 ,    415838727998660263567416106138748985
, 'OLB_ALERT',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998674430666864715074390073 ,    415838727998679153033347584719603769
, 'OLB_BLOCK',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998693320132796193655244857 ,    415838727998698042499279063300458553
, 'OLB_CANVAS',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998712209598727672236099641 ,    415838727998716931965210541881313337
, 'OLB_EDITOR',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998731099064659150816954425 ,    415838727998735821431142020462168121
, 'OLB_FORM_PARAMETER',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998749988530590629397809209 ,    415838727998754710897073499043022905
, 'OLB_ITEM',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998768877996522107978663993 ,    415838727998773600363004977623877689
, 'OLB_GRAPHIC',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998787767462453586559518777 ,    415838727998792489828936456204732473
, 'OLB_LOV',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998806656928385065140373561 ,    415838727998811379294867934785587257
, 'OLB_OBJECT_GROUP',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998825546394316543721228345 ,    415838727998830268760799413366442041
, 'OLB_OBJECT_LIBRARY',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998844435860248022302083129 ,    415838727998849158226730891947296825
, 'OLB_MENU',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998863325326179500882937913 ,    415838727998868047692662370528151609
, 'OLB_MENU_ITEM',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998882214792110979463792697 ,    415838727998886937158593849109006393
, 'OLB_MENU_PARAMETER',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998901104258042458044647481 ,    415838727998905826624525327689861177
, 'OLB_PROGRAM_UNIT_BODY',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
   2353170283730948312853414014511071535,  2353170284040433322674759083235852591
, 'OLB_REPORT',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998919993723973936625502265 ,    415838727998924716090456806270715961
, 'OLB_PROGRAM_UNIT_FUNC',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998938883189905415206357049 ,    415838727998943605556388284851570745
, 'OLB_PROGRAM_UNIT_PROC',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998957772655836893787211833 ,    415838727998962495022319763432425529
, 'OLB_PROGRAM_UNIT_SPEC',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998976662121768372368066617 ,    415838727998981384488251242013280313
, 'OLB_PROPERTY_CLASS',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727998995551587699850948921401 ,    415838727999000273954182720594135097
, 'OLB_RECORD_GROUP',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999014441053631329529776185 ,    415838727999019163420114199174989881
, 'OLB_TAB_PAGE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999033330519562808110630969 ,    415838727999038052886045677755844665
, 'OLB_TRIGGER',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999052219985494286691485753 ,    415838727999056942351977156336699449
, 'OLB_VISUAL_ATTRIBUTE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999071109451425765272340537 ,    415838727999075831817908634917554233
, 'OLB_WINDOW',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999089998917357243853195321 ,    415838727999094721283840113498409017
, 'MENU_OBJECT_GROUP',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999108888383288722434050105 ,    415838727999113610749771592079263801
, 'MENU_MENU',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999127777849220201014904889 ,    415838727999132500215703070660118585
, 'MENU_MENU_ITEM',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999146667315151679595759673 ,    415838727999151389681634549240973369
, 'MENU_MENU_PARAMETER',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999165556781083158176614457 ,    415838727999170279147566027821828153
, 'MENU_MENU_MODULE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999184446247014636757469241 ,    415838727999189168613497506402682937
, 'MENU_PROGRAM_UNIT_BODY',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999203335712946115338324025 ,    415838727999208058079428984983537721
, 'MENU_PROGRAM_UNIT_FUNC',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999222225178877593919178809 ,    415838727999226947545360463564392505
, 'MENU_PROGRAM_UNIT_PROC',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999241114644809072500033593 ,    415838727999245837011291942145247289
, 'MENU_PROGRAM_UNIT_SPEC',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999260004110740551080888377 ,    415838727999264726477223420726102073
, 'MENU_PROPERTY_CLASS',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999278893576672029661743161 ,    415838727999283615943154899306956857
, 'MENU_VISUAL_ATTRIBUTE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999297783042603508242597945 ,    415838727999302505409086377887811641
, 'RELATION_PARTITION',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999316672508534986823452729 ,    415838727999321394875017856468666425
, 'SHARED_LIBRARY',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999335561974466465404307513 ,    415838727999340284340949335049521209
, 'REPORTS_REPORT_MODULE',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999354451440397943985162297 ,    415838727999359173806880813630375993
, 'C_FUNCTION',
'Y');

insert into sdd_global_name_domains (irid, ivid, name, system_flag) values (
  415838727999373340906329422566017081 ,    415838727999378063272812292211230777
, 'C_INCLUDE',
'Y');

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727997947186228502789711480889 ,    415838727997951908594985659356694585 ,
'Application Logic Event',
'Application Logic Events',
'US',        415838727997937741495537050421053497 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727997966075694434268292335673 ,    415838727997970798060917137937549369 ,
'Java Field',
'Java Fields',
'US',        415838727997956630961468529001908281 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727997984965160365746873190457 ,    415838727997989687526848616518404153 ,
'Java Method',
'Java Methods',
'US',        415838727997975520427400007582763065 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998003854626297225454045241 ,    415838727998008576992780095099258937 ,
'Java Type',
'Java Types',
'US',        415838727997994409893331486163617849 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998022744092228704034900025 ,    415838727998027466458711573680113721 ,
'Database Link',
'Database Links',
'US',        415838727998013299359262964744472633 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
474092531114597482734221381672126521, 474092531114602205100704251317340217, 
'Outline',
'Outlines',
'US',        474092531114559703802358424510416953 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
474092531114606927467187120962553913, 474092531114611649833669990607767609, 
'Context',
'Contexts',
'US',       474092531114569148535324163800844345 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
474092531114616372200152860252981305,  474092531114621094566635729898195001,
'Dimension',
'Dimensions',
'US',        474092531114578593268289903091271737 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
474092531114625816933118599543408697, 474092531114630539299601469188622393,
'Index Type',
'Index Types',
'US',        474092531114588038001255642381699129 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998041633558160182615754809 ,    415838727998046355924643052260968505 ,
'PLSQL Module Package Body',
'PLSQL Module Package Bodies',
'US',        415838727998032188825194443325327417 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998060523024091661196609593 ,    415838727998065245390574530841823289 ,
'PLSQL Module Package Cursor',
'PLSQL Module Package Cursors',
'US',        415838727998051078291125921906182201 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998079412490023139777464377 ,    415838727998084134856506009422678073 ,
'PLSQL Module Package Spec',
'PLSQL Module Package Specs',
'US',        415838727998069967757057400487036985 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998098301955954618358319161 ,    415838727998103024322437488003532857 ,
'PLSQL Module Package Subtype',
'PLSQL Module Package Subtypes',
'US',        415838727998088857222988879067891769 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998117191421886096939173945 ,    415838727998121913788368966584387641 ,
'PLSQL Module Package Type',
'PLSQL Module Package Types',
'US',        415838727998107746688920357648746553 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998136080887817575520028729 ,    415838727998140803254300445165242425 ,
'PLSQL Module Package Variable',
'PLSQL Module Package Variables',
'US',        415838727998126636154851836229601337 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998154970353749054100883513 ,    415838727998159692720231923746097209 ,
'PLSQL Module Subroutine',
'PLSQL Module Subroutines',
'US',        415838727998145525620783314810456121 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998173859819680532681738297 ,    415838727998178582186163402326951993 ,
'PLSQL Module Trigger',
'PLSQL Module Triggers',
'US',        415838727998164415086714793391310905 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998192749285612011262593081 ,    415838727998197471652094880907806777 ,
'Forms Alert',
'Forms Alerts',
'US',        415838727998183304552646271972165689 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998211638751543489843447865 ,    415838727998216361118026359488661561 ,
'Forms Block',
'Forms Blocks',
'US',        415838727998202194018577750553020473 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998230528217474968424302649 ,    415838727998235250583957838069516345 ,
'Forms Canvas',
'Forms Canvases',
'US',        415838727998221083484509229133875257 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998249417683406447005157433 ,    415838727998254140049889316650371129 ,
'Forms Editor',
'Forms Editors',
'US',        415838727998239972950440707714730041 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998268307149337925586012217 ,    415838727998273029515820795231225913 ,
'Forms Item',
'Forms Items',
'US',        415838727998258862416372186295584825 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998287196615269404166867001 ,    415838727998291918981752273812080697 ,
'Forms Graphic',
'Forms Graphics',
'US',        415838727998277751882303664876439609 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998306086081200882747721785 ,    415838727998310808447683752392935481 ,
'Forms List of Values',
'Forms List of Values',
'US',        415838727998296641348235143457294393 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998324975547132361328576569 ,    415838727998329697913615230973790265 ,
'Forms Object Group',
'Forms Object Groups',
'US',        415838727998315530814166622038149177 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998343865013063839909431353 ,    415838727998348587379546709554645049 ,
'Forms Form Parameter',
'Forms Form Parameters',
'US',        415838727998334420280098100619003961 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998362754478995318490286137 ,    415838727998367476845478188135499833 ,
'Forms Menu',
'Forms Menus',
'US',        415838727998353309746029579199858745 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998381643944926797071140921 ,    415838727998386366311409666716354617 ,
'Forms Menu Item',
'Forms Menu Items',
'US',        415838727998372199211961057780713529 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998400533410858275651995705 ,    415838727998405255777341145297209401 ,
'Forms Form Module',
'Forms Form Modules',
'US',        415838727998391088677892536361568313 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998419422876789754232850489 ,    415838727998424145243272623878064185 ,
'Forms Program Unit Body',
'Forms Program Unit Bodies',
'US',        415838727998409978143824014942423097 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998438312342721232813705273 ,    415838727998443034709204102458918969 ,
'Forms Program Unit Function',
'Forms Program Unit Functions',
'US',        415838727998428867609755493523277881 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998457201808652711394560057 ,    415838727998461924175135581039773753 ,
'Forms Program Unit Procedure',
'Forms Program Unit Procedures',
'US',        415838727998447757075686972104132665 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998476091274584189975414841 ,    415838727998480813641067059620628537 ,
'Forms Program Unit Spec',
'Forms Program Unit Specs',
'US',        415838727998466646541618450684987449 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998494980740515668556269625 ,    415838727998499703106998538201483321 ,
'Forms Property Class',
'Forms Property Classes',
'US',        415838727998485536007549929265842233 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998513870206447147137124409 ,    415838727998518592572930016782338105 ,
'Forms Record Group',
'Forms Record Groups',
'US',        415838727998504425473481407846697017 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998532759672378625717979193 ,    415838727998537482038861495363192889 ,
'Forms Report',
'Forms Reports',
'US',        415838727998523314939412886427551801 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998551649138310104298833977 ,    415838727998556371504792973944047673 ,
'Forms Trigger',
'Forms Triggers',
'US',        415838727998542204405344365008406585 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998570538604241582879688761 ,    415838727998575260970724452524902457 ,
'Forms Tab Page',
'Forms Tab Pages',
'US',        415838727998561093871275843589261369 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998589428070173061460543545 ,    415838727998594150436655931105757241 ,
'Forms Visual Attribute',
'Forms Visual Attributes',
'US',        415838727998579983337207322170116153 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998608317536104540041398329 ,    415838727998613039902587409686612025 ,
'Forms Window',
'Forms Windows',
'US',        415838727998598872803138800750970937 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998627207002036018622253113 ,    415838727998631929368518888267466809 ,
'Forms Relation',
'Forms Relations',
'US',        415838727998617762269070279331825721 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998646096467967497203107897 ,    415838727998650818834450366848321593 ,
'Library Library Module',
'Library Library Modules',
'US',        415838727998636651735001757912680505 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998664985933898975783962681 ,    415838727998669708300381845429176377 ,
'OLB Alert',
'OLB Alerts',
'US',        415838727998655541200933236493535289 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998683875399830454364817465 ,    415838727998688597766313324010031161 ,
'OLB Block',
'OLB Blocks',
'US',        415838727998674430666864715074390073 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998702764865761932945672249 ,    415838727998707487232244802590885945 ,
'OLB Canvas',
'OLB Canvases',
'US',        415838727998693320132796193655244857 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998721654331693411526527033 ,    415838727998726376698176281171740729 ,
'OLB Editor',
'OLB Editors',
'US',        415838727998712209598727672236099641 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998740543797624890107381817 ,    415838727998745266164107759752595513 ,
'OLB Form Parameter',
'OLB Form Parameters',
'US',        415838727998731099064659150816954425 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998759433263556368688236601 ,    415838727998764155630039238333450297 ,
'OLB Item',
'OLB Items',
'US',        415838727998749988530590629397809209 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998778322729487847269091385 ,    415838727998783045095970716914305081 ,
'OLB Graphic',
'OLB Graphics',
'US',        415838727998768877996522107978663993 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998797212195419325849946169 ,    415838727998801934561902195495159865 ,
'OLB List of Values',
'OLB List of Values',
'US',        415838727998787767462453586559518777 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998816101661350804430800953 ,    415838727998820824027833674076014649 ,
'OLB Object Group',
'OLB Object Groups',
'US',        415838727998806656928385065140373561 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998834991127282283011655737 ,    415838727998839713493765152656869433 ,
'OLB Object Library',
'OLB Object Libraries',
'US',        415838727998825546394316543721228345 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998853880593213761592510521 ,    415838727998858602959696631237724217 ,
'OLB Menu',
'OLB Menus',
'US',        415838727998844435860248022302083129 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998872770059145240173365305 ,    415838727998877492425628109818579001 ,
'OLB Menu Item',
'OLB Menu Items',
'US',        415838727998863325326179500882937913 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998891659525076718754220089 ,    415838727998896381891559588399433785 ,
'OLB Menu Parameter',
'OLB Menu Parameters',
'US',        415838727998882214792110979463792697 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998910548991008197335074873 ,    415838727998915271357491066980288569 ,
'OLB Program Unit Body',
'OLB Program Unit Bodies',
'US',        415838727998901104258042458044647481 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  2353170284349918332496104151960633647 ,  2353170284659403342317449220685414703 ,
'OLB Report',
'OLB Reports',
'US',        2353170283730948312853414014511071535 );


insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998929438456939675915929657 ,    415838727998934160823422545561143353 ,
'OLB Program Unit Function',
'OLB Program Unit Functions',
'US',        415838727998919993723973936625502265 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998948327922871154496784441 ,    415838727998953050289354024141998137 ,
'OLB Program Unit Procedure',
'OLB Program Unit Procedures',
'US',        415838727998938883189905415206357049 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998967217388802633077639225 ,    415838727998971939755285502722852921 ,
'OLB Program Unit Spec',
'OLB Program Unit Specs',
'US',        415838727998957772655836893787211833 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727998986106854734111658494009 ,    415838727998990829221216981303707705 ,
'OLB Property Class',
'OLB Property Classes',
'US',        415838727998976662121768372368066617 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999004996320665590239348793 ,    415838727999009718687148459884562489 ,
'OLB Record Group',
'OLB Record Groups',
'US',        415838727998995551587699850948921401 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999023885786597068820203577 ,    415838727999028608153079938465417273 ,
'OLB Tab Page',
'OLB Tab Pages',
'US',        415838727999014441053631329529776185 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999042775252528547401058361 ,    415838727999047497619011417046272057 ,
'OLB Trigger',
'OLB Triggers',
'US',        415838727999033330519562808110630969 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999061664718460025981913145 ,    415838727999066387084942895627126841 ,
'OLB Visual Attribute',
'OLB Visual Attributes',
'US',        415838727999052219985494286691485753 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999080554184391504562767929 ,    415838727999085276550874374207981625 ,
'OLB Window',
'OLB Windows',
'US',        415838727999071109451425765272340537 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999099443650322983143622713 ,    415838727999104166016805852788836409 ,
'Menu Object Group',
'Menu Object Groups',
'US',        415838727999089998917357243853195321 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999118333116254461724477497 ,    415838727999123055482737331369691193 ,
'Menu Menu',
'Menu Menus',
'US',        415838727999108888383288722434050105 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999137222582185940305332281 ,    415838727999141944948668809950545977 ,
'Menu Menu Item',
'Menu Menu Items',
'US',        415838727999127777849220201014904889 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999156112048117418886187065 ,    415838727999160834414600288531400761 ,
'Menu Menu Parameter',
'Menu Menu Parameters',
'US',        415838727999146667315151679595759673 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999175001514048897467041849 ,    415838727999179723880531767112255545 ,
'Menu Menu Module',
'Menu Menu Modules',
'US',        415838727999165556781083158176614457 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999193890979980376047896633 ,    415838727999198613346463245693110329 ,
'Menu Program Unit Body',
'Menu Program Unit Bodies',
'US',        415838727999184446247014636757469241 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999212780445911854628751417 ,    415838727999217502812394724273965113 ,
'Menu Program Unit Function',
'Menu Program Unit Functions',
'US',        415838727999203335712946115338324025 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999231669911843333209606201 ,    415838727999236392278326202854819897 ,
'Menu Program Unit Procedure',
'Menu Program Unit Procedures',
'US',        415838727999222225178877593919178809 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999250559377774811790460985 ,    415838727999255281744257681435674681 ,
'Menu Program Unit Spec',
'Menu Program Unit Specs',
'US',        415838727999241114644809072500033593 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999269448843706290371315769 ,    415838727999274171210189160016529465 ,
'Menu Property Class',
'Menu Property Classes',
'US',        415838727999260004110740551080888377 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999288338309637768952170553 ,    415838727999293060676120638597384249 ,
'Menu Visual Attribute',
'Menu Visual Attributes',
'US',        415838727999278893576672029661743161 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999307227775569247533025337 ,    415838727999311950142052117178239033 ,
'Relation Partition',
'Relation Partitions',
'US',        415838727999297783042603508242597945 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999326117241500726113880121 ,    415838727999330839607983595759093817 ,
'Shared Library',
'Shared Libraries',
'US',        415838727999316672508534986823452729 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999345006707432204694734905 ,    415838727999349729073915074339948601 ,
'Reports Report Module',
'Reports Report Modules',
'US',        415838727999335561974466465404307513 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999363896173363683275589689 ,    415838727999368618539846552920803385 ,
'C Function',
'C Functions',
'US',        415838727999354451440397943985162297 );

insert into sdd_nls_global_name_domains (irid, ivid, nls_name, nls_plural_name, nls_lang, gnd_irid)
values (
  415838727999382785639295161856444473 ,    415838727999387508005778031501658169 ,
'C Include',
'C Includes',
'US',        415838727999373340906329422566017081 );

create or replace trigger sdd_gns_domains_audit
  before update on sdd_global_name_domains
  for each row
  begin
    jr_audit.pre_update( :new.number_of_times_modified, :new.date_changed, :new.changed_by);
  end;
/

create or replace trigger sdd_nls_gnd_audit
  before update on sdd_nls_global_name_domains
  for each row
  begin
    jr_audit.pre_update( :new.number_of_times_modified, :new.date_changed, :new.changed_by);
  end;
/

rem ---------------------------------------------------------------------------+
prompt Table : sdd_global_names
rem
rem Note : This table is NOT versionable. Ivid is added as a dummy column so
rem        that joins can be performed from sdd_dependencies to any repos table,
rem        including this one, using (irid, ivid)
rem ---------------------------------------------------------------------------+
rem
create table sdd_global_names (
  irid                      number		                    not null
, ivid                      number                        not null
, name                      varchar2(256)                 not null
, number_of_times_modified  number        default 0       not null
, date_created              date          default sysdate not null
, created_by                varchar2(30)  default user    not null
, date_changed              date
, changed_by                varchar2(30)
, domain_irid   		        number
, type_id       	          number
)
/

comment on table  sdd_global_names      is 'Holds globally visible names, each name scoped by a domain or a type #repos_pragma{is_system=true}';
comment on column sdd_global_names.name is 'An example of name could be schema.table.columnname';

-- sdd_gns_pk
alter table sdd_global_names add constraint sdd_gns_pk
primary key (irid)
/

-- sdd_gns_uk
alter table sdd_global_names add constraint sdd_gns_uk
unique (name, type_id, domain_irid)
/

-- sdd_gns_to_gnsdom_fk
alter table sdd_global_names add constraint sdd_gns_to_gnsdom_fk
foreign key (domain_irid) references sdd_global_name_domains
/

-- sdd_gns_chk_nn1
alter table sdd_global_names add constraint sdd_gns_chk_nn1
check ((domain_irid is null     and type_id is not null) or
       (domain_irid is not null and type_id is null))
/

create index ind_gn_name_domain on
sdd_global_names (name, domain_irid)
/

create index ind_gn_domain on
sdd_global_names (domain_irid)
/

create index ind_gn_type_id on
sdd_global_names (type_id)
/

create or replace trigger sdd_global_names_audit
  before update on sdd_global_names
  for each row
  begin
    jr_audit.pre_update( :new.number_of_times_modified, :new.date_changed, :new.changed_by);
  end;
/

rem ---------------------------------------------------------------------------+
rem Dependency purging tables
rem ---------------------------------------------------------------------------+

rem ---------------------------------------------------------------------------+
prompt sdd_dpnd_purging_policies
rem ---------------------------------------------------------------------------+
create table sdd_dpnd_purging_policies (
  irid                       number                        not null
, ivid                       number                        not null
, policy_name                varchar2(256)                 not null
, number_of_times_modified   number        default 0       not null
, date_created               date          default sysdate not null
, created_by                 varchar2(30)  default user    not null
, date_changed               date
, changed_by                 varchar2(30)
, date_last_purged           date
, scheduled_date             date
)
/

comment on table sdd_dpnd_purging_policies is 'Holds dependency purging policies #repos_pragma{is_system=true}';
comment on column sdd_dpnd_purging_policies.policy_name is '#repos_pragma{name_column=true}';

-- sdd_dppu_control_pk
alter table sdd_dpnd_purging_policies add constraint sdd_dppu_control_pk
primary key (irid)
/

-- sdd_dppu_control_uk
alter table sdd_dpnd_purging_policies add constraint sdd_dppu_control_uk
unique (policy_name)
/

create or replace trigger sdd_dppu_control_audit
  before update on sdd_dpnd_purging_policies
  for each row
  begin
    jr_audit.pre_update( :new.number_of_times_modified, :new.date_changed, :new.changed_by);
  end;
/

rem ---------------------------------------------------------------------------+
prompt sdd_dpnd_purging_cfg_policies
rem ---------------------------------------------------------------------------+
create table sdd_dpnd_purging_cfg_policies (
  irid                       number 	                     not null
, ivid                       number                        not null
, policy_id                  number                        not null
, config_irid                number                        not null
, config_ivid                number                        not null
, keep_dependencies_for      varchar2(1)   default 'Y'     not null
, purge_dependencies_for     varchar2(1)   default 'N'     not null
, number_of_times_modified   number        default 0       not null
, date_created               date          default sysdate not null
, created_by                 varchar2(30)  default user    not null
, date_changed               date
, changed_by                 varchar2(30)
)
/

comment on table  sdd_dpnd_purging_cfg_policies is 'Holds dependency purging policies for configurations #repos_pragma{is_system=true}';
comment on column sdd_dpnd_purging_cfg_policies.keep_dependencies_for  is 'If Y then keep dependencies involving members of the configuration';
comment on column sdd_dpnd_purging_cfg_policies.purge_dependencies_for is 'If Y then purge dependencies involving members of the configuration';

-- sdd_dppu_cfg_pol_pk
alter table sdd_dpnd_purging_cfg_policies add constraint sdd_dppu_cfg_pol_pk
primary key (irid)
/

-- sdd_dppu_cfg_pol_fk
alter table sdd_dpnd_purging_cfg_policies add constraint sdd_dppu_cfg_pol_fk
foreign key (config_ivid) references i$sdd_configurations
/

-- sdd_dppu_cfg_pol_fk2
alter table sdd_dpnd_purging_cfg_policies add constraint sdd_dppu_cfg_pol_fk2
foreign key (policy_id) references sdd_dpnd_purging_policies
/

-- sdd_dppu_cfg_pol_uk
alter table sdd_dpnd_purging_cfg_policies add constraint sdd_dppu_cfg_pol_uk
unique (policy_id, config_irid, config_ivid)
/

-- sdd_dppu_cfg_pol_chk_keep
alter table sdd_dpnd_purging_cfg_policies add constraint sdd_dppu_cfg_pol_chk_keep
check (keep_dependencies_for  in ('Y', 'N'))
/

-- sdd_dppu_cfg_pol_chk_pur
alter table sdd_dpnd_purging_cfg_policies add constraint sdd_dppu_cfg_pol_chk_pur
check (purge_dependencies_for  in ('Y', 'N'))
/

-- sdd_dppu_cfg_pol_chk_pukp
alter table sdd_dpnd_purging_cfg_policies add constraint sdd_dppu_cfg_pol_chk_pukp
check ((keep_dependencies_for = 'Y' and purge_dependencies_for = 'N') or
       (keep_dependencies_for = 'N' and purge_dependencies_for = 'Y') or
       (keep_dependencies_for = 'N' and purge_dependencies_for = 'N'))
/

create or replace trigger sdd_dppu_cfgpol_audit
  before update on sdd_dpnd_purging_cfg_policies
  for each row
  begin
    jr_audit.pre_update( :new.number_of_times_modified, :new.date_changed, :new.changed_by);
  end;
/

rem ---------------------------------------------------------------------------+
prompt sdd_dpnd_purging_br_policies
rem ---------------------------------------------------------------------------+
create table sdd_dpnd_purging_br_policies (
  irid                       number 	                     not null
, ivid                       number                        not null
, policy_id                  number                        not null
, branch_id                  number                        not null
, number_of_versions         number        default 1       not null
, number_of_times_modified   number        default 0       not null
, date_created               date          default sysdate not null
, created_by                 varchar2(30)  default user    not null
, date_changed               date
, changed_by                 varchar2(30)
)
/

comment on table sdd_dpnd_purging_br_policies is 'Holds dependency purging policies for branches #repos_pragma{is_system=true}';
comment on column sdd_dpnd_purging_br_policies.number_of_versions is 'The number of most recent versions on the branch to keep dependencies for can be 1 or 2';

-- sdd_dppu_br_pol_pk
alter table sdd_dpnd_purging_br_policies add constraint sdd_dppu_br_pol_pk
primary key (irid)
/

-- sdd_dppu_br_pol_fk
alter table sdd_dpnd_purging_br_policies add constraint sdd_dppu_br_pol_fk
foreign key (branch_id) references i$sdd_branches
/

-- sdd_dppu_br_pol_fk2
alter table sdd_dpnd_purging_br_policies add constraint sdd_dppu_br_pol_fk2
foreign key (policy_id) references sdd_dpnd_purging_policies
/

-- sdd_dppu_br_pol_uk
alter table sdd_dpnd_purging_br_policies add constraint sdd_dppu_br_pol_uk
unique (policy_id, branch_id)
/

-- sdd_dppu_br_pol_chk_nver
alter table sdd_dpnd_purging_br_policies add constraint sdd_dppu_br_pol_chk_nver
check (number_of_versions  in (1, 2))
/

create or replace trigger sdd_dppu_brpol_audit
  before update on sdd_dpnd_purging_br_policies
  for each row
  begin
    jr_audit.pre_update( :new.number_of_times_modified, :new.date_changed, :new.changed_by);
  end;
/


