--------------------------------------------------------
--  File created - Thursday-September-12-2019   
--------------------------------------------------------
DROP TYPE "RELEASE_MANAGER"."RELMGR_NUMBER_TAB_T";
DROP TYPE "RELEASE_MANAGER"."RELMGR_PKG_DESTROY_ERR_T";
DROP TYPE "RELEASE_MANAGER"."RELMGR_PKG_DESTROY_ERR_TAB_T";
DROP TYPE "RELEASE_MANAGER"."RELMGR_VARCHAR2_TAB_T";
DROP TYPE "RELEASE_MANAGER"."TDICTIONARY";
DROP SEQUENCE "RELEASE_MANAGER"."MICROSOFTSEQDTPROPERTIES";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_ADDITIONAL_NOTES";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_BLAT_MOD";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_BLAT_SERVER_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_BMCON_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_BM_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_BSA_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_BUILD_INSTANCE";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_BUILD_PLATFORMS";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_CR_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_DAEMON_INSTRUCTION_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_GBE_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_GROUP_EMAIL_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_MSG_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_PKG_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_PROJ_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_PV_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_RCON_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_RELEASE_MOD";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_RTAG_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_SCHEDULED_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_SDKTAG_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_SDK_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_SESSION_NUM";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_TESTRUN_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_UNIT_TESTS";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_USER_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_VCS_TYPE";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_VIEW_ID";
DROP SEQUENCE "RELEASE_MANAGER"."SEQ_VTREE_ID";
DROP TABLE "RELEASE_MANAGER"."ABT_ACTION_LOG";
DROP TABLE "RELEASE_MANAGER"."ACTION_LOG";
DROP TABLE "RELEASE_MANAGER"."ACTION_TYPE";
DROP TABLE "RELEASE_MANAGER"."ADDITIONAL_NOTES";
DROP TABLE "RELEASE_MANAGER"."ADVISORY_RIPPLE";
DROP TABLE "RELEASE_MANAGER"."ARCHIVE_ACTION_LOG";
DROP TABLE "RELEASE_MANAGER"."ARCHIVE_DATA";
DROP TABLE "RELEASE_MANAGER"."AUTOBUILD_FAILURE";
DROP TABLE "RELEASE_MANAGER"."BLAT_PROJECTS";
DROP TABLE "RELEASE_MANAGER"."BLAT_RELEASES";
DROP TABLE "RELEASE_MANAGER"."BLAT_SERVERS";
DROP TABLE "RELEASE_MANAGER"."BUILD_ENVIRONMENTS";
DROP TABLE "RELEASE_MANAGER"."BUILD_ENV_DOCUMENTS";
DROP TABLE "RELEASE_MANAGER"."BUILD_INSTANCES";
DROP TABLE "RELEASE_MANAGER"."BUILD_INSTANCE_PLATFORMS";
DROP TABLE "RELEASE_MANAGER"."BUILD_MACHINES";
DROP TABLE "RELEASE_MANAGER"."BUILD_MACHINE_CONFIG";
DROP TABLE "RELEASE_MANAGER"."BUILD_ORDER";
DROP TABLE "RELEASE_MANAGER"."BUILD_PLAN";
DROP TABLE "RELEASE_MANAGER"."BUILD_PLATFORMS";
DROP TABLE "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG";
DROP TABLE "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG2";
DROP TABLE "RELEASE_MANAGER"."BUILD_SERVICE_CONFIG";
DROP TABLE "RELEASE_MANAGER"."BUILD_STANDARDS";
DROP TABLE "RELEASE_MANAGER"."BUILD_STANDARDS_ADDENDUM";
DROP TABLE "RELEASE_MANAGER"."CODE_REVIEWS";
DROP TABLE "RELEASE_MANAGER"."CODE_REVIEW_URL";
DROP TABLE "RELEASE_MANAGER"."CQ_HISTORY";
DROP TABLE "RELEASE_MANAGER"."CQ_ISSUES";
DROP TABLE "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE";
DROP TABLE "RELEASE_MANAGER"."CQ_STATEDEF";
DROP TABLE "RELEASE_MANAGER"."CQ_USERS";
DROP TABLE "RELEASE_MANAGER"."DAEMON_ACTION_LOG";
DROP TABLE "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS";
DROP TABLE "RELEASE_MANAGER"."DASH_BOARD";
DROP TABLE "RELEASE_MANAGER"."DEPRECATED_PACKAGES";
DROP TABLE "RELEASE_MANAGER"."DO_NOT_RIPPLE";
DROP TABLE "RELEASE_MANAGER"."GBE_MACHTYPE";
DROP TABLE "RELEASE_MANAGER"."IGNORE_WARNINGS";
DROP TABLE "RELEASE_MANAGER"."JIRA_ISSUES";
DROP TABLE "RELEASE_MANAGER"."LICENCES";
DROP TABLE "RELEASE_MANAGER"."LICENCING";
DROP TABLE "RELEASE_MANAGER"."LXR_STATE";
DROP TABLE "RELEASE_MANAGER"."MEMBERS_GROUP";
DROP TABLE "RELEASE_MANAGER"."MESSAGE_BOARD";
DROP TABLE "RELEASE_MANAGER"."MICROSOFTDTPROPERTIES";
DROP TABLE "RELEASE_MANAGER"."NOTE_MANAGER";
DROP TABLE "RELEASE_MANAGER"."NOTIFICATION_HISTORY";
DROP TABLE "RELEASE_MANAGER"."PACKAGES";
DROP TABLE "RELEASE_MANAGER"."PACKAGE_BUILD_ENV";
DROP TABLE "RELEASE_MANAGER"."PACKAGE_BUILD_INFO";
DROP TABLE "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES";
DROP TABLE "RELEASE_MANAGER"."PACKAGE_DOCUMENTS";
DROP TABLE "RELEASE_MANAGER"."PACKAGE_INTEREST";
DROP TABLE "RELEASE_MANAGER"."PACKAGE_METRICS";
DROP TABLE "RELEASE_MANAGER"."PACKAGE_PATCHES";
DROP TABLE "RELEASE_MANAGER"."PACKAGE_PROCESSES";
DROP TABLE "RELEASE_MANAGER"."PACKAGE_VERSIONS";
DROP TABLE "RELEASE_MANAGER"."PACKAGE_VERSION_PLATFORMS";
DROP TABLE "RELEASE_MANAGER"."PEGGED_VERSIONS";
DROP TABLE "RELEASE_MANAGER"."PLANNED";
DROP TABLE "RELEASE_MANAGER"."PLANNED_VERSIONS";
DROP TABLE "RELEASE_MANAGER"."PLATFORMS";
DROP TABLE "RELEASE_MANAGER"."PROCESSES";
DROP TABLE "RELEASE_MANAGER"."PRODUCT_COMPONENTS";
DROP TABLE "RELEASE_MANAGER"."PRODUCT_STATES";
DROP TABLE "RELEASE_MANAGER"."PROJECTS";
DROP TABLE "RELEASE_MANAGER"."PROJECT_ACTION_LOG";
DROP TABLE "RELEASE_MANAGER"."PROJECT_EXTENTIONS";
DROP TABLE "RELEASE_MANAGER"."RELEASE_COMPONENTS";
DROP TABLE "RELEASE_MANAGER"."RELEASE_CONFIG";
DROP TABLE "RELEASE_MANAGER"."RELEASE_CONTENT";
DROP TABLE "RELEASE_MANAGER"."RELEASE_LINKS";
DROP TABLE "RELEASE_MANAGER"."RELEASE_METRICS";
DROP TABLE "RELEASE_MANAGER"."RELEASE_MODIFIED";
DROP TABLE "RELEASE_MANAGER"."RELEASE_TAGS";
DROP TABLE "RELEASE_MANAGER"."RM_PACKAGE_ISSUES_DELETE_ME";
DROP TABLE "RELEASE_MANAGER"."RM_PKG_ISSUES";
DROP TABLE "RELEASE_MANAGER"."RUNTIME_DEPENDENCIES";
DROP TABLE "RELEASE_MANAGER"."RUN_LEVEL";
DROP TABLE "RELEASE_MANAGER"."RUN_LEVEL_SCHEDULE";
DROP TABLE "RELEASE_MANAGER"."SDK_CONTENT";
DROP TABLE "RELEASE_MANAGER"."SDK_NAMES";
DROP TABLE "RELEASE_MANAGER"."SDK_TAGS";
DROP TABLE "RELEASE_MANAGER"."TEMP_ENV_DEPS";
DROP TABLE "RELEASE_MANAGER"."TEMP_ENV_STATES";
DROP TABLE "RELEASE_MANAGER"."TEMP_SASH";
DROP TABLE "RELEASE_MANAGER"."TEMP_TREE_BROWSE";
DROP TABLE "RELEASE_MANAGER"."TEST_RUN";
DROP TABLE "RELEASE_MANAGER"."TEST_TYPES";
DROP TABLE "RELEASE_MANAGER"."UNIT_TESTS";
DROP TABLE "RELEASE_MANAGER"."VALIDATION_RULES_DELETE_ME";
DROP TABLE "RELEASE_MANAGER"."VCS_TYPE";
DROP TABLE "RELEASE_MANAGER"."VIEWS";
DROP TABLE "RELEASE_MANAGER"."VIEW_DEF";
DROP TABLE "RELEASE_MANAGER"."VIEW_SETTINGS";
DROP TABLE "RELEASE_MANAGER"."VTREES";
DROP TABLE "RELEASE_MANAGER"."VTREES_WORLD";
DROP TABLE "RELEASE_MANAGER"."WORK_IN_PROGRESS";
DROP TABLE "RELEASE_MANAGER"."WORLDS";
DROP VIEW "RELEASE_MANAGER"."ENVIRONMENT_VIEW";
DROP PROCEDURE "RELEASE_MANAGER"."ADD_AUTOBUILD_FAILURE_INFO";
DROP PROCEDURE "RELEASE_MANAGER"."ADD_COMPONENT";
DROP PROCEDURE "RELEASE_MANAGER"."ADD_PACKAGE_INTEREST";
DROP PROCEDURE "RELEASE_MANAGER"."ADD_RUNTIME_DEPENDENCY";
DROP PROCEDURE "RELEASE_MANAGER"."ADD_VIEW_MEMBERS";
DROP PROCEDURE "RELEASE_MANAGER"."BASIC_CLONE";
DROP PROCEDURE "RELEASE_MANAGER"."BUILD_TREE";
DROP PROCEDURE "RELEASE_MANAGER"."CHANGE_PACKAGE_STATE";
DROP PROCEDURE "RELEASE_MANAGER"."CHANGE_RELEASE_MODE";
DROP PROCEDURE "RELEASE_MANAGER"."CHECK_NEW_PATCHES";
DROP PROCEDURE "RELEASE_MANAGER"."CLEAN_ADVISORY_RIPPLE";
DROP PROCEDURE "RELEASE_MANAGER"."CLEAN_DO_NOT_RIPPLE";
DROP PROCEDURE "RELEASE_MANAGER"."CLEAR_ADVISORY_RIPPLE";
DROP PROCEDURE "RELEASE_MANAGER"."CLONED_PACKAGE_PROCESSES";
DROP PROCEDURE "RELEASE_MANAGER"."CLONED_PROCESSES";
DROP PROCEDURE "RELEASE_MANAGER"."DELETE_AUTOBUILD_FAILURE_INFO";
DROP PROCEDURE "RELEASE_MANAGER"."DEPRECATE_PACKAGE";
DROP PROCEDURE "RELEASE_MANAGER"."DT_DROPUSEROBJECTBYID";
DROP PROCEDURE "RELEASE_MANAGER"."DT_SETPROPERTYBYID";
DROP PROCEDURE "RELEASE_MANAGER"."IGNORE_DEPENDENCY_WARNINGS";
DROP PROCEDURE "RELEASE_MANAGER"."INSERT_INTO_PACKAGE_BUILD_INFO";
DROP PROCEDURE "RELEASE_MANAGER"."INSERT_MULTIPLE_STICKY_NOTES";
DROP PROCEDURE "RELEASE_MANAGER"."LEVEL_N_CONFLICTS";
DROP PROCEDURE "RELEASE_MANAGER"."LEVEL_ONE_CONFLICTS";
DROP PROCEDURE "RELEASE_MANAGER"."LOCK_PACKAGE";
DROP PROCEDURE "RELEASE_MANAGER"."LOG_ACTION";
DROP PROCEDURE "RELEASE_MANAGER"."LOG_ACTION_BULK";
DROP PROCEDURE "RELEASE_MANAGER"."LOG_DAEMON_ACTION";
DROP PROCEDURE "RELEASE_MANAGER"."LOG_PROJECT_ACTION";
DROP PROCEDURE "RELEASE_MANAGER"."NEW_ADDITIONAL_NOTE";
DROP PROCEDURE "RELEASE_MANAGER"."NEW_PACKAGE_NAME";
DROP PROCEDURE "RELEASE_MANAGER"."NEW_PATCH";
DROP PROCEDURE "RELEASE_MANAGER"."NEW_UNIT_TEST";
DROP PROCEDURE "RELEASE_MANAGER"."PAOLO_BUILD_TREE";
DROP PROCEDURE "RELEASE_MANAGER"."REBUILD_DEPRECATE_STATE";
DROP PROCEDURE "RELEASE_MANAGER"."REBUILD_ENVIRONMENT";
DROP PROCEDURE "RELEASE_MANAGER"."REMOVE_COMPONENTS";
DROP PROCEDURE "RELEASE_MANAGER"."REMOVE_DOCUMENT";
DROP PROCEDURE "RELEASE_MANAGER"."REMOVE_PACKAGE_INTEREST";
DROP PROCEDURE "RELEASE_MANAGER"."REMOVE_PATCH";
DROP PROCEDURE "RELEASE_MANAGER"."REMOVE_PROJECT_VIEW_OWNER";
DROP PROCEDURE "RELEASE_MANAGER"."REMOVE_RELEASE_CONTENT";
DROP PROCEDURE "RELEASE_MANAGER"."REMOVE_RUNTIME";
DROP PROCEDURE "RELEASE_MANAGER"."RENAME_PACKAGE_VERSION";
DROP PROCEDURE "RELEASE_MANAGER"."RESET_IGNORE_WARNINGS";
DROP PROCEDURE "RELEASE_MANAGER"."RIPPLE_PACKAGE";
DROP PROCEDURE "RELEASE_MANAGER"."SEED_PACKAGE_NAMES_VERSIONS";
DROP PROCEDURE "RELEASE_MANAGER"."SET_ADVISORY_RIPPLE";
DROP PROCEDURE "RELEASE_MANAGER"."SET_PACKAGE_BUILD_ENV";
DROP PROCEDURE "RELEASE_MANAGER"."SET_PACKAGE_BUILD_ENV_TEMP";
DROP PROCEDURE "RELEASE_MANAGER"."SET_TO_AUTOBUILDABLE";
DROP PROCEDURE "RELEASE_MANAGER"."SHIFT_INSTALL_ORDER";
DROP PROCEDURE "RELEASE_MANAGER"."SPLIT_VERSION";
DROP PROCEDURE "RELEASE_MANAGER"."SWITCH_REPRODUCIBLE_PACKAGE";
DROP PROCEDURE "RELEASE_MANAGER"."SYNC_PROJECTS_NEW_VERSION";
DROP PROCEDURE "RELEASE_MANAGER"."TOUCH_RELEASE";
DROP PROCEDURE "RELEASE_MANAGER"."TOUCH_RELEASE_BULK";
DROP PROCEDURE "RELEASE_MANAGER"."TO_INSERT_VTREE_ID";
DROP PROCEDURE "RELEASE_MANAGER"."UNDEPRECATE_PACKAGE";
DROP PROCEDURE "RELEASE_MANAGER"."UNLOCK_PACKAGE";
DROP PROCEDURE "RELEASE_MANAGER"."UNRIPPLE_PACKAGE";
DROP PROCEDURE "RELEASE_MANAGER"."UNRIPPLE_PACKAGE_INDIRECT";
DROP PROCEDURE "RELEASE_MANAGER"."UPDATE_ADDITIONAL_NOTE";
DROP PROCEDURE "RELEASE_MANAGER"."UPDATE_DEPRECATION_STATE";
DROP PROCEDURE "RELEASE_MANAGER"."UPDATE_MISC_VIEW";
DROP PROCEDURE "RELEASE_MANAGER"."UPDATE_PACKAGE_DEPENDENCY";
DROP PROCEDURE "RELEASE_MANAGER"."UPDATE_PACKAGE_STATES";
DROP PROCEDURE "RELEASE_MANAGER"."UPDATE_PROCESSES";
DROP PROCEDURE "RELEASE_MANAGER"."UPDATE_RUNTIME_DEPENDENCY";
DROP PROCEDURE "RELEASE_MANAGER"."UPDATE_UNIT_TEST";
DROP PROCEDURE "RELEASE_MANAGER"."UPDATE_UNIT_TEST_ACCEPTANCE";
DROP PACKAGE "RELEASE_MANAGER"."PK_APP_UTILS";
DROP PACKAGE "RELEASE_MANAGER"."PK_BLATAPI";
DROP PACKAGE "RELEASE_MANAGER"."PK_BUILDAPI";
DROP PACKAGE "RELEASE_MANAGER"."PK_ENVIRONMENT";
DROP PACKAGE "RELEASE_MANAGER"."PK_LICENCING";
DROP PACKAGE "RELEASE_MANAGER"."PK_PACKAGE";
DROP PACKAGE "RELEASE_MANAGER"."PK_PLANNED";
DROP PACKAGE "RELEASE_MANAGER"."PK_PROJECT";
DROP PACKAGE "RELEASE_MANAGER"."PK_RELEASE";
DROP PACKAGE "RELEASE_MANAGER"."PK_RMAPI";
DROP PACKAGE "RELEASE_MANAGER"."PK_WORK_IN_PROGRESS";
DROP PACKAGE "RELEASE_MANAGER"."RM_ISSUES";
DROP PACKAGE BODY "RELEASE_MANAGER"."PK_APP_UTILS";
DROP PACKAGE BODY "RELEASE_MANAGER"."PK_BLATAPI";
DROP PACKAGE BODY "RELEASE_MANAGER"."PK_BUILDAPI";
DROP PACKAGE BODY "RELEASE_MANAGER"."PK_ENVIRONMENT";
DROP PACKAGE BODY "RELEASE_MANAGER"."PK_LICENCING";
DROP PACKAGE BODY "RELEASE_MANAGER"."PK_PACKAGE";
DROP PACKAGE BODY "RELEASE_MANAGER"."PK_PLANNED";
DROP PACKAGE BODY "RELEASE_MANAGER"."PK_PROJECT";
DROP PACKAGE BODY "RELEASE_MANAGER"."PK_RELEASE";
DROP PACKAGE BODY "RELEASE_MANAGER"."PK_RMAPI";
DROP PACKAGE BODY "RELEASE_MANAGER"."PK_WORK_IN_PROGRESS";
DROP PACKAGE BODY "RELEASE_MANAGER"."RM_ISSUES";
DROP FUNCTION "RELEASE_MANAGER"."CAN_EDIT_PKG_IN_PROJECT";
DROP FUNCTION "RELEASE_MANAGER"."DT_ADDUSEROBJECT";
DROP FUNCTION "RELEASE_MANAGER"."GET_AUTOMATED_LABEL";
DROP FUNCTION "RELEASE_MANAGER"."GET_BUILD_NUMBER";
DROP FUNCTION "RELEASE_MANAGER"."GET_PATCH_VERSION";
DROP FUNCTION "RELEASE_MANAGER"."GET_PV_FIRST_MODIFIED";
DROP FUNCTION "RELEASE_MANAGER"."GET_V_EXT";
DROP FUNCTION "RELEASE_MANAGER"."IN_LIST_NUMBER";
DROP FUNCTION "RELEASE_MANAGER"."IN_LIST_NUMBER2";
DROP FUNCTION "RELEASE_MANAGER"."IN_LIST_VARCHAR2";
DROP FUNCTION "RELEASE_MANAGER"."IS_NUMBER";
DROP FUNCTION "RELEASE_MANAGER"."IS_VERSION_EXTENSION";
DROP FUNCTION "RELEASE_MANAGER"."ORA_SYSDATE";
DROP FUNCTION "RELEASE_MANAGER"."ORA_SYSDATETIME";
DROP FUNCTION "RELEASE_MANAGER"."PERL_DBD_TESTFUNC";
DROP FUNCTION "RELEASE_MANAGER"."RELEASE_MODE";
DROP SYNONYM "RELEASE_MANAGER"."APPLICATIONS";
DROP SYNONYM "RELEASE_MANAGER"."APPLICATION_PAGES";
DROP SYNONYM "RELEASE_MANAGER"."CONTROL_OBJECTS";
DROP SYNONYM "RELEASE_MANAGER"."DATA_PERMISSIONS";
DROP SYNONYM "RELEASE_MANAGER"."DATA_TABLES";
DROP SYNONYM "RELEASE_MANAGER"."PAGE_CONTROL_OBJECTS";
DROP SYNONYM "RELEASE_MANAGER"."PERMISSION_TYPES";
DROP SYNONYM "RELEASE_MANAGER"."PK_AMUTILS";
DROP SYNONYM "RELEASE_MANAGER"."PK_SECURITY";
DROP SYNONYM "RELEASE_MANAGER"."ROLES";
DROP SYNONYM "RELEASE_MANAGER"."ROLE_PRIVILEGES";
DROP SYNONYM "RELEASE_MANAGER"."USERS";
DROP SYNONYM "RELEASE_MANAGER"."USER_APPLICATIONS";
DROP SYNONYM "RELEASE_MANAGER"."USER_ROLES";
--------------------------------------------------------
--  DDL for Type RELMGR_NUMBER_TAB_T
--------------------------------------------------------

  CREATE OR REPLACE TYPE "RELEASE_MANAGER"."RELMGR_NUMBER_TAB_T" as TABLE of NUMBER

/
--------------------------------------------------------
--  DDL for Type RELMGR_PKG_DESTROY_ERR_T
--------------------------------------------------------

  CREATE OR REPLACE TYPE "RELEASE_MANAGER"."RELMGR_PKG_DESTROY_ERR_T" AS OBJECT 
( msg VARCHAR(200),
  mtype CHAR(1)
)

/
--------------------------------------------------------
--  DDL for Type RELMGR_PKG_DESTROY_ERR_TAB_T
--------------------------------------------------------

  CREATE OR REPLACE TYPE "RELEASE_MANAGER"."RELMGR_PKG_DESTROY_ERR_TAB_T" 
AS TABLE OF RELMGR_PKG_DESTROY_ERR_T;

/
--------------------------------------------------------
--  DDL for Type RELMGR_VARCHAR2_TAB_T
--------------------------------------------------------

  CREATE OR REPLACE TYPE "RELEASE_MANAGER"."RELMGR_VARCHAR2_TAB_T" 
as TABLE of VARCHAR2(4000)

/
--------------------------------------------------------
--  DDL for Type TDICTIONARY
--------------------------------------------------------

  CREATE OR REPLACE TYPE "RELEASE_MANAGER"."TDICTIONARY" AS
  TABLE OF VARCHAR2(4000)

/
--------------------------------------------------------
--  DDL for Sequence MICROSOFTSEQDTPROPERTIES
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."MICROSOFTSEQDTPROPERTIES"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 50 NOORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_ADDITIONAL_NOTES
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_ADDITIONAL_NOTES"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 38175 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_BLAT_MOD
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_BLAT_MOD"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 341 CACHE 20 NOORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_BLAT_SERVER_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_BLAT_SERVER_ID"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 81 CACHE 20 NOORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_BMCON_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_BMCON_ID"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 401 CACHE 20 NOORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_BM_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_BM_ID"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 6 NOCACHE  ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_BSA_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_BSA_ID"  MINVALUE 8 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 48 CACHE 20 NOORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_BUILD_INSTANCE
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_BUILD_INSTANCE"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 295286 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_BUILD_PLATFORMS
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_BUILD_PLATFORMS"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 201 CACHE 20 NOORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_CR_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_CR_ID"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 96512 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_DAEMON_INSTRUCTION_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_DAEMON_INSTRUCTION_ID"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 183365 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_GBE_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_GBE_ID"  MINVALUE 40 MAXVALUE 9999999999999999999999990 INCREMENT BY 1 START WITH 1245 NOCACHE  ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_GROUP_EMAIL_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_GROUP_EMAIL_ID"  MINVALUE 1 MAXVALUE 999999999999999999999999 INCREMENT BY 1 START WITH 1186 CACHE 20 NOORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_MSG_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_MSG_ID"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 582 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_PKG_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_PKG_ID"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 68965 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_PROJ_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_PROJ_ID"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1041 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_PV_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_PV_ID"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1282857 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_RCON_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_RCON_ID"  MINVALUE 1 MAXVALUE 9999999999999999999999999990 INCREMENT BY 1 START WITH 38663 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_RELEASE_MOD
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_RELEASE_MOD"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 369379 CACHE 20 NOORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_RTAG_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_RTAG_ID"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 41076 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_SCHEDULED_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_SCHEDULED_ID"  MINVALUE 1 MAXVALUE 9999999999999999999999999990 INCREMENT BY 1 START WITH 30374 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_SDKTAG_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_SDKTAG_ID"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1963 CACHE 20 NOORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_SDK_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_SDK_ID"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 183 CACHE 20 NOORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_SESSION_NUM
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_SESSION_NUM"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1126786 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_TESTRUN_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_TESTRUN_ID"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 5016624 CACHE 20 NOORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_UNIT_TESTS
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_UNIT_TESTS"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 378582 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_USER_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_USER_ID"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 3961 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_VCS_TYPE
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_VCS_TYPE"  MINVALUE 1 MAXVALUE 255 INCREMENT BY 1 START WITH 63 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_VIEW_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_VIEW_ID"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 10381 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Sequence SEQ_VTREE_ID
--------------------------------------------------------

   CREATE SEQUENCE  "RELEASE_MANAGER"."SEQ_VTREE_ID"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 37755 CACHE 20 ORDER  NOCYCLE ;
--------------------------------------------------------
--  DDL for Table ABT_ACTION_LOG
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."ABT_ACTION_LOG" 
   (	"RCON_ID" NUMBER, 
	"ACTION_DATETIME" DATE, 
	"ACTION" VARCHAR2(4000 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."ABT_ACTION_LOG" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ABT_ACTION_LOG" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ABT_ACTION_LOG" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table ACTION_LOG
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."ACTION_LOG" 
   (	"USER_ID" NUMBER, 
	"ACTION_DATETIME" DATE DEFAULT SYSDATE, 
	"PV_ID" NUMBER, 
	"DESCRIPTION" VARCHAR2(4000 BYTE), 
	"ACTTYPE_ID" NUMBER, 
	"ACTION_TIMESTAMP" TIMESTAMP (6) DEFAULT CURRENT_TIMESTAMP
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 308281344 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."ACTION_LOG"."ACTION_DATETIME" IS 'To be deprecated. Use timestamp instead';
  GRANT SELECT ON "RELEASE_MANAGER"."ACTION_LOG" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ACTION_LOG" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ACTION_LOG" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ACTION_LOG" TO "RELEASE_MANAGER_READ";
  GRANT DELETE ON "RELEASE_MANAGER"."ACTION_LOG" TO "DEPLOYMENT_MANAGER";
  GRANT UPDATE ON "RELEASE_MANAGER"."ACTION_LOG" TO "DEPLOYMENT_MANAGER";
  GRANT INSERT ON "RELEASE_MANAGER"."ACTION_LOG" TO "DEPLOYMENT_MANAGER";
  GRANT SELECT ON "RELEASE_MANAGER"."ACTION_LOG" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table ACTION_TYPE
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."ACTION_TYPE" 
   (	"ACTTYPE_ID" NUMBER, 
	"NAME" VARCHAR2(255 BYTE), 
	"DESCRIPTION" VARCHAR2(4000 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."ACTION_TYPE" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ACTION_TYPE" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ACTION_TYPE" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ACTION_TYPE" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table ADDITIONAL_NOTES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."ADDITIONAL_NOTES" 
   (	"NOTE_ID" NUMBER, 
	"PV_ID" NUMBER, 
	"NOTE_TITLE" VARCHAR2(2000 BYTE), 
	"NOTE_BODY" VARCHAR2(4000 BYTE), 
	"MOD_DATE" DATE, 
	"MOD_USER" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 55574528 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."ADDITIONAL_NOTES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ADDITIONAL_NOTES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ADDITIONAL_NOTES" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ADDITIONAL_NOTES" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table ADVISORY_RIPPLE
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."ADVISORY_RIPPLE" 
   (	"RTAG_ID" NUMBER, 
	"PV_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."ADVISORY_RIPPLE" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ADVISORY_RIPPLE" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ADVISORY_RIPPLE" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table ARCHIVE_ACTION_LOG
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."ARCHIVE_ACTION_LOG" 
   (	"USER_ID" NUMBER, 
	"DATE_TIME_STAMP" DATE, 
	"RTAG_ID" NUMBER, 
	"DESCRIPTION" VARCHAR2(4000 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."ARCHIVE_ACTION_LOG" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ARCHIVE_ACTION_LOG" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ARCHIVE_ACTION_LOG" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table ARCHIVE_DATA
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."ARCHIVE_DATA" 
   (	"RTAG_ID" NUMBER(*,0), 
	"PV_ID" NUMBER(*,0)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."ARCHIVE_DATA" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ARCHIVE_DATA" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ARCHIVE_DATA" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table AUTOBUILD_FAILURE
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."AUTOBUILD_FAILURE" 
   (	"GROUP_EMAIL_ID" NUMBER, 
	"PROJ_ID" NUMBER, 
	"VIEW_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."AUTOBUILD_FAILURE" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."AUTOBUILD_FAILURE" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."AUTOBUILD_FAILURE" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."AUTOBUILD_FAILURE" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table BLAT_PROJECTS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BLAT_PROJECTS" 
   (	"BLAT_ID" NUMBER, 
	"PROJ_ID" NUMBER, 
	"BP_ENABLED" CHAR(1 BYTE) DEFAULT 'Y'
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_PROJECTS"."BLAT_ID" IS 'Ref into BLAT_SERVERS';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_PROJECTS"."PROJ_ID" IS 'Transfer entire project';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_PROJECTS"."BP_ENABLED" IS 'y: Enabled';
--------------------------------------------------------
--  DDL for Table BLAT_RELEASES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BLAT_RELEASES" 
   (	"BLAT_ID" NUMBER, 
	"RTAG_ID" NUMBER, 
	"BR_ENABLED" CHAR(1 BYTE) DEFAULT 'Y', 
	"BR_EXCLUDE" CHAR(1 BYTE) DEFAULT 'N'
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_RELEASES"."BLAT_ID" IS 'Ref into BLAT_SERVERS';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_RELEASES"."RTAG_ID" IS 'RTAG_ID to transfer';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_RELEASES"."BR_ENABLED" IS 'y:Enabled';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_RELEASES"."BR_EXCLUDE" IS 'N:Include, else Exclude';
--------------------------------------------------------
--  DDL for Table BLAT_SERVERS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BLAT_SERVERS" 
   (	"BLAT_ID" NUMBER, 
	"BLAT_SERVER_NAME" NVARCHAR2(100), 
	"BLAT_DISPLAY_NAME" VARCHAR2(20 BYTE), 
	"BLAT_DESCRIPTION" VARCHAR2(1000 BYTE), 
	"BLAT_ENABLE" CHAR(1 BYTE) DEFAULT 'Y', 
	"BLAT_MODE" CHAR(1 BYTE) DEFAULT 'N', 
	"BLAT_TIMESTAMP" TIMESTAMP (6), 
	"BLAT_SEQNUM" NUMBER DEFAULT 0
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_SERVERS"."BLAT_ID" IS 'Unique ID';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_SERVERS"."BLAT_SERVER_NAME" IS 'Name of the Blat server';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_SERVERS"."BLAT_DISPLAY_NAME" IS 'Name displayed to the user';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_SERVERS"."BLAT_DESCRIPTION" IS 'A field of comments';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_SERVERS"."BLAT_ENABLE" IS 'Y:Enabled';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_SERVERS"."BLAT_MODE" IS 'n:Normal, p:All Projects, E: Entire Archive';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_SERVERS"."BLAT_TIMESTAMP" IS 'Time of config chnage';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BLAT_SERVERS"."BLAT_SEQNUM" IS 'Indicated config has changed';
--------------------------------------------------------
--  DDL for Table BUILD_ENVIRONMENTS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BUILD_ENVIRONMENTS" 
   (	"BE_ID" NUMBER, 
	"BE_NAME" VARCHAR2(255 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_ENVIRONMENTS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_ENVIRONMENTS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_ENVIRONMENTS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_ENVIRONMENTS" TO "RELEASE_MANAGER_READ";
  GRANT UPDATE ON "RELEASE_MANAGER"."BUILD_ENVIRONMENTS" TO "DEPLOYMENT_MANAGER";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_ENVIRONMENTS" TO "DEPLOYMENT_MANAGER";
  GRANT INSERT ON "RELEASE_MANAGER"."BUILD_ENVIRONMENTS" TO "DEPLOYMENT_MANAGER";
  GRANT DELETE ON "RELEASE_MANAGER"."BUILD_ENVIRONMENTS" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table BUILD_ENV_DOCUMENTS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BUILD_ENV_DOCUMENTS" 
   (	"BE_ID" NUMBER, 
	"DOC_NUM" VARCHAR2(255 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_ENV_DOCUMENTS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_ENV_DOCUMENTS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_ENV_DOCUMENTS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_ENV_DOCUMENTS" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table BUILD_INSTANCES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BUILD_INSTANCES" 
   (	"BUILD_ID" NUMBER, 
	"RTAG_ID" NUMBER, 
	"PV_ID" NUMBER, 
	"TIMESTAMP" TIMESTAMP (6) DEFAULT CURRENT_TIMESTAMP, 
	"REASON" CHAR(1 BYTE), 
	"STATE" CHAR(1 BYTE) DEFAULT 'B', 
	"BUILD_REF" VARCHAR2(50 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_INSTANCES"."BUILD_ID" IS 'Unique. Auto generated when row is created.';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_INSTANCES"."RTAG_ID" IS 'Link the build to a Release';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_INSTANCES"."PV_ID" IS 'Link the build to a Package';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_INSTANCES"."TIMESTAMP" IS 'When the instance is created';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_INSTANCES"."REASON" IS 'Reason for the build. Ripple(''R''), Test(''T''), NewVersion(''N''), Restore(''P''), ForcedRipple(''F'')';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_INSTANCES"."STATE" IS 'Result of the build. ''B'', ''Buiding'', ''C'', ''Complete'', ''E'', ''Error'', ''S'', ''SysErr''';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_INSTANCES"."BUILD_REF" IS 'Used to locate build logs';
--------------------------------------------------------
--  DDL for Table BUILD_INSTANCE_PLATFORMS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BUILD_INSTANCE_PLATFORMS" 
   (	"BUILD_ID" NUMBER, 
	"BP_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_INSTANCE_PLATFORMS"."BUILD_ID" IS 'Associated Build Instance';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_INSTANCE_PLATFORMS"."BP_ID" IS 'Associated Build Platform';
   COMMENT ON TABLE "RELEASE_MANAGER"."BUILD_INSTANCE_PLATFORMS"  IS 'Platforms that the build instance were built for.This will be a subset of those it can be built for.';
--------------------------------------------------------
--  DDL for Table BUILD_MACHINES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BUILD_MACHINES" 
   (	"BM_ID" NUMBER, 
	"BM_NAME" VARCHAR2(20 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_MACHINES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_MACHINES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_MACHINES" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_MACHINES" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table BUILD_MACHINE_CONFIG
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BUILD_MACHINE_CONFIG" 
   (	"BMCON_ID" NUMBER, 
	"DISPLAY_NAME" VARCHAR2(50 BYTE), 
	"MACHINE_HOSTNAME" VARCHAR2(50 BYTE), 
	"DESCRIPTION" VARCHAR2(512 BYTE), 
	"GBE_ID" NUMBER, 
	"ACTIVE" CHAR(1 BYTE) DEFAULT 'Y'
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_MACHINE_CONFIG"."ACTIVE" IS 'Allows user to select deamon, otherwise its not shown unless already in use.';
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_MACHINE_CONFIG" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_MACHINE_CONFIG" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_MACHINE_CONFIG" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_MACHINE_CONFIG" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table BUILD_ORDER
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BUILD_ORDER" 
   (	"RTAG_ID" NUMBER, 
	"STEP_NUM" NUMBER, 
	"PV_ID" NUMBER, 
	"UNRESOLVED" CHAR(1 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 2097152 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_ORDER" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_ORDER" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_ORDER" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_ORDER" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table BUILD_PLAN
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BUILD_PLAN" 
   (	"RTAG_ID" NUMBER, 
	"BUILD_ORDER" NUMBER, 
	"PV_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_PLAN"."RTAG_ID" IS 'Identify target Release';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_PLAN"."BUILD_ORDER" IS 'Sequence for build';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_PLAN"."PV_ID" IS 'Package to build';
--------------------------------------------------------
--  DDL for Table BUILD_PLATFORMS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BUILD_PLATFORMS" 
   (	"BP_ID" NUMBER, 
	"BP_NAME" VARCHAR2(50 BYTE), 
	"BP_ACTIVE" CHAR(1 BYTE) DEFAULT 'Y', 
	"BP_DESCRIPTION" VARCHAR2(1000 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_PLATFORMS"."BP_ID" IS 'Build Platform Id';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_PLATFORMS"."BP_NAME" IS 'Name of the platform';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_PLATFORMS"."BP_ACTIVE" IS 'Platform availbale to be configured';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_PLATFORMS"."BP_DESCRIPTION" IS 'Description of the platform';
--------------------------------------------------------
--  DDL for Table BUILD_PLATFORMS_CONFIG
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG" 
   (	"BP_ID" NUMBER, 
	"GBE_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG"."BP_ID" IS 'Link into BUILD_PLATFORMS';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG"."GBE_ID" IS 'Link to GBE_MACHTYPE';
   COMMENT ON TABLE "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG"  IS 'This table controls which BUILD_PLATFORMS can be assigned to a GBE_MACHTYPE';
--------------------------------------------------------
--  DDL for Table BUILD_PLATFORMS_CONFIG2
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG2" 
   (	"BP_ID" NUMBER, 
	"BMCON_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG2"."BP_ID" IS 'Link to BUILD_PLATFORMS';
   COMMENT ON COLUMN "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG2"."BMCON_ID" IS 'Link to BUILD_MACHINE_CONFIG';
   COMMENT ON TABLE "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG2"  IS 'Define the PLATFORMS that are available on a specific BUILD_MACHINE';
--------------------------------------------------------
--  DDL for Table BUILD_SERVICE_CONFIG
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BUILD_SERVICE_CONFIG" 
   (	"SERVICE" VARCHAR2(50 BYTE), 
	"CONFIG" VARCHAR2(2000 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_SERVICE_CONFIG" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_SERVICE_CONFIG" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_SERVICE_CONFIG" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_SERVICE_CONFIG" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table BUILD_STANDARDS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BUILD_STANDARDS" 
   (	"BS_ID" NUMBER, 
	"BS_NAME" VARCHAR2(20 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_STANDARDS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_STANDARDS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_STANDARDS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_STANDARDS" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table BUILD_STANDARDS_ADDENDUM
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."BUILD_STANDARDS_ADDENDUM" 
   (	"BSA_ID" NUMBER, 
	"BSA_NAME" VARCHAR2(4000 BYTE), 
	"BS_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_STANDARDS_ADDENDUM" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_STANDARDS_ADDENDUM" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_STANDARDS_ADDENDUM" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."BUILD_STANDARDS_ADDENDUM" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table CODE_REVIEWS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."CODE_REVIEWS" 
   (	"PV_ID" NUMBER, 
	"DATE_OF_REVIEW" DATE, 
	"TIME_SPENT" FLOAT(126), 
	"REVIEW_REASON" VARCHAR2(4000 BYTE), 
	"RTEAM_DOMAIN_EXPERT" VARCHAR2(4000 BYTE), 
	"RTEAM_LANGUAGE_EXPERT" VARCHAR2(4000 BYTE), 
	"RTEAM_PEER_DEVELOPER" VARCHAR2(4000 BYTE), 
	"RTEAM_AUTHOR" VARCHAR2(4000 BYTE), 
	"FILES_REVIEWED" VARCHAR2(4000 BYTE), 
	"REVIEW_RESULTS" NUMBER, 
	"ISSUES_RAISED" VARCHAR2(4000 BYTE), 
	"REVIEW_COMMENTS" VARCHAR2(4000 BYTE), 
	"FNC_S_MEETS_FUNCTIONALITY" CHAR(1 BYTE), 
	"FNC_C_MEETS_FUNCTIONALITY" VARCHAR2(4000 BYTE), 
	"RBS_S_BOUND_COND_HANDLED" CHAR(1 BYTE), 
	"RBS_C_BOUND_COND_HANDLED" VARCHAR2(4000 BYTE), 
	"RBS_S_CLASS_INTERF_PRECOND" CHAR(1 BYTE), 
	"RBS_C_CLASS_INTERF_PRECOND" VARCHAR2(4000 BYTE), 
	"RBS_S_NO_UNITIALISED_DATE" CHAR(1 BYTE), 
	"RBS_C_NO_UNITIALISED_DATE" VARCHAR2(4000 BYTE), 
	"RBS_S_EXCEP_HANDING" CHAR(1 BYTE), 
	"RBS_C_EXCEP_HANDING" VARCHAR2(4000 BYTE), 
	"RBS_S_RESOURCE_MNG" CHAR(1 BYTE), 
	"RBS_C_RESOURCE_MNG" VARCHAR2(4000 BYTE), 
	"RBS_S_TRANS_COMPLET" CHAR(1 BYTE), 
	"RBS_C_TRANS_COMPLET" VARCHAR2(4000 BYTE), 
	"RBS_S_THREADSAFETY" CHAR(1 BYTE), 
	"RBS_C_THREADSAFETY" VARCHAR2(4000 BYTE), 
	"RBS_S_RET_VALS" CHAR(1 BYTE), 
	"RBS_C_RET_VALS" VARCHAR2(4000 BYTE), 
	"RBS_S_CORR_ERR_HANDLING" CHAR(1 BYTE), 
	"RBS_C_CORR_ERR_HANDLING" VARCHAR2(4000 BYTE), 
	"RBS_S_SQL_STD" CHAR(1 BYTE), 
	"RBS_C_SQL_STD" VARCHAR2(4000 BYTE), 
	"MNT_S_EXT_REF" CHAR(1 BYTE), 
	"MNT_C_EXT_REF" VARCHAR2(4000 BYTE), 
	"MNT_S_CLASS_SIZE" CHAR(1 BYTE), 
	"MNT_C_CLASS_SIZE" VARCHAR2(4000 BYTE), 
	"MNT_S_METHOD_SIZE" CHAR(1 BYTE), 
	"MNT_C_METHOD_SIZE" VARCHAR2(4000 BYTE), 
	"MNT_S_APPROP_COMM" CHAR(1 BYTE), 
	"MNT_C_APPROP_COMM" VARCHAR2(4000 BYTE), 
	"MNT_S_IDENT_NAME_STD" CHAR(1 BYTE), 
	"MNT_C_IDENT_NAME_STD" VARCHAR2(4000 BYTE), 
	"MNT_S_SWITCH_HAVE_DEFAULTS" CHAR(1 BYTE), 
	"MNT_C_SWITCH_HAVE_DEFAULTS" VARCHAR2(4000 BYTE), 
	"MNT_S_NO_LIT_NUM" CHAR(1 BYTE), 
	"MNT_C_NO_LIT_NUM" VARCHAR2(4000 BYTE), 
	"MNT_S_NO_DEAD_CODE" CHAR(1 BYTE), 
	"MNT_C_NO_DEAD_CODE" VARCHAR2(4000 BYTE), 
	"DEI_S_STD_DES_PATT" CHAR(1 BYTE), 
	"DEI_C_STD_DES_PATT" VARCHAR2(4000 BYTE), 
	"DEI_S_APPROP_ALGOR" CHAR(1 BYTE), 
	"DEI_C_APPROP_ALGOR" VARCHAR2(4000 BYTE), 
	"DEI_S_APPROP_OBJ" CHAR(1 BYTE), 
	"DEI_C_APPROP_OBJ" VARCHAR2(4000 BYTE), 
	"DEI_S_APPROP_ERR_MSG" CHAR(1 BYTE), 
	"DEI_C_APPROP_ERR_MSG" VARCHAR2(4000 BYTE), 
	"DEI_S_STD_FRAMEW_COMP" CHAR(1 BYTE), 
	"DEI_C_STD_FRAMEW_COMP" VARCHAR2(4000 BYTE), 
	"DEI_S_APPROP_LOGGING" CHAR(1 BYTE), 
	"DEI_C_APPROP_LOGGING" VARCHAR2(4000 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 524288 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."CODE_REVIEWS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CODE_REVIEWS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CODE_REVIEWS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CODE_REVIEWS" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table CODE_REVIEW_URL
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."CODE_REVIEW_URL" 
   (	"CR_ID" NUMBER, 
	"PV_ID" NUMBER, 
	"PROJ_ID" NUMBER, 
	"URL" VARCHAR2(4000 BYTE), 
	"REASON" VARCHAR2(4000 BYTE), 
	"DATE_OF_REVIEW" DATE, 
	"LAST_MODIFIED" DATE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 983040 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."CODE_REVIEW_URL" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CODE_REVIEW_URL" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CODE_REVIEW_URL" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table CQ_HISTORY
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."CQ_HISTORY" 
   (	"DBID" NUMBER(10,0), 
	"ENTITY_DBID" NUMBER(10,0), 
	"ENTITYDEF_ID" NUMBER(10,0), 
	"ENTITYDEF_NAME" VARCHAR2(30 CHAR), 
	"ACTION_TIMESTAMP" DATE, 
	"USER_NAME" VARCHAR2(30 CHAR), 
	"ACTION_NAME" VARCHAR2(30 CHAR), 
	"OLD_STATE" VARCHAR2(30 CHAR), 
	"NEW_STATE" VARCHAR2(30 CHAR), 
	"EXPIRED_TIMESTAMP" DATE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_HISTORY" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_HISTORY" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_HISTORY" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_HISTORY" TO "DEPLOYMENT_MANAGER";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_HISTORY" TO "ACCESS_MANAGER";
--------------------------------------------------------
--  DDL for Table CQ_ISSUES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."CQ_ISSUES" 
   (	"PV_ID" NUMBER, 
	"ISS_DB" NUMBER, 
	"ISS_ID" NUMBER, 
	"ISS_STATE" NUMBER, 
	"MOD_DATE" DATE, 
	"NOTES" VARCHAR2(255 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 4194304 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_ISSUES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_ISSUES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_ISSUES" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_ISSUES" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_ISSUES" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table CQ_SOFTWARE_ISSUE
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE" 
   (	"RATL_MASTERSHIP" NUMBER(10,0), 
	"DBID" NUMBER(10,0), 
	"IS_ACTIVE" NUMBER(10,0), 
	"ID" VARCHAR2(13 CHAR), 
	"STATE" NUMBER(10,0), 
	"VERSION" NUMBER(10,0), 
	"LOCK_VERSION" NUMBER(10,0), 
	"LOCKED_BY" NUMBER(10,0), 
	"IS_DUPLICATE" NUMBER(10,0), 
	"UNDUPLICATE_STATE" VARCHAR2(50 CHAR), 
	"HEADLINE" VARCHAR2(150 CHAR), 
	"DESCRIPTION" CLOB, 
	"PRIORITY" VARCHAR2(50 CHAR), 
	"SUBMITTER" NUMBER(10,0), 
	"SUBMIT_DATE" DATE, 
	"OWNER" NUMBER(10,0), 
	"APPROVER" NUMBER(10,0), 
	"NOTE_ENTRY" CLOB, 
	"NOTES_LOG" CLOB, 
	"RESOLUTION_DATE" DATE, 
	"ISSUE_TYPE" VARCHAR2(50 CHAR), 
	"PACKAGE_REF" VARCHAR2(50 CHAR), 
	"SOLUTION_APPROVED_DATE" DATE, 
	"CLOSE_DATE" DATE, 
	"BUILD_NUMBER" VARCHAR2(50 CHAR), 
	"NEW_NUM" VARCHAR2(50 CHAR), 
	"FOR_INFORMATION" CLOB, 
	"PROP_SOL_DATE" DATE, 
	"ARTIFACTS_TO_BE_UPDATED_1" CLOB, 
	"ISSUE_ID" NUMBER(10,0), 
	"SOLUTION_DATE" DATE, 
	"KPI_SOLUTION_DATE" DATE, 
	"TITLE" VARCHAR2(80 CHAR), 
	"PROJECT" VARCHAR2(50 CHAR), 
	"ORIGINATING_AREA" VARCHAR2(50 CHAR), 
	"ESTIMATED_TIME_INHOURS" NUMBER(10,0), 
	"RELEASE_PART1" NUMBER(10,0), 
	"RELEASE_PART2" NUMBER(10,0), 
	"RELEASE_PART3" NUMBER(10,0), 
	"SOLUTION_RELEASE_PART1" NUMBER(10,0), 
	"SOLUTION_RELEASE_PART2" NUMBER(10,0), 
	"SOLUTION_RELEASE_PART3" NUMBER(10,0), 
	"ORIGINAL_IMPLEMENT_DATE" DATE, 
	"ISSUE_LABEL" VARCHAR2(50 CHAR), 
	"PRODUCT" VARCHAR2(50 CHAR), 
	"ORIGIN" VARCHAR2(50 CHAR), 
	"CLONE_NOTE" CLOB, 
	"SOLUTION_LABEL" VARCHAR2(50 CHAR), 
	"REQUIRED_BY" DATE, 
	"ITERATION_AFFECTED" VARCHAR2(50 CHAR), 
	"MERGE_OLD_ID" VARCHAR2(150 CHAR), 
	"COMMENTS" CLOB, 
	"CHANGE_CONTROL" VARCHAR2(50 CHAR), 
	"MERGE_COMMENTS" CLOB, 
	"MERGE_CHANGE_CONTROL" VARCHAR2(50 CHAR), 
	"AWAITING_INFO_DESC" CLOB, 
	"REQUEST_CLOSE_DESC" CLOB, 
	"ROOT_CAUSE" VARCHAR2(50 CHAR), 
	"FLAGA" VARCHAR2(50 CHAR), 
	"FLAGB" VARCHAR2(50 CHAR), 
	"FLAGC" VARCHAR2(50 CHAR), 
	"SCHEDULED_RELEASE" VARCHAR2(60 CHAR), 
	"SEVERITY" VARCHAR2(50 CHAR), 
	"CUSTOM_FIELD_01" CLOB, 
	"CUSTOM_FIELD_02" CLOB, 
	"CUSTOM_FIELD_03" CLOB, 
	"CUSTOMER_REFERENCE" VARCHAR2(254 CHAR), 
	"TEAMLEADER" NUMBER(10,0), 
	"WIP" CLOB, 
	"RELEASEINFO" CLOB, 
	"SBOM" VARCHAR2(254 CHAR), 
	"NEW_EXTERNAL_NOTE" CLOB, 
	"EXTERNAL_NOTE_LOG" CLOB, 
	"CUSTOMER_REFERENCE_2" VARCHAR2(50 CHAR), 
	"CUSTOMER_REFERENCE_3" VARCHAR2(50 CHAR), 
	"CUSTOMER_REFERENCE_4" VARCHAR2(50 CHAR), 
	"CUSTOMER_REFERENCE_5" VARCHAR2(50 CHAR), 
	"TEST_CASES" CLOB, 
	"INTEGRATION_NOTES" CLOB, 
	"UPDATED_DESIGN_NOTES" VARCHAR2(50 CHAR), 
	"RELATED_DATABASE_PATCHES" VARCHAR2(50 CHAR), 
	"AFFECTED_PACKAGES" VARCHAR2(50 CHAR), 
	"CODEREVIEW_REFERENCE" CLOB, 
	"RISK" VARCHAR2(50 CHAR), 
	"DEPENDANT_DEVIS" VARCHAR2(50 CHAR), 
	"CUSTOM_FIELD_04" CLOB, 
	"CUSTOM_FIELD_05" CLOB, 
	"ITERATION_FOUND" VARCHAR2(50 CHAR)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" 
 LOB ("DESCRIPTION") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("NOTE_ENTRY") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("NOTES_LOG") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("FOR_INFORMATION") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("ARTIFACTS_TO_BE_UPDATED_1") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("CLONE_NOTE") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("COMMENTS") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("MERGE_COMMENTS") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("AWAITING_INFO_DESC") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("REQUEST_CLOSE_DESC") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("CUSTOM_FIELD_01") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("CUSTOM_FIELD_02") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("CUSTOM_FIELD_03") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("WIP") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("RELEASEINFO") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("NEW_EXTERNAL_NOTE") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("EXTERNAL_NOTE_LOG") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("TEST_CASES") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("INTEGRATION_NOTES") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("CODEREVIEW_REFERENCE") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("CUSTOM_FIELD_04") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) 
 LOB ("CUSTOM_FIELD_05") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE" TO "DEPLOYMENT_MANAGER";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE" TO "ACCESS_MANAGER";
--------------------------------------------------------
--  DDL for Table CQ_STATEDEF
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."CQ_STATEDEF" 
   (	"ID" NUMBER(10,0), 
	"PACKAGE_OWNERSHIP" NUMBER(10,0), 
	"NAME" VARCHAR2(255 CHAR), 
	"ENTITYDEF_ID" NUMBER(10,0), 
	"ORDINAL" NUMBER(10,0)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_STATEDEF" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_STATEDEF" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_STATEDEF" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_STATEDEF" TO "DEPLOYMENT_MANAGER";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_STATEDEF" TO "ACCESS_MANAGER";
--------------------------------------------------------
--  DDL for Table CQ_USERS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."CQ_USERS" 
   (	"DBID" VARCHAR2(8 BYTE), 
	"LOGIN_NAME" VARCHAR2(17 BYTE), 
	"FULLNAME" VARCHAR2(30 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_USERS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_USERS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_USERS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_USERS" TO "DEPLOYMENT_MANAGER";
  GRANT SELECT ON "RELEASE_MANAGER"."CQ_USERS" TO "ACCESS_MANAGER";
--------------------------------------------------------
--  DDL for Table DAEMON_ACTION_LOG
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."DAEMON_ACTION_LOG" 
   (	"USER_ID" NUMBER, 
	"ACTION_DATETIME" DATE, 
	"RCON_ID" NUMBER, 
	"DESCRIPTION" VARCHAR2(4000 BYTE), 
	"ACTTYPE_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."DAEMON_ACTION_LOG" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."DAEMON_ACTION_LOG" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."DAEMON_ACTION_LOG" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table DAEMON_INSTRUCTIONS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS" 
   (	"DAEMON_INSTRUCTIONS_ID" NUMBER, 
	"OP_CODE" NUMBER(*,0), 
	"RTAG_ID" NUMBER, 
	"PV_ID" NUMBER, 
	"SCHEDULED_DATETIME" DATE, 
	"REPEAT_SECS" NUMBER(*,0), 
	"ADDED_DATETIME" DATE, 
	"USER_ID" NUMBER, 
	"IN_PROGRESS" CHAR(1 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS"."OP_CODE" IS 'The instruction op-code';
   COMMENT ON COLUMN "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS"."SCHEDULED_DATETIME" IS 'The datetime after which the instruction can be carried out.';
   COMMENT ON COLUMN "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS"."REPEAT_SECS" IS 'The number of seconds to add to scheduled_datetime when instruction is repeating';
   COMMENT ON COLUMN "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS"."ADDED_DATETIME" IS 'The datetime the instruction was added to the table - informational only';
   COMMENT ON COLUMN "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS"."USER_ID" IS 'The user who added the instruction to the table  - informational only';
  GRANT SELECT ON "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table DASH_BOARD
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."DASH_BOARD" 
   (	"PROJ_ID" NUMBER, 
	"RTAG_ID" NUMBER, 
	"LAST_BUILD_TIME" DATE, 
	"AUTOMATED_PACKAGES" NUMBER, 
	"TOTAL_PACKAGES" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."DASH_BOARD" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."DASH_BOARD" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."DASH_BOARD" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table DEPRECATED_PACKAGES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."DEPRECATED_PACKAGES" 
   (	"RTAG_ID" NUMBER, 
	"PKG_ID" NUMBER, 
	"COMMENTS" VARCHAR2(4000 BYTE), 
	"V_EXT" VARCHAR2(50 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."DEPRECATED_PACKAGES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."DEPRECATED_PACKAGES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."DEPRECATED_PACKAGES" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table DO_NOT_RIPPLE
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."DO_NOT_RIPPLE" 
   (	"RTAG_ID" NUMBER, 
	"PV_ID" NUMBER, 
	"ROOT_PV_ID" NUMBER, 
	"ROOT_CAUSE" VARCHAR2(50 BYTE), 
	"ROOT_FILE" VARCHAR2(100 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 655360 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."DO_NOT_RIPPLE" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."DO_NOT_RIPPLE" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."DO_NOT_RIPPLE" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."DO_NOT_RIPPLE" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."DO_NOT_RIPPLE" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table GBE_MACHTYPE
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."GBE_MACHTYPE" 
   (	"GBE_ID" NUMBER, 
	"GBE_VALUE" VARCHAR2(20 BYTE), 
	"BM_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."GBE_MACHTYPE" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."GBE_MACHTYPE" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."GBE_MACHTYPE" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."GBE_MACHTYPE" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table IGNORE_WARNINGS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."IGNORE_WARNINGS" 
   (	"RTAG_ID" NUMBER, 
	"PV_ID" NUMBER, 
	"DPV_ID" NUMBER, 
	"IS_PATCH_IGNORE" CHAR(1 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 3145728 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."IGNORE_WARNINGS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."IGNORE_WARNINGS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."IGNORE_WARNINGS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."IGNORE_WARNINGS" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table JIRA_ISSUES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."JIRA_ISSUES" 
   (	"PV_ID" NUMBER, 
	"ISS_KEY" VARCHAR2(4000 BYTE), 
	"DATE_TIME_STAMP" DATE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 262144 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."JIRA_ISSUES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."JIRA_ISSUES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."JIRA_ISSUES" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."JIRA_ISSUES" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."JIRA_ISSUES" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table LICENCES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."LICENCES" 
   (	"LICENCE" NUMBER, 
	"NAME" VARCHAR2(50 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."LICENCES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."LICENCES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."LICENCES" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table LICENCING
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."LICENCING" 
   (	"PV_ID" NUMBER, 
	"LICENCE" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."LICENCING" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."LICENCING" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."LICENCING" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table LXR_STATE
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."LXR_STATE" 
   (	"RTAG_ID" NUMBER, 
	"LXRSERVER" CHAR(1 BYTE) DEFAULT 'N'
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."LXR_STATE"."RTAG_ID" IS 'Link to Release_Tags';
   COMMENT ON COLUMN "RELEASE_MANAGER"."LXR_STATE"."LXRSERVER" IS 'Written by server - I:Indexed, C:Closing, N:Not Known. May be InProgress.';
   COMMENT ON TABLE "RELEASE_MANAGER"."LXR_STATE"  IS 'Contains data updated by the LXR server.
This table is writable by a user known to the LXR Server';
  GRANT UPDATE ON "RELEASE_MANAGER"."LXR_STATE" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."LXR_STATE" TO "RM_READONLY";
  GRANT INSERT ON "RELEASE_MANAGER"."LXR_STATE" TO "RM_READONLY";
  GRANT DELETE ON "RELEASE_MANAGER"."LXR_STATE" TO "RM_READONLY";
  GRANT ALTER ON "RELEASE_MANAGER"."LXR_STATE" TO "RM_READONLY";
--------------------------------------------------------
--  DDL for Table MEMBERS_GROUP
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."MEMBERS_GROUP" 
   (	"GROUP_EMAIL_ID" NUMBER, 
	"USER_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."MEMBERS_GROUP" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."MEMBERS_GROUP" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."MEMBERS_GROUP" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."MEMBERS_GROUP" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table MESSAGE_BOARD
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."MESSAGE_BOARD" 
   (	"MSG_ID" NUMBER, 
	"MSG_DETAILS" VARCHAR2(2000 BYTE), 
	"SUBMITION_DATE" DATE, 
	"EXPIRY_DATE" DATE, 
	"DUE_DATE" DATE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."MESSAGE_BOARD" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."MESSAGE_BOARD" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."MESSAGE_BOARD" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."MESSAGE_BOARD" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table MICROSOFTDTPROPERTIES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."MICROSOFTDTPROPERTIES" 
   (	"ID" NUMBER, 
	"OBJECTID" NUMBER, 
	"PROPERTY" VARCHAR2(64 BYTE), 
	"VALUE" VARCHAR2(255 BYTE), 
	"LVALUE" LONG RAW, 
	"VERSION" NUMBER DEFAULT (0)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."MICROSOFTDTPROPERTIES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."MICROSOFTDTPROPERTIES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."MICROSOFTDTPROPERTIES" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."MICROSOFTDTPROPERTIES" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table NOTE_MANAGER
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."NOTE_MANAGER" 
   (	"NID" VARCHAR2(30 BYTE), 
	"LAST_USER" VARCHAR2(20 BYTE), 
	"LAST_DATE" DATE, 
	"DESCRIPTION" VARCHAR2(4000 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."NOTE_MANAGER" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."NOTE_MANAGER" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."NOTE_MANAGER" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."NOTE_MANAGER" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table NOTIFICATION_HISTORY
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."NOTIFICATION_HISTORY" 
   (	"RTAG_ID" NUMBER, 
	"PV_ID" NUMBER, 
	"USER_ID" NUMBER, 
	"DATE_TIME_STAMP" DATE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 2097152 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."NOTIFICATION_HISTORY" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."NOTIFICATION_HISTORY" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."NOTIFICATION_HISTORY" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."NOTIFICATION_HISTORY" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table PACKAGES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PACKAGES" 
   (	"PKG_ID" NUMBER, 
	"PKG_NAME" VARCHAR2(255 BYTE), 
	"SUNOS_ELECTRONIC_NAME" VARCHAR2(255 BYTE), 
	"WIN_ELECTRONIC_NAME" VARCHAR2(255 BYTE), 
	"DEFAULT_PEGGED" CHAR(1 BYTE), 
	"DEFAULT_ADVISORY_RIPPLE" CHAR(1 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 196608 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."PACKAGES"."DEFAULT_PEGGED" IS 'Default pegged state for packages that are added to a release.';
   COMMENT ON COLUMN "RELEASE_MANAGER"."PACKAGES"."DEFAULT_ADVISORY_RIPPLE" IS 'Default advisiory ripple state for packages that are added to a release.';
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGES" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGES" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGES" TO "DEPLOYMENT_MANAGER_READ";
  GRANT UPDATE ON "RELEASE_MANAGER"."PACKAGES" TO "DEPLOYMENT_MANAGER";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGES" TO "DEPLOYMENT_MANAGER";
  GRANT INSERT ON "RELEASE_MANAGER"."PACKAGES" TO "DEPLOYMENT_MANAGER";
  GRANT DELETE ON "RELEASE_MANAGER"."PACKAGES" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table PACKAGE_BUILD_ENV
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PACKAGE_BUILD_ENV" 
   (	"PV_ID" NUMBER, 
	"BE_ID" NUMBER, 
	"BUILD_TYPE" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 5242880 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_BUILD_ENV" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_BUILD_ENV" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_BUILD_ENV" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_BUILD_ENV" TO "RELEASE_MANAGER_READ";
  GRANT UPDATE ON "RELEASE_MANAGER"."PACKAGE_BUILD_ENV" TO "DEPLOYMENT_MANAGER";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_BUILD_ENV" TO "DEPLOYMENT_MANAGER";
  GRANT INSERT ON "RELEASE_MANAGER"."PACKAGE_BUILD_ENV" TO "DEPLOYMENT_MANAGER";
  GRANT DELETE ON "RELEASE_MANAGER"."PACKAGE_BUILD_ENV" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table PACKAGE_BUILD_INFO
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PACKAGE_BUILD_INFO" 
   (	"PV_ID" NUMBER, 
	"BM_ID" NUMBER, 
	"BSA_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 5242880 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_BUILD_INFO" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_BUILD_INFO" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_BUILD_INFO" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_BUILD_INFO" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table PACKAGE_DEPENDENCIES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES" 
   (	"PV_ID" NUMBER, 
	"DPV_ID" NUMBER, 
	"PKG_ID" NUMBER, 
	"DPKG_ID" NUMBER, 
	"BUILD_TYPE" CHAR(1 BYTE), 
	"DISPLAY_ORDER" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 100663296 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES"."PV_ID" IS 'Package Version Identifier';
   COMMENT ON COLUMN "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES"."DPV_ID" IS 'Depends on this package version';
   COMMENT ON COLUMN "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES"."BUILD_TYPE" IS 'B:BuildPkgArchive, L:LinkPkgArchive';
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table PACKAGE_DOCUMENTS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PACKAGE_DOCUMENTS" 
   (	"PV_ID" NUMBER, 
	"TEST_ID" NUMBER, 
	"DOC_ID" NUMBER, 
	"DOC_NUM" VARCHAR2(50 BYTE), 
	"IS_LATEST" CHAR(1 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 2097152 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_DOCUMENTS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_DOCUMENTS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_DOCUMENTS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_DOCUMENTS" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table PACKAGE_INTEREST
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PACKAGE_INTEREST" 
   (	"PKG_ID" NUMBER, 
	"PROJ_ID" NUMBER, 
	"USER_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_INTEREST" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_INTEREST" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_INTEREST" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table PACKAGE_METRICS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PACKAGE_METRICS" 
   (	"PV_ID" NUMBER, 
	"BRANCHES" NUMBER, 
	"BRANCH_LIST" VARCHAR2(4000 BYTE), 
	"CODE_FILES" NUMBER, 
	"IGNORED_FILES" NUMBER, 
	"DIRECTORIES" NUMBER, 
	"DIRECTORY_DEPTH" NUMBER, 
	"TOTAL_FILES" NUMBER, 
	"MAKEFILES" NUMBER, 
	"BLANK_LINES" NUMBER, 
	"CODE_LINES" NUMBER, 
	"COMMENT_LINES" NUMBER, 
	"CREATED_STAMP" DATE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 12582912 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_METRICS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_METRICS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_METRICS" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table PACKAGE_PATCHES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PACKAGE_PATCHES" 
   (	"PV_ID" NUMBER, 
	"PATCH_ID" NUMBER, 
	"INSTALL_ORDER" NUMBER, 
	"PATCH_OBSOLETED_BY" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 327680 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_PATCHES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_PATCHES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_PATCHES" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_PATCHES" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_PATCHES" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table PACKAGE_PROCESSES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PACKAGE_PROCESSES" 
   (	"PV_ID" NUMBER, 
	"PROC_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_PROCESSES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_PROCESSES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_PROCESSES" TO "DM_READONLY";
  GRANT UPDATE ON "RELEASE_MANAGER"."PACKAGE_PROCESSES" TO "DEPLOYMENT_MANAGER";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_PROCESSES" TO "DEPLOYMENT_MANAGER";
  GRANT INSERT ON "RELEASE_MANAGER"."PACKAGE_PROCESSES" TO "DEPLOYMENT_MANAGER";
  GRANT DELETE ON "RELEASE_MANAGER"."PACKAGE_PROCESSES" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table PACKAGE_VERSIONS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PACKAGE_VERSIONS" 
   (	"PV_ID" NUMBER, 
	"PKG_ID" NUMBER, 
	"PKG_VERSION" VARCHAR2(50 BYTE), 
	"DLOCKED" CHAR(1 BYTE), 
	"RELEASED_AT" NUMBER, 
	"MODIFIED_STAMP" DATE, 
	"MODIFIER_ID" NUMBER, 
	"CREATED_STAMP" DATE, 
	"CREATOR_ID" NUMBER, 
	"COMMENTS" VARCHAR2(4000 BYTE), 
	"V_MM" VARCHAR2(50 BYTE), 
	"V_NMM" VARCHAR2(50 BYTE), 
	"V_EXT" VARCHAR2(50 BYTE), 
	"PKG_LABEL" VARCHAR2(60 BYTE), 
	"SRC_PATH" VARCHAR2(2000 BYTE), 
	"PV_DESCRIPTION" VARCHAR2(4000 BYTE), 
	"OWNER_ID" NUMBER, 
	"PV_OVERVIEW" VARCHAR2(4000 BYTE), 
	"IS_PATCH" CHAR(1 BYTE), 
	"LAST_PV_ID" NUMBER, 
	"RELEASE_NOTES_INFO" VARCHAR2(1000 BYTE), 
	"IS_DEPLOYABLE" CHAR(1 BYTE), 
	"IS_BUILD_ENV_REQUIRED" CHAR(1 BYTE), 
	"IS_OBSOLETE" CHAR(1 BYTE), 
	"OBSOLETE_COMMENTS" VARCHAR2(4000 BYTE), 
	"BUILD_TYPE" CHAR(1 BYTE), 
	"CHANGE_TYPE" CHAR(1 BYTE), 
	"LINK" VARCHAR2(4000 BYTE), 
	"PATCH_ELECTRONIC_NAME" VARCHAR2(4000 BYTE), 
	"BS_ID" NUMBER, 
	"IS_AUTOBUILDABLE" CHAR(1 BYTE), 
	"SBOM_PRIORITY" CHAR(1 BYTE), 
	"RIPPLE_FIELD" CHAR(1 CHAR), 
	"MAXIMUM_BUILD_TIME" NUMBER, 
	"BUILD_TIME" NUMBER, 
	"MAJOR_LIMIT" NUMBER(10,0), 
	"MINOR_LIMIT" NUMBER(10,0), 
	"PATCH_LIMIT" NUMBER(10,0), 
	"BUILD_NUMBER_LIMIT" NUMBER(10,0), 
	"VCS_TYPE_ID" NUMBER, 
	"PKG_IDEXT" VARCHAR2(70 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 134217728 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."PACKAGE_VERSIONS"."RELEASED_AT" IS 'No longer used';
   COMMENT ON COLUMN "RELEASE_MANAGER"."PACKAGE_VERSIONS"."OWNER_ID" IS 'Copied from previous version. Set on ''Make Pending'' - you touched it you own it.';
   COMMENT ON COLUMN "RELEASE_MANAGER"."PACKAGE_VERSIONS"."IS_DEPLOYABLE" IS 'null:No, NonNull:Yes Y:Yes';
   COMMENT ON COLUMN "RELEASE_MANAGER"."PACKAGE_VERSIONS"."BUILD_TYPE" IS 'A:Auto, M:Manual, U:UnBuildable';
   COMMENT ON COLUMN "RELEASE_MANAGER"."PACKAGE_VERSIONS"."IS_AUTOBUILDABLE" IS 'Y: Indicates that the package has been built on a build machine';
   COMMENT ON COLUMN "RELEASE_MANAGER"."PACKAGE_VERSIONS"."BUILD_TIME" IS 'Duration of last build';
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" TO "RELEASE_MANAGER_READ";
  GRANT UPDATE ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" TO "DEPLOYMENT_MANAGER";
  GRANT SELECT ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" TO "DEPLOYMENT_MANAGER";
  GRANT INSERT ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" TO "DEPLOYMENT_MANAGER";
  GRANT DELETE ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table PACKAGE_VERSION_PLATFORMS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PACKAGE_VERSION_PLATFORMS" 
   (	"PV_ID" NUMBER, 
	"BP_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON TABLE "RELEASE_MANAGER"."PACKAGE_VERSION_PLATFORMS"  IS 'Platforms that the package version can be built for. A given build instance may not be built for all of these.';
--------------------------------------------------------
--  DDL for Table PEGGED_VERSIONS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PEGGED_VERSIONS" 
   (	"RTAG_ID" NUMBER, 
	"PV_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PEGGED_VERSIONS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PEGGED_VERSIONS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PEGGED_VERSIONS" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table PLANNED
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PLANNED" 
   (	"RTAG_ID" NUMBER, 
	"PV_ID" NUMBER, 
	"VIEW_ID" NUMBER, 
	"OPERATION" CHAR(1 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."PLANNED"."OPERATION" IS 'A: Add existing version.

S:Subtract existing Version.

R:Add New Version';
   COMMENT ON TABLE "RELEASE_MANAGER"."PLANNED"  IS 'This table contains WORK IN PROGRESS packages';
  GRANT SELECT ON "RELEASE_MANAGER"."PLANNED" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PLANNED" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PLANNED" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PLANNED" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."PLANNED" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table PLANNED_VERSIONS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PLANNED_VERSIONS" 
   (	"PKG_ID" NUMBER, 
	"PKG_VERSION" VARCHAR2(50 BYTE), 
	"PLANNED_TIME" DATE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PLANNED_VERSIONS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PLANNED_VERSIONS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PLANNED_VERSIONS" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table PLATFORMS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PLATFORMS" 
   (	"CODE" NUMBER, 
	"NAME" VARCHAR2(255 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PLATFORMS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PLATFORMS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PLATFORMS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PLATFORMS" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."PLATFORMS" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table PROCESSES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PROCESSES" 
   (	"PROC_ID" NUMBER, 
	"PROC_NAME" VARCHAR2(255 BYTE), 
	"PROC_DESCRIPTION" VARCHAR2(255 BYTE), 
	"RUN_AS" VARCHAR2(255 BYTE), 
	"PKG_OWNER" VARCHAR2(4000 BYTE), 
	"IS_INTERFACE" CHAR(1 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PROCESSES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PROCESSES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PROCESSES" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PROCESSES" TO "RELEASE_MANAGER_READ";
  GRANT UPDATE ON "RELEASE_MANAGER"."PROCESSES" TO "DEPLOYMENT_MANAGER";
  GRANT SELECT ON "RELEASE_MANAGER"."PROCESSES" TO "DEPLOYMENT_MANAGER";
  GRANT INSERT ON "RELEASE_MANAGER"."PROCESSES" TO "DEPLOYMENT_MANAGER";
  GRANT DELETE ON "RELEASE_MANAGER"."PROCESSES" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table PRODUCT_COMPONENTS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PRODUCT_COMPONENTS" 
   (	"PV_ID" NUMBER, 
	"OS_ID" NUMBER, 
	"FILE_PATH" VARCHAR2(4000 BYTE), 
	"FILE_NAME" VARCHAR2(4000 BYTE), 
	"DESTINATION_PATH" VARCHAR2(4000 BYTE), 
	"BYTE_SIZE" NUMBER, 
	"CRC_CKSUM" VARCHAR2(2000 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 31457280 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PRODUCT_COMPONENTS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PRODUCT_COMPONENTS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PRODUCT_COMPONENTS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PRODUCT_COMPONENTS" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."PRODUCT_COMPONENTS" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table PRODUCT_STATES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PRODUCT_STATES" 
   (	"STATE_ID" NUMBER, 
	"STATE" VARCHAR2(4000 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PRODUCT_STATES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PRODUCT_STATES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PRODUCT_STATES" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table PROJECTS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PROJECTS" 
   (	"PROJ_ID" NUMBER, 
	"PROJ_NAME" VARCHAR2(50 BYTE), 
	"BASE_URL" VARCHAR2(4000 BYTE), 
	"JIRA_KEY" VARCHAR2(16 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECTS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECTS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECTS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECTS" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECTS" TO "DEPLOYMENT_MANAGER_READ";
  GRANT UPDATE ON "RELEASE_MANAGER"."PROJECTS" TO "DEPLOYMENT_MANAGER";
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECTS" TO "DEPLOYMENT_MANAGER";
  GRANT INSERT ON "RELEASE_MANAGER"."PROJECTS" TO "DEPLOYMENT_MANAGER";
  GRANT DELETE ON "RELEASE_MANAGER"."PROJECTS" TO "DEPLOYMENT_MANAGER";
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECTS" TO "ACCESS_MANAGER";
--------------------------------------------------------
--  DDL for Table PROJECT_ACTION_LOG
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PROJECT_ACTION_LOG" 
   (	"USER_ID" NUMBER, 
	"ACTION_DATETIME" DATE, 
	"PROJ_ID" NUMBER, 
	"DESCRIPTION" VARCHAR2(4000 BYTE), 
	"ACTTYPE_ID" NUMBER, 
	"RTAG_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 851968 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECT_ACTION_LOG" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECT_ACTION_LOG" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECT_ACTION_LOG" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECT_ACTION_LOG" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table PROJECT_EXTENTIONS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."PROJECT_EXTENTIONS" 
   (	"PROJ_ID" NUMBER, 
	"EXT_NAME" VARCHAR2(10 BYTE), 
	"UCOMMENT" VARCHAR2(120 BYTE), 
	"IS_VISIBLE" CHAR(1 BYTE) DEFAULT 'Y', 
	"IS_COTS" CHAR(1 BYTE) DEFAULT 'N'
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECT_EXTENTIONS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECT_EXTENTIONS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECT_EXTENTIONS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECT_EXTENTIONS" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."PROJECT_EXTENTIONS" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table RELEASE_COMPONENTS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."RELEASE_COMPONENTS" 
   (	"PV_ID" NUMBER, 
	"FILE_NAME" VARCHAR2(255 BYTE), 
	"FILE_PATH" VARCHAR2(2000 BYTE), 
	"BYTE_SIZE" NUMBER, 
	"CRC_CKSUM" VARCHAR2(50 BYTE), 
	"CRC_MODCRC" VARCHAR2(50 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 2828009472 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_COMPONENTS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_COMPONENTS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_COMPONENTS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_COMPONENTS" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table RELEASE_CONFIG
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."RELEASE_CONFIG" 
   (	"RCON_ID" NUMBER, 
	"RTAG_ID" NUMBER, 
	"GBE_ID" NUMBER, 
	"DAEMON_HOSTNAME" VARCHAR2(50 BYTE), 
	"DAEMON_MODE" CHAR(1 CHAR), 
	"GBE_BUILDFILTER" VARCHAR2(255 BYTE), 
	"BMCON_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 196608 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_CONFIG"."GBE_ID" IS 'Do not use. Data should come from build_machine_config';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_CONFIG"."DAEMON_HOSTNAME" IS 'Do not use. Data should come from build_machine_config';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_CONFIG"."BMCON_ID" IS 'Link to the build_machine_config table';
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_CONFIG" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_CONFIG" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_CONFIG" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_CONFIG" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table RELEASE_CONTENT
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."RELEASE_CONTENT" 
   (	"RTAG_ID" NUMBER, 
	"PV_ID" NUMBER, 
	"BASE_VIEW_ID" NUMBER, 
	"INSERT_STAMP" DATE, 
	"INSERTOR_ID" NUMBER, 
	"PKG_STATE" NUMBER, 
	"PKG_ID" NUMBER, 
	"DEPRECATED_STATE" NUMBER, 
	"PRODUCT_STATE" NUMBER, 
	"SDKTAG_ID" NUMBER, 
	"RIPPLE_STOP" CHAR(1 BYTE), 
	"PERSIST_RIPPLE_STOP" CHAR(1 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 11534336 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_CONTENT"."PKG_ID" IS 'NotUsed any more. Was:Package that has been deprecated';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_CONTENT"."DEPRECATED_STATE" IS '6: Deprecated Package, 7: Deprecated Dependent';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_CONTENT"."SDKTAG_ID" IS 'Pkg imported via SDK';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_CONTENT"."RIPPLE_STOP" IS 's: Stop Ripple, w:Wait for Reset, g:GoBuild';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_CONTENT"."PERSIST_RIPPLE_STOP" IS 'Null:No';
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_CONTENT" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_CONTENT" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_CONTENT" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_CONTENT" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_CONTENT" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table RELEASE_LINKS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."RELEASE_LINKS" 
   (	"RTAG_ID" NUMBER, 
	"REF_RTAG_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_LINKS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_LINKS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_LINKS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_LINKS" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table RELEASE_METRICS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."RELEASE_METRICS" 
   (	"RTAG_ID" NUMBER, 
	"TOTAL_PACKAGES" NUMBER, 
	"AUTOBUILT" NUMBER, 
	"LINES_OF_CODE" NUMBER, 
	"UNIT_TESTED" NUMBER, 
	"AUTOTESTED" NUMBER, 
	"BRANCHES" NUMBER, 
	"LAST_BUILD_TIME" DATE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_METRICS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_METRICS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_METRICS" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table RELEASE_MODIFIED
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."RELEASE_MODIFIED" 
   (	"RTAG_ID" NUMBER, 
	"TIMESTAMP" TIMESTAMP (6) DEFAULT CURRENT_TIMESTAMP, 
	"SEQNUM" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_MODIFIED"."RTAG_ID" IS 'Link to Release';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_MODIFIED"."TIMESTAMP" IS 'Time of the modification';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_MODIFIED"."SEQNUM" IS 'Unique number indicating change';
   COMMENT ON TABLE "RELEASE_MANAGER"."RELEASE_MODIFIED"  IS 'This table conatins a single entry for each RELEASE_TAG.
It is used by the build system to help detect changes to the content of a Release.
A stored proceedure simplifies the use of this table: PK_RELEASE.SET_RELEASE_MODIFIED

This should be called whenever the package_versions in the release have changed in such
a manner that the build daemons should examine the release. This includes:
 - Packages added and removed
 - Packages build status changed (re-included in the release )
 - Packages made Pending Build';
--------------------------------------------------------
--  DDL for Table RELEASE_TAGS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."RELEASE_TAGS" 
   (	"RTAG_ID" NUMBER, 
	"VTREE_ID" NUMBER, 
	"RTAG_NAME" VARCHAR2(50 BYTE), 
	"DESCRIPTION" VARCHAR2(4000 BYTE), 
	"CREATED_STAMP" DATE, 
	"CREATOR_ID" NUMBER, 
	"OFFICIAL_STAMP" DATE, 
	"RELEASOR_ID" NUMBER, 
	"OFFICIAL" CHAR(1 BYTE), 
	"REBUILD_ENV" CHAR(1 BYTE), 
	"REBUILD_STAMP" NUMBER, 
	"RTAG_VERSION" VARCHAR2(4000 BYTE), 
	"RTAG_LIFE_CYCLE" NUMBER, 
	"PARENT_RTAG_ID" NUMBER, 
	"PROJ_ID" NUMBER, 
	"DISPLAY_ORDER" NUMBER, 
	"OWNER_EMAIL" VARCHAR2(1000 BYTE), 
	"ASSOC_MASS_REF" NUMBER, 
	"OWNER_PERSONAL_EMAIL" VARCHAR2(1000 BYTE), 
	"CONFIG_SPEC_BRANCH" VARCHAR2(4000 BYTE), 
	"PRODUCT_STATE_USED" CHAR(1 BYTE), 
	"OFFICIAL_ID" NUMBER, 
	"BUILD_AGE" NUMBER DEFAULT 31, 
	"LXR" CHAR(1 BYTE) DEFAULT 'N', 
	"PLAN_THRESHOLD" NUMBER DEFAULT 20, 
	"PLAN_DROP" CHAR(1 BYTE) DEFAULT 'N'
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 262144 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_TAGS"."CREATED_STAMP" IS 'Date Release was created';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_TAGS"."CREATOR_ID" IS 'User who created the release';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_TAGS"."OFFICIAL_STAMP" IS 'Date OFFICIAL state was changed';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_TAGS"."RELEASOR_ID" IS 'Not Used';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_TAGS"."OFFICIAL" IS 'State of release. A:Archived, Y:Closed, C:CCB Mode, R:Restricted, N: Open';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_TAGS"."REBUILD_ENV" IS 'Y: Rebuild Package State';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_TAGS"."REBUILD_STAMP" IS 'Not used ?';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_TAGS"."OFFICIAL_ID" IS 'User last changed OFFICIAL state';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_TAGS"."BUILD_AGE" IS 'Days without building before warning is shown';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_TAGS"."LXR" IS 'Y:Enable LXR';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_TAGS"."PLAN_THRESHOLD" IS 'Controls the build plan . Values 0:20:100';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RELEASE_TAGS"."PLAN_DROP" IS 'Plan Drop request.';
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_TAGS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_TAGS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_TAGS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_TAGS" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."RELEASE_TAGS" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table RM_PACKAGE_ISSUES_DELETE_ME
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."RM_PACKAGE_ISSUES_DELETE_ME" 
   (	"PKG_ID" NUMBER, 
	"PKG_NAME" VARCHAR2(50 BYTE), 
	"PV_ID" NUMBER, 
	"PKG_VERSION" VARCHAR2(50 BYTE), 
	"DPV_ID" NUMBER, 
	"DPKG_NAME" VARCHAR2(50 BYTE), 
	"DPKG_VERSION" VARCHAR2(50 BYTE), 
	"ISS_DB" NUMBER, 
	"ISS_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."RM_PACKAGE_ISSUES_DELETE_ME" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RM_PACKAGE_ISSUES_DELETE_ME" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RM_PACKAGE_ISSUES_DELETE_ME" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RM_PACKAGE_ISSUES_DELETE_ME" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table RM_PKG_ISSUES
--------------------------------------------------------

  CREATE GLOBAL TEMPORARY TABLE "RELEASE_MANAGER"."RM_PKG_ISSUES" 
   (	"PKG_ID" NUMBER, 
	"PKG_NAME" VARCHAR2(50 BYTE), 
	"PV_ID" NUMBER, 
	"PKG_VERSION" VARCHAR2(50 BYTE), 
	"DPV_ID" NUMBER, 
	"DPKG_NAME" VARCHAR2(50 BYTE), 
	"DPKG_VERSION" VARCHAR2(50 BYTE), 
	"ISS_DB" NUMBER, 
	"ISS_ID" NUMBER
   ) ON COMMIT PRESERVE ROWS ;
  GRANT SELECT ON "RELEASE_MANAGER"."RM_PKG_ISSUES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RM_PKG_ISSUES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RM_PKG_ISSUES" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RM_PKG_ISSUES" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table RUNTIME_DEPENDENCIES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."RUNTIME_DEPENDENCIES" 
   (	"PV_ID" NUMBER, 
	"RTD_ID" NUMBER, 
	"RTD_COMMENTS" VARCHAR2(2000 BYTE), 
	"RTD_URL" VARCHAR2(2000 BYTE), 
	"MOD_DATE" DATE, 
	"MOD_USER" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 7340032 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."RUNTIME_DEPENDENCIES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RUNTIME_DEPENDENCIES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RUNTIME_DEPENDENCIES" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RUNTIME_DEPENDENCIES" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table RUN_LEVEL
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."RUN_LEVEL" 
   (	"RCON_ID" NUMBER, 
	"CURRENT_BUILD_FILES" CLOB, 
	"CURRENT_RUN_LEVEL" NUMBER, 
	"PAUSE" NUMBER, 
	"CURRENT_PKG_ID_BEING_BUILT" NUMBER, 
	"KEEP_ALIVE" DATE, 
	"CURRENT_PV_ID" NUMBER, 
	"LAST_BUILD" DATE DEFAULT sysdate
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" 
 LOB ("CURRENT_BUILD_FILES") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."RUN_LEVEL"."RCON_ID" IS 'Link to the Release_config table';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RUN_LEVEL"."CURRENT_BUILD_FILES" IS 'The current build file. Set by the Master, consumed by the Slaves.';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RUN_LEVEL"."CURRENT_RUN_LEVEL" IS 'Daemon indiactes its current state. 1:Cannot Continue, 2:Paused, 3:Active, 4:Idle, 5:Waiting, 6:Publishing, 7:Planning';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RUN_LEVEL"."PAUSE" IS 'The daemon should pause at the end of the current build.Null:Run, 1:Pause, 2:Disable';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RUN_LEVEL"."CURRENT_PKG_ID_BEING_BUILT" IS 'pkg_id of the package currently being built';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RUN_LEVEL"."KEEP_ALIVE" IS 'DateTime of the last database enquiry made by the daemon. Used to locate dead daemons.';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RUN_LEVEL"."CURRENT_PV_ID" IS 'The PV_ID of the package currently being built.';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RUN_LEVEL"."LAST_BUILD" IS 'The DateTime that the last build started. This does not include dummy builds. Used to determine unused daemons.';
  GRANT SELECT ON "RELEASE_MANAGER"."RUN_LEVEL" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RUN_LEVEL" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RUN_LEVEL" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table RUN_LEVEL_SCHEDULE
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."RUN_LEVEL_SCHEDULE" 
   (	"SCHEDULED_ID" NUMBER, 
	"SCHEDULED_PAUSE" DATE, 
	"SCHEDULED_RESUME" DATE, 
	"REPEAT" CHAR(1 BYTE), 
	"INDEFINITE_PAUSE" CHAR(1 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 262144 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."RUN_LEVEL_SCHEDULE"."SCHEDULED_ID" IS 'Unique entry identifier';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RUN_LEVEL_SCHEDULE"."SCHEDULED_PAUSE" IS 'Start DateTime of the outage';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RUN_LEVEL_SCHEDULE"."SCHEDULED_RESUME" IS 'End DateTime of the outage';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RUN_LEVEL_SCHEDULE"."REPEAT" IS '0:Once, 1:Daily, 7:Weekly';
   COMMENT ON COLUMN "RELEASE_MANAGER"."RUN_LEVEL_SCHEDULE"."INDEFINITE_PAUSE" IS 'Non Null indicates indefinite pause';
  GRANT SELECT ON "RELEASE_MANAGER"."RUN_LEVEL_SCHEDULE" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RUN_LEVEL_SCHEDULE" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."RUN_LEVEL_SCHEDULE" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table SDK_CONTENT
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."SDK_CONTENT" 
   (	"SDKTAG_ID" NUMBER, 
	"PV_ID" NUMBER, 
	"SDKPKG_STATE" CHAR(1 BYTE) DEFAULT '-'
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_CONTENT"."SDKTAG_ID" IS 'Ref to SDK TAG';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_CONTENT"."PV_ID" IS 'Ref to Package Versions';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_CONTENT"."SDKPKG_STATE" IS 'Package State: -:Not exposed, E:Exposed';
--------------------------------------------------------
--  DDL for Table SDK_NAMES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."SDK_NAMES" 
   (	"SDK_ID" NUMBER, 
	"SDK_NAME" VARCHAR2(50 BYTE), 
	"SDK_COMMENT" VARCHAR2(4000 BYTE), 
	"VIEW_ID" NUMBER, 
	"PROJ_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_NAMES"."SDK_ID" IS 'Auto Created when row is created';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_NAMES"."SDK_NAME" IS 'Name of the SDK';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_NAMES"."SDK_COMMENT" IS 'User comment';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_NAMES"."VIEW_ID" IS 'Base View for display';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_NAMES"."PROJ_ID" IS 'Project ID for Security context';
--------------------------------------------------------
--  DDL for Table SDK_TAGS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."SDK_TAGS" 
   (	"SDKTAG_ID" NUMBER, 
	"SDKTAG_NAME" VARCHAR2(50 BYTE), 
	"DESCRIPTION" VARCHAR2(4000 BYTE), 
	"SDK_ID" NUMBER, 
	"RTAG_ID" NUMBER, 
	"CREATED_STAMP" TIMESTAMP (6) DEFAULT SYSTIMESTAMP, 
	"CREATOR_ID" NUMBER, 
	"STATE_STAMP" TIMESTAMP (6) DEFAULT SYSTIMESTAMP, 
	"STATE_ID" NUMBER, 
	"SDK_STATE" CHAR(1 BYTE) DEFAULT 'U'
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_TAGS"."SDKTAG_ID" IS 'Unique ID. Created automatically';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_TAGS"."SDKTAG_NAME" IS 'Name of the SDK Version';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_TAGS"."DESCRIPTION" IS 'General description';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_TAGS"."SDK_ID" IS 'Parent SDK';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_TAGS"."RTAG_ID" IS 'Release within which this SDK is maintained';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_TAGS"."CREATED_STAMP" IS 'When created';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_TAGS"."CREATOR_ID" IS 'Who Created the version';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_TAGS"."STATE_STAMP" IS 'Time of last change to this version';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_TAGS"."STATE_ID" IS 'User id who made the last state change';
   COMMENT ON COLUMN "RELEASE_MANAGER"."SDK_TAGS"."SDK_STATE" IS 'State: U-Under Development; R-Released; D-Deprecated';
--------------------------------------------------------
--  DDL for Table TEMP_ENV_DEPS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."TEMP_ENV_DEPS" 
   (	"SESSION_NUM" NUMBER, 
	"PV_ID" NUMBER, 
	"PKG_ID" NUMBER, 
	"V_EXT" VARCHAR2(50 BYTE), 
	"DPV_ID" NUMBER, 
	"DPKG_ID" NUMBER, 
	"DV_EXT" VARCHAR2(50 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON TABLE "RELEASE_MANAGER"."TEMP_ENV_DEPS"  IS 'This table is used in the creation of the package_state information
Data in the table is temporary. It should be cleared out after its been used.
Data will only be used for a few seconds.

The table is used to map DPV_IDs to PV_IDs, but only for DPV_IDs that are of interest';
--------------------------------------------------------
--  DDL for Table TEMP_ENV_STATES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."TEMP_ENV_STATES" 
   (	"SESSION_NUM" NUMBER, 
	"LEVEL_NUM" NUMBER, 
	"PV_ID" NUMBER, 
	"PKG_ID" NUMBER, 
	"V_EXT" VARCHAR2(50 BYTE), 
	"TES_STATE" NUMBER, 
	"BUILD_TYPE" CHAR(1 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 524288 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."TEMP_ENV_STATES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."TEMP_ENV_STATES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."TEMP_ENV_STATES" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."TEMP_ENV_STATES" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table TEMP_SASH
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."TEMP_SASH" 
   (	"RTAG_ID" NUMBER, 
	"PROJ_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."TEMP_SASH" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."TEMP_SASH" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."TEMP_SASH" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."TEMP_SASH" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table TEMP_TREE_BROWSE
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."TEMP_TREE_BROWSE" 
   (	"SESSION_NUM" NUMBER, 
	"LEVEL_NUM" NUMBER, 
	"PV_ID" NUMBER, 
	"PKG_ID" NUMBER, 
	"V_EXT" VARCHAR2(50 BYTE), 
	"DIRECTION" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."TEMP_TREE_BROWSE" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."TEMP_TREE_BROWSE" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."TEMP_TREE_BROWSE" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."TEMP_TREE_BROWSE" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table TEST_RUN
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."TEST_RUN" 
   (	"TESTRUN_ID" NUMBER, 
	"BUILD_ID" NUMBER, 
	"PLATFORM" VARCHAR2(50 BYTE), 
	"TYPE" VARCHAR2(1 BYTE), 
	"TEST_NAME" VARCHAR2(200 BYTE), 
	"TEST_OUTCOME" VARCHAR2(20 BYTE), 
	"TIME_TAKEN" NUMBER, 
	"FAIL_MESSAGE" CLOB
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" 
 LOB ("FAIL_MESSAGE") STORE AS BASICFILE (
  TABLESPACE "RELEASE_MANAGER_DATA" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."TEST_RUN"."TESTRUN_ID" IS 'Unique Id. Used to generate a primary key.';
   COMMENT ON COLUMN "RELEASE_MANAGER"."TEST_RUN"."PLATFORM" IS 'Target Platform';
   COMMENT ON COLUMN "RELEASE_MANAGER"."TEST_RUN"."TYPE" IS 'P or D';
   COMMENT ON COLUMN "RELEASE_MANAGER"."TEST_RUN"."TEST_OUTCOME" IS 'PASS/FAIL/SKIP';
   COMMENT ON COLUMN "RELEASE_MANAGER"."TEST_RUN"."TIME_TAKEN" IS 'Test Duration in milliseconds';
   COMMENT ON COLUMN "RELEASE_MANAGER"."TEST_RUN"."FAIL_MESSAGE" IS 'Failure Message';
--------------------------------------------------------
--  DDL for Table TEST_TYPES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."TEST_TYPES" 
   (	"TEST_TYPE_ID" NUMBER, 
	"TEST_TYPE_NAME" VARCHAR2(50 BYTE), 
	"DISPLAY_ORDER" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."TEST_TYPES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."TEST_TYPES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."TEST_TYPES" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."TEST_TYPES" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."TEST_TYPES" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table UNIT_TESTS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."UNIT_TESTS" 
   (	"TEST_ID" NUMBER, 
	"PV_ID" NUMBER, 
	"TEST_TYPES_FK" NUMBER, 
	"TEST_SUMMARY" VARCHAR2(4000 BYTE), 
	"COMPLETION_DATE" DATE, 
	"COMPLETED_BY" NUMBER, 
	"RESULTS_URL" VARCHAR2(2000 BYTE), 
	"RESULTS_ATTACHMENT_NAME" VARCHAR2(2000 BYTE), 
	"TEST_ACCEPTED" CHAR(1 BYTE), 
	"ACCEPTANCE_DATE" DATE, 
	"ACCEPTED_BY" NUMBER, 
	"REVIEW_COMMENTS" VARCHAR2(4000 BYTE), 
	"NUMOF_TEST" VARCHAR2(50 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 31457280 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."UNIT_TESTS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."UNIT_TESTS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."UNIT_TESTS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."UNIT_TESTS" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."UNIT_TESTS" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table VALIDATION_RULES_DELETE_ME
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."VALIDATION_RULES_DELETE_ME" 
   (	"FIELD_NAME" VARCHAR2(1000 BYTE), 
	"IS_REQUIRED" CHAR(1 BYTE), 
	"IS_NUMERIC" CHAR(1 BYTE), 
	"MIN_NUMERIC_VALUE" NUMBER, 
	"MAX_NUMERIC_VALUE" NUMBER, 
	"IS_DATE" CHAR(1 BYTE), 
	"START_DATE" DATE, 
	"END_DATE" DATE, 
	"MIN_STRING_LENGTH" NUMBER, 
	"MAX_STRING_LENGTH" NUMBER, 
	"REGEXP" VARCHAR2(4000 BYTE), 
	"REGEXP_DESCRIPTION" VARCHAR2(50 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."VALIDATION_RULES_DELETE_ME" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VALIDATION_RULES_DELETE_ME" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VALIDATION_RULES_DELETE_ME" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VALIDATION_RULES_DELETE_ME" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table VCS_TYPE
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."VCS_TYPE" 
   (	"VCS_TYPE_ID" NUMBER, 
	"NAME" VARCHAR2(128 BYTE), 
	"TAG" VARCHAR2(32 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."VCS_TYPE" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VCS_TYPE" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VCS_TYPE" TO "DM_READONLY";
--------------------------------------------------------
--  DDL for Table VIEWS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."VIEWS" 
   (	"VIEW_ID" NUMBER, 
	"VIEW_NAME" VARCHAR2(30 BYTE), 
	"OWNER_ID" NUMBER, 
	"BASE_VIEW" CHAR(1 BYTE), 
	"PUBLIC_READ" CHAR(1 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."VIEWS"."OWNER_ID" IS '0:Public';
   COMMENT ON COLUMN "RELEASE_MANAGER"."VIEWS"."BASE_VIEW" IS 'Y:Base View';
  GRANT SELECT ON "RELEASE_MANAGER"."VIEWS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VIEWS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VIEWS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VIEWS" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table VIEW_DEF
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."VIEW_DEF" 
   (	"VIEW_ID" NUMBER, 
	"PKG_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;

   COMMENT ON COLUMN "RELEASE_MANAGER"."VIEW_DEF"."VIEW_ID" IS 'Non Base View ID';
   COMMENT ON COLUMN "RELEASE_MANAGER"."VIEW_DEF"."PKG_ID" IS 'Package ID';
   COMMENT ON TABLE "RELEASE_MANAGER"."VIEW_DEF"  IS 'Packages in a non-baseview';
  GRANT SELECT ON "RELEASE_MANAGER"."VIEW_DEF" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VIEW_DEF" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VIEW_DEF" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VIEW_DEF" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table VIEW_SETTINGS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."VIEW_SETTINGS" 
   (	"USER_ID" NUMBER, 
	"VIEW_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."VIEW_SETTINGS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VIEW_SETTINGS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VIEW_SETTINGS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VIEW_SETTINGS" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table VTREES
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."VTREES" 
   (	"VTREE_ID" NUMBER, 
	"PROJ_ID" NUMBER, 
	"VTREE_NAME" VARCHAR2(50 BYTE), 
	"HIDE" CHAR(1 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."VTREES" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VTREES" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VTREES" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VTREES" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."VTREES" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table VTREES_WORLD
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."VTREES_WORLD" 
   (	"WORLD_ID" NUMBER, 
	"VTREE_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."VTREES_WORLD" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VTREES_WORLD" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VTREES_WORLD" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."VTREES_WORLD" TO "RELEASE_MANAGER_READ";
  GRANT SELECT ON "RELEASE_MANAGER"."VTREES_WORLD" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Table WORK_IN_PROGRESS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."WORK_IN_PROGRESS" 
   (	"RTAG_ID" NUMBER, 
	"PV_ID" NUMBER, 
	"VIEW_ID" NUMBER
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."WORK_IN_PROGRESS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."WORK_IN_PROGRESS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."WORK_IN_PROGRESS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."WORK_IN_PROGRESS" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Table WORLDS
--------------------------------------------------------

  CREATE TABLE "RELEASE_MANAGER"."WORLDS" 
   (	"WORLD_ID" NUMBER, 
	"WORLD_NAME" VARCHAR2(30 BYTE), 
	"WORLD_DESC" VARCHAR2(255 BYTE)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
  GRANT SELECT ON "RELEASE_MANAGER"."WORLDS" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."WORLDS" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."WORLDS" TO "DM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."WORLDS" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for View ENVIRONMENT_VIEW
--------------------------------------------------------

  CREATE OR REPLACE FORCE VIEW "RELEASE_MANAGER"."ENVIRONMENT_VIEW" ("ENV_AREA", "PV_ID", "RTAG_ID", "VIEW_ID", "PKG_STATE", "DEPRECATED_STATE", "INSERTOR_ID", "INSERT_STAMP", "OPERATION") AS 
  WITH building as (
            SELECT unique rl.CURRENT_PV_ID as pv_id, rc.RTAG_ID 
            FROM RELEASE_CONFIG rc, RELEASE_TAGS rt, RUN_LEVEL rl 
            WHERE rt.RTAG_ID = rc.RTAG_ID 
            AND rc.bmcon_id is not null
            AND rt.OFFICIAL in ( 'N', 'R', 'C')
            AND rl.RCON_ID(+) = rc.RCON_ID
            AND rl.CURRENT_PKG_ID_BEING_BUILT is not null
            AND NVL(rl.PAUSE,0) < 2
        ), scheduled as (
            SELECT pv_id, RTAG_ID from daemon_instructions di
            WHERE di.op_code = 2
        ) , buildFail as (
            SELECT pv_id, root_pv_id, RTAG_ID from do_not_ripple dnr
        ) , baseData as (
            SELECT 2 AS ENV_AREA,
                rc.PV_ID,
                rc.RTAG_ID,
                rc.BASE_VIEW_ID AS VIEW_ID,
                rc.PKG_STATE,
                rc.DEPRECATED_STATE,
                rc.INSERTOR_ID,
                rc.INSERT_STAMP,
                ' ' AS OPERATION
              FROM RELEASE_CONTENT rc
            UNION
            SELECT 0 AS ENV_AREA,
                wip.PV_ID,
                wip.RTAG_ID,
                wip.VIEW_ID,
                NULL AS PKG_STATE,
             NULL AS DEPRECATED_STATE,
                NULL AS INSERTOR_ID,
                NULL AS INSERT_STAMP,
                ' ' AS OPERATION
              FROM WORK_IN_PROGRESS wip
            UNION
            SELECT 1 AS ENV_AREA,
                pl.PV_ID,
                pl.RTAG_ID,
                pl.VIEW_ID,
                NULL AS PKG_STATE,
             NULL AS DEPRECATED_STATE,
                NULL AS INSERTOR_ID,
                NULL AS INSERT_STAMP,
                pl.operation
            FROM PLANNED pl
        )
        
SELECT unique rc.ENV_AREA,
    rc.PV_ID,
    rc.RTAG_ID,
    rc.VIEW_ID,
    Case
        When sdi.pv_id is not null then 14
        When bb.pv_id is not null then 15
        When bf.pv_id is not null AND bf.root_pv_id is NULL then 16
        When bf.pv_id is not null AND bf.root_pv_id is NOT NULL then  17
        When rc.pkg_state is not null then rc.pkg_state
        Else 0
    End as pkg_state,
    rc.DEPRECATED_STATE,
    rc.INSERTOR_ID,
    rc.INSERT_STAMP,
    rc.OPERATION
  FROM baseData rc,
       scheduled sdi,
       buildFail bf,
       building bb
  WHERE sdi.pv_id(+)    = rc.pv_id  AND sdi.rtag_id(+) = rc.rtag_id
        AND bf.pv_id(+) = rc.pv_id  AND bf.rtag_id(+) = rc.rtag_id
        AND bb.pv_id(+) = rc.pv_id  AND bb.rtag_id(+) = rc.rtag_id
;
  GRANT SELECT ON "RELEASE_MANAGER"."ENVIRONMENT_VIEW" TO "RM_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ENVIRONMENT_VIEW" TO "MS_READONLY";
  GRANT SELECT ON "RELEASE_MANAGER"."ENVIRONMENT_VIEW" TO "RELEASE_MANAGER_READ";
--------------------------------------------------------
--  DDL for Index PACKAGE_VERSIONS_PLATFORMS_IN
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PACKAGE_VERSIONS_PLATFORMS_IN" ON "RELEASE_MANAGER"."PACKAGE_VERSION_PLATFORMS" ("PV_ID", "BP_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index PK_LICENCES
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PK_LICENCES" ON "RELEASE_MANAGER"."LICENCES" ("LICENCE") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_PKG_BUILD_ENV
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_PKG_BUILD_ENV" ON "RELEASE_MANAGER"."PACKAGE_BUILD_ENV" ("PV_ID", "BE_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 6291456 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index SDK_NAMES_UK1
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."SDK_NAMES_UK1" ON "RELEASE_MANAGER"."SDK_NAMES" ("SDK_NAME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_PACKAGES
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_PACKAGES" ON "RELEASE_MANAGER"."PACKAGES" ("PKG_NAME", "PKG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 262144 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PACKAGES_ALIAS
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PACKAGES_ALIAS" ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" ("PKG_ID", "V_EXT") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index CODE_REVIEW_URL_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."CODE_REVIEW_URL_PK" ON "RELEASE_MANAGER"."CODE_REVIEW_URL" ("CR_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index SDK_NAMES_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."SDK_NAMES_PK" ON "RELEASE_MANAGER"."SDK_NAMES" ("SDK_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_ACTION_TIMESTAMP
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_ACTION_TIMESTAMP" ON "RELEASE_MANAGER"."ACTION_LOG" ("ACTION_TIMESTAMP") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_UT_COMPLETED
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_UT_COMPLETED" ON "RELEASE_MANAGER"."UNIT_TESTS" ("COMPLETION_DATE", "COMPLETED_BY") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 5242880 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BLAT_PROJECTS_INDEX1
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BLAT_PROJECTS_INDEX1" ON "RELEASE_MANAGER"."BLAT_PROJECTS" ("BLAT_ID", "PROJ_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index INX_PV_ID_PKGDOC
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PV_ID_PKGDOC" ON "RELEASE_MANAGER"."PACKAGE_DOCUMENTS" ("PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 1048576 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_VIEW_SETTINGS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_VIEW_SETTINGS" ON "RELEASE_MANAGER"."VIEW_SETTINGS" ("USER_ID", "VIEW_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PP_PV_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PP_PV_ID" ON "RELEASE_MANAGER"."PACKAGE_PATCHES" ("PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 327680 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BUILD_INSTANCE_PLATFORMS_INDE
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BUILD_INSTANCE_PLATFORMS_INDE" ON "RELEASE_MANAGER"."BUILD_INSTANCE_PLATFORMS" ("BUILD_ID", "BP_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index PK_VIEWS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PK_VIEWS" ON "RELEASE_MANAGER"."VIEWS" ("VIEW_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index CQ_USERS_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."CQ_USERS_PK" ON "RELEASE_MANAGER"."CQ_USERS" ("DBID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PK_PACKAGES
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PK_PACKAGES" ON "RELEASE_MANAGER"."PACKAGES" ("PKG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PK_TEST_TYPES
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PK_TEST_TYPES" ON "RELEASE_MANAGER"."TEST_TYPES" ("TEST_TYPE_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_ACTTYPE_ID
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_ACTTYPE_ID" ON "RELEASE_MANAGER"."ACTION_TYPE" ("ACTTYPE_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PROJ_ACTION_DATE_TIME
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PROJ_ACTION_DATE_TIME" ON "RELEASE_MANAGER"."PROJECT_ACTION_LOG" ("ACTION_DATETIME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 327680 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_RC_PKG_STATE
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_RC_PKG_STATE" ON "RELEASE_MANAGER"."RELEASE_CONTENT" ("PKG_STATE") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 7340032 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BLAT_SERVERS_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BLAT_SERVERS_PK" ON "RELEASE_MANAGER"."BLAT_SERVERS" ("BLAT_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index PROCESSES_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PROCESSES_PK" ON "RELEASE_MANAGER"."PROCESSES" ("PROC_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PACKAGE_DEPS_DPV_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PACKAGE_DEPS_DPV_ID" ON "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES" ("DPV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 75497472 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PACKAGE_VERSIONS_RNOTE
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."PACKAGE_VERSIONS_RNOTE" ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" ("RELEASE_NOTES_INFO", "DLOCKED", "MODIFIED_STAMP") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index INX_PACKAGES_PKG_VERSION
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PACKAGES_PKG_VERSION" ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" ("PKG_VERSION") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 10485760 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_PACKAGE_METRICS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_PACKAGE_METRICS" ON "RELEASE_MANAGER"."PACKAGE_METRICS" ("PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 4194304 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_PLATFORM
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_PLATFORM" ON "RELEASE_MANAGER"."PLATFORMS" ("NAME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BUILD_PLATFORMS_UK1
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BUILD_PLATFORMS_UK1" ON "RELEASE_MANAGER"."BUILD_PLATFORMS" ("BP_NAME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index UNQ_VIEWS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_VIEWS" ON "RELEASE_MANAGER"."VIEWS" ("VIEW_NAME", "OWNER_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PRODUCT_STATES_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PRODUCT_STATES_PK" ON "RELEASE_MANAGER"."PRODUCT_STATES" ("STATE_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PK_MESSAGE_BOARD
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PK_MESSAGE_BOARD" ON "RELEASE_MANAGER"."MESSAGE_BOARD" ("MSG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PK_BUILD_MACHINE_CONFIG
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PK_BUILD_MACHINE_CONFIG" ON "RELEASE_MANAGER"."BUILD_MACHINE_CONFIG" ("BMCON_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_MSGBOARD
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_MSGBOARD" ON "RELEASE_MANAGER"."MESSAGE_BOARD" ("EXPIRY_DATE", "DUE_DATE") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PK_VTREES
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PK_VTREES" ON "RELEASE_MANAGER"."VTREES" ("VTREE_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_UT_PART1
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_UT_PART1" ON "RELEASE_MANAGER"."UNIT_TESTS" ("PV_ID", "TEST_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 7340032 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_BUILD_ENV
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_BUILD_ENV" ON "RELEASE_MANAGER"."BUILD_ENVIRONMENTS" ("BE_NAME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PK_RUN_LEVEL
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PK_RUN_LEVEL" ON "RELEASE_MANAGER"."RUN_LEVEL" ("RCON_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BUILD_PLATFORMS_CONFIG2_INDEX1
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG2_INDEX1" ON "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG2" ("BP_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index INX_ACTION_DATE_TIME
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_ACTION_DATE_TIME" ON "RELEASE_MANAGER"."ACTION_LOG" ("ACTION_DATETIME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 92274688 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_BUILD_MACHINE_CONFIG02
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_BUILD_MACHINE_CONFIG02" ON "RELEASE_MANAGER"."BUILD_MACHINE_CONFIG" ("MACHINE_HOSTNAME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index CQ_SOFTWARE_ISSUE_INDEX6
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE_INDEX6" ON "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE" ("NEW_NUM") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BUILD_MACHINES_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BUILD_MACHINES_PK" ON "RELEASE_MANAGER"."BUILD_MACHINES" ("BM_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_TTB_SESSION
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_TTB_SESSION" ON "RELEASE_MANAGER"."TEMP_TREE_BROWSE" ("SESSION_NUM") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_RTD
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."UNQ_RTD" ON "RELEASE_MANAGER"."RUNTIME_DEPENDENCIES" ("PV_ID", "RTD_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 5242880 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BUILD_PLAN_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BUILD_PLAN_PK" ON "RELEASE_MANAGER"."BUILD_PLAN" ("RTAG_ID", "BUILD_ORDER", "PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index SDK_CONTENT_INDEX1
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."SDK_CONTENT_INDEX1" ON "RELEASE_MANAGER"."SDK_CONTENT" ("SDKTAG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index CQ_STATEDEF_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."CQ_STATEDEF_PK" ON "RELEASE_MANAGER"."CQ_STATEDEF" ("ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_RL_RTAG_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_RL_RTAG_ID" ON "RELEASE_MANAGER"."RELEASE_LINKS" ("RTAG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_VIEW_DEF
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_VIEW_DEF" ON "RELEASE_MANAGER"."VIEW_DEF" ("VIEW_ID", "PKG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PACKAGES_PKG_NAME
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PACKAGES_PKG_NAME" ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" ("PKG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 6291456 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PCOMP_FK_PV_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PCOMP_FK_PV_ID" ON "RELEASE_MANAGER"."PRODUCT_COMPONENTS" ("PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 11534336 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index DAEMON_INSTRUCTIONS_UK1
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS_UK1" ON "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS" ("OP_CODE", "RTAG_ID", "PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_FILE_NAME
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_FILE_NAME" ON "RELEASE_MANAGER"."RELEASE_COMPONENTS" (UPPER("FILE_NAME")) 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 1147142144 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_IS_PATCH_IGNORE
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_IS_PATCH_IGNORE" ON "RELEASE_MANAGER"."IGNORE_WARNINGS" ("IS_PATCH_IGNORE") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PK_TEST_RUN
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."PK_TEST_RUN" ON "RELEASE_MANAGER"."TEST_RUN" ("TESTRUN_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 109051904 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_BUILD_ENV_DOCS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_BUILD_ENV_DOCS" ON "RELEASE_MANAGER"."BUILD_ENV_DOCUMENTS" ("BE_ID", "DOC_NUM") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PROJ_ACTION_LOG_PROJ
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PROJ_ACTION_LOG_PROJ" ON "RELEASE_MANAGER"."PROJECT_ACTION_LOG" ("PROJ_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 327680 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index LICENCING_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."LICENCING_PK" ON "RELEASE_MANAGER"."LICENCING" ("PV_ID", "LICENCE") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BUILD_SERVICE_CONFIG_INDEX1
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BUILD_SERVICE_CONFIG_INDEX1" ON "RELEASE_MANAGER"."BUILD_SERVICE_CONFIG" ("SERVICE") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index RELEASE_MODIFIED_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."RELEASE_MODIFIED_PK" ON "RELEASE_MANAGER"."RELEASE_MODIFIED" ("RTAG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index CQ_HISTORY_INDEX2
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."CQ_HISTORY_INDEX2" ON "RELEASE_MANAGER"."CQ_HISTORY" ("ENTITYDEF_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_TTB_LEVEL_NUM
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_TTB_LEVEL_NUM" ON "RELEASE_MANAGER"."TEMP_TREE_BROWSE" ("LEVEL_NUM") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BLAT_SERVERS_UK1
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BLAT_SERVERS_UK1" ON "RELEASE_MANAGER"."BLAT_SERVERS" ("BLAT_SERVER_NAME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index UNQ_WORK_IN_PROGRESS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_WORK_IN_PROGRESS" ON "RELEASE_MANAGER"."WORK_IN_PROGRESS" ("RTAG_ID", "PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BUILD_PLATFORMS_CONFIG_INDEX1
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG_INDEX1" ON "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG" ("BP_ID", "GBE_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index INX_PACKAGES_V_NMM
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PACKAGES_V_NMM" ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" ("V_NMM") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 9437184 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index TEST_RUN_IDX_BUILD_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."TEST_RUN_IDX_BUILD_ID" ON "RELEASE_MANAGER"."TEST_RUN" ("BUILD_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index UNQ_PLANNED
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."UNQ_PLANNED" ON "RELEASE_MANAGER"."PLANNED" ("RTAG_ID", "PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PV_BUILDINFO
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PV_BUILDINFO" ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" ("PKG_ID", "PKG_VERSION", "MODIFIED_STAMP", "MODIFIER_ID", "DLOCKED", "BUILD_TIME", "BUILD_TYPE", "CREATED_STAMP") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index INX_TES_PKGEXT
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_TES_PKGEXT" ON "RELEASE_MANAGER"."TEMP_ENV_STATES" ("PKG_ID", "V_EXT") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 524288 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_BUILD_MACHINE_CONFIG01
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_BUILD_MACHINE_CONFIG01" ON "RELEASE_MANAGER"."BUILD_MACHINE_CONFIG" (LOWER("DISPLAY_NAME")) 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index CQ_SOFTWARE_ISSUE_INDEX2
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE_INDEX2" ON "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE" ("STATE") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index TEMP_ENV_DEPS_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."TEMP_ENV_DEPS_PK" ON "RELEASE_MANAGER"."TEMP_ENV_DEPS" ("PV_ID", "SESSION_NUM", "DPV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_RELEASE_LINKS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_RELEASE_LINKS" ON "RELEASE_MANAGER"."RELEASE_LINKS" ("RTAG_ID", "REF_RTAG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_PKG_DOC
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_PKG_DOC" ON "RELEASE_MANAGER"."PACKAGE_DOCUMENTS" ("PV_ID", "DOC_NUM") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 2097152 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index LXR_STATE_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."LXR_STATE_PK" ON "RELEASE_MANAGER"."LXR_STATE" ("RTAG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index DAEMON_INSTRUCTIONS_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS_PK" ON "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS" ("DAEMON_INSTRUCTIONS_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BUILD_PLATFORMS_CONFIG2_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG2_PK" ON "RELEASE_MANAGER"."BUILD_PLATFORMS_CONFIG2" ("BP_ID", "BMCON_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index INX_DAEMON_INST_SCHED_DATETIME
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_DAEMON_INST_SCHED_DATETIME" ON "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS" ("SCHEDULED_DATETIME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_TTB_PKG
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_TTB_PKG" ON "RELEASE_MANAGER"."TEMP_TREE_BROWSE" ("PKG_ID", "V_EXT") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_VALIDATION_RULES
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_VALIDATION_RULES" ON "RELEASE_MANAGER"."VALIDATION_RULES_DELETE_ME" ("FIELD_NAME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BUILD_STANDARDS_ADDENDUM_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BUILD_STANDARDS_ADDENDUM_PK" ON "RELEASE_MANAGER"."BUILD_STANDARDS_ADDENDUM" ("BSA_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PV_OWNER_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PV_OWNER_ID" ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" ("OWNER_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 7340032 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_TES_TES_STATE
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_TES_TES_STATE" ON "RELEASE_MANAGER"."TEMP_ENV_STATES" ("TES_STATE") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 458752 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PV_MODIFIER
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PV_MODIFIER" ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" ("MODIFIER_ID", "MODIFIED_STAMP") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index UNQ_AN_PART1
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_AN_PART1" ON "RELEASE_MANAGER"."ADDITIONAL_NOTES" ("PV_ID", "NOTE_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 3145728 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_RELEASE_CONTENTS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_RELEASE_CONTENTS" ON "RELEASE_MANAGER"."RELEASE_CONTENT" ("RTAG_ID", "PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 10485760 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_ACTION_LOG_PV_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_ACTION_LOG_PV_ID" ON "RELEASE_MANAGER"."ACTION_LOG" ("PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 109051904 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_TEST_TYPE_NAME
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_TEST_TYPE_NAME" ON "RELEASE_MANAGER"."TEST_TYPES" ("TEST_TYPE_NAME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PEGGED_VERSIONS_INDEX1
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."PEGGED_VERSIONS_INDEX1" ON "RELEASE_MANAGER"."PEGGED_VERSIONS" ("RTAG_ID", "PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PKNOTE_MANAGER1
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PKNOTE_MANAGER1" ON "RELEASE_MANAGER"."NOTE_MANAGER" ("NID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PACKAGES_V_MM
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PACKAGES_V_MM" ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" ("V_MM") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 6291456 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_CODE_REVIEW
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."INX_CODE_REVIEW" ON "RELEASE_MANAGER"."CODE_REVIEWS" ("PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_VTREES
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_VTREES" ON "RELEASE_MANAGER"."VTREES" ("PROJ_ID", "VTREE_NAME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PACKAGE_DEPS_PKG_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PACKAGE_DEPS_PKG_ID" ON "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES" ("PKG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 83886080 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_PROJECTS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_PROJECTS" ON "RELEASE_MANAGER"."PROJECTS" ("PROJ_NAME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PACKAGES_V_EXT
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PACKAGES_V_EXT" ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" ("V_EXT") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 7340032 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PK_PROJECTS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PK_PROJECTS" ON "RELEASE_MANAGER"."PROJECTS" ("PROJ_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_TES_PV
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_TES_PV" ON "RELEASE_MANAGER"."TEMP_ENV_STATES" ("PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 851968 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index CQ_SOFTWARE_ISSUE_INDEX5
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE_INDEX5" ON "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE" ("PRODUCT") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_VTREE_WORLD
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_VTREE_WORLD" ON "RELEASE_MANAGER"."VTREES_WORLD" ("WORLD_ID", "VTREE_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_IGW
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_IGW" ON "RELEASE_MANAGER"."IGNORE_WARNINGS" ("RTAG_ID", "PV_ID", "DPV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 5242880 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_DAEMON_INST_RTAG_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_DAEMON_INST_RTAG_ID" ON "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS" ("RTAG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index SDK_TAGS_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."SDK_TAGS_PK" ON "RELEASE_MANAGER"."SDK_TAGS" ("SDKTAG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index CQ_SOFTWARE_ISSUE_INDEX7
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE_INDEX7" ON "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE" ("DEPENDANT_DEVIS") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PK_NOTIFICATION_HISTORY
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PK_NOTIFICATION_HISTORY" ON "RELEASE_MANAGER"."NOTIFICATION_HISTORY" ("RTAG_ID", "PV_ID", "USER_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 2097152 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_PACKAGE_DEPENDENCIES
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_PACKAGE_DEPENDENCIES" ON "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES" ("PV_ID", "DPV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 100663296 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PACKAGE_PATCHES_INDEX1
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PACKAGE_PATCHES_INDEX1" ON "RELEASE_MANAGER"."PACKAGE_PATCHES" ("PV_ID", "PATCH_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index INX_PACKAGE_DEPS_PV_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PACKAGE_DEPS_PV_ID" ON "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES" ("PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 75497472 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BUILD_STANDARDS_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BUILD_STANDARDS_PK" ON "RELEASE_MANAGER"."BUILD_STANDARDS" ("BS_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_CQ
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_CQ" ON "RELEASE_MANAGER"."CQ_ISSUES" ("PV_ID", "ISS_ID", "ISS_DB") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 4194304 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BUILD_PLATFORMS_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BUILD_PLATFORMS_PK" ON "RELEASE_MANAGER"."BUILD_PLATFORMS" ("BP_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index UNQ_PACKAGE_VERSIONS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_PACKAGE_VERSIONS" ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" ("PKG_ID", "PKG_VERSION") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 11534336 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PV_ID_TEST_ID_PKGDOC
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PV_ID_TEST_ID_PKGDOC" ON "RELEASE_MANAGER"."PACKAGE_DOCUMENTS" ("PV_ID", "TEST_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 2097152 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_PACKAGE_PATCHES
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_PACKAGE_PATCHES" ON "RELEASE_MANAGER"."PACKAGE_PATCHES" ("PATCH_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 327680 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index CQ_SOFTWARE_ISSUE_INDEX3
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE_INDEX3" ON "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE" ("PACKAGE_REF") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_PACKAGE_DEP_REV
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_PACKAGE_DEP_REV" ON "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES" ("DPV_ID", "PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index CQ_SOFTWARE_ISSUE_INDEX4
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE_INDEX4" ON "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE" ("PROJECT") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_REL_COMPONENTS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_REL_COMPONENTS" ON "RELEASE_MANAGER"."RELEASE_COMPONENTS" ("PV_ID", "FILE_NAME", "FILE_PATH") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 3489660928 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PK_PACKAGE_VERSIONS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PK_PACKAGE_VERSIONS" ON "RELEASE_MANAGER"."PACKAGE_VERSIONS" ("PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 5242880 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_RELEASE_METRICS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_RELEASE_METRICS" ON "RELEASE_MANAGER"."RELEASE_METRICS" ("RTAG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_BUILD_ORDER
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_BUILD_ORDER" ON "RELEASE_MANAGER"."BUILD_ORDER" ("RTAG_ID", "PV_ID", "STEP_NUM") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 3145728 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PK_BUILD_ENVIRONMENTS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PK_BUILD_ENVIRONMENTS" ON "RELEASE_MANAGER"."BUILD_ENVIRONMENTS" ("BE_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index CQ_SOFTWARE_ISSUE_INDEX1
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE_INDEX1" ON "RELEASE_MANAGER"."CQ_SOFTWARE_ISSUE" ("DBID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PACKAGE_DEPS_DPKG_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PACKAGE_DEPS_DPKG_ID" ON "RELEASE_MANAGER"."PACKAGE_DEPENDENCIES" ("DPKG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 83886080 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_RL_REFRTAG_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_RL_REFRTAG_ID" ON "RELEASE_MANAGER"."RELEASE_LINKS" ("REF_RTAG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_RC_BASE_VIEW_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_RC_BASE_VIEW_ID" ON "RELEASE_MANAGER"."RELEASE_CONTENT" ("BASE_VIEW_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
  STORAGE(INITIAL 8388608 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_DAEMON_INST_PV_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_DAEMON_INST_PV_ID" ON "RELEASE_MANAGER"."DAEMON_INSTRUCTIONS" ("PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_PROJECT_EXT
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_PROJECT_EXT" ON "RELEASE_MANAGER"."PROJECT_EXTENTIONS" ("PROJ_ID", "EXT_NAME") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index VCS_TYPE_PK
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."VCS_TYPE_PK" ON "RELEASE_MANAGER"."VCS_TYPE" ("VCS_TYPE_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_PC_FILE_NAME
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_PC_FILE_NAME" ON "RELEASE_MANAGER"."PRODUCT_COMPONENTS" (UPPER("FILE_NAME")) 
  PCTFREE 10 INITRANS 2 MAXTRANS 167 COMPUTE STATISTICS 
  STORAGE(INITIAL 18874368 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PK_RELEASE_TAGS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PK_RELEASE_TAGS" ON "RELEASE_MANAGER"."RELEASE_TAGS" ("RTAG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index FK_PROJ_ID_RELEASE_TAGS
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."FK_PROJ_ID_RELEASE_TAGS" ON "RELEASE_MANAGER"."RELEASE_TAGS" ("PROJ_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_RCOMP_PV_ID
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_RCOMP_PV_ID" ON "RELEASE_MANAGER"."RELEASE_COMPONENTS" ("PV_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 724566016 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index MICROSOFT_PK_DTPROPERTIES
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."MICROSOFT_PK_DTPROPERTIES" ON "RELEASE_MANAGER"."MICROSOFTDTPROPERTIES" ("ID", "PROPERTY") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index BLAT_RELEASES_INDEX1
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BLAT_RELEASES_INDEX1" ON "RELEASE_MANAGER"."BLAT_RELEASES" ("BLAT_ID", "RTAG_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_DATA" ;
--------------------------------------------------------
--  DDL for Index BUILD_ID
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."BUILD_ID" ON "RELEASE_MANAGER"."BUILD_INSTANCES" ("BUILD_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index INX_UT_PV_TEST_TYPE
--------------------------------------------------------

  CREATE INDEX "RELEASE_MANAGER"."INX_UT_PV_TEST_TYPE" ON "RELEASE_MANAGER"."UNIT_TESTS" ("PV_ID", "TEST_TYPES_FK") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 7340032 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index PK_WORLDS
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."PK_WORLDS" ON "RELEASE_MANAGER"."WORLDS" ("WORLD_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 131072 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index CQ_HISTORY_INDEX1
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."CQ_HISTORY_INDEX1" ON "RELEASE_MANAGER"."CQ_HISTORY" ("DBID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Index UNQ_AN_PART2
--------------------------------------------------------

  CREATE UNIQUE INDEX "RELEASE_MANAGER"."UNQ_AN_PART2" ON "RELEASE_MANAGER"."ADDITIONAL_NOTES" ("PV_ID", "NOTE_TITLE") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 6291456 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "RELEASE_MANAGER_INDX" ;
--------------------------------------------------------
--  DDL for Trigger TRIGGER_BLAT_SERVER_ID
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "RELEASE_MANAGER"."TRIGGER_BLAT_SERVER_ID" 
BEFORE INSERT ON BLAT_SERVERS 
for each row
BEGIN
  select SEQ_BLAT_SERVER_ID.nextval
  into :new.BLAT_ID
  from DUAL;
END;
/
ALTER TRIGGER "RELEASE_MANAGER"."TRIGGER_BLAT_SERVER_ID" ENABLE;
--------------------------------------------------------
--  DDL for Trigger TRIGGER_BSA_ID
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "RELEASE_MANAGER"."TRIGGER_BSA_ID" 
BEFORE INSERT ON BUILD_STANDARDS_ADDENDUM
for each row
BEGIN
  select SEQ_BSA_ID.nextval
  into :new.BSA_ID
  from DUAL;
END;
/
ALTER TRIGGER "RELEASE_MANAGER"."TRIGGER_BSA_ID" ENABLE;
--------------------------------------------------------
--  DDL for Trigger TRIGGER_BUILD_INSTANCE
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "RELEASE_MANAGER"."TRIGGER_BUILD_INSTANCE" 
BEFORE INSERT ON BUILD_INSTANCES
for each row
BEGIN
  If :new.BUILD_ID is null then
  select SEQ_BUILD_INSTANCE.nextval
  into :new.BUILD_ID
  from DUAL;
  End If;
END;
/
ALTER TRIGGER "RELEASE_MANAGER"."TRIGGER_BUILD_INSTANCE" ENABLE;
--------------------------------------------------------
--  DDL for Trigger TRIGGER_BUILD_PLATFORMS
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "RELEASE_MANAGER"."TRIGGER_BUILD_PLATFORMS" 
BEFORE INSERT ON BUILD_PLATFORMS 
for each row
BEGIN
    If :new.BP_ID is null then
      select SEQ_BUILD_PLATFORMS.nextval
      into :new.BP_ID
      from DUAL;
  END IF;
END;
/
ALTER TRIGGER "RELEASE_MANAGER"."TRIGGER_BUILD_PLATFORMS" ENABLE;
--------------------------------------------------------
--  DDL for Trigger TRIGGER_SDK_NAMES
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "RELEASE_MANAGER"."TRIGGER_SDK_NAMES" 
BEFORE INSERT ON SDK_NAMES
for each row
BEGIN
  select SEQ_SDK_ID.nextval
  into :new.SDK_ID
  from DUAL;
END;
/
ALTER TRIGGER "RELEASE_MANAGER"."TRIGGER_SDK_NAMES" ENABLE;
--------------------------------------------------------
--  DDL for Trigger TRIGGER_SDK_TAGS
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "RELEASE_MANAGER"."TRIGGER_SDK_TAGS" 
BEFORE INSERT ON SDK_TAGS
for each row
BEGIN
  select SEQ_SDKTAG_ID.nextval
  into :new.SDKTAG_ID
  from DUAL;
END;
/
ALTER TRIGGER "RELEASE_MANAGER"."TRIGGER_SDK_TAGS" ENABLE;
--------------------------------------------------------
--  DDL for Trigger TRIGGER_TEST_RUNS
--------------------------------------------------------

  CREATE OR REPLACE TRIGGER "RELEASE_MANAGER"."TRIGGER_TEST_RUNS" 
  BEFORE INSERT ON TEST_RUN
  for each row
BEGIN
  if :new.TESTRUN_ID is null then
  select SEQ_TESTRUN_ID.nextval
    into :new.TESTRUN_ID
  from DUAL;
  end if;
END;
/
ALTER TRIGGER "RELEASE_MANAGER"."TRIGGER_TEST_RUNS" ENABLE;
--------------------------------------------------------
--  DDL for Procedure ADD_AUTOBUILD_FAILURE_INFO
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."ADD_AUTOBUILD_FAILURE_INFO" (
   nprojid     IN   NUMBER,
   nviewid     IN   NUMBER,
   suserlist   IN   VARCHAR2
)
IS
   groupid   NUMBER;
/******************************************************************************
   NAME:       ADD_AUTOBUILD_FAILURE
   PURPOSE:

   REVISIONS:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        11/04/2006   Rupesh Solanki Created this procedure.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     ADD_AUTOBUILD_FAILURE
      Sysdate:         11/04/2006
      Date and Time:   11/04/2006, 9:28:28 AM, and 11/04/2006 9:28:28 AM
      Username:         (set in TOAD Options, Procedure Editor)
      Table Name:       (set in the "New PL/SQL Object" dialog)

******************************************************************************/
BEGIN
   BEGIN
      SELECT group_email_id
        INTO groupid
        FROM autobuild_failure
       WHERE proj_id = nprojid AND view_id = nviewid;
   EXCEPTION
      WHEN NO_DATA_FOUND
      THEN
         --  Create Next Sequence Id ---
         SELECT seq_group_email_id.NEXTVAL
           INTO groupid
           FROM DUAL;

         INSERT INTO autobuild_failure
                     (group_email_id, proj_id, view_id
                     )
              VALUES (groupid, nprojid, nviewid
                     );
   END;

   add_view_members (groupid, suserlist);
END add_autobuild_failure_info;

/
--------------------------------------------------------
--  DDL for Procedure ADD_COMPONENT
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."ADD_COMPONENT" ( nPvId IN RELEASE_COMPONENTS.PV_ID%TYPE,
	   	  		  						  	sFileName IN RELEASE_COMPONENTS.FILE_NAME%TYPE,
											sFilePath IN RELEASE_COMPONENTS.FILE_PATH%TYPE DEFAULT NULL,
											nByteSize IN RELEASE_COMPONENTS.BYTE_SIZE%TYPE,
											sCRCcksum IN RELEASE_COMPONENTS.CRC_CKSUM%TYPE DEFAULT NULL,
											sCRCmodcrc IN RELEASE_COMPONENTS.CRC_MODCRC%TYPE DEFAULT NULL
                                           ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0.0
   --------------------------------------------------------------------------- */


BEGIN

	 --- Insert into RELEASE_COMPONENTS
	 INSERT INTO RELEASE_COMPONENTS ( PV_ID, FILE_NAME, FILE_PATH, BYTE_SIZE, CRC_CKSUM, CRC_MODCRC )
	 VALUES ( nPvId, sFileName, sFilePath, nByteSize, sCRCcksum, sCRCmodcrc  );




END Add_Component;

/
--------------------------------------------------------
--  DDL for Procedure ADD_PACKAGE_INTEREST
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."ADD_PACKAGE_INTEREST" (
    nProjId    IN PROJECTS.PROJ_ID%TYPE,
    nPkgIdList IN VARCHAR2,
    nUserId    IN NUMBER )
IS
  npkgidcollector relmgr_number_tab_t := relmgr_number_tab_t ();
  nPkgId        NUMBER;
  alreadyExists NUMBER;
BEGIN
  npkgidcollector := in_list_number2 (nPkgIdList);
  FOR i IN 1..npkgidcollector.COUNT
  LOOP
    nPkgId := npkgidcollector(i);
    --- Ensure it doesn't already exist
    SELECT COUNT(*)
    INTO alreadyExists
    FROM PACKAGE_INTEREST
    WHERE USER_ID      = nUserId
    AND PKG_ID         = nPkgId
    AND PROJ_ID        = nProjId;

    IF ( alreadyExists = 0 ) THEN
      --- Insert into PACKAGE_INTEREST TABLE
      INSERT
        INTO PACKAGE_INTEREST (PROJ_ID, PKG_ID, USER_ID )
        VALUES (nProjId, nPkgId, nUserId );
    END IF;
  END LOOP;
END ADD_PACKAGE_INTEREST;

/
--------------------------------------------------------
--  DDL for Procedure ADD_RUNTIME_DEPENDENCY
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."ADD_RUNTIME_DEPENDENCY" ( NNpv_id IN NUMBER,
                                                     SSrtd_name IN PACKAGES.pkg_name%TYPE,
                                                     SSrtd_version IN PACKAGE_VERSIONS.pkg_version%TYPE,
                                                     NNuser_id IN NUMBER
                                                    ) IS
/* ---------------------------------------------------------------------------
    Version: 3.1
   --------------------------------------------------------------------------- */

    retRTD_ID NUMBER;

	CURSOR rtd_cur IS
        SELECT rtd_id FROM runtime_dependencies WHERE pv_id = NNpv_id AND rtd_id = retRTD_ID;
    rtd_rec rtd_cur%ROWTYPE;

BEGIN
    --- Seed database with package_name and version if required ---
    Seed_Package_Names_Versions ( SSrtd_name, SSrtd_version, NNuser_id, retRTD_ID );

	OPEN rtd_cur;
    FETCH rtd_cur INTO rtd_rec;

    IF rtd_cur%NOTFOUND
    THEN
		/* Make sure it does not exists already as runtime dependency */

		--- Add new Runtime Dependency ---
	    INSERT INTO runtime_dependencies ( pv_id, rtd_id, mod_date, mod_user )
	    VALUES (  NNpv_id, retRTD_ID, ora_sysdatetime , NNuser_id );

    	/* LOG ACTION */
        Log_Action ( NNpv_id, 'runtime_add', NNuser_id,
    			     'Runtime package: '|| SSrtd_name ||' '|| SSrtd_version );

	END IF;


END Add_Runtime_Dependency;

/
--------------------------------------------------------
--  DDL for Procedure ADD_VIEW_MEMBERS
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."ADD_VIEW_MEMBERS" (nGroupId IN NUMBER, sUserList IN VARCHAR2) IS

/******************************************************************************
   NAME:       ADD_VIEW_MEMBERS
   PURPOSE:

   REVISIONS:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        11/04/2006          1. Created this procedure.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     ADD_VIEW_MEMBERS
      Sysdate:         11/04/2006
      Date and Time:   11/04/2006, 9:52:58 AM, and 11/04/2006 9:52:58 AM
      Username:         (set in TOAD Options, Procedure Editor)
      Table Name:       (set in the "New PL/SQL Object" dialog)

******************************************************************************/
CURSOR user_cur IS
	SELECT u.USER_ID
	  FROM USERS u
	 WHERE u.USER_ID IN (
	 	   			   	SELECT *
						  FROM THE ( SELECT CAST( IN_LIST_NUMBER( sUserList ) AS RELMGR_NUMBER_TAB_t ) FROM dual )
						);
user_rec user_cur%ROWTYPE;


BEGIN

	 OPEN user_cur;
	 FETCH user_cur INTO user_rec;

	 WHILE user_cur%FOUND
	 LOOP
	 	 INSERT INTO MEMBERS_GROUP (GROUP_EMAIL_ID, USER_ID)
	 	 VALUES ( nGroupId, user_rec.USER_ID);

	 	 FETCH user_cur INTO user_rec;
	 END LOOP;



END ADD_VIEW_MEMBERS;

/
--------------------------------------------------------
--  DDL for Procedure BASIC_CLONE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."BASIC_CLONE" (
        nFROMpv_id IN NUMBER,
        nTOpv_id IN NUMBER,
        nRtag_id IN NUMBER,
        nUser_id IN NUMBER,
        nTOpkg_id IN NUMBER DEFAULT NULL,
        enumISSUES_STATE_IMPORTED IN NUMBER DEFAULT NULL ) IS

   FromVersion PACKAGE_VERSIONS.PKG_VERSION%TYPE;
   major NUMBER;
   minor NUMBER;
   patch NUMBER;
   buildn NUMBER;
   from_vcs_type_id NUMBER;
BEGIN
------------------------------ Version Control System ------------------------------------------
   SELECT vcs_type_id
      INTO from_vcs_type_id
      FROM package_versions WHERE pv_id = nFROMpv_id;

   UPDATE package_versions
      SET vcs_type_id = from_vcs_type_id
      WHERE pv_id = nTOpv_id;
------------------------------------- Limits ---------------------------------------------------
   select major_limit, minor_limit, patch_limit, build_number_limit
   into major, minor, patch, buildn
   from package_versions where pv_id=nFROMpv_id;
    UPDATE package_versions SET
           major_limit = major,
           minor_limit = minor,
           patch_limit = patch,
           build_number_limit = buildn
     WHERE PV_ID = nTOpv_id;
------------------------------------- Clone Dependencies ---------------------------------------------------
   IF NOT nRtag_id IS NULL
   THEN
      -- Auto Update Dependencies --
      INSERT INTO PACKAGE_DEPENDENCIES
           SELECT nTOpv_id AS pv_id,
                  DECODE(nUser_id,
                         frc.modifier_id,
                         frc.pv_id,
                         DECODE(frc.dlocked,
                                'Y',
                                frc.pv_id,
                                dep.dpv_id)
                         ) AS dpv_id,
                  nTOpkg_id AS pkg_id,
                  dep.dpkg_id,
                  dep.build_type,
                  dep.display_order
             FROM PACKAGE_DEPENDENCIES dep,
                  PACKAGE_VERSIONS pv,
                  (
                  /* Full Release Contents used for reference*/
                  SELECT rpv.pv_id, rpv.pkg_id, NVL(rpv.v_ext, '|LINK_A_NULL|') AS v_ext, rpv.modifier_id, rpv.dlocked
                  FROM RELEASE_CONTENT rel, PACKAGE_VERSIONS rpv
                  WHERE rel.pv_id = rpv.pv_id AND rtag_id = nRtag_id
                  ) frc
            WHERE dep.pv_id = nFROMpv_id
              AND dep.dpv_id = pv.pv_id
              AND pv.pkg_id = frc.pkg_id(+)
              AND NVL(pv.v_ext, '|LINK_A_NULL|') = frc.v_ext(+);
   ELSE
      -- Clone Dependencies --
      INSERT INTO PACKAGE_DEPENDENCIES
           SELECT nTOpv_id         AS pv_id,
                  dep.dpv_id,
                  nTOpkg_id        AS pkg_id,
                  dep.dpkg_id,
                  dep.build_type,
                  dep.display_order
             FROM PACKAGE_DEPENDENCIES dep
            WHERE dep.pv_id = nFROMpv_id;

   END IF;

----------------------------------------- Clone Issues -------------------------------------------------------
   IF enumISSUES_STATE_IMPORTED IS NULL
   THEN
        /* All Issues */
       INSERT INTO CQ_ISSUES ( pv_id, iss_db, iss_id, iss_state, mod_date, notes )
            SELECT nTOpv_id AS pv_id, iss_db, iss_id, iss_state, mod_date, notes
              FROM CQ_ISSUES
             WHERE pv_id = nFROMpv_id;
   ELSE
       /* Outstanding Issues Only */
       INSERT INTO CQ_ISSUES ( pv_id, iss_db, iss_id, iss_state, mod_date, notes )
            SELECT nTOpv_id AS pv_id, iss_db, iss_id, iss_state, mod_date, notes
              FROM CQ_ISSUES
             WHERE pv_id = nFROMpv_id
               AND iss_state = enumISSUES_STATE_IMPORTED;
   END IF;

------------------------------------ Clone Runtime Dependencies -----------------------------------------------
   INSERT INTO RUNTIME_DEPENDENCIES (pv_id, rtd_id, rtd_url, rtd_comments, mod_date, mod_user)
       SELECT nTOpv_id AS pv_id, rtd_id, rtd_url, rtd_comments, mod_date, mod_user
       FROM RUNTIME_DEPENDENCIES WHERE pv_id = nFROMpv_id;

--------------------------------------- Clone Additional Notes ------------------------------------------------
   INSERT INTO ADDITIONAL_NOTES ( NOTE_ID, PV_ID, NOTE_TITLE, NOTE_BODY, MOD_DATE, MOD_USER )
        SELECT an.NOTE_ID,
               nTOpv_id AS PV_ID,
               an.NOTE_TITLE,
               an.NOTE_BODY,
               an.MOD_DATE,
               an.MOD_USER
          FROM ADDITIONAL_NOTES an
         WHERE an.PV_ID = nFROMpv_id;

-------------------------------------------- Clone Unit Tests -------------------------------------------------
-- Only clone 'Auto Unit Test', 'Interactive Unit Test' and 'Autobuild UTF'
-- Only clone the basic information: TEST_SUMMARY

    INSERT INTO UNIT_TESTS (
                            TEST_ID,
                            PV_ID,
                            TEST_TYPES_FK,
                            TEST_SUMMARY
                           )
       SELECT ut.TEST_ID,
              nTOpv_id AS PV_ID,
              ut.TEST_TYPES_FK,
              ut.TEST_SUMMARY
         FROM UNIT_TESTS ut
        WHERE ut.PV_ID = nFROMpv_id
          AND ut.TEST_TYPES_FK IN (5,6,7);

-------------------------------------------- Clone Package Documents ------------------------------------------
   INSERT INTO PACKAGE_DOCUMENTS ( PV_ID, TEST_ID, DOC_NUM, DOC_ID, IS_LATEST )
        SELECT nTOpv_id AS PV_ID,
               pd.test_id,
               pd.doc_num,
               pd.doc_id,
               pd.IS_LATEST
          FROM PACKAGE_DOCUMENTS pd
         WHERE pd.PV_ID = nFROMpv_id;

-------------------------------------------- Clone Build Environments -----------------------------------------
    INSERT INTO PACKAGE_BUILD_ENV ( PV_ID, BE_ID, BUILD_TYPE )
    SELECT nTOpv_id AS PV_ID,
           pkgbe.BE_ID,
           pkgbe.BUILD_TYPE
      FROM PACKAGE_BUILD_ENV pkgbe
     WHERE pkgbe.PV_ID = nFROMpv_id;

---------------------------------------------Clone Package Build Info------------------------------------------
    INSERT INTO PACKAGE_BUILD_INFO (PV_ID, BM_ID, BSA_ID)
    SELECT nTOpv_id AS PV_ID,
           pkgbinfo.BM_ID,
           pkgbinfo.BSA_ID
      FROM PACKAGE_BUILD_INFO pkgbinfo
     WHERE pkgbinfo.PV_ID = nFROMpv_id;

---------------------------------------------Clone Package Version Processes-----------------------------------
    INSERT INTO PACKAGE_PROCESSES ( PV_ID, PROC_ID )
    SELECT nTOpv_id AS PV_ID,
           pp.PROC_ID
      FROM PACKAGE_PROCESSES pp
     WHERE pp.PV_ID = nFROMpv_id;

---------------------------------------------Clone Licencing Associations-----------------------------------
    PK_LICENCING.CLONE_LICENCING(nFROMpv_id, nTOpv_id, nUser_id);
---------------------------------------------------------------------------------------------------------------

    /* LOG ACTION */
    SELECT pv.PKG_VERSION INTO FromVersion
      FROM PACKAGE_VERSIONS pv
     WHERE pv.PV_ID = nFROMpv_id;

    Log_Action ( nTOpv_id, 'clone_from', nUser_id,
                 'Details cloned from: '|| FromVersion );

---------------------------------------------------------------------------------------------------------------

END Basic_Clone;

/
--------------------------------------------------------
--  DDL for Procedure BUILD_TREE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."BUILD_TREE" ( nRtag_id IN NUMBER,
	   	  		  					     retSessionNum OUT NUMBER ) IS

/* ---------------------------------------------------------------------------
    Version: 3.0.0
   --------------------------------------------------------------------------- */
    rowCnt 			NUMBER := 0;						-- Iterations counter
    iteration 		NUMBER := 1;                  -- Maximum number of iterations allowed.
    maxIterations 	NUMBER := 50;      	  	-- This will prevent infinite loops if cyrcular dependencies are found
	UP_THE_TREE 	CONSTANT NUMBER DEFAULT 1;
	DOWN_THE_TREE 	CONSTANT NUMBER DEFAULT -1;
    sessionNum 		NUMBER;
	levelNum		NUMBER;

BEGIN
    SELECT SEQ_session_num.nextval INTO sessionNum FROM DUAL;

	/*
	||	   Start UP THE TREE
	*/


	/* Packages with no dependencies */
    INSERT INTO TEMP_TREE_BROWSE (SESSION_NUM, LEVEL_NUM, DIRECTION, PV_ID, PKG_ID, V_EXT )
		SELECT sessionNum AS SESSION_NUM,
			   iteration AS LEVEL_NUM,
			   UP_THE_TREE AS DIRECTION,
			   rc.pv_id, pv.pkg_id, pv.v_ext
		  FROM release_content rc,
		  	   package_versions pv
		 WHERE rc.rtag_id = nRtag_id
		   AND rc.pv_id = pv.pv_id
		 MINUS
		SELECT sessionNum AS SESSION_NUM,
			   iteration AS LEVEL_NUM,
			   UP_THE_TREE AS DIRECTION,
			   dep.pv_id, pv.pkg_id, pv.v_ext
		  FROM package_dependencies dep,
		  	   package_versions pv
		 WHERE dep.pv_id IN ( SELECT pv_id FROM release_content WHERE rtag_id = nRtag_id )
		   AND dep.pv_id = pv.pv_id;


	/* Browse UP the build tree */
	iteration := iteration + 1;
    LOOP

		INSERT INTO TEMP_TREE_BROWSE (SESSION_NUM, LEVEL_NUM, DIRECTION, PV_ID, PKG_ID, V_EXT )
			SELECT DISTINCT
			       sessionNum AS SESSION_NUM,
			       iteration AS LEVEL_NUM,
				   UP_THE_TREE AS DIRECTION,
				   rdep.pv_id, rdep.pkg_id, rdep.v_ext
			  FROM (
			        SELECT dep.pv_id, pv.pkg_id, pv.v_ext, dep.dpv_id, dpv.pkg_id AS dpkg_id, dpv.v_ext AS dv_ext
			          FROM package_dependencies dep,
			               release_content rc,
						   package_versions pv,
						   package_versions dpv
			         WHERE dep.pv_id = rc.pv_id
			           AND rc.rtag_id = nRtag_id
					   AND dep.pv_id = pv.pv_id
					   AND dep.dpv_id = dpv.pv_id
					) rdep,
					temp_tree_browse ttb
			 WHERE rdep.dpkg_id  = ttb.pkg_id
			   AND NVL(rdep.dv_ext ,'|LINK_A_NULL|') = NVL(ttb.v_ext,'|LINK_A_NULL|')
			   AND ttb.SESSION_NUM = sessionNum
			   AND ttb.LEVEL_NUM = iteration - 1
			MINUS
			/* Packages with all depencencies NOT matched */
			SELECT DISTINCT
			       sessionNum AS SESSION_NUM,
			       iteration AS LEVEL_NUM,
				   UP_THE_TREE AS DIRECTION,
				   rdep.pv_id, rdep.pkg_id, rdep.v_ext
			  FROM (
			        SELECT dep.pv_id, pv.pkg_id, pv.v_ext, dep.dpv_id, dpv.pkg_id AS dpkg_id, dpv.v_ext AS dv_ext
			          FROM package_dependencies dep,
			               release_content rc,
						   package_versions pv,
						   package_versions dpv
			         WHERE dep.pv_id = rc.pv_id
			           AND rc.rtag_id = nRtag_id
					   AND dep.pv_id = pv.pv_id
					   AND dep.dpv_id = dpv.pv_id
					) rdep,
					(
					 SELECT tb.*
					   FROM temp_tree_browse tb
					  WHERE tb.SESSION_NUM = sessionNum
					) ttb
			 WHERE rdep.dpkg_id  = ttb.pkg_id (+)
			   AND NVL(rdep.dv_ext ,'|LINK_A_NULL|') = NVL(ttb.v_ext (+),'|LINK_A_NULL|')
			   AND ttb.SESSION_NUM IS NULL;

		rowCnt := SQL%ROWCOUNT;
		IF rowCnt > 0 THEN
           iteration := iteration + 1;
		END IF;
        EXIT WHEN (rowCnt < 1) OR (iteration > maxIterations);
    END LOOP;

	/*---------------------------------------------------------------------------------------------------------------------*/

	/*     Check for unresolved dependencies
	||
	*/
	/* UNRESOLVED */
	 SELECT COUNT(*) INTO rowCnt
	   FROM (
			 SELECT pv.pv_id, pv.pkg_id, pv.v_ext
			  FROM release_content rc,
			  	   package_versions pv
			 WHERE rc.rtag_id = nRtag_id
			   AND rc.pv_id = pv.pv_id
			MINUS
			SELECT ttb.pv_id, ttb.pkg_id, ttb.v_ext
			  FROM temp_tree_browse ttb
			 WHERE ttb.session_num = sessionNum
			);



	 IF rowCnt > 0
	 THEN
	 	 /*     Circular dependencies detected.
		 ||     Try to resolve build order from the top now.
		 ||		Start DOWN THE TREE
		 */

		iteration := 0;
		 /* Top Level packages */
		INSERT INTO TEMP_TREE_BROWSE (SESSION_NUM, LEVEL_NUM, DIRECTION, PV_ID, PKG_ID, V_EXT )
			SELECT sessionNum AS SESSION_NUM,
			       iteration AS LEVEL_NUM,
				   DOWN_THE_TREE AS DIRECTION,
				   pv.pv_id, pv.pkg_id, pv.v_ext
			  FROM (
					/* Packages no one depends on ( Top level packages )*/
					(
					/* All parents*/
					SELECT pv.pkg_id, pv.v_ext
			          FROM package_dependencies dep,
			               release_content rc,
						   package_versions pv
			         WHERE dep.pv_id = rc.pv_id
			           AND rc.rtag_id = nRtag_id
					   AND dep.pv_id = pv.pv_id
					 MINUS
					 /* All children */
					SELECT dpv.pkg_id, dpv.v_ext
			          FROM package_dependencies dep,
			               release_content rc,
						   package_versions dpv
			         WHERE dep.pv_id = rc.pv_id
			           AND rc.rtag_id = nRtag_id
					   AND dep.dpv_id = dpv.pv_id
					 )
					 MINUS
					/* Packages with resolved dependencies from UP THE TREE */
					SELECT ttb.pkg_id, ttb.v_ext
					  FROM temp_tree_browse ttb
					 WHERE ttb.session_num = sessionNum
				  ) tpkg,
				  package_versions pv,
				  release_content rc
			WHERE rc.rtag_id = nRtag_id
			  AND rc.pv_id = pv.pv_id
			  AND tpkg.pkg_id = pv.pkg_id
			  AND NVL(tpkg.v_ext,'|LINK_A_NULL|') = NVL(pv.v_ext,'|LINK_A_NULL|');


		 /* Keep taking packages which no one depende on */
		 iteration := iteration - 1;
		 LOOP
			   INSERT INTO TEMP_TREE_BROWSE (SESSION_NUM, LEVEL_NUM, DIRECTION, PV_ID, PKG_ID, V_EXT )
					SELECT sessionNum AS SESSION_NUM,
					       iteration AS LEVEL_NUM,
					       DOWN_THE_TREE AS DIRECTION,
					       pv.pv_id, pv.pkg_id, pv.v_ext
					  FROM (
					 	/* All Unresolved */
					 	(
					 	SELECT pv.pkg_id, pv.v_ext
					 	  FROM release_content rc,
					 	  	   package_versions pv
					 	 WHERE rc.rtag_id = nRtag_id
					 	   AND rc.pv_id = pv.pv_id
					 	MINUS
					 	SELECT ttb.pkg_id, ttb.v_ext
					 	  FROM temp_tree_browse ttb
					 	 WHERE ttb.session_num = sessionNum
					 	)
					 	 MINUS
					 	(
					 	 /* Children of Unresolved */
					 	SELECT dpv.pkg_id, dpv.V_EXT
					 	  FROM (
					 			SELECT pv.pv_id, pv.pkg_id, pv.v_ext
					 			  FROM release_content rc,
					 			  	   package_versions pv
					 			 WHERE rc.rtag_id = nRtag_id
					 			   AND rc.pv_id = pv.pv_id
					 			MINUS
					 			SELECT ttb.pv_id, ttb.pkg_id, ttb.v_ext
					 			  FROM temp_tree_browse ttb
					 			 WHERE ttb.session_num = sessionNum
					 		   ) unr,
					 		   package_dependencies dep,
					 		   package_versions dpv
					 	 WHERE unr.pv_id = dep.pv_id
					 	   AND dep.dpv_id = dpv.pv_id
					 	 )
					   ) tpkg,
					   package_versions pv,
					   release_content rc
					WHERE rc.rtag_id = nRtag_id
					  AND rc.pv_id = pv.pv_id
					  AND tpkg.pkg_id = pv.pkg_id
					  AND NVL(tpkg.v_ext,'|LINK_A_NULL|') = NVL(pv.v_ext,'|LINK_A_NULL|');

            rowCnt := SQL%ROWCOUNT;
        	IF rowCnt > 0 THEN
	           iteration := iteration - 1;
			END IF;
            EXIT WHEN (rowCnt < 1);
     	END LOOP;

	 END IF;


	/*---------------------------------------------------------------------------------------------------------------------*/

	/*
	|| 	 Save results from temp table
	*/
	/* Clean up build_order table */
	DELETE FROM BUILD_ORDER WHERE rtag_id = nRtag_id;

	/* Save UP THE TREE */
	INSERT INTO BUILD_ORDER ( RTAG_ID, STEP_NUM, PV_ID )
		SELECT nRtag_id AS rtag_id,
			   ttb.level_num AS step_num,
			   ttb.PV_ID
		  FROM temp_tree_browse ttb
		 WHERE ttb.session_num = sessionNum
		   AND ttb.direction = UP_THE_TREE;

	/*Get last step_num */
	SELECT MAX(ttb.level_num) + 1 INTO levelNum
	FROM temp_tree_browse ttb WHERE ttb.session_num = sessionNum AND ttb.DIRECTION = UP_THE_TREE;

	/* UNRESOLVED */
	 SELECT COUNT(*) INTO rowCnt
	   FROM (
			 SELECT pv.pv_id, pv.pkg_id, pv.v_ext
			  FROM release_content rc,
			  	   package_versions pv
			 WHERE rc.rtag_id = nRtag_id
			   AND rc.pv_id = pv.pv_id
			MINUS
			SELECT ttb.pv_id, ttb.pkg_id, ttb.v_ext
			  FROM temp_tree_browse ttb
			 WHERE ttb.session_num = sessionNum
			);


	IF rowCnt > 0
	THEN
		/* Save unresolved packages */
 		INSERT INTO BUILD_ORDER ( RTAG_ID, STEP_NUM, PV_ID, UNRESOLVED )
		    SELECT  nRtag_id AS rtag_id,
				    levelNum AS step_num,
				    upv.PV_ID,
					'Y' AS UNRESOLVED
			   FROM (
					 SELECT pv.pv_id, pv.pkg_id, pv.v_ext
					  FROM release_content rc,
					  	   package_versions pv
					 WHERE rc.rtag_id = nRtag_id
					   AND rc.pv_id = pv.pv_id
					MINUS
					SELECT ttb.pv_id, ttb.pkg_id, ttb.v_ext
					  FROM temp_tree_browse ttb
					 WHERE ttb.session_num = sessionNum
					) upv;
	END IF;

	/* Save DOWN THE TREE */
	levelNum := 1000;
	INSERT INTO BUILD_ORDER ( RTAG_ID, STEP_NUM, PV_ID )
		SELECT nRtag_id AS rtag_id,
			   levelNum + ttb.level_num  AS step_num,
			   ttb.PV_ID
		  FROM temp_tree_browse ttb
		 WHERE ttb.session_num = sessionNum
		   AND ttb.direction = DOWN_THE_TREE;


	/*---------------------------------------------------------------------------------------------------------------------*/

	/* Clean up temp table */
	DELETE FROM TEMP_TREE_BROWSE WHERE session_num = sessionNum;

	retSessionNum := sessionNum;
END Build_Tree;

/
--------------------------------------------------------
--  DDL for Procedure CHANGE_PACKAGE_STATE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."CHANGE_PACKAGE_STATE" ( nPvId IN PACKAGE_VERSIONS.PV_ID%TYPE,
											 nRtagId IN RELEASE_TAGS.RTAG_ID%TYPE ) IS
/* ---------------------------------------------------------------------------
    Version: 4.0
   --------------------------------------------------------------------------- */

BEGIN

    -- Unlock Package
    UPDATE RELEASE_CONTENT rc SET
    	rc.PKG_STATE = 0
    WHERE rc.PV_ID = nPvId
	AND rc.RTAG_ID = nRtagId;

    /* LOG ACTION */
   /*	Log_Action ( nPvId, 'unlock_package', nUserId );*/

END Change_Package_State;

/
--------------------------------------------------------
--  DDL for Procedure CHANGE_RELEASE_MODE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."CHANGE_RELEASE_MODE" ( nModeCode IN NUMBER, nRtagId IN NUMBER, UserId IN NUMBER ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0.0
   --------------------------------------------------------------------------- */

	cMode CHAR(1) := NULL;
	nProjId NUMBER;

BEGIN


	/*
	Author: Rupesh Solanki
	Modified: 24th October 2006
	Reason: Added the archive mode state into Release Manager
	||	1 - Open Mode
	||	2 - Restrictive Mode
	||	3 - Closed Mode
	||	4 - CCB Mode
	||	5 - Archive Mode
  ||  6 - Preserve Mode
	*/
	-- Get project Id
	SELECT rt.PROJ_ID INTO nProjId
	  FROM RELEASE_TAGS rt
	 WHERE rt.RTAG_ID = nRtagId;

	IF nModeCode = 1 THEN
		-- Open Mode
		cMode := 'N';

		/* LOG ACTION */
   		Log_Project_Action ( nProjId, 'set_to_open_mode', UserId, 'Release is set to Open Mode', nRtagId );

	ELSIF nModeCode = 2 THEN
		-- Restrictive Mode
		cMode := 'R';

		/* LOG ACTION */
   		Log_Project_Action ( nProjId, 'set_to_restrictive_mode', UserId, 'Release is set to Restrictive Mode', nRtagId );

	ELSIF nModeCode = 3 THEN
		-- Closed Mode
		cMode := 'Y';

		/* LOG ACTION */
   		Log_Project_Action ( nProjId, 'set_to_closed_mode', UserId, 'Release is set to Closed Mode', nRtagId  );

	ELSIF nModeCode = 4 THEN
		-- CCB Mode
		cMode := 'C';

		/* LOG ACTION */
   		Log_Project_Action ( nProjId, 'set_to_ccb_mode', UserId, 'Release is set to CCB Mode', nRtagId  );

	ELSIF nModeCode = 5 THEN
		-- Archive Mode
		cMode := 'A';

		/* LOG ACTION */
   		Log_Project_Action ( nProjId, 'set_to_archive_mode', UserId, 'Release is set to Archive Mode', nRtagId  );

  ELSIF nModeCode = 6 THEN
		-- Archive Mode
		cMode := 'P';

		/* LOG ACTION */
   		Log_Project_Action ( nProjId, 'set_to_archive_mode', UserId, 'Release is set to Preserve Mode', nRtagId  );
	END IF;



	-- Now update table
	IF NOT cMode IS NULL THEN
		UPDATE RELEASE_TAGS rt SET
		rt.OFFICIAL = cMode,
    rt.OFFICIAL_STAMP = ORA_SYSDATETIME,
    rt.OFFICIAL_ID = UserId
		WHERE rt.RTAG_ID = nRtagId;

	END IF;


END CHANGE_RELEASE_MODE;

/
--------------------------------------------------------
--  DDL for Procedure CHECK_NEW_PATCHES
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."CHECK_NEW_PATCHES" (
   nrtagid   IN   release_content.rtag_id%TYPE
)
IS
/* ---------------------------------------------------------------------------
    Version: 3.0
   --------------------------------------------------------------------------- */
BEGIN
   /*--------------- Business Rules Here -------------------*/
   /*IF nRtagId NOT IN (SELECT RTAG_ID FROM RELEASE_TAGS ) THEN
      RAISE_APPLICATION_ERROR (-20000, 'Please contact the person in charge of Release Manager now.' );
   END IF

   /*-------------------------------------------------------*/
   UPDATE release_content rc
      SET rc.pkg_state = 5                          -- enumPKG_STATE_NEW_PATCH
    WHERE rc.pv_id IN (
             SELECT prod.pv_id
               FROM (SELECT   pp.pv_id AS orig_parent_id,
                              COUNT (*) AS num_of_patches
                         FROM release_content rc, package_patches pp
                        WHERE rc.pv_id = pp.pv_id AND rc.rtag_id = nrtagid
                     GROUP BY pp.pv_id) orig,
                    (SELECT   prodpp.pv_id, pp.pv_id AS parent_id,
                              COUNT (*) AS num_of_patches
                         FROM release_content rc,
                              package_patches pp,
                              package_dependencies dep,
                              package_versions pv,
                              package_patches prodpp
                        WHERE rc.pv_id = pp.pv_id
                          AND rc.rtag_id = nrtagid
                          AND pp.patch_id = dep.dpv_id
                          AND dep.pv_id = pv.pv_id
                          AND pv.is_patch = 'Y'
                          AND pv.dlocked = 'Y'
                          AND prodpp.patch_id = dep.pv_id
                     GROUP BY prodpp.pv_id, pp.pv_id) prod,
                    release_content rc
              WHERE orig.orig_parent_id = prod.pv_id
                AND orig.num_of_patches != prod.num_of_patches
                AND rc.rtag_id = nrtagid
                AND rc.pv_id = prod.pv_id
                AND rc.pkg_state = 0
             UNION
             SELECT   prodpp.pv_id
                 FROM release_content rc,
                      package_patches pp,
                      package_dependencies dep,
                      package_versions pv,
                      package_patches prodpp
                WHERE rc.pv_id = pp.pv_id
                  AND rc.rtag_id = nrtagid
                  AND pp.patch_id = dep.dpv_id
                  AND dep.pv_id = pv.pv_id
                  AND pv.is_patch = 'Y'
                  AND pv.dlocked = 'Y'
                  AND prodpp.patch_id = dep.pv_id
             GROUP BY prodpp.pv_id, pp.pv_id
             MINUS
             SELECT   pp.pv_id
                 FROM release_content rc, package_patches pp
                WHERE rc.pv_id = pp.pv_id AND rc.rtag_id = nrtagid
             GROUP BY pp.pv_id);
END check_new_patches;

/
--------------------------------------------------------
--  DDL for Procedure CLEAN_ADVISORY_RIPPLE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."CLEAN_ADVISORY_RIPPLE" (nrtagid IN NUMBER)
IS
/******************************************************************************
   NAME:       clean_advisory_ripple

   PURPOSE:    To delete entries from the advisory_ripple table based upon
               an RTAG_ID only

               This is a tidy-up operation performed against the advisory_ripple
               table, ensuring that the table does not have rtag_id/pv_id
               combinations that cannot be found in the release's wip/pending/release
               tabs.

******************************************************************************/
BEGIN
   -- Delete any invalid rtag_id/pv_id combination from the advisory_ripple table.
   -- An invalid rtag_id/pv_id combination is one that cannot be found in the
   -- work_in_progress, planned, or release_content table.
   -- NOTE: Planned operations that represent pending additive/subtractive merge
   -- operations are ignored because they have not been approved yet and so
   -- cannot be said to be "in the release".
   DELETE FROM advisory_ripple
         WHERE rtag_id = nrtagid
           AND pv_id not in
               ((SELECT pv_id FROM release_content WHERE rtag_id = nrtagid)
                 UNION
                (SELECT pv_id FROM work_in_progress WHERE rtag_id = nrtagid)
                 UNION
                (SELECT pv_id FROM planned WHERE rtag_id = nrtagid AND (operation is null OR operation = 'R'))
               );
END clean_advisory_ripple;

/
--------------------------------------------------------
--  DDL for Procedure CLEAN_DO_NOT_RIPPLE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."CLEAN_DO_NOT_RIPPLE" (nrtagid IN NUMBER)
IS
/******************************************************************************
   NAME:       clean_do_not_ripple

   PURPOSE:    To delete entries from the do_not_ripple table based upon
               an RTAG_ID only

               This is a tidy-up operation performed against the do_not_ripple
               table, ensuring that the table does not have rtag_id/pv_id
               combinations that cannot be found in the release's wip/pending/release
               tabs.

******************************************************************************/
BEGIN
   -- Delete any invalid rtag_id/pv_id combination from the do_not_ripple table.
   -- An invalid rtag_id/pv_id combination is one that cannot be found in the
   -- work_in_progress, planned, or release_content table.
   -- NOTE: Planned operations that represent pending additive/subtractive merge
   -- operations are ignored because they have not been approved yet and so
   -- cannot be said to be "in the release".
   DELETE FROM do_not_ripple
         WHERE rtag_id = nrtagid
           AND pv_id not in
               ((SELECT pv_id FROM release_content WHERE rtag_id = nrtagid)
                 UNION
                (SELECT pv_id FROM work_in_progress WHERE rtag_id = nrtagid)
                 UNION
                (SELECT pv_id FROM planned WHERE rtag_id = nrtagid AND (operation is null OR operation = 'R'))
               );
END clean_do_not_ripple;

/
--------------------------------------------------------
--  DDL for Procedure CLEAR_ADVISORY_RIPPLE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."CLEAR_ADVISORY_RIPPLE" ( nPvId IN PACKAGE_VERSIONS.PV_ID%TYPE,
	   	  		  							   nRtagId IN RELEASE_TAGS.RTAG_ID%TYPE,
											 nUserId IN NUMBER ) IS
/* ---------------------------------------------------------------------------
    Version: 4.0
   --------------------------------------------------------------------------- */

BEGIN

    -- Clear Advisory Ripple Package
    DELETE FROM ADVISORY_RIPPLE
	WHERE PV_ID = nPvId
	AND RTAG_ID = nRtagId;

    /* LOG ACTION */
   	Log_Action ( nPvId, 'clear_advisory_ripple', nUserId );

	/*Rebuild_Environment(nRtagId);*/

END Clear_Advisory_Ripple;

/
--------------------------------------------------------
--  DDL for Procedure CLONED_PACKAGE_PROCESSES
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."CLONED_PACKAGE_PROCESSES" 
IS

proc_id NUMBER;
/******************************************************************************
   NAME:       DELETE_DO_NOT_RIPPLE
   PURPOSE:    TO DELETE ENTRIES FROM THE DO_NOT_RIPPLE TABLE WHEN A PACKAGE
               IS RELEASED

   REVISIONS:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        21/04/2006  Rupesh Solanki     1. Created this procedure.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     DELETE_DO_NOT_RIPPLE
      Sysdate:         21/04/2006
      Date and Time:   21/04/2006, 3:21:55 PM, and 21/04/2006 3:21:55 PM
      Username:         (set in TOAD Options, Procedure Editor)
      Table Name:       (set in the "New PL/SQL Object" dialog)

******************************************************************************/
   CURSOR ripple_cur
   IS
      select distinct proc_id, prod_id from deployment_manager.processes_config;

   ripple_rec   ripple_cur%ROWTYPE;
BEGIN
   OPEN ripple_cur;

   FETCH ripple_cur
    INTO ripple_rec;

   WHILE ripple_cur%FOUND
   LOOP



insert into package_processes (PROC_ID, PV_ID)
values( ripple_rec.proc_id, ripple_rec.prod_id);

      FETCH ripple_cur
       INTO ripple_rec;
   END LOOP;
END CLONED_PACKAGE_PROCESSES;

/
--------------------------------------------------------
--  DDL for Procedure CLONED_PROCESSES
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."CLONED_PROCESSES" 
IS

proc_id NUMBER;
/******************************************************************************
   NAME:       DELETE_DO_NOT_RIPPLE
   PURPOSE:    TO DELETE ENTRIES FROM THE DO_NOT_RIPPLE TABLE WHEN A PACKAGE
               IS RELEASED

   REVISIONS:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        21/04/2006  Rupesh Solanki     1. Created this procedure.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     DELETE_DO_NOT_RIPPLE
      Sysdate:         21/04/2006
      Date and Time:   21/04/2006, 3:21:55 PM, and 21/04/2006 3:21:55 PM
      Username:         (set in TOAD Options, Procedure Editor)
      Table Name:       (set in the "New PL/SQL Object" dialog)

******************************************************************************/
   CURSOR ripple_cur
   IS
      select distinct pkg_health_tag, cmd_interface, pkg_owner, is_interface from deployment_manager.processes_config;

   ripple_rec   ripple_cur%ROWTYPE;
BEGIN
   OPEN ripple_cur;

   FETCH ripple_cur
    INTO ripple_rec;

   WHILE ripple_cur%FOUND
   LOOP

   select deployment_manager.seq_proc_id.nextval into proc_id from dual;

insert into processes (PROC_ID, PROC_NAME, RUN_AS, PKG_OWNER, IS_INTERFACE)
values(proc_id, ripple_rec.pkg_health_tag, ripple_rec.cmd_interface, ripple_rec.pkg_owner, ripple_rec.is_interface);

      FETCH ripple_cur
       INTO ripple_rec;
   END LOOP;
END CLONED_PROCESSES;

/
--------------------------------------------------------
--  DDL for Procedure DELETE_AUTOBUILD_FAILURE_INFO
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."DELETE_AUTOBUILD_FAILURE_INFO" 
IS
/******************************************************************************
   NAME:       DELETE_AUTOBUILD_FAILURE_INFO
   PURPOSE:

   REVISIONS:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        2/06/2006    Rupesh Solanki      1. Created this procedure.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     DELETE_AUTOBUILD_FAILURE_INFO
      Sysdate:         2/06/2006
      Date and Time:   2/06/2006, 8:44:25 AM, and 2/06/2006 8:44:25 AM
      Username:         (set in TOAD Options, Procedure Editor)
      Table Name:       (set in the "New PL/SQL Object" dialog)

******************************************************************************/
BEGIN
   DELETE FROM autobuild_failure
         WHERE group_email_id NOT IN (SELECT group_email_id
                                        FROM members_group);
END delete_autobuild_failure_info;

/
--------------------------------------------------------
--  DDL for Procedure DEPRECATE_PACKAGE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."DEPRECATE_PACKAGE" (
    nPvId     IN PACKAGE_VERSIONS.PV_ID%TYPE,
    nRtagId   IN DEPRECATED_PACKAGES.RTAG_ID%TYPE,
    nPkgId    IN DEPRECATED_PACKAGES.PKG_ID%TYPE,
    sComments IN DEPRECATED_PACKAGES.COMMENTS%TYPE,
    nUserId   IN NUMBER)
IS
  ext VARCHAR2(50);
BEGIN
  --Extract the package version extension
  SELECT V_EXT INTO ext
  FROM PACKAGE_VERSIONS
  WHERE PV_ID = nPvId;

  -- Deprecate Package
  INSERT INTO DEPRECATED_PACKAGES
    ( RTAG_ID, PKG_ID, COMMENTS, V_EXT )
    VALUES ( nRtagId, nPkgId, sComments, ext );

  -- Update Release Contents entry
  -- Process PackageName.ext for the package. ie: Allow multiple
  -- versions of the package to be in the release.
    UPDATE RELEASE_CONTENT
    SET
      DEPRECATED_STATE = 6
    WHERE RTAG_ID      = nRtagId
    AND PV_ID IN (
      SELECT PV.PV_ID
      FROM PACKAGE_VERSIONS PV
      WHERE PV.PKG_ID   = nPkgId
      AND NVL(PV.V_EXT, '.NULL') = NVL(ext,'.NULL')
      );

  -- Update consumers of the package
  --  Update ALL packages in the Release

  REBUILD_DEPRECATE_STATE(nRtagId);

  /* LOG ACTION */
  /*Log_Action ( nPkgId, 'deprecated_package', nUserId );*/
END Deprecate_Package;

/
--------------------------------------------------------
--  DDL for Procedure DT_DROPUSEROBJECTBYID
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."DT_DROPUSEROBJECTBYID" ( PARAM_ID IN NUMBER ) AS BEGIN DELETE FROM MICROSOFTDTPROPERTIES WHERE OBJECTID = PARAM_ID; END DT_DROPUSEROBJECTBYID;

/
--------------------------------------------------------
--  DDL for Procedure DT_SETPROPERTYBYID
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."DT_SETPROPERTYBYID" (
    PARAM_ID       IN NUMBER,
    PARAM_PROPERTY IN VARCHAR2,
    PARAM_VALUE    IN VARCHAR2,
    PARAM_LVALUE   IN LONG RAW )
AS
BEGIN
  DECLARE
    X NUMBER(38);
  BEGIN
    SELECT COUNT(*)
    INTO X
    FROM MICROSOFTDTPROPERTIES
    WHERE OBJECTID=PARAM_ID
    AND PROPERTY  =PARAM_PROPERTY;
    IF X          = 0 THEN
      INSERT
      INTO MICROSOFTDTPROPERTIES
        (
          ID,
          PROPERTY,
          OBJECTID,
          VALUE,
          LVALUE,
          VERSION
        )
        VALUES
        (
          MICROSOFTSEQDTPROPERTIES.NEXTVAL,
          PARAM_PROPERTY,
          PARAM_ID,
          PARAM_VALUE,
          PARAM_LVALUE,
          0
        );
    ELSE
      UPDATE MICROSOFTDTPROPERTIES
      SET VALUE     =PARAM_VALUE,
        LVALUE      =PARAM_LVALUE,
        VERSION     =VERSION+1
      WHERE OBJECTID=PARAM_ID
      AND PROPERTY  =PARAM_PROPERTY;
    END IF;
  END;
END DT_SETPROPERTYBYID;

/
--------------------------------------------------------
--  DDL for Procedure IGNORE_DEPENDENCY_WARNINGS
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."IGNORE_DEPENDENCY_WARNINGS" ( nRtagId IN IGNORE_WARNINGS.RTAG_ID%TYPE,
                                                         nPvId IN IGNORE_WARNINGS.PV_ID%TYPE,
                                                         sIgnoreIdList IN VARCHAR2,
                                                         bDoPatchIgnore IN BOOLEAN DEFAULT FALSE,
                                                         nUserId IN NUMBER DEFAULT NULL ) IS
/* ---------------------------------------------------------------------------
    Updates the ignore warnings table - this is really two functions in one.

    1) One function updates the table based on a list of dependent PV_IDs and a parent PV_ID
       and is called from the RM website's SetIgnoreWarnings() function after a user changes
       the ignore warnings checkboxes and submits the form.
       This can (at time of writing this) only be done within releases that are not build
       daemon enabled. The ignore warnings feature is a feature we would like to see the end
       of in an ideal world.
       The SetIgnoreWarnings() website function now calls Touch_Release so there is no need to
       do so in this stored procedure, thereby making this stored procedure much more precise in
       that it only updates the ignore_warnings table (action log table too although that is just
       a log and doesn't affect any subsequent business rules behaviour) and it cares nothing
       about website presentation layer states, etc.

    2) The other function updates the table for out of sync dependencies that have in fact
       been satisfied by patches made to some other product in the release.
       This seems to be a seldom used feature in current projects.
       It is probably the most often taken path through this function given that it occurs when
       this function is called from Rebuild_Environment, and that is called in many circumstances
       from the RM website whenever the seems to be a possibility that the state of a package
       in a release might have changed and therefore affects the state of other packages in
       that same release.

    Parameter Usage:
                        when called from    | when called from
                        Rebuild_Environment | SetIgnoreWarnings()
                        stored procedure.   | in the Website
      --------------------------------------+----------------------------
      nRtagId           RTAG_ID             | RTAG_ID
      nPvId             NULL                | PV_ID
      sIgnoreIdList     NULL                | list of dependent PV_ID's
      bDoPatchIgnore    TRUE                | FALSE
      nUserId           NULL                | current user ID
   --------------------------------------------------------------------------- */

oIgnoreIdCollector RELMGR_NUMBER_TAB_t := RELMGR_NUMBER_TAB_t();
ReleaseLocation VARCHAR2(4000);
ActionTypeId NUMBER;

BEGIN

   IF (NOT bDoPatchIgnore) THEN
      /* Manual Ignore Warnings - this execution path is the one taken when called from SetIgnoreWarnings() in the Website
      */
      oIgnoreIdCollector := IN_LIST_NUMBER ( sIgnoreIdList );


      /* Log Action */
      -- Get Release Location
      SELECT proj.PROJ_NAME ||' / '|| rt.RTAG_NAME INTO ReleaseLocation
        FROM PROJECTS proj,
             RELEASE_TAGS rt
       WHERE rt.PROJ_ID = proj.PROJ_ID
         AND rt.RTAG_ID = nRtagId;

      -- Get Action Type Id for IGNORE_ON
      SELECT act.ACTTYPE_ID INTO ActionTypeId
        FROM ACTION_TYPE act
       WHERE act.NAME = 'ignore_on';

      -- Get Ignored (Current MINUS Old)
      INSERT INTO ACTION_LOG ( USER_ID, PV_ID, DESCRIPTION, ACTTYPE_ID )
      SELECT nUserId, nPvId, pkg.PKG_NAME ||' '|| rpv.PKG_VERSION ||' at '|| ReleaseLocation, ActionTypeId
        FROM (
              SELECT TO_NUMBER(nRtagId) AS RTAG_ID, TO_NUMBER(nPvId), pv.PV_ID AS DPV_ID
                FROM PACKAGE_VERSIONS pv
               WHERE pv.PV_ID IN ( SELECT * FROM TABLE ( CAST ( oIgnoreIdCollector AS RELMGR_NUMBER_TAB_t ) ) )
              MINUS
              SELECT igw.RTAG_ID, igw.PV_ID, igw.DPV_ID
                FROM IGNORE_WARNINGS igw
               WHERE igw.RTAG_ID = nRtagId
                 AND igw.PV_ID = nPvId
             ) qry,
             PACKAGE_VERSIONS pv,
             PACKAGES pkg,
             RELEASE_CONTENT rc,
             PACKAGE_VERSIONS rpv
       WHERE pv.PKG_ID = pkg.PKG_ID
         AND rc.RTAG_ID = nRtagId
         AND rc.PV_ID = rpv.PV_ID
         AND rpv.PKG_ID = pv.PKG_ID
         AND NVL( rpv.V_EXT, 'LINK_A_NULL' ) = NVL( pv.V_EXT, 'LINK_A_NULL' )
         AND qry.DPV_ID = pv.PV_ID;


      -- Get Action Type Id for IGNORE_OFF
      SELECT act.ACTTYPE_ID INTO ActionTypeId
        FROM ACTION_TYPE act
       WHERE act.NAME = 'ignore_off';

      -- Get UnIgnored (Old MINUS Current)
      INSERT INTO ACTION_LOG ( USER_ID, PV_ID, DESCRIPTION, ACTTYPE_ID )
      SELECT nUserId, nPvId, pkg.PKG_NAME ||' '|| rpv.PKG_VERSION ||' at '|| ReleaseLocation, ActionTypeId
        FROM (
              SELECT igw.RTAG_ID, igw.PV_ID, igw.DPV_ID
                FROM IGNORE_WARNINGS igw
               WHERE igw.RTAG_ID = nRtagId
                 AND igw.PV_ID = nPvId
              MINUS
              SELECT TO_NUMBER(nRtagId) AS RTAG_ID, TO_NUMBER(nPvId), pv.PV_ID AS DPV_ID
                FROM PACKAGE_VERSIONS pv
               WHERE pv.PV_ID IN ( SELECT * FROM TABLE ( CAST ( oIgnoreIdCollector AS RELMGR_NUMBER_TAB_t ) ) )
             ) qry,
             PACKAGE_VERSIONS pv,
             PACKAGES pkg,
             RELEASE_CONTENT rc,
             PACKAGE_VERSIONS rpv
       WHERE pv.PKG_ID = pkg.PKG_ID
         AND rc.RTAG_ID = nRtagId
         AND rc.PV_ID = rpv.PV_ID
         AND rpv.PKG_ID = pv.PKG_ID
         AND NVL( rpv.V_EXT, 'LINK_A_NULL' ) = NVL( pv.V_EXT, 'LINK_A_NULL' )
         AND qry.DPV_ID = pv.PV_ID;


      -- Delete Current Ignore Warnings
      DELETE
        FROM IGNORE_WARNINGS igw
       WHERE igw.RTAG_ID = nRtagId
         AND igw.PV_ID = nPvId
         AND igw.IS_PATCH_IGNORE IS NULL;


      IF (oIgnoreIdCollector.COUNT > 0) THEN
         -- Insert Ignore Warnings
         INSERT INTO IGNORE_WARNINGS igw ( RTAG_ID, PV_ID, DPV_ID )
         SELECT nRtagId,
                nPvId,
                pv.PV_ID AS DPV_ID
           FROM PACKAGE_VERSIONS pv
          WHERE pv.PV_ID IN ( SELECT * FROM TABLE ( CAST ( oIgnoreIdCollector AS RELMGR_NUMBER_TAB_t ) ) );
      END IF;

   ELSE
      /* Patch Ignore Warnings - this execution path is the one taken when called from the Rebuild_Environment stored procedure */

      -- Delete Current Patch Ignore Warnings
      DELETE
        FROM IGNORE_WARNINGS igw
       WHERE igw.RTAG_ID = nRtagId
         AND igw.IS_PATCH_IGNORE = 'Y';


      -- Delete Manual Ignores that need to be Patch Ignores
      DELETE
        FROM IGNORE_WARNINGS igw
       WHERE ( RTAG_ID, PV_ID, DPV_ID ) IN
             (
              SELECT DISTINCT
                     nRtagId,
                     err.PV_ID,
                     err.ERR_DPV AS DPV_ID
               FROM  (
                      /* Full Release Contents used for reference*/
                      SELECT rpv.PV_ID, rpv.pkg_id, NVL(rpv.v_ext, '|LINK_A_NULL|') AS v_ext
                        FROM release_content rel, package_versions rpv
                       WHERE rel.pv_id = rpv.pv_id
                         AND rtag_id = nRtagId
                     ) frc,
                     (
                      /* DPV_IDs not fount in release*/
                      SELECT dep.pv_id, dep.dpv_id AS err_dpv
                        FROM package_dependencies dep
                       WHERE dep.pv_id IN ( SELECT pv_id FROM release_content WHERE rtag_id = nRtagId )
                         AND NOT dep.dpv_id IN ( SELECT pv_id FROM release_content WHERE rtag_id = nRtagId )
                     ) err,
                     (
                      SELECT DISTINCT pp.PV_ID, dep.DPV_ID
                        FROM PACKAGE_PATCHES pp,
                             PACKAGE_DEPENDENCIES dep,
                             RELEASE_CONTENT rc
                       WHERE rc.RTAG_ID = nRtagId
                         AND rc.PV_ID = pp.PV_ID
                         AND dep.PV_ID = pp.PATCH_ID
                     ) pp,
                     package_versions errpkg,
                     package_versions errpv
               WHERE err.err_dpv = errpv.pv_id
                 AND errpv.pkg_id = frc.pkg_id(+)
                 AND NVL(errpv.v_ext, '|LINK_A_NULL|') = frc.v_ext(+)
                 AND err.pv_id = errpkg.pv_id
                 AND err.PV_ID = pp.PV_ID
                 AND frc.PV_ID = pp.DPV_ID
             );

      /*
      ---------------------------------------------------
      --  Make sure that select statement above and below are same
      ---------------------------------------------------
      */

      -- Insert Patch Ignores
      INSERT INTO IGNORE_WARNINGS igw ( RTAG_ID, PV_ID, DPV_ID, IS_PATCH_IGNORE )
      SELECT DISTINCT
             nRtagId,
             err.PV_ID,
             err.ERR_DPV AS DPV_ID,
             'Y'
        FROM (
              /* Full Release Contents used for reference*/
              SELECT rpv.PV_ID, rpv.pkg_id, NVL(rpv.v_ext, '|LINK_A_NULL|') AS v_ext
                FROM release_content rel, package_versions rpv
               WHERE rel.pv_id = rpv.pv_id
                 AND rtag_id = nRtagId
             ) frc,
             (
               /* DPV_IDs not fount in release*/
               SELECT dep.pv_id, dep.dpv_id AS err_dpv
                 FROM package_dependencies dep
                WHERE dep.pv_id IN ( SELECT pv_id FROM release_content WHERE rtag_id = nRtagId )
                  AND NOT dep.dpv_id IN ( SELECT pv_id FROM release_content WHERE rtag_id = nRtagId )
             ) err,
             (
              SELECT DISTINCT pp.PV_ID, dep.DPV_ID
                FROM PACKAGE_PATCHES pp,
                     PACKAGE_DEPENDENCIES dep,
                     RELEASE_CONTENT rc
               WHERE rc.RTAG_ID = nRtagId
                 AND rc.PV_ID = pp.PV_ID
                 AND dep.PV_ID = pp.PATCH_ID
             ) pp,
             package_versions errpkg,
             package_versions errpv
       WHERE err.err_dpv = errpv.pv_id
         AND errpv.pkg_id = frc.pkg_id(+)
         AND NVL(errpv.v_ext, '|LINK_A_NULL|') = frc.v_ext(+)
         AND err.pv_id = errpkg.pv_id
         AND err.PV_ID = pp.PV_ID
         AND frc.PV_ID = pp.DPV_ID;

    END IF;

END Ignore_Dependency_Warnings;

/
--------------------------------------------------------
--  DDL for Procedure INSERT_INTO_PACKAGE_BUILD_INFO
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."INSERT_INTO_PACKAGE_BUILD_INFO" IS

/******************************************************************************
   NAME:       INSERT_INTO_PACKAGE_BUILD_INFO
   PURPOSE:

   REVISIONS:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        6/12/2006          1. Created this procedure.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     INSERT_INTO_PACKAGE_BUILD_INFO
      Sysdate:         6/12/2006
      Date and Time:   6/12/2006, 1:53:40 PM, and 6/12/2006 1:53:40 PM
      Username:         (set in TOAD Options, Procedure Editor)
      Table Name:       (set in the "New PL/SQL Object" dialog)

******************************************************************************/

	CURSOR curInfo IS
    SELECT PV_ID
	FROM PACKAGE_BUILD_ENV
	WHERE BE_ID IN (11, 12);
    recInfo curInfo%ROWTYPE;


BEGIN

	OPEN curInfo;
    FETCH curInfo INTO recInfo;

	WHILE curInfo%FOUND
	LOOP

		INSERT INTO PACKAGE_BUILD_INFO ( PV_ID, BM_ID, BSA_ID )
		VALUES( recInfo.PV_ID, 2, 5);

		UPDATE PACKAGE_VERSIONS SET BS_ID = 2 WHERE PV_ID = recInfo.PV_ID;

		FETCH curInfo INTO recInfo;

	END LOOP;

	CLOSE curInfo;




END INSERT_INTO_PACKAGE_BUILD_INFO;

/
--------------------------------------------------------
--  DDL for Procedure INSERT_MULTIPLE_STICKY_NOTES
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."INSERT_MULTIPLE_STICKY_NOTES" IS

/******************************************************************************
   NAME:       INSERT_MULTIPLE_STICKY_NOTES
   PURPOSE:

   REVISIONS:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        6/12/2006          1. Created this procedure.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     INSERT_MULTIPLE_STICKY_NOTES
      Sysdate:         6/12/2006
      Date and Time:   6/12/2006, 1:53:40 PM, and 6/12/2006 1:53:40 PM
      Username:         (set in TOAD Options, Procedure Editor)
      Table Name:       (set in the "New PL/SQL Object" dialog)

******************************************************************************/

	CURSOR curInfo IS
    SELECT PV_ID
	FROM PACKAGE_BUILD_ENV
	WHERE BE_ID IN (11, 12);
    recInfo curInfo%ROWTYPE;


BEGIN

	OPEN curInfo;
    FETCH curInfo INTO recInfo;

	WHILE curInfo%FOUND
	LOOP

		INSERT INTO NOTE_MANAGER ( NID, LAST_USER, LAST_DATE, DESCRIPTION )
		VALUES( recInfo.PV_ID, 'awehalle', ORA_SYSDATETIME, '' );

		FETCH curInfo INTO recInfo;

	END LOOP;

	CLOSE curInfo;




END INSERT_MULTIPLE_STICKY_NOTES;

/
--------------------------------------------------------
--  DDL for Procedure LEVEL_N_CONFLICTS
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."LEVEL_N_CONFLICTS" (
   nnrtag_id       IN       NUMBER,
   nnsession_num   IN       NUMBER,
   nnrowcnt        OUT      NUMBER,
   nniteration     IN       NUMBER
)
IS
/* ---------------------------------------------------------------------------
    Version: 3.0.1
   --------------------------------------------------------------------------- */
   previteration   NUMBER := nniteration - 1;
BEGIN
  -- Map broken dependency information from a package into a consumer
  -- package. ie: Ripple need-to-build info up the dependency tree.

   /* ---------  LEVEL 1 CONFILCTS -----------
   || Following states are used:
   || 0 -> NOT FOUND
   || 1 -> MAJOR
   || 2 -> MINOR MINOR
   */
   INSERT INTO temp_env_states
               SELECT DISTINCT nnsession_num AS session_num, nniteration AS level_num,
                      dpv.pv_id, dpv.pkg_id, dpv.v_ext,
                      DECODE (tes.tes_state, 2, 2, 1) AS MESSAGE,
                      'X'
                 FROM TEMP_ENV_DEPS dpv,
                      temp_env_states tes
                WHERE dpv.SESSION_NUM = nnsession_num
                  AND dpv.dpkg_id = tes.pkg_id
                  AND NVL (dpv.dv_ext, '|LINK_A_NULL|') = NVL (tes.v_ext, '|LINK_A_NULL|')
                  AND tes.session_num = nnsession_num
                  AND tes.level_num = previteration;

   nnrowcnt := SQL%ROWCOUNT;
END level_n_conflicts;

/
--------------------------------------------------------
--  DDL for Procedure LEVEL_ONE_CONFLICTS
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."LEVEL_ONE_CONFLICTS" (
   nnrtag_id       IN   NUMBER,
   nnsession_num   IN   NUMBER
)
IS
BEGIN
  --  Prepare the TEMP_ENV_DEPS table
  --  This table maps package-versions to their dependencies and is
  --  used to walk up the dependency tree.
  --  This table consists of PV_ID -> DPV_ID in the release in which we are interested
  --  ie: Those that ARE NOT a part of:
  --    Pegged Package
  --    SDK imported package
  --    Marked with an ignore warnings
  --    Marked as an advisory ripple
  --
  --  This table speeds up the process by a huge (really huge) amount
  --
      INSERT into TEMP_ENV_DEPS
      (
      SELECT DISTINCT nnsession_num AS session_num,
                      pv.pv_id, pv.pkg_id, pv.v_ext,
                      dpv.pv_id as dpv_id, dpv.pkg_id as dpkg_id, dpv.v_ext as dv_ext

                 FROM release_content rel,
                      package_dependencies dep,
                      package_versions dpv,
                      package_versions pv

                WHERE rel.pv_id = dep.pv_id
                  AND rel.rtag_id = nnrtag_id
                  AND dep.pv_id = pv.pv_id
                  AND dep.dpv_id = dpv.pv_id
                  --AND rel.SDKTAG_ID is null
                  --AND NOT dep.pv_id IN (SELECT pegv.pv_id FROM PEGGED_VERSIONS pegv WHERE pegv.rtag_id = nnrtag_id)
                  AND NOT (dep.pv_id, dep.dpv_id) in (SELECT igw.pv_id, igw.DPV_ID from ignore_warnings igw where igw.rtag_id = nnrtag_id)
                  );

   /* ---------  LEVEL 1 CONFILCTS -----------
   || Following states are used:
   || 0 -> NOT FOUND
   || 1 -> MAJOR
   || 2 -> MINOR MINOR
   */
   INSERT INTO temp_env_states
   (
      SELECT nnsession_num AS session_num, 
        1 AS level_num,
        rd.pv_id, 
        rd.pkg_id, 
        rd.v_ext,
        DECODE (rd.v_nmm,
                    NULL, 0,
                    pv2.v_nmm, DECODE (rd.v_mm,
                                       pv2.v_mm, 0,
                                                 2
                                       ),
                    1
              ) AS MESSAGE,
        rd.build_type
from (
      SELECT DISTINCT err.pv_id, errpkg.pkg_id, errpkg.v_ext,
                      frc.build_type,
                      frc.v_nmm,
                      frc.v_mm,
                      errpv.pv_id as errpv_id
                 FROM (
                       /* Full Release Contents used for reference*/
                        SELECT rel.rtag_id, rpv.pv_id, rpv.pkg_id,
                                NVL (rpv.v_ext, '|LINK_A_NULL|') AS v_ext,
                                rpv.pkg_version, rpv.v_nmm, rpv.v_mm,
                                (SELECT COUNT(*) FROM ADVISORY_RIPPLE avr WHERE avr.rtag_id = rel.rtag_id AND avr.pv_id = rel.pv_id ) AS IsAvr,
                                rpv.build_type
                          FROM release_content rel,
                                package_versions rpv
                          WHERE rel.pv_id = rpv.pv_id
                             AND rtag_id = nnrtag_id
                      ) frc,

                      (
                       /* DPV_IDs not found in release. Excluding:
                              Those from pegged versions
                              Those from packages imported via an SDK
                              */
                       SELECT dep.pv_id, dep.dpv_id AS err_dpv
                         FROM package_dependencies dep
                        WHERE dep.pv_id IN (SELECT pv_id FROM release_content WHERE rtag_id = nnrtag_id AND release_content.SDKTAG_ID is NULL)
                          AND NOT dep.pv_id IN (SELECT pegv.pv_id FROM PEGGED_VERSIONS pegv WHERE pegv.rtag_id = nnrtag_id)
                          AND NOT dep.dpv_id IN (SELECT pv_id FROM release_content WHERE rtag_id = nnrtag_id)
                          
                       /* INCLUDE Unbuildable packages to force missing */
                       UNION
                       SELECT bpv.pv_id, bpv.pv_id as err_dpv
                        FROM package_versions bpv, release_content brc
                        WHERE bpv.build_type = 'U' AND brc.rtag_id = nnrtag_id AND bpv.pv_id = brc.pv_id

                       MINUS
                       /* MINUS Dependencies to be ignored */
                       SELECT igw.pv_id, igw.dpv_id AS err_dpv
                         FROM ignore_warnings igw
                        WHERE igw.rtag_id = nnrtag_id

                      ) err,
                      package_versions errpkg,
                      package_versions errpv
                WHERE err.err_dpv = errpv.pv_id
                  AND errpv.pkg_id = frc.pkg_id(+)
                  AND NVL (errpv.v_ext, '|LINK_A_NULL|') = frc.v_ext(+)
                  AND err.pv_id = errpkg.pv_id
                  AND NVL(frc.IsAvr,0) = 0
                  ) rd,
                  package_versions pv2
                  where rd.errpv_id = pv2.PV_ID
                  );
END level_one_conflicts;

/
--------------------------------------------------------
--  DDL for Procedure LOCK_PACKAGE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."LOCK_PACKAGE" ( nPvId IN PACKAGE_VERSIONS.PV_ID%TYPE,
											 nUserId IN NUMBER ) IS
/* ---------------------------------------------------------------------------
    Version: 4.0
   --------------------------------------------------------------------------- */

BEGIN

    -- Lock Package
    UPDATE PACKAGE_VERSIONS pv SET
    	pv.DLOCKED = 'Y'
    WHERE pv.PV_ID = nPvId;

    /* LOG ACTION */
   	Log_Action ( nPvId, 'lock_package', nUserId );

END Lock_Package;

/
--------------------------------------------------------
--  DDL for Procedure LOG_ACTION
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."LOG_ACTION" ( nPvId IN PACKAGE_VERSIONS.PV_ID%TYPE,
										 enumActionTypeName IN ACTION_TYPE.NAME%TYPE,
                                         nUserId IN ACTION_LOG.USER_ID%TYPE,
										 sAdditionalComments IN ACTION_LOG.DESCRIPTION%TYPE DEFAULT NULL  ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0
   --------------------------------------------------------------------------- */

    ActionTypeId NUMBER;

BEGIN

    -- Get Action Type FK
    SELECT act.ACTTYPE_ID INTO ActionTypeId
      FROM ACTION_TYPE act
     WHERE act.NAME = enumActionTypeName;


    INSERT INTO ACTION_LOG ( USER_ID, PV_ID, DESCRIPTION, ACTTYPE_ID )
    VALUES ( nUserId, nPvId, sAdditionalComments, ActionTypeId );


END Log_Action;

/
--------------------------------------------------------
--  DDL for Procedure LOG_ACTION_BULK
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."LOG_ACTION_BULK" ( nPvIdList IN VARCHAR2,
										 	  enumActionTypeName IN ACTION_TYPE.NAME%TYPE,
                                         	  nUserId IN ACTION_LOG.USER_ID%TYPE,
										 	  sAdditionalComments IN ACTION_LOG.DESCRIPTION%TYPE DEFAULT NULL  ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0
   --------------------------------------------------------------------------- */

    ActionTypeId NUMBER;
    oPvIdCollector RELMGR_NUMBER_TAB_t := RELMGR_NUMBER_TAB_t();

BEGIN

    oPvIdCollector := IN_LIST_NUMBER ( nPvIdList );

    -- Get Action Type FK
    SELECT act.ACTTYPE_ID INTO ActionTypeId
      FROM ACTION_TYPE act
     WHERE act.NAME = enumActionTypeName;

    -- Log Action
    INSERT INTO ACTION_LOG ( USER_ID, PV_ID, DESCRIPTION, ACTTYPE_ID )
    SELECT nUserId,
    	     pv.PV_ID,
           sAdditionalComments,
           ActionTypeId
      FROM PACKAGE_VERSIONS pv
     WHERE pv.PV_ID IN ( SELECT * FROM TABLE ( CAST ( oPvIdCollector AS RELMGR_NUMBER_TAB_t ) ) );


END Log_Action_Bulk;

/
--------------------------------------------------------
--  DDL for Procedure LOG_DAEMON_ACTION
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."LOG_DAEMON_ACTION" ( nRconId IN NUMBER,
												 enumActionTypeName IN VARCHAR2,
		                                         nUserId IN NUMBER,
												 sAdditionalComments IN VARCHAR2 DEFAULT NULL  ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0
   --------------------------------------------------------------------------- */

    ActionTypeId NUMBER;

BEGIN

    -- Get Action Type FK
    SELECT act.ACTTYPE_ID INTO ActionTypeId
      FROM ACTION_TYPE act
     WHERE act.NAME = enumActionTypeName;


    INSERT INTO DAEMON_ACTION_LOG
    VALUES ( nUserId, ORA_SYSDATETIME, nRconId, sAdditionalComments, ActionTypeId );


END Log_Daemon_Action;

/
--------------------------------------------------------
--  DDL for Procedure LOG_PROJECT_ACTION
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."LOG_PROJECT_ACTION" ( nProjId IN NUMBER,
												 enumActionTypeName IN VARCHAR2,
		                                         nUserId IN NUMBER,
												 sAdditionalComments IN VARCHAR2 DEFAULT NULL,
												 nRtagId IN NUMBER  ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0
   --------------------------------------------------------------------------- */

    ActionTypeId NUMBER;

BEGIN

    -- Get Action Type FK
    SELECT act.ACTTYPE_ID INTO ActionTypeId
      FROM ACTION_TYPE act
     WHERE act.NAME = enumActionTypeName;


    INSERT INTO PROJECT_ACTION_LOG ( USER_ID, ACTION_DATETIME, PROJ_ID, DESCRIPTION, ACTTYPE_ID, RTAG_ID)
    VALUES ( nUserId, ORA_SYSDATETIME, nProjId, sAdditionalComments, ActionTypeId, nRtagId);


END Log_Project_Action;

/
--------------------------------------------------------
--  DDL for Procedure NEW_ADDITIONAL_NOTE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."NEW_ADDITIONAL_NOTE" ( pnPv_id IN NUMBER,
                                                  psNote_title IN ADDITIONAL_NOTES.NOTE_TITLE%TYPE,
                                                  psNote_body IN ADDITIONAL_NOTES.NOTE_BODY%TYPE,
                                                  pnUser_id IN NUMBER,
                                                  outErrCode OUT NUMBER
                                                 ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0.0
   --------------------------------------------------------------------------- */

    newID NUMBER;

	CURSOR an_duplicate_cur IS
        SELECT note_id
          FROM ADDITIONAL_NOTES
         WHERE pv_id = pnPv_id
           AND note_title = psNote_title;
    an_duplicate_rec an_duplicate_cur%ROWTYPE;

BEGIN
	outErrCode := -1;		-- Set default return error code to ERROR state

	OPEN an_duplicate_cur;
    FETCH an_duplicate_cur INTO an_duplicate_rec;

    IF an_duplicate_cur%NOTFOUND
    THEN
		/* No duplicate titles */
		-- Get new ID --
    	SELECT SEQ_ADDITIONAL_NOTES.NEXTVAL INTO newID FROM DUAL;

		--- Add Additional Note ---
	    INSERT INTO ADDITIONAL_NOTES ( note_id, pv_id, note_title, note_body, mod_date, mod_user  )
	    VALUES (  newID, pnPv_id, psNote_title, psNote_body, ora_sysdatetime, pnUser_id );
		outErrCode := 0;		-- Set return to SUCCESS
	END IF;

	CLOSE an_duplicate_cur;
END New_Additional_Note;

/
--------------------------------------------------------
--  DDL for Procedure NEW_PACKAGE_NAME
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."NEW_PACKAGE_NAME" ( SSpkg_name IN PACKAGES.pkg_name%TYPE,
                                               retPKG_ID OUT NUMBER ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0.0
   --------------------------------------------------------------------------- */

    CURSOR packages_cur IS
        SELECT pkg.pkg_id
          FROM packages pkg
         WHERE pkg.pkg_name = SSpkg_name;
    packages_rec packages_cur%ROWTYPE;


BEGIN

    /* ---------------------------------------------------- */
    /* Find if package name exists                          */
    /* ---------------------------------------------------- */

    OPEN packages_cur;
    FETCH packages_cur INTO packages_rec;

    IF packages_cur%NOTFOUND
    THEN
        -- Create new pkg_name --
        SELECT SEQ_PKG_ID.nextval INTO retPKG_ID FROM DUAL;

        INSERT INTO packages ( pkg_id, pkg_name )
        VALUES ( retPKG_ID, SSpkg_name );

    ELSE
        retPKG_ID := packages_rec.pkg_id;

    END IF;


    CLOSE packages_cur;

END New_Package_Name;

/
--------------------------------------------------------
--  DDL for Procedure NEW_PATCH
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."NEW_PATCH" ( SSpatch_version IN PACKAGE_VERSIONS.pkg_version%TYPE,
 	   	  		  					  	NNparent_id IN NUMBER,
                                        sPatchIdList IN VARCHAR2,
										NNuser_id IN NUMBER ) IS
/* ---------------------------------------------------------------------------
    Version: 3.5
   --------------------------------------------------------------------------- */

    patchPv_id    NUMBER;
	parPkg_id	  NUMBER;
    LastInstallOrder NUMBER;
    isPatchDlocked PACKAGE_VERSIONS.DLOCKED%TYPE;
    SSV_MM PACKAGE_VERSIONS.V_MM%TYPE;
    SSV_NMM PACKAGE_VERSIONS.V_NMM%TYPE;
    SSV_EXT PACKAGE_VERSIONS.V_EXT%TYPE;
	oPatchDepCollector RELMGR_NUMBER_TAB_t := RELMGR_NUMBER_TAB_t();

	CURSOR parent_cur IS
        SELECT pv.*, pkg.pkg_name
          FROM package_versions pv,
		       packages pkg
         WHERE pv.pv_id = NNparent_id
		   AND pv.pkg_id = pkg.pkg_id;
    parent_rec parent_cur%ROWTYPE;

    CURSOR patch_cur IS
        SELECT pv.*, pg.pkg_name
          FROM package_versions pv,
		       packages pg
         WHERE pv.pkg_id = parPkg_id
		   AND pv.pkg_version = SSpatch_version
		   AND pv.pkg_id = pg.pkg_id;
    patch_rec patch_cur%ROWTYPE;

	CURSOR releases_cur IS
        SELECT rc.pv_id
		  FROM release_content rc
		 WHERE rc.pv_id = patch_rec.pv_id;
    releases_rec releases_cur%ROWTYPE;


BEGIN

	-- Get Last Install Order
    SELECT Count(*) INTO LastInstallOrder
	  FROM PACKAGE_PATCHES pp
	 WHERE pp.PV_ID = NNparent_id;


    -- Get parent details
	OPEN parent_cur;
    FETCH parent_cur INTO parent_rec;
	parPkg_id := parent_rec.pkg_id;


	-- Find if patch exists in database
    OPEN patch_cur;
    FETCH patch_cur INTO patch_rec;


    -- Parent must be official
    IF parent_rec.dlocked = 'Y' THEN

	    IF patch_cur%NOTFOUND
	    THEN
        	isPatchDlocked := 'N';

	        -- Create new patch version --
	        SELECT SEQ_PV_ID.nextval INTO patchPv_id FROM DUAL;


	        Split_version ( SSpatch_version, SSV_MM, SSV_NMM, SSV_EXT );

	        INSERT INTO package_versions ( pv_id, pkg_id, pkg_version, dlocked, created_stamp, creator_id, modified_stamp, modifier_id, V_MM, V_NMM, V_EXT, src_path, pv_description, owner_id, is_patch, LAST_PV_ID, bs_id, is_autobuildable, ripple_field )
				   VALUES (
						   patchPv_id,
	                       parPkg_id,
	                       SSpatch_version,
	                       isPatchDlocked,
	                       ora_sysdatetime,
	                       NNuser_id,
	                       ORA_SYSDATETIME,
	                       NNuser_id,
	                       SSV_MM,
	                       SSV_NMM,
	                       SSV_EXT,
	                       parent_rec.src_path,
	                       'This is a patch to ' || parent_rec.pkg_name || ' ' || parent_rec.pkg_version,
	                       NNuser_id,
						   'Y',
                           patchPv_id,
						   parent_rec.bs_id,
						   parent_rec.is_autobuildable,
						   parent_rec.ripple_field

						   );

			INSERT INTO package_patches ( pv_id, patch_id, INSTALL_ORDER )
		    	   ( SELECT NNparent_id AS pv_id,
				            pv.pv_id AS patch_id,
	                        LastInstallOrder + 1 AS INSTALL_ORDER
				       FROM package_versions pv
					  WHERE pv.pv_id = patchPv_id
					    AND pv.is_patch = 'Y' );

	        /* LOG ACTION */
            Log_Action ( patchPv_id, 'new_version', NNuser_id,
        			     'Patch version created: '|| SSpatch_version );

        	Log_Action ( NNparent_id, 'patch_add', NNuser_id,
        			     'New patch created and attached: '|| SSpatch_version );


	    ELSE

		    patchPv_id := patch_rec.pv_id;
	    	isPatchDlocked := patch_rec.dlocked;

			-- Find if pv_id exists in release content (i.e. it cannot be a patch)
		    OPEN releases_cur;
		    FETCH releases_cur INTO releases_rec;

			IF releases_cur%NOTFOUND
	   		THEN
				-- This pv_id is trully a patch, hence add Y to column IS_PATCH
				UPDATE package_versions SET
					   is_patch = 'Y'
					   WHERE pv_id = patchPv_id;

				INSERT INTO package_patches ( pv_id, patch_id, INSTALL_ORDER )
			    	   ( SELECT NNparent_id AS pv_id,
					            pv.pv_id AS patch_id,
	                            LastInstallOrder + 1 AS INSTALL_ORDER
					       FROM package_versions pv
						  WHERE pv.pv_id = patchPv_id
						    AND pv.is_patch = 'Y' );

			END IF;

			CLOSE releases_cur;

            /* LOG ACTION */
        	Log_Action ( NNparent_id, 'patch_add', NNuser_id,
        			     'Patch version was found and attached: '|| SSpatch_version );

	    END IF;




    END IF;



    /* Create Patch Dependencies */
    oPatchDepCollector := IN_LIST_NUMBER ( sPatchIdList );


    -- Make sure patch is unofficial before altering its dependencies
    IF (oPatchDepCollector.COUNT > 0) AND (isPatchDlocked = 'N') THEN
    	-- Delete Existing Dependencies
        DELETE
          FROM PACKAGE_DEPENDENCIES dep
         WHERE dep.PV_ID = patchPv_id;


        -- Insert new dependencies
        INSERT INTO PACKAGE_DEPENDENCIES ( PV_ID, DPV_ID, PKG_ID, DPKG_ID, BUILD_TYPE )
        SELECT patchPv_id AS PV_ID,
        	   pv.PV_ID AS DPV_ID,
               parPkg_id AS PKG_ID,
               pv.PKG_ID AS DPKG_ID,
               'L' AS BUILD_TYPE
          FROM PACKAGE_VERSIONS pv
         WHERE pv.PV_ID IN ( SELECT * FROM TABLE ( CAST ( oPatchDepCollector AS RELMGR_NUMBER_TAB_t ) ) );


    END IF;


    CLOSE parent_cur;
    CLOSE patch_cur;
END New_Patch;

/
--------------------------------------------------------
--  DDL for Procedure NEW_UNIT_TEST
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."NEW_UNIT_TEST" ( nPv_id IN NUMBER,
                                            nTestTypeId IN UNIT_TESTS.TEST_TYPES_FK%TYPE,
                                            sTest_summary IN UNIT_TESTS.TEST_SUMMARY%TYPE,
                                            sNumOfTest IN UNIT_TESTS.NUMOF_TEST%TYPE,
                                            sDpkg_path IN VARCHAR2,
                                            sResults IN VARCHAR2,
                                            sCompletion_date IN VARCHAR2,
                                            nCompleted_by IN NUMBER,
											enumTEST_TYPE_AUTOMATIC IN NUMBER,
											enumTEST_TYPE_NOT_DONE IN NUMBER,
											outFileName OUT VARCHAR2
                                           ) IS
/* ---------------------------------------------------------------------------
    Version: 3.2.0
   --------------------------------------------------------------------------- */

   	FILENAME_PREFIX CONSTANT VARCHAR2(50) := 'RM_UNIT_TEST';

    newID NUMBER;
    ResultsURL UNIT_TESTS.RESULTS_URL%TYPE DEFAULT NULL;
    ResultsAttachment UNIT_TESTS.RESULTS_ATTACHMENT_NAME%TYPE DEFAULT NULL;

BEGIN

	-- Get new ID --
   	SELECT SEQ_UNIT_TESTS.NEXTVAL INTO newID FROM DUAL;

       IF nTestTypeId = enumTEST_TYPE_AUTOMATIC THEN
       	ResultsURL := sResults;
       ELSE
       	IF (sResults <> '') OR ( NOT sResults IS NULL ) THEN
        	outFileName := FILENAME_PREFIX || newID ||'_'|| sResults;
    		ResultsAttachment := sDpkg_path || '/' || outFileName;
           END IF;
       END IF;

	-- Remove NOT_DONE entry if exists
	DELETE FROM UNIT_TESTS
	 WHERE pv_id = nPv_id
	   AND test_types_fk = enumTEST_TYPE_NOT_DONE;

	--- Add Additional Note ---
    INSERT INTO UNIT_TESTS ( TEST_ID,
								PV_ID,
								TEST_TYPES_FK,
								TEST_SUMMARY,
								COMPLETION_DATE,
								COMPLETED_BY,
								RESULTS_URL,
								RESULTS_ATTACHMENT_NAME,
								NUMOF_TEST )
    VALUES (
       	newID,
           nPv_id,
           nTestTypeId,
           sTest_summary,
           TO_DATE( sCompletion_date,'DD/MM/YYYY' ),
           nCompleted_by,
           ResultsURL,
           ResultsAttachment,
		   sNumOfTest );

END New_Unit_Test;

/
--------------------------------------------------------
--  DDL for Procedure PAOLO_BUILD_TREE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."PAOLO_BUILD_TREE" ( nRtag_id IN NUMBER ) IS

    sessionNumber NUMBER := 0;
    iteration NUMBER := 1;
    rowCnt NUMBER := 0;
    maxIterations 	NUMBER := 50;

BEGIN


    INSERT INTO TEMP_TREE_BROWSE ( SESSION_NUM, LEVEL_NUM, PV_ID )
    SELECT sessionNumber, iteration, rc.PV_ID
      FROM RELEASE_CONTENT rc
     WHERE rc.RTAG_ID = nRtag_id;

    iteration := iteration + 1;
    LOOP

        INSERT INTO TEMP_TREE_BROWSE ( SESSION_NUM, LEVEL_NUM, PV_ID )
		SELECT sessionNumber,
               iteration,
               dep.DPV_ID
          FROM TEMP_TREE_BROWSE ttb,
               PACKAGE_DEPENDENCIES dep
         WHERE dep.PV_ID = ttb.PV_ID
           AND ttb.LEVEL_NUM = iteration - 1

         MINUS

        SELECT sessionNumber, iteration, ttb.PV_ID
          FROM TEMP_TREE_BROWSE ttb;




		rowCnt := SQL%ROWCOUNT;
		IF rowCnt > 0 THEN
           iteration := iteration + 1;
		END IF;
        EXIT WHEN (rowCnt < 1) OR (iteration > maxIterations);
    END LOOP;

END PAOLO_Build_Tree;

/
--------------------------------------------------------
--  DDL for Procedure REBUILD_DEPRECATE_STATE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."REBUILD_DEPRECATE_STATE" ( nRtagId IN INT ) AS
BEGIN

  --  Clear the 'calculated' values from the Release Conetnts
  --
  UPDATE RELEASE_CONTENT
      SET DEPRECATED_STATE = NULL
  WHERE RTAG_ID =  nRtagId
  AND DEPRECATED_STATE != 6
  AND DEPRECATED_STATE is NOT NULL;

  --
  --  Insert new calculated values into the table
  --  Use of 'AAA' speeds up the CONNECT BY PRIOR query (lots)
  UPDATE RELEASE_CONTENT
      SET DEPRECATED_STATE = 7
  WHERE RTAG_ID =  nRtagId
  AND DEPRECATED_STATE is null
  AND PV_ID in (
        WITH AAA AS
          (SELECT pd.*
          FROM PACKAGE_DEPENDENCIES pd,
            RELEASE_CONTENT RC1
          WHERE rc1.rtag_id = nRtagId
          AND RC1.PV_ID     = pd.PV_ID
          )
      SELECT DISTINCT qry.PV_ID
      FROM
        (SELECT dep.*,
          LEVEL AS LEVEL_NUM
        FROM AAA dep
          START WITH dep.DPV_ID IN (
                SELECT rc.pv_id as pv_id
                FROM RELEASE_CONTENT rc
                WHERE rc.rtag_id  = nRtagId
                AND rc.DEPRECATED_STATE = 6 )
          CONNECT BY PRIOR dep.PV_ID = dep.DPV_ID
        ) qry,
        PACKAGES pkg,
        PACKAGE_VERSIONS pv,
        RELEASE_CONTENT rc
      WHERE qry.PV_ID          = pv.PV_ID
      AND pv.PKG_ID            = pkg.PKG_ID
      AND rc.RTAG_ID           = nRtagId
      AND rc.PV_ID             = qry.PV_ID
      );
END REBUILD_DEPRECATE_STATE;

/
--------------------------------------------------------
--  DDL for Procedure REBUILD_ENVIRONMENT
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."REBUILD_ENVIRONMENT" ( NNrtag_id IN NUMBER ) IS
  --
  --  Recalculate the package_state
  --  Triggered by the Web Interface
  --
    rowCnt NUMBER := 0;
    iteration NUMBER := 2;          -- Iterations counter
    maxIterations NUMBER := 30;     -- Maximum number of iterations allowed.
                                    -- This will prevent infinite loops if cyrcular dependencies are found
    sessionNum NUMBER;
BEGIN
    SELECT SEQ_session_num.nextval INTO sessionNum FROM DUAL;


    -- Redo Patch Ignore warnings
    Ignore_Dependency_Warnings ( NNrtag_id, NULL, NULL, TRUE );

    Level_One_Conflicts ( NNrtag_id, sessionNum );
    --commit;

    LOOP
        Level_N_Conflicts ( NNrtag_id, sessionNum, rowCnt, iteration );
        --commit;
        iteration := iteration + 1;
        EXIT WHEN (rowCnt < 1) OR (iteration > maxIterations);
    END LOOP;

    Update_Package_States ( NNrtag_id, sessionNum );

    DELETE FROM temp_env_states WHERE session_num = sessionNum;
    DELETE FROM TEMP_ENV_DEPS WHERE session_num = sessionNum;

    -- Flag Packages with New Patches Available
    -- Temp deleted 28-Mar-2017 (25-Jul-2018)
    -- Reason: It takes a very long time and we dont use patches any more
    -- Check_New_Patches ( NNrtag_id );

	Clean_Do_Not_Ripple( NNrtag_id );


	/* Circular Dependency Flag */
    /*
	IF iteration > maxIterations
	THEN
		UPDATE release_tags SET
		   	   circular_dependency = 'Y'
		 WHERE rtag_id = NNrtag_id;
	ELSE
		UPDATE release_tags SET
		   	   circular_dependency = NULL
		 WHERE rtag_id = NNrtag_id;
	END IF;
    */
END Rebuild_Environment;

/
--------------------------------------------------------
--  DDL for Procedure REMOVE_COMPONENTS
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."REMOVE_COMPONENTS" ( nPvId IN RELEASE_COMPONENTS.PV_ID%TYPE ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0.0
   --------------------------------------------------------------------------- */


BEGIN

	 --- Delete From RELEASE_COMPONENTS
	 DELETE FROM RELEASE_COMPONENTS
	 WHERE PV_ID = nPvId;

END Remove_Components;

/
--------------------------------------------------------
--  DDL for Procedure REMOVE_DOCUMENT
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."REMOVE_DOCUMENT" ( nPvId IN PACKAGE_VERSIONS.PV_ID%TYPE,
											  nDocId IN PACKAGE_DOCUMENTS.DOC_ID%TYPE,
                                              nUserId IN NUMBER ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0
   --------------------------------------------------------------------------- */

   DocNumber PACKAGE_DOCUMENTS.DOC_NUM%TYPE;

BEGIN

	-- Get Doc Num
    SELECT pd.DOC_NUM INTO DocNumber
      FROM PACKAGE_DOCUMENTS pd
     WHERE pd.PV_ID = nPvId
       AND pd.DOC_ID = nDocId;


	-- Delete Document
    DELETE
      FROM PACKAGE_DOCUMENTS pd
     WHERE pd.PV_ID = nPvId
       AND pd.DOC_ID = nDocId;


    /* LOG ACTION */
   	Log_Action ( nPvId, 'document_remove', nUserId,
   			     'Document number: '|| DocNumber );


END Remove_Document;

/
--------------------------------------------------------
--  DDL for Procedure REMOVE_PACKAGE_INTEREST
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."REMOVE_PACKAGE_INTEREST" (nProjId IN PROJECTS.PROJ_ID%TYPE,
	   	  		  								  	nPkgId IN PACKAGES.PKG_ID%TYPE,
												  	nUserId IN NUMBER
	   	  		  									) IS

/******************************************************************************
   NAME:       REMOVE_PACKAGE_INTEREST
   PURPOSE:    To remove interest in a given package per project

   REVISIONS:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        12/05/2006  Rupesh Solanki      1. Created this procedure.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     REMOVE_PACKAGE_INTEREST
      Sysdate:         12/05/2006
      Date and Time:   12/05/2006, 11:28:50 AM, and 12/05/2006 11:28:50 AM
      Username:         (set in TOAD Options, Procedure Editor)
      Table Name:       (set in the "New PL/SQL Object" dialog)

******************************************************************************/
BEGIN

	 --Delete from PACKAGE_INTEREST
	 DELETE FROM PACKAGE_INTEREST
	 WHERE PROJ_ID = nProjId
	 AND PKG_ID = nPkgId
	 AND USER_ID = nUserId;

END REMOVE_PACKAGE_INTEREST;

/
--------------------------------------------------------
--  DDL for Procedure REMOVE_PATCH
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."REMOVE_PATCH" ( nPatchId IN PACKAGE_PATCHES.PATCH_ID%TYPE,
										   nPvId IN PACKAGE_PATCHES.PV_ID%TYPE,
                                           nUserId IN NUMBER ) IS
/* ---------------------------------------------------------------------------
    Version: 4.0
   --------------------------------------------------------------------------- */

PatchVersion PACKAGE_VERSIONS.PKG_VERSION%TYPE;

CURSOR curPatch IS
	SELECT pp.PV_ID,
		   pp.PATCH_ID,
	       ROWNUM AS NEW_INSTALL_ORDER
	  FROM PACKAGE_PATCHES pp
	 WHERE pp.PV_ID = nPvId
	ORDER BY pp.INSTALL_ORDER;
recPatch curPatch%ROWTYPE;

BEGIN

	 -- Delete Patch
     DELETE
       FROM PACKAGE_PATCHES pp
      WHERE pp.PV_ID = nPvId
        AND pp.PATCH_ID = nPatchId;


	-- Redo Install Order
    OPEN curPatch;
	FETCH curPatch INTO recPatch;

	WHILE curPatch%FOUND
	LOOP

		UPDATE PACKAGE_PATCHES pp SET
			pp.INSTALL_ORDER = recPatch.NEW_INSTALL_ORDER
		WHERE pp.PV_ID = nPvId
		  AND pp.PATCH_ID = recPatch.PATCH_ID;

		FETCH curPatch INTO recPatch;
	END LOOP;

	CLOSE curPatch;




    /* LOG ACTION */
    SELECT pv.PKG_VERSION INTO PatchVersion
      FROM PACKAGE_VERSIONS pv
     WHERE pv.PV_ID = nPatchId;

   	Log_Action ( nPvId, 'patch_remove', nUserId,
   			     'Version: '|| PatchVersion );

END Remove_Patch;

/
--------------------------------------------------------
--  DDL for Procedure REMOVE_PROJECT_VIEW_OWNER
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."REMOVE_PROJECT_VIEW_OWNER" (nProjId IN NUMBER,
	   	  		  						 			  nViewId IN NUMBER,
										 			  sUserIdList IN VARCHAR2,
										 			  nUserId IN NUMBER ) IS

GroupId NUMBER;



/******************************************************************************
   NAME:       UPDATE_VIEW
   PURPOSE:

   REVISIONS:
   Ver        Date        Author           		Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        10/04/2006     Rupesh Solanki     1. Created this procedure.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     UPDATE_VIEW
      Sysdate:         10/04/2006
      Date and Time:   10/04/2006, 1:55:19 PM, and 10/04/2006 1:55:19 PM
      Username:         (set in TOAD Options, Procedure Editor)
      Table Name:       (set in the "New PL/SQL Object" dialog)

******************************************************************************/

BEGIN
	 SELECT GROUP_EMAIL_ID into GroupId
	 FROM AUTOBUILD_FAILURE
	 WHERE PROJ_ID = nProjId
	 AND VIEW_ID = nViewId;

	 DELETE FROM MEMBERS_GROUP
	 WHERE GROUP_EMAIL_ID = GroupId
	 AND USER_ID IN (
	 SELECT * FROM THE ( SELECT CAST( IN_LIST_NUMBER( sUserIdList ) AS RELMGR_NUMBER_TAB_t ) FROM dual )
	 );



END REMOVE_PROJECT_VIEW_OWNER;

/
--------------------------------------------------------
--  DDL for Procedure REMOVE_RELEASE_CONTENT
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."REMOVE_RELEASE_CONTENT" ( sPvIdList IN VARCHAR2,
													 sNotPvIdList IN VARCHAR2,
                                                     nRTagId IN RELEASE_CONTENT.RTAG_ID%TYPE ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0
   --------------------------------------------------------------------------- */

oPvIdCollector RELMGR_NUMBER_TAB_t := RELMGR_NUMBER_TAB_t();
oNotPvIdCollector RELMGR_NUMBER_TAB_t := RELMGR_NUMBER_TAB_t();

BEGIN
	oPvIdCollector := IN_LIST_NUMBER ( sPvIdList );
    oNotPvIdCollector := IN_LIST_NUMBER ( sNotPvIdList );

    -- Delete From Release Content
    DELETE
      FROM RELEASE_CONTENT
	 WHERE rtag_id = nRTagId
	   AND pv_id IN ( SELECT * FROM TABLE ( CAST ( oPvIdCollector AS RELMGR_NUMBER_TAB_t ) ) )
	   AND NOT pv_id IN ( SELECT * FROM TABLE ( CAST ( oNotPvIdCollector AS RELMGR_NUMBER_TAB_t ) ) );



END Remove_Release_Content;

/
--------------------------------------------------------
--  DDL for Procedure REMOVE_RUNTIME
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."REMOVE_RUNTIME" ( nPvId IN PACKAGE_VERSIONS.PV_ID%TYPE,
											 nRuntimeId IN RUNTIME_DEPENDENCIES.RTD_ID%TYPE,
                                             nUserId IN NUMBER ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0
   --------------------------------------------------------------------------- */

   RuntimeDependency VARCHAR2(4000);

BEGIN

	-- Get Runtime dependency
    SELECT pkg.PKG_NAME ||' '|| pv.PKG_VERSION  INTO RuntimeDependency
	  FROM RUNTIME_DEPENDENCIES rtd,
	  	   PACKAGES pkg,
	       PACKAGE_VERSIONS pv
	 WHERE rtd.PV_ID = nPvId
	   AND pv.PKG_ID = pkg.PKG_ID
	   AND rtd.RTD_ID = pv.PV_ID
	   AND rtd.RTD_ID = nRuntimeId;


	-- Delete Document
    DELETE
      FROM RUNTIME_DEPENDENCIES rtd
     WHERE rtd.PV_ID = nPvId
       AND rtd.RTD_ID = nRuntimeId;


    /* LOG ACTION */
   	Log_Action ( nPvId, 'runtime_remove', nUserId,
   			     'Runtime package: '|| RuntimeDependency );


END Remove_Runtime;

/
--------------------------------------------------------
--  DDL for Procedure RENAME_PACKAGE_VERSION
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."RENAME_PACKAGE_VERSION" ( NNpv_id IN NUMBER,
                                  SSpkg_version IN PACKAGE_VERSIONS.pkg_version%TYPE,
                                  cBuildType IN CHAR,
                                  cChangeType IN CHAR,
                                  NNuser_id IN NUMBER,
                                  errMessage OUT VARCHAR2 ) IS
/* ---------------------------------------------------------------------------
    Version: 3.2
   --------------------------------------------------------------------------- */

    sPackageVersion VARCHAR2(4000);
    sLabel VARCHAR2(4000) := NULL;
    sChangeType VARCHAR2(100) := NULL;
    uChangeType CHAR := cChangeType;
    OldPkgVersion PACKAGE_VERSIONS.PKG_VERSION%TYPE;

    SSV_MM PACKAGE_VERSIONS.V_MM%TYPE;
    SSV_NMM PACKAGE_VERSIONS.V_NMM%TYPE;
    SSV_EXT PACKAGE_VERSIONS.V_EXT%TYPE;

    CURSOR package_versions_cur IS
        SELECT pv_id
          FROM package_versions
         WHERE pkg_id IN ( SELECT pkg_id FROM package_versions WHERE pv_id = NNpv_id )
           AND pkg_version = SSpkg_version;
    package_versions_rec package_versions_cur%ROWTYPE;


BEGIN

    /* ---------------------------------------------------- */
    /* Find if package_version exists                       */
    /* ---------------------------------------------------- */

    errMessage := NULL;

    -- Get previous version
    SELECT pv.PKG_VERSION INTO OldPkgVersion
      FROM PACKAGE_VERSIONS pv
     WHERE pv.PV_ID = NNpv_id;

    sPackageVersion := SSpkg_version;

    IF OldPkgVersion != sPackageVersion THEN

        OPEN package_versions_cur;
        FETCH package_versions_cur INTO package_versions_rec;

        IF package_versions_cur%NOTFOUND
        THEN

            -- Split current version in parts
            Split_Version ( SSpkg_version, SSV_MM, SSV_NMM, SSV_EXT );


                -- Automated built config
                IF ( cBuildType = 'M' ) THEN
                    uChangeType := 'F';
                END IF;

                -- Automated version numbering
                -- Make sure that version is still unique
                IF (uChangeType != 'F') THEN
                    sPackageVersion := '('|| NNpv_id ||')'|| SSV_EXT;
                END IF;

                -- Packge version not found, hence rename it.
                UPDATE package_versions
                   SET pkg_version = sPackageVersion,
                       v_mm = SSV_MM,
                       v_nmm = SSV_NMM,
                       v_ext = SSV_EXT,
                       modified_stamp = ORA_SYSDATETIME,
                       modifier_id = NNuser_id,
                       build_type = cBuildType,
                       change_type = uChangeType,
                       pkg_label = NULL
                 WHERE pv_id = NNpv_id;

                sLabel := GET_AUTOMATED_LABEL( NNpv_id );
                UPDATE PACKAGE_VERSIONS pv SET
                    pv.PKG_LABEL = sLabel
                WHERE pv_id = NNpv_id;


              /* LOG ACTION */
              IF (cChangeType = 'F') THEN
                  Log_Action ( NNpv_id, 'rename', NNuser_id, 'From '|| OldPkgVersion ||' to '|| sPackageVersion );
              ELSE

                  IF cChangeType = 'M' THEN
                    sChangeType := 'Major Change';
                  ELSIF cChangeType = 'N' THEN
                    sChangeType := 'Minor Change';
                  ELSIF cChangeType = 'P' THEN
                    sChangeType := 'Patch Change';
                  ELSE
                    sChangeType := 'Unknown Change';
                  END IF;

                  Log_Action ( NNpv_id, 'rename', NNuser_id, 'From '|| OldPkgVersion ||' to '|| sPackageVersion || ',' || sChangeType );
              END IF;

        ELSE
            -- Package version exists. Cannot proceed.
            errMessage := 'enum_MSG_VERSION_EXISTS';

        END IF;

        CLOSE package_versions_cur;

    END IF;

END Rename_Package_Version;

/
--------------------------------------------------------
--  DDL for Procedure RESET_IGNORE_WARNINGS
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."RESET_IGNORE_WARNINGS" ( sPvIdList IN VARCHAR2,
                                                    nRTagId IN RELEASE_CONTENT.RTAG_ID%TYPE ) IS
/* ---------------------------------------------------------------------------
    Version: 5.0
   --------------------------------------------------------------------------- */

oPvIdCollector RELMGR_NUMBER_TAB_t := RELMGR_NUMBER_TAB_t();

BEGIN
	oPvIdCollector := IN_LIST_NUMBER ( sPvIdList );

    -- Remove Ignore Warnings
     DELETE
       FROM ignore_warnings
	  WHERE (rtag_id, pv_id, dpv_id) IN
	     (
	      SELECT igw.rtag_id, igw.pv_id, igw.dpv_id
	        FROM ignore_warnings igw,
	             package_versions dpv,
	             package_versions pv
	       WHERE igw.dpv_id = dpv.pv_id
	         AND igw.rtag_id = nRTagId
	         AND dpv.pkg_id = pv.pkg_id
	         AND NVL(dpv.v_ext,'|LINK_A_NULL|') = NVL(pv.v_ext,'|LINK_A_NULL|')
	         AND pv.pv_id IN ( SELECT * FROM TABLE ( CAST ( oPvIdCollector AS RELMGR_NUMBER_TAB_t ) ) )
         );

END Reset_Ignore_Warnings;

/
--------------------------------------------------------
--  DDL for Procedure RIPPLE_PACKAGE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."RIPPLE_PACKAGE" (
        sPvIdList IN VARCHAR2,
        nRtagId IN RELEASE_TAGS.RTAG_ID%TYPE,
        nUserId IN NUMBER
    ) IS
/* ---------------------------------------------------------------------------
    Version: 4.1
   --------------------------------------------------------------------------- */

BEGIN

    IF (sPvIdList IS NULL) THEN
        RAISE_APPLICATION_ERROR (-20000, 'Please select at least one package.' );
    END IF;

    -- Ripple Package
    DELETE FROM DO_NOT_RIPPLE
    WHERE RTAG_ID = nRtagId
    AND PV_ID IN (
        SELECT *
        FROM THE (
            SELECT CAST( IN_LIST_NUMBER( sPvIdList )
            AS RELMGR_NUMBER_TAB_t )
            FROM DUAL
        )
    );

    -- Mark Release Changed for build
    PK_RELEASE.SET_RELEASE_MODIFIED(nRtagId);

    /* LOG ACTION */
    Log_Action_Bulk ( sPvIdList, 'ripple_package', nUserId );

END Ripple_Package;

/
--------------------------------------------------------
--  DDL for Procedure SEED_PACKAGE_NAMES_VERSIONS
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."SEED_PACKAGE_NAMES_VERSIONS" ( SSpkg_name IN PACKAGES.pkg_name%TYPE,
                                          SSpkg_version IN PACKAGE_VERSIONS.pkg_version%TYPE,
                                          NNuser_id IN NUMBER,
                                          retPV_ID OUT NUMBER,
                                          nCloneFromPvId IN NUMBER DEFAULT NULL,
                                          nBuildType IN CHAR DEFAULT 'U',
                                          nChangeType IN CHAR DEFAULT 'F') IS
/* ---------------------------------------------------------------------------
    Version: 5.0
   --------------------------------------------------------------------------- */

    parPkg_id   NUMBER;
    parPv_id    NUMBER;
    cloneFrom_pv_id NUMBER;
    SSV_MM PACKAGE_VERSIONS.V_MM%TYPE;
    SSV_NMM PACKAGE_VERSIONS.V_NMM%TYPE;
    SSV_EXT PACKAGE_VERSIONS.V_EXT%TYPE;
    spackageversion VARCHAR2 (4000);
    slabel VARCHAR2 (4000) := NULL;

    CURSOR packages_cur IS
        SELECT pkg_id FROM PACKAGES
        WHERE pkg_name = SSpkg_name;
    packages_rec packages_cur%ROWTYPE;

    CURSOR package_versions_cur IS
        SELECT pv_id FROM PACKAGE_VERSIONS
        WHERE pkg_id = parPkg_id
        AND pkg_version = SSpkg_version;
    package_versions_rec package_versions_cur%ROWTYPE;

    CURSOR clone_package_versions_cur IS
        SELECT MAX(pv_id) AS pv_id
          FROM PACKAGE_VERSIONS
         WHERE pkg_id = parPkg_id
           AND NVL(v_ext,'LINK_A_NULL') = NVL(SSV_EXT,'LINK_A_NULL');
    clone_package_versions_rec clone_package_versions_cur%ROWTYPE;

BEGIN
    /* -------------------------------------------- */
    /* Find if pkg_name exists and seed if required */
    /* -------------------------------------------- */
    OPEN packages_cur;
    FETCH packages_cur INTO packages_rec;

    IF packages_cur%NOTFOUND
    THEN
        /* INSERT into packages table */
        SELECT SEQ_PKG_ID.NEXTVAL INTO parPkg_id FROM DUAL;
        INSERT INTO PACKAGES ( pkg_id, pkg_name ) VALUES ( parPkg_id, SSpkg_name );

    ELSE
        parPkg_id := packages_rec.pkg_id;

    END IF;

    CLOSE packages_cur;


    /* ---------------------------------------------------- */
    /* Find if package_version exists and seed if required  */
    /* ---------------------------------------------------- */
    OPEN package_versions_cur;
    FETCH package_versions_cur INTO package_versions_rec;

    IF package_versions_cur%NOTFOUND
    THEN
        SELECT SEQ_PV_ID.NEXTVAL INTO parPv_id FROM DUAL;

        /* Generate automated version Number */
        Split_Version ( SSpkg_version, SSV_MM, SSV_NMM, SSV_EXT );
        spackageversion := SSpkg_version;

        IF ( nChangeType <> 'F' )
        THEN
            spackageversion := '(' || parPv_id || ')' || SSV_EXT;
        END If;

        /*  Determine clone source for new package-version
            Use nCloneFromPvId - iff provided
            Use most recently created pkgName/pkgExtension - if it exists
            Else create a brand new package-version
        */

        IF ( NOT nCloneFromPvId IS NULL) THEN
            cloneFrom_pv_id := nCloneFromPvId;
        ELSE
            /* Find similar pkg_name + ext to clone from */
            OPEN clone_package_versions_cur;
            FETCH clone_package_versions_cur INTO clone_package_versions_rec;
            CLOSE clone_package_versions_cur;

            IF ( NOT clone_package_versions_rec.pv_id IS NULL) THEN
                cloneFrom_pv_id := clone_package_versions_rec.pv_id;
            ELSE
                cloneFrom_pv_id := NULL;
            END IF;

        END IF;

        IF NOT cloneFrom_pv_id IS NULL
        THEN
            -- Clone Package Version Details --
            INSERT INTO PACKAGE_VERSIONS ( pv_id, pkg_id, pkg_version, dlocked, created_stamp, creator_id, modified_stamp, modifier_id, V_MM, V_NMM, V_EXT,
                                           src_path, pv_description, PV_OVERVIEW, LAST_PV_ID, owner_id, BUILD_TYPE, IS_BUILD_ENV_REQUIRED, bs_id, is_autobuildable, is_deployable, ripple_field,change_type  )
                SELECT parPv_id         AS pv_id,
                       parPkg_id        AS pkg_id,
                       spackageversion  AS pkg_version,
                       'N'              AS dlocked,
                       ora_sysdatetime  AS created_stamp,
                       NNuser_id        AS creator_id,
                       Ora_Sysdatetime  AS modified_stamp,
                       NNuser_id        AS modifier_id,
                       SSV_MM           AS V_MM,
                       SSV_NMM          AS V_NMM,
                       SSV_EXT          AS V_EXT,
                       pv.src_path,
                       pv.pv_description,
                       pv.PV_OVERVIEW,
                       cloneFrom_pv_id  AS LAST_PV_ID,
                       pv.owner_id,
                       nBuildType       AS BUILD_TYPE,
                       pv.IS_BUILD_ENV_REQUIRED,
                       pv.BS_ID,
                       pv.is_autobuildable,
                       pv.IS_DEPLOYABLE,
                       pv.ripple_field,
                       nChangeType       AS change_type
                  FROM PACKAGE_VERSIONS pv
                 WHERE pv.pv_id = cloneFrom_pv_id;

            Basic_Clone ( cloneFrom_pv_id, parPv_id, NULL, NNuser_id, parPkg_id, 0 );

        ELSE
            /* BRAND NEW version + ext */
            INSERT INTO PACKAGE_VERSIONS ( pv_id, pkg_id, pkg_version, dlocked, created_stamp, creator_id, modified_stamp, modifier_id, V_MM, V_NMM, V_EXT, owner_id, LAST_PV_ID, BUILD_TYPE, ripple_field, change_type )
            VALUES (
                    parPv_id,
                    parPkg_id,
                    spackageversion,
                    'N',
                    ora_sysdatetime,
                    NNuser_id,
                    Ora_Sysdatetime,
                    NNuser_id,
                    SSV_MM,
                    SSV_NMM,
                    SSV_EXT,
                    NNuser_id,
                    parPv_id,
                    nBuildType,
                    'b',
                    nChangeType
                   );
        END IF;

        /* Insert initial package label */
        slabel := get_automated_label (parPv_id);
        UPDATE package_versions pv
        SET pv.pkg_label = slabel
        WHERE pv.pv_id = parPv_id;

        retPV_ID := parPv_id;
        
        /* LOG ACTION */
        Log_Action ( parPv_id, 'new_version', NNuser_id,
                     'New package version: '|| spackageversion );

    ELSE
        retPV_ID := package_versions_rec.pv_id;

    END IF;

    CLOSE package_versions_cur;

END Seed_Package_Names_Versions;

/

  GRANT EXECUTE ON "RELEASE_MANAGER"."SEED_PACKAGE_NAMES_VERSIONS" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Procedure SET_ADVISORY_RIPPLE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."SET_ADVISORY_RIPPLE" ( nPvId IN PACKAGE_VERSIONS.PV_ID%TYPE,
	   	  		  							   nRtagId IN RELEASE_TAGS.RTAG_ID%TYPE,
											 nUserId IN NUMBER ) IS
/* ---------------------------------------------------------------------------
    Version: 4.0
   --------------------------------------------------------------------------- */

BEGIN

    -- Set Advisory Ripple Package
    INSERT INTO ADVISORY_RIPPLE (RTAG_ID, PV_ID)
	VALUES (nRtagId, nPvId);

    /* LOG ACTION */
   	Log_Action ( nPvId, 'set_advisory_ripple', nUserId );

	/*Rebuild_Environment(nRtagId);*/

END Set_Advisory_Ripple;

/
--------------------------------------------------------
--  DDL for Procedure SET_PACKAGE_BUILD_ENV
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."SET_PACKAGE_BUILD_ENV" ( nPvId IN PACKAGE_BUILD_ENV.PV_ID%TYPE,
	   	  		  								  	sBuildEnvIdList IN VARCHAR2 ) IS
/* ---------------------------------------------------------------------------
    Last Modified: Rupesh Solanki
	Version: 3.0.1
   --------------------------------------------------------------------------- */


BEGIN

   -- Delete Current Build Env settings
   DELETE FROM PACKAGE_BUILD_ENV
   WHERE pv_id = nPvId;

   -- Delet Current Package Build Info Settings
   DELETE FROM PACKAGE_BUILD_INFO
   WHERE pv_id = nPvId;

   -- Reset flag to N
   UPDATE PACKAGE_VERSIONS SET
	   IS_BUILD_ENV_REQUIRED = 'N'
   WHERE PV_ID = nPvId;


   -- Set new Build Env
   IF NOT sBuildEnvIdList IS NULL THEN
   	  -- Insert into PACKAGE_BUILD_ENV
      INSERT INTO PACKAGE_BUILD_ENV ( PV_ID, BE_ID )
	  SELECT nPvId AS PV_ID,
	  		 be.BE_ID
	    FROM BUILD_ENVIRONMENTS be
	   WHERE be.BE_ID IN (
	   		 		  	   SELECT *
					   	     FROM THE ( SELECT CAST( IN_LIST_NUMBER( sBuildEnvIdList ) AS RELMGR_NUMBER_TAB_t ) FROM dual )
	   		 		  	 );

   	  -- Insert into PACKAGE_BUILD_INFO
      INSERT INTO PACKAGE_BUILD_INFO ( PV_ID, BM_ID )
	  SELECT nPvId AS PV_ID,
	  		 be.BM_ID
	    FROM BUILD_MACHINES be
	   WHERE be.BM_ID IN (
	   		 		  	   SELECT *
					   	     FROM THE ( SELECT CAST( IN_LIST_NUMBER( sBuildEnvIdList ) AS RELMGR_NUMBER_TAB_t ) FROM dual )
	   		 		  	 );

	   -- Set flag to Y
	   UPDATE PACKAGE_VERSIONS SET
		   IS_BUILD_ENV_REQUIRED = 'Y'
	   WHERE PV_ID = nPvId;

   END IF;


END Set_Package_Build_Env;

/
--------------------------------------------------------
--  DDL for Procedure SET_PACKAGE_BUILD_ENV_TEMP
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."SET_PACKAGE_BUILD_ENV_TEMP" ( nPvId IN PACKAGE_BUILD_ENV.PV_ID%TYPE,
	   	  		  								  	   	 sBuildEnvIdList IN VARCHAR2,
														 nBuildStandard IN PACKAGE_VERSIONS.BS_ID%TYPE
														 ) IS
/* ---------------------------------------------------------------------------
    Last Modified: Rupesh Solanki
	Version: 3.0.1
   --------------------------------------------------------------------------- */

   nBsCollector RELMGR_NUMBER_TAB_t := RELMGR_NUMBER_TAB_t();
   BsId NUMBER;
   HackBsId NUMBER;


BEGIN

   nBsCollector := IN_LIST_NUMBER ( sBuildEnvIdList );

   -- Delete Current Build Env settings
   DELETE FROM PACKAGE_BUILD_ENV
   WHERE pv_id = nPvId;

   -- Delet Current Package Build Info Settings
   DELETE FROM PACKAGE_BUILD_INFO
   WHERE pv_id = nPvId;

   -- Reset flag to N
   UPDATE PACKAGE_VERSIONS SET
	   IS_BUILD_ENV_REQUIRED = 'N'
   WHERE PV_ID = nPvId;


   -- Set new Build Env
   IF NOT sBuildEnvIdList IS NULL THEN
	FOR i IN 1..nBsCollector.COUNT
	LOOP

	BsId := nBsCollector(i);

	IF nBuildStandard = 2 THEN
	   IF BsId = 1 THEN
	   	  HackBsId := 11;
	   ELSE
	   	  HackBsId := 12;
	   END IF;

   	  -- Insert into PACKAGE_BUILD_ENV
      INSERT INTO PACKAGE_BUILD_ENV ( PV_ID, BE_ID )
	  SELECT nPvId AS PV_ID,
	  		 be.BE_ID
	    FROM BUILD_ENVIRONMENTS be
	   WHERE be.BE_ID IN ( HackBsId );

   	  -- Insert into PACKAGE_BUILD_INFO
      INSERT INTO PACKAGE_BUILD_INFO ( PV_ID, BM_ID )
	  SELECT nPvId AS PV_ID,
	  		 be.BM_ID
	    FROM BUILD_MACHINES be
	   WHERE be.BM_ID IN ( BsId );

	   -- Set flag to Y
	   UPDATE PACKAGE_VERSIONS SET
		   IS_BUILD_ENV_REQUIRED = 'Y'
	   WHERE PV_ID = nPvId;


	ELSE

   	  -- Insert into PACKAGE_BUILD_ENV
      INSERT INTO PACKAGE_BUILD_ENV ( PV_ID, BE_ID )
	  SELECT nPvId AS PV_ID,
	  		 be.BE_ID
	    FROM BUILD_ENVIRONMENTS be
	   WHERE be.BE_ID IN ( BsId );

   	  -- Insert into PACKAGE_BUILD_INFO
      INSERT INTO PACKAGE_BUILD_INFO ( PV_ID, BM_ID )
	  SELECT nPvId AS PV_ID,
	  		 be.BM_ID
	    FROM BUILD_MACHINES be
	   WHERE be.BM_ID IN ( BsId );

	   -- Set flag to Y
	   UPDATE PACKAGE_VERSIONS SET
		   IS_BUILD_ENV_REQUIRED = 'Y'
	   WHERE PV_ID = nPvId;

	END IF;


	END LOOP;

   END IF;


END Set_Package_Build_Env_Temp;

/
--------------------------------------------------------
--  DDL for Procedure SET_TO_AUTOBUILDABLE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."SET_TO_AUTOBUILDABLE" (
   nrtagid     IN   NUMBER,
   spvidlist   IN   VARCHAR2
)
IS
/******************************************************************************
   NAME:       SET_TO_AUTOBUILDABLE
   PURPOSE:

   REVISIONS:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        15/12/2006   Rupesh Solanki       1. Created this procedure.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     SET_TO_AUTOBUILDABLE
      Sysdate:         15/12/2006
      Date and Time:   15/12/2006, 11:42:29 AM, and 15/12/2006 11:42:29 AM
      Username:         (set in TOAD Options, Procedure Editor)
      Table Name:       (set in the "New PL/SQL Object" dialog)

******************************************************************************/
   npvidcollector   relmgr_number_tab_t := relmgr_number_tab_t ();
   PvId NUMBER;
BEGIN

   npvidcollector := in_list_number2 (spvidlist);

   UPDATE package_versions
      SET is_autobuildable = 'N'
    WHERE pv_id IN (SELECT pv_id
                      FROM release_content
                     WHERE rtag_id = nrtagid);



   	FOR i IN 1..npvidcollector.COUNT
	LOOP
		PvId := npvidcollector(i);

		UPDATE package_versions
		set is_autobuildable = 'Y'
		where pv_id = PvId;

	END LOOP;


END set_to_autobuildable;

/
--------------------------------------------------------
--  DDL for Procedure SHIFT_INSTALL_ORDER
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."SHIFT_INSTALL_ORDER" ( nPatchId IN PACKAGE_PATCHES.PATCH_ID%TYPE,
												  nPvId IN PACKAGE_PATCHES.PV_ID%TYPE,
                                                  nToInstallOrder IN PACKAGE_PATCHES.INSTALL_ORDER%TYPE ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0
   --------------------------------------------------------------------------- */

currInstallOrder NUMBER;
FromInstallOrder NUMBER;

BEGIN

	 -- Get Current Install Order
     SELECT pp.INSTALL_ORDER INTO currInstallOrder
       FROM PACKAGE_PATCHES pp
      WHERE pp.PV_ID = nPvId
        AND pp.PATCH_ID = nPatchId;


	 IF currInstallOrder > nToInstallOrder
	 THEN

		FromInstallOrder := nToInstallOrder;

	    -- Shift others Up
		UPDATE PACKAGE_PATCHES pp SET
			   pp.INSTALL_ORDER = pp.INSTALL_ORDER + 1
		 WHERE pp.PV_ID = nPvId
           AND pp.PATCH_ID != nPatchId
		   AND pp.INSTALL_ORDER BETWEEN  FromInstallOrder  AND  currInstallOrder - 1;


	 ELSIF currInstallOrder < nToInstallOrder
	 THEN

		FromInstallOrder := currInstallOrder + 1;

		-- Shift others Down
        UPDATE PACKAGE_PATCHES pp SET
			   pp.INSTALL_ORDER = pp.INSTALL_ORDER - 1
		 WHERE pp.PV_ID = nPvId
           AND pp.PATCH_ID != nPatchId
		   AND pp.INSTALL_ORDER BETWEEN  FromInstallOrder  AND  nToInstallOrder;

	 END IF;


	 -- Move Patch to new install order
     UPDATE PACKAGE_PATCHES pp SET
		    pp.INSTALL_ORDER = nToInstallOrder
	  WHERE pp.PV_ID = nPvId
	    AND pp.PATCH_ID = nPatchId;


END Shift_Install_Order;

/
--------------------------------------------------------
--  DDL for Procedure SPLIT_VERSION
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."SPLIT_VERSION" ( SSpkg_version IN PACKAGE_VERSIONS.pkg_version%TYPE,
                                            SSV_MM OUT PACKAGE_VERSIONS.V_MM%TYPE,
                                            SSV_NMM OUT PACKAGE_VERSIONS.V_NMM%TYPE,
                                            SSV_EXT OUT PACKAGE_VERSIONS.V_EXT%TYPE  ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0.0
   --------------------------------------------------------------------------- */

    TYPE VERSION_COMPONENTS_TYPE IS TABLE OF VARCHAR2(50)
        INDEX BY BINARY_INTEGER;

    version_components VERSION_COMPONENTS_TYPE;
    lastDot NUMBER := 0;
    currDot NUMBER := 0;

BEGIN
    currDot := INSTR ( SSpkg_version, '.', -1 );      -- Find 1st dot from the right

    IF ( currDot > 0 )
    THEN
        -- YES dot separator found --
        SSV_EXT := GET_V_EXT( SSpkg_version );

        IF NOT SSV_EXT IS NULL
        THEN
            lastDot := currDot;
            currDot := INSTR ( SSpkg_version, '.', -1, 2 );   -- Find 2nd dot from the right

            IF ( currDot > 0 )
            THEN
                -- XXXX.M.E
                SSV_MM := SUBSTR ( SSpkg_version, currDot + 1, lastDot - currDot - 1);
                SSV_NMM := SUBSTR ( SSpkg_version, 0, currDot ) || SSV_EXT;
            ELSE
                -- XXXX.E
                SSV_MM := NULL;
                SSV_NMM := SSpkg_version;
            END IF;

        ELSE
            -- XXXX.M
            SSV_MM := SUBSTR ( SSpkg_version, currDot + 1, LENGTH(SSpkg_version) - currDot );
            SSV_NMM := SUBSTR ( SSpkg_version, 0, currDot );

        END IF;

    ELSE
        -- NO dot separator found --
        -- XXXXXX
        SSV_MM  := NULL;
        SSV_NMM := SSpkg_version;
        SSV_EXT := NULL;

    END IF;

END Split_Version;

/
--------------------------------------------------------
--  DDL for Procedure SWITCH_REPRODUCIBLE_PACKAGE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."SWITCH_REPRODUCIBLE_PACKAGE" (nPvId IN NUMBER, nUserId IN NUMBER)IS
Auto CHAR;
/******************************************************************************
   NAME:       SWITCH_REPRODUCIBLE_PACKAGE
   PURPOSE:

   REVISIONS:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        14/12/2006   Rupesh Solanki       1. Created this procedure.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     SWITCH_REPRODUCIBLE_PACKAGE
      Sysdate:         14/12/2006
      Date and Time:   14/12/2006, 11:35:15 AM, and 14/12/2006 11:35:15 AM
      Username:         (set in TOAD Options, Procedure Editor)
      Table Name:       (set in the "New PL/SQL Object" dialog)

******************************************************************************/
BEGIN

	 SELECT IS_AUTOBUILDABLE into Auto
	 FROM PACKAGE_VERSIONS
	 WHERE PV_ID = nPvId;

	 IF Auto = 'N' Then

	 	UPDATE PACKAGE_VERSIONS
	 	SET IS_AUTOBUILDABLE = 'Y'
	 	WHERE PV_ID = nPvId;


	 	/* LOG ACTION */
   		Log_Action ( nPvId, 'reproducible_package', nUserId );

	 Else

		 UPDATE PACKAGE_VERSIONS
		 SET IS_AUTOBUILDABLE = 'N'
		 WHERE PV_ID = nPvId;


	 	 /* LOG ACTION */
   	 	 Log_Action ( nPvId, 'unreproducible_package', nUserId );

	 End If;








END SWITCH_REPRODUCIBLE_PACKAGE;

/
--------------------------------------------------------
--  DDL for Procedure SYNC_PROJECTS_NEW_VERSION
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."SYNC_PROJECTS_NEW_VERSION" ( nPv_id 				IN NUMBER,
														  sSyncRtagsInList		IN VARCHAR2,
				                                          nUser_id 				IN NUMBER ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0.0
   --------------------------------------------------------------------------- */

	CURSOR sync_rtags_cur IS
        SELECT rc.RTAG_ID, rc.BASE_VIEW_ID, pv.pv_id
		  FROM release_content rc,
		  	   package_versions pv,
		       package_versions opv
		 WHERE rc.pv_id = pv.pv_id
		   AND opv.pkg_id = pv.pkg_id
		   AND NVL(opv.v_ext, '|LINK_A_NULL|') = NVL(pv.v_ext, '|LINK_A_NULL|')
		   AND opv.pv_id = nPv_id
		   AND rtag_id IN ( SELECT *
		   	   		   	      FROM THE (
					   	   		   	    SELECT CAST( IN_LIST_NUMBER( sSyncRtagsInList ) AS RELMGR_NUMBER_TAB_t )
					       		   	    FROM dual
									   )
						  );
    sync_rtags_rec sync_rtags_cur%ROWTYPE;

BEGIN

	OPEN sync_rtags_cur;
	FETCH sync_rtags_cur INTO sync_rtags_rec;

	WHILE sync_rtags_cur%FOUND
	LOOP
		DELETE FROM RELEASE_CONTENT
		 WHERE rtag_id = sync_rtags_rec.rtag_id
	       AND pv_id = sync_rtags_rec.pv_id;

		INSERT INTO RELEASE_CONTENT ( RTAG_ID, PV_ID, BASE_VIEW_ID, INSERT_STAMP, INSERTOR_ID, PKG_STATE )
	   		   VALUES ( sync_rtags_rec.rtag_id,
		       		  	nPv_id,
						sync_rtags_rec.BASE_VIEW_ID,
	           			ora_sysdatetime,
	           			nUser_id,
						0
	      	   		   );

-- 		UPDATE RELEASE_CONTENT
-- 	       SET pv_id = nPv_id,
-- 	           insert_stamp = ora_sysdatetime,
-- 	           insertor_id = nUser_id
-- 	     WHERE rtag_id = sync_rtags_rec.rtag_id
-- 	       AND pv_id = sync_rtags_rec.pv_id;

		FETCH sync_rtags_cur INTO sync_rtags_rec;
	END LOOP;

	CLOSE sync_rtags_cur;

END Sync_Projects_New_Version;

/
--------------------------------------------------------
--  DDL for Procedure TOUCH_RELEASE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."TOUCH_RELEASE" ( nRtagId IN RELEASE_TAGS.RTAG_ID%TYPE ) IS
/* ---------------------------------------------------------------------------
    The purpose of this procedure is to flag in the database that the specified
    release has changed to an extent that the procedure Rebuild_Environment
    should be called at the next opportunity in order that the package state
    icons are all re-evaluated.
    The package state icons are controlled using the pkg_state column in the
    release_content table, and Rebuild_Environment updates that column.
    It will be through user action in the website that Rebuild_Environment will
    be called, for example:
      a) when setting/clearing ignore warnings checkboxes
      b) when someone opens a page upon a rtag/pvid and rebuild_en flag is set
      c) when someone opens the build order report form
      d) when someone modifies dependencies of a package
      + other scenarios (?)
   --------------------------------------------------------------------------- */
BEGIN
   -- Touch Release for Rebuild
   UPDATE RELEASE_TAGS rt SET
          rt.REBUILD_ENV = 'Y',
          rt.REBUILD_STAMP = 0
    WHERE rt.RTAG_ID = nRtagId;

END Touch_Release;

/
--------------------------------------------------------
--  DDL for Procedure TOUCH_RELEASE_BULK
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."TOUCH_RELEASE_BULK" ( nRtagIdList IN VARCHAR2 ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0
   --------------------------------------------------------------------------- */

oRTagIdCollector RELMGR_NUMBER_TAB_t := RELMGR_NUMBER_TAB_t();

BEGIN
	 oRTagIdCollector := IN_LIST_NUMBER ( nRtagIdList );

	 -- Touch Release for Rebuild
     UPDATE RELEASE_TAGS rt SET
     	rt.REBUILD_ENV = 'Y',
        rt.REBUILD_STAMP = 0
      WHERE rt.RTAG_ID IN ( SELECT * FROM TABLE ( CAST ( oRTagIdCollector AS RELMGR_NUMBER_TAB_t ) ) );


END Touch_Release_Bulk;

/
--------------------------------------------------------
--  DDL for Procedure TO_INSERT_VTREE_ID
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."TO_INSERT_VTREE_ID" IS

/******************************************************************************
   NAME:       TO_INSERT_VTREE_ID
   PURPOSE:

   REVISIONS:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        2/02/2007          1. Created this procedure.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     TO_INSERT_VTREE_ID
      Sysdate:         2/02/2007
      Date and Time:   2/02/2007, 8:42:56 AM, and 2/02/2007 8:42:56 AM
      Username:         (set in TOAD Options, Procedure Editor)
      Table Name:       (set in the "New PL/SQL Object" dialog)

******************************************************************************/
VTreeId NUMBER;


	CURSOR curInfo IS
    SELECT RTAG_ID
	FROM RELEASE_TAGS
	WHERE VTREE_ID IS NULL;
    recInfo curInfo%ROWTYPE;


BEGIN

	OPEN curInfo;
    FETCH curInfo INTO recInfo;

	WHILE curInfo%FOUND
	LOOP
		SELECT SEQ_VTREE_ID.nextval INTO VTreeId FROM DUAL;

		UPDATE RELEASE_TAGS
		SET VTREE_ID = VTreeId
		WHERE RTAG_ID = recInfo.RTAG_ID;

		FETCH curInfo INTO recInfo;
	END LOOP;

	CLOSE curInfo;

END TO_INSERT_VTREE_ID;

/
--------------------------------------------------------
--  DDL for Procedure UNDEPRECATE_PACKAGE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."UNDEPRECATE_PACKAGE" (
    nPvId   IN PACKAGE_VERSIONS.PV_ID%TYPE,
    nRtagId IN DEPRECATED_PACKAGES.RTAG_ID%TYPE,
    nPkgId  IN DEPRECATED_PACKAGES.PKG_ID%TYPE,
    nUserId IN NUMBER)
IS
  ext      VARCHAR2(50);

BEGIN
  --Extract the package extension
  SELECT V_EXT INTO ext
  FROM PACKAGE_VERSIONS
  WHERE PV_ID = nPvId;

    -- Undeprecate Package
    DELETE
    FROM DEPRECATED_PACKAGES
    WHERE RTAG_ID = nRtagId
    AND PKG_ID    = nPkgId
    AND NVL(V_EXT,'.NULL') = NVL(ext,'.NULL');

    -- Update Release Contents entry
    -- Process PackageName.ext for the package. ie: Allow multiple
    -- versions of the package to be in the release.

    UPDATE RELEASE_CONTENT
    SET
      DEPRECATED_STATE = NULL
    WHERE RTAG_ID      = nRtagId
    AND PV_ID IN (
      SELECT PV.PV_ID
      FROM PACKAGE_VERSIONS PV
      WHERE PV.PKG_ID   = nPkgId
      AND NVL(PV.V_EXT, '.NULL') = NVL(ext,'.NULL')
      );

  -- Update consumers of the package
  --  Update ALL packages in the Release

  REBUILD_DEPRECATE_STATE(nRtagId);

END Undeprecate_Package;

/
--------------------------------------------------------
--  DDL for Procedure UNLOCK_PACKAGE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."UNLOCK_PACKAGE" ( nPvId IN PACKAGE_VERSIONS.PV_ID%TYPE,
											 nUserId IN NUMBER ) IS
/* ---------------------------------------------------------------------------
    Author: Rupesh Solanki

	Version: 4.0
   --------------------------------------------------------------------------- */
   STATE CHAR;

BEGIN

	SELECT DLOCKED INTO STATE
	FROM PACKAGE_VERSIONS
	WHERE PV_ID = nPvId;

	IF STATE = 'A' THEN --It was made official for autobuilds
		-- Unlock Package
		UPDATE PACKAGE_VERSIONS pv SET
		pv.DLOCKED = 'P'
		WHERE pv.PV_ID = nPvId;
	ELSE
		-- Unlock Package
		UPDATE PACKAGE_VERSIONS pv SET
		pv.DLOCKED = 'N'
		WHERE pv.PV_ID = nPvId;

	END IF;

    /* LOG ACTION */
   	Log_Action ( nPvId, 'unlock_package', nUserId );

END Unlock_Package;

/
--------------------------------------------------------
--  DDL for Procedure UNRIPPLE_PACKAGE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."UNRIPPLE_PACKAGE" (
        sPvIdList IN VARCHAR2,
        nRtagId IN RELEASE_TAGS.RTAG_ID%TYPE,
        nUserId IN NUMBER
    ) IS
/* ---------------------------------------------------------------------------
    Version: 4.1
   --------------------------------------------------------------------------- */

    oPvIdCollector RELMGR_NUMBER_TAB_t := RELMGR_NUMBER_TAB_t();

BEGIN

    IF (sPvIdList IS NULL) THEN
        RAISE_APPLICATION_ERROR (-20000, 'Please select at least one package.' );
    END IF;

    oPvIdCollector := IN_LIST_NUMBER ( sPvIdList );

    -- UnRipple Package
    INSERT INTO DO_NOT_RIPPLE ( RTAG_ID, PV_ID )
    SELECT nRtagId, pv.PV_ID
    FROM PACKAGE_VERSIONS pv
    WHERE pv.PV_ID IN (
        SELECT *
        FROM TABLE (
            CAST ( oPvIdCollector AS RELMGR_NUMBER_TAB_t )
        )
    );

    /* LOG ACTION */
    Log_Action_Bulk ( sPvIdList, 'unripple_package', nUserId );

END UnRipple_Package;

/
--------------------------------------------------------
--  DDL for Procedure UNRIPPLE_PACKAGE_INDIRECT
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."UNRIPPLE_PACKAGE_INDIRECT" (
        nPvId IN NUMBER,
        nRtagId IN NUMBER,
        nUserId IN NUMBER,
        nrootCausePvId IN NUMBER,
        srootCause IN VARCHAR2,
        srootFile IN VARCHAR2
    ) IS
    ReleaseLocation VARCHAR2(4000);
BEGIN

    -- UnRipple Package
    delete from do_not_ripple where rtag_id=nRtagId and pv_id=nPvId;
    INSERT INTO DO_NOT_RIPPLE ( RTAG_ID, PV_ID, ROOT_PV_ID, ROOT_CAUSE, ROOT_FILE ) values (nRtagId, nPvId, nrootCausePvId, srootCause, srootFile);

    -- Do not log if RootCause is -2
    IF nrootCausePvId IS NOT NULL AND nrootCausePvId = -2 THEN
      RETURN;
    END IF;

    /* LOG ACTION */
   SELECT proj.PROJ_NAME ||' / '|| rt.RTAG_NAME INTO ReleaseLocation
              FROM PROJECTS proj,
                   RELEASE_TAGS rt
             WHERE rt.RTAG_ID = nRtagId
               AND rt.PROJ_ID = proj.PROJ_ID;

    /* LOG ACTION */
    Log_Action ( nPvId, 'unripple_package', nUserId, 'Location: '|| ReleaseLocation );

END UnRipple_Package_Indirect;

/
--------------------------------------------------------
--  DDL for Procedure UPDATE_ADDITIONAL_NOTE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."UPDATE_ADDITIONAL_NOTE" ( pnNote_id IN NUMBER,
													 pnPv_id IN NUMBER,
                                                     psNote_title IN ADDITIONAL_NOTES.NOTE_TITLE%TYPE,
                                                     psNote_body IN ADDITIONAL_NOTES.NOTE_BODY%TYPE,
                                                     pnUser_id IN NUMBER,
                                                     outErrCode OUT NUMBER
                                                    ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0.1
   --------------------------------------------------------------------------- */

    newID NUMBER;

    /* Disallow duplicate Note Titles */
	CURSOR an_duplicate_cur IS
        SELECT COUNT(*) AS cnt_note
          FROM ADDITIONAL_NOTES
         WHERE pv_id = pnPv_id
           AND note_id != pnNote_id
           AND note_title = psNote_title;
    an_duplicate_rec an_duplicate_cur%ROWTYPE;

BEGIN
	outErrCode := -1;		-- Set default return error code to ERROR state

	OPEN an_duplicate_cur;
    FETCH an_duplicate_cur INTO an_duplicate_rec;

    IF an_duplicate_rec.cnt_note < 1
    THEN
		--- Update Additional Note ---
	    UPDATE ADDITIONAL_NOTES SET
		       note_title = psNote_title,
		       note_body = psNote_body,
		       mod_date = ora_sysdatetime,
		       mod_user = pnUser_id
         WHERE note_id = pnNote_id
           AND pv_id = pnPv_id;
		outErrCode := 0;		-- Set return to SUCCESS
	END IF;

	CLOSE an_duplicate_cur;
END Update_Additional_Note;

/
--------------------------------------------------------
--  DDL for Procedure UPDATE_DEPRECATION_STATE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."UPDATE_DEPRECATION_STATE" (nnrtag_id IN NUMBER) AS

recno NUMBER;

CURSOR deprecate_cur IS

SELECT rc.pv_id
FROM release_content rc
WHERE rtag_id = nnrtag_id
 AND deprecated_state IN(7);

deprecate_rec deprecate_cur % rowtype;

BEGIN

  OPEN deprecate_cur;

  FETCH deprecate_cur
  INTO deprecate_rec;

  WHILE deprecate_cur % FOUND
  LOOP

    SELECT COUNT(*)
    INTO recno
    FROM package_dependencies pd,
      release_content rc
    WHERE pd.pv_id = deprecate_rec.pv_id
     AND rc.pv_id = pd.dpv_id
     AND rc.rtag_id = nnrtag_id
     AND rc.deprecated_state IN(6,   7);

    IF recno = 0 THEN

      UPDATE release_content
      SET pkg_id = NULL, deprecated_state = NULL
      WHERE pv_id = deprecate_rec.pv_id
       AND rtag_id = nnrtag_id;

    END IF;

    FETCH deprecate_cur
    INTO deprecate_rec;
  END LOOP;

END;

/
--------------------------------------------------------
--  DDL for Procedure UPDATE_MISC_VIEW
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."UPDATE_MISC_VIEW" IS
/******************************************************************************
   NAME:       UPDATE_MISC_VIEW
   PURPOSE:

   REVISIONS:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        16/03/2007          1. Created this procedure.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     UPDATE_MISC_VIEW
      Sysdate:         16/03/2007
      Date and Time:   16/03/2007, 8:56:29 AM, and 16/03/2007 8:56:29 AM
      Username:         (set in TOAD Options, Procedure Editor)
      Table Name:       (set in the "New PL/SQL Object" dialog)

******************************************************************************/
   CURSOR view_cur /*Create a record set to store the ripple data*/
   IS
   	 SELECT pkg.pkg_id, rc.base_view_id
	 FROM package_versions pv, packages pkg, release_content rc
	 where rc.rtag_id = 2362
	 and rc.pv_id = pv.pv_id
	 and pv.pkg_id = pkg.pkg_id;
   view_rec   view_cur%ROWTYPE;



BEGIN
   OPEN view_cur;

   FETCH view_cur
    INTO view_rec;

   WHILE view_cur%FOUND
   LOOP


	   update release_content
	   set base_view_id = view_rec.base_view_id
	   where rtag_id = 8027
	   and pv_id IN
	   (
	   	select pv.pv_id from release_content rc, package_versions pv
		where rc.rtag_id = 8027
		and pv.pv_id = rc.pv_id
		and pv.pkg_id = view_rec.pkg_id

	   );









   FETCH view_cur
   		 INTO view_rec;
   END LOOP;





END UPDATE_MISC_VIEW;

/
--------------------------------------------------------
--  DDL for Procedure UPDATE_PACKAGE_DEPENDENCY
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."UPDATE_PACKAGE_DEPENDENCY" ( NNpv_id IN NUMBER,
                                                        SSdep_name IN PACKAGES.pkg_name%TYPE,
                                                        SSdep_version IN PACKAGE_VERSIONS.pkg_version%TYPE,
                                                        CCbuild_type IN PACKAGE_DEPENDENCIES.build_type%TYPE,
                                                        NNuser_id IN NUMBER,
                                                        NNdelete_old_dependency IN NUMBER
                                                       ) IS
/* ---------------------------------------------------------------------------
    Version: 3.3
   --------------------------------------------------------------------------- */

    retPV_ID NUMBER;
    SSV_EXT PACKAGE_VERSIONS.v_ext%TYPE;
	DepIsPatch	PACKAGE_VERSIONS.is_patch%TYPE;
    PvIsPatch	PACKAGE_VERSIONS.is_patch%TYPE;
    NNpkg_id NUMBER;
    NNdpkg_id NUMBER;

BEGIN
    --- Seed database with package_name and version if required ---
    Seed_Package_Names_Versions ( SSdep_name, SSdep_version, NNuser_id, retPV_ID );

    -- get v_ext,pkg_id of current dependency
    SELECT v_ext, pkg_id, is_patch INTO SSV_EXT, NNdpkg_id, DepIsPatch
      FROM PACKAGE_VERSIONS
     WHERE pv_id = retPV_ID;

    -- get pkg_id of parent package
    SELECT pkg_id, is_patch INTO NNpkg_id, PvIsPatch
      FROM PACKAGE_VERSIONS
     WHERE pv_id = NNpv_id;


	IF ( (PvIsPatch IS NULL) AND (DepIsPatch IS NULL) ) OR
    	( (PvIsPatch IS NOT NULL) )THEN

	    IF NNdelete_old_dependency = 1 THEN
	        /* Used for CUSTOM dependency add/edit */

	        --- Remove old dependency ---
            IF (PvIsPatch IS NULL) THEN
            	-- Do it for Packages
		        DELETE FROM PACKAGE_DEPENDENCIES
		         WHERE ( pv_id, dpv_id, pkg_id, dpkg_id, build_type, display_order ) IN
		            (
		            SELECT dep.*
		              FROM PACKAGE_DEPENDENCIES dep,
		                   PACKAGE_VERSIONS dpv,
		                   PACKAGE_VERSIONS pv
		             WHERE dep.dpv_id = dpv.pv_id
		               AND dep.pv_id = NNpv_id
		               AND pv.pv_id = retPV_ID
		               AND dpv.pkg_id = pv.pkg_id
		               AND NVL(dpv.v_ext, '|LINK_A_NULL|') = NVL(SSV_EXT, '|LINK_A_NULL|')
		            );
            ELSE
            	-- Do it for Patches
                DELETE FROM PACKAGE_DEPENDENCIES
		         WHERE ( pv_id, dpv_id, pkg_id, dpkg_id, build_type, display_order ) IN
		            (
		            SELECT dep.*
		              FROM PACKAGE_DEPENDENCIES dep
		             WHERE dep.dpv_id = retPV_ID
		               AND dep.pv_id = NNpv_id
		            );
			END IF;

	    END IF;

	    /* NOTE: for JATS, ANTS dependency update, it is expected that all dependencies are removed. */

	    --- Add new dependency ---
	    INSERT INTO PACKAGE_DEPENDENCIES ( pv_id, dpv_id, pkg_id, dpkg_id, build_type )
	    VALUES ( NNpv_id, retPV_ID, NNpkg_id, NNdpkg_id, CCbuild_type );

	END IF;

END Update_Package_Dependency;

/
--------------------------------------------------------
--  DDL for Procedure UPDATE_PACKAGE_STATES
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."UPDATE_PACKAGE_STATES" ( NNrtag_id IN NUMBER,
                                                    NNsession_num IN NUMBER ) IS
/* =============  STATE RULES =================== */
/*
   MNR   MRR   MN   MR    |   pkg_state
   ------------------------------------
    0     0     0     0   |      OK
    0     0     0     1   |      MAJOR
    0     0     1     0   |      MINOR
    0     0     1     1   |      MAJOR
   ------------------------------------
    0     1     0     0   |      MAJOR_READY
    0     1     0     1   |      MAJOR
    0     1     1     0   |      MAJOR
    0     1     1     1   |      MAJOR
   ------------------------------------
    1     0     0     0   |      MINOR_READY
    1     0     0     1   |      MAJOR
    1     0     1     0   |      MINOR
    1     0     1     1   |      MAJOR
   ------------------------------------
    1     1     0     0   |      MAJOR_READY
    1     1     0     1   |      MAJOR
    1     1     1     0   |      MAJOR
    1     1     1     1   |      MAJOR
   ------------------------------------
*/
BEGIN
    /*----------------------------------------------
    ||              MINOR READY
    */----------------------------------------------

    UPDATE release_content
       SET pkg_state = 4
     WHERE rtag_id = NNrtag_id
       AND pv_id IN
           (
           SELECT DISTINCT pv_id
           FROM temp_env_states
           WHERE session_num = NNsession_num
             AND level_num = 1
             AND tes_state = 2
           );

    /*----------------------------------------------
    ||              MAJOR READY
    */----------------------------------------------
    UPDATE release_content
       SET pkg_state = 3
     WHERE rtag_id = NNrtag_id
       AND pv_id IN
           (
           SELECT DISTINCT pv_id
           FROM temp_env_states
           WHERE session_num = NNsession_num
             AND level_num = 1
             AND tes_state IN (0,1)
           );

    /*----------------------------------------------
    ||                MINOR
    */----------------------------------------------
    UPDATE release_content
       SET pkg_state = 2
     WHERE rtag_id = NNrtag_id
       AND pv_id IN
           (
           SELECT DISTINCT pv_id
            FROM temp_env_states
            WHERE session_num = NNsession_num
              AND level_num >= 2
              AND tes_state = 2
            MINUS
           SELECT pv_id
             FROM release_content
            WHERE rtag_id = NNrtag_id
              AND pkg_state = 3
           );

    /*----------------------------------------------
    ||                MAJOR
    */----------------------------------------------
    UPDATE release_content
       SET pkg_state = 1
     WHERE rtag_id = NNrtag_id
       AND pv_id IN
           (
           SELECT DISTINCT pv_id
           FROM temp_env_states
           WHERE session_num = NNsession_num
             AND level_num >= 2
             AND tes_state IN (0,1)
           /* MAJOR EXCEPTION - When package has Major Ready and Minor */
           UNION
           SELECT DISTINCT tes.pv_id
           FROM temp_env_states tes,
                release_content rc
           WHERE tes.session_num = NNsession_num
             AND tes.level_num >= 2
             AND tes.tes_state = 2
             AND rtag_id = NNrtag_id
             AND rc.pv_id = tes.pv_id
             AND rc.pkg_state = 3
           );

    /*----------------------------------------------
    ||                 OK
    */----------------------------------------------
    UPDATE release_content
       SET pkg_state = 0
     WHERE rtag_id = NNrtag_id
       AND pv_id IN
           (
           SELECT rc.pv_id
             FROM release_content rc
            WHERE rc.rtag_id = NNrtag_id
              AND NOT rc.pv_id IN
                    (
                     SELECT DISTINCT pv_id
                     FROM temp_env_states WHERE session_num = NNsession_num
                    )
           );

      Update_Deprecation_State (NNrtag_id);

    /*----------------------------------------------
    ||              PEGGED VERSIONS DEPENDENT
    */----------------------------------------------
    UPDATE release_content
       SET pkg_state = 10
     WHERE rtag_id = NNrtag_id
       AND pv_id IN
           (
           SELECT DISTINCT pv_id
           FROM pegged_versions pegv
           WHERE pegv.rtag_id = NNrtag_id
           );

    /*----------------------------------------------
    ||              ADVISORY RIPPLE
    */----------------------------------------------
    UPDATE release_content
       SET pkg_state = 8
     WHERE rtag_id = NNrtag_id
       AND pv_id IN
           (
           SELECT DISTINCT pv_id
           FROM advisory_ripple ar
           WHERE ar.rtag_id = NNrtag_id
           )
       AND pv_id IN
           (
           SELECT DISTINCT pv_id
           FROM release_content rc
           WHERE rc.rtag_id = NNrtag_id
           );

    /*----------------------------------------------
    ||              SDK Imported
    */----------------------------------------------
    UPDATE release_content
       SET pkg_state = 11
     WHERE rtag_id = NNrtag_id
       AND sdktag_id is not null;

   /*----------------------------------------------
    ||              UnBuildable
    */----------------------------------------------
    UPDATE release_content
       SET pkg_state = 13
     WHERE rtag_id = NNrtag_id
       AND pv_id in (select pv_id from temp_env_states WHERE session_num = NNsession_num AND build_type = 'U');

END Update_Package_States;

/
--------------------------------------------------------
--  DDL for Procedure UPDATE_PROCESSES
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."UPDATE_PROCESSES" 
IS

proc_id NUMBER;
/******************************************************************************
   NAME:       DELETE_DO_NOT_RIPPLE
   PURPOSE:    TO DELETE ENTRIES FROM THE DO_NOT_RIPPLE TABLE WHEN A PACKAGE
               IS RELEASED

   REVISIONS:
   Ver        Date        Author           Description
   ---------  ----------  ---------------  ------------------------------------
   1.0        21/04/2006  Rupesh Solanki     1. Created this procedure.

   NOTES:

   Automatically available Auto Replace Keywords:
      Object Name:     DELETE_DO_NOT_RIPPLE
      Sysdate:         21/04/2006
      Date and Time:   21/04/2006, 3:21:55 PM, and 21/04/2006 3:21:55 PM
      Username:         (set in TOAD Options, Procedure Editor)
      Table Name:       (set in the "New PL/SQL Object" dialog)

******************************************************************************/
   CURSOR ripple_cur
   IS
      select proc_id,  proc_name, run_as, pkg_owner, is_interface from processes;

   ripple_rec   ripple_cur%ROWTYPE;
BEGIN
   OPEN ripple_cur;

   FETCH ripple_cur
    INTO ripple_rec;

   WHILE ripple_cur%FOUND
   LOOP


update deployment_manager.processes_config
set proc_id = ripple_rec.proc_id
where pkg_health_tag = ripple_rec.proc_name
and cmd_interface IS NULL
and pkg_owner IS NULL
and is_interface IS NULL;


      FETCH ripple_cur
       INTO ripple_rec;
   END LOOP;
END UPDATE_PROCESSES;

/
--------------------------------------------------------
--  DDL for Procedure UPDATE_RUNTIME_DEPENDENCY
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."UPDATE_RUNTIME_DEPENDENCY" ( NNpv_id IN RUNTIME_DEPENDENCIES.pv_id%TYPE,
				   	  		  						    NNrtd_id IN RUNTIME_DEPENDENCIES.rtd_id%TYPE,
				   	  		  						    SSrtd_version IN PACKAGE_VERSIONS.pkg_version%TYPE,
													    SSrtd_url IN RUNTIME_DEPENDENCIES.rtd_url%TYPE,
													    SSrtd_comments IN RUNTIME_DEPENDENCIES.rtd_comments%TYPE,
													    NNuser_id IN NUMBER ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0.1
   --------------------------------------------------------------------------- */

    retRTD_ID	NUMBER;
	CURSOR rtd_cur IS
	    SELECT pv.pkg_version, pkg.pkg_name
		  FROM runtime_dependencies rtd,
		       package_versions pv,
			   packages pkg
		 WHERE rtd.rtd_id = pv.pv_id
		   AND pv.pkg_id = pkg.pkg_id
		   AND rtd.pv_id = NNpv_id
		   AND rtd.rtd_id = NNrtd_id;
	   rtd_rec rtd_cur%ROWTYPE;

	CURSOR old_rtd_cur IS
	    SELECT pv.pv_id
		  FROM package_versions pv
		 WHERE pv.pkg_id IN ( SELECT rtdpv.pkg_id
		 	   			 	    FROM package_versions rtdpv
							   WHERE rtdpv.pv_id = NNrtd_id )
		   AND pv.pkg_version = SSrtd_version;
	old_rtd_rec old_rtd_cur%ROWTYPE;


BEGIN

    -- Get current runtime dependency details
	OPEN rtd_cur;
    FETCH rtd_cur INTO rtd_rec;




	IF rtd_rec.pkg_version != SSrtd_version THEN
           -- Version has changed, hence create new runtime dependency --
	    /* NOTE: You must create new version as updating just a version will affect
		        all packages using this runtime dependency and user does not expect that.
		        It is safer to create new version */
		OPEN old_rtd_cur;
		FETCH old_rtd_cur INTO old_rtd_rec;


		IF old_rtd_cur%NOTFOUND
		THEN
			-- Version not found, hence Create New version --
    		Seed_Package_Names_Versions ( rtd_rec.pkg_name, SSrtd_version, NNuser_id, retRTD_ID );

			-- Update runtime dependency table --
			UPDATE runtime_dependencies SET
				   rtd_id = retRTD_ID,
				   rtd_url = SSrtd_url,
				   rtd_comments = SSrtd_comments
			 WHERE pv_id = NNpv_id
			   AND rtd_id = NNrtd_id;

		ELSE
			-- Update runtime dependency table --
			UPDATE runtime_dependencies SET
				   rtd_id = old_rtd_rec.pv_id,
				   rtd_url = SSrtd_url,
				   rtd_comments = SSrtd_comments
			 WHERE pv_id = NNpv_id
			   AND rtd_id = NNrtd_id;

		END IF;


		CLOSE old_rtd_cur;

	ELSE
		--  Version has not changed, hence update everithing except	version --
		UPDATE runtime_dependencies SET
			   rtd_url = SSrtd_url,
			   rtd_comments = SSrtd_comments
		 WHERE pv_id = NNpv_id
		   AND rtd_id = NNrtd_id;



	END IF;


	CLOSE rtd_cur;

END Update_Runtime_Dependency;

/
--------------------------------------------------------
--  DDL for Procedure UPDATE_UNIT_TEST
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."UPDATE_UNIT_TEST" ( nTest_id IN NUMBER,
	   	  		  							   nTestTypeId IN UNIT_TESTS.TEST_TYPES_FK%TYPE,
											   nPv_id IN NUMBER,
											   nUserId IN NUMBER,
	                                           sTest_summary IN UNIT_TESTS.TEST_SUMMARY%TYPE,
											   sNumof_test IN UNIT_TESTS.NUMOF_TEST%TYPE,
	                                           sCompletion_date IN VARCHAR2,
											   sDpkg_path IN VARCHAR2,
											   enumTEST_TYPE_AUTOMATIC IN NUMBER,
											   sResults IN VARCHAR2,
											   outFileName OUT VARCHAR2
                                              ) IS
/* ---------------------------------------------------------------------------
    Version: 3.1.0
   --------------------------------------------------------------------------- */

   	FILENAME_PREFIX CONSTANT VARCHAR2(50) := 'RM_UNIT_TEST';

    ResultsURL UNIT_TESTS.RESULTS_URL%TYPE DEFAULT NULL;
    ResultsAttachment UNIT_TESTS.RESULTS_ATTACHMENT_NAME%TYPE DEFAULT NULL;


BEGIN

       IF nTestTypeId = enumTEST_TYPE_AUTOMATIC THEN
       	ResultsURL := sResults;
       ELSE
       	IF (sResults <> '') OR ( NOT sResults IS NULL ) THEN
        	outFileName := FILENAME_PREFIX || nTest_id ||'_'|| sResults;
    		ResultsAttachment := sDpkg_path || '/' || outFileName;
           END IF;
       END IF;

	--- Update Unit Test ---
    UPDATE UNIT_TESTS SET
           TEST_SUMMARY = sTest_summary,
		   NUMOF_TEST = sNumof_test,
           COMPLETION_DATE = TO_DATE( sCompletion_date,'DD/MM/YYYY' ),
		   COMPLETED_BY = nUserId,
		   RESULTS_URL = ResultsURL,
		   RESULTS_ATTACHMENT_NAME = ResultsAttachment
     WHERE TEST_ID = nTest_id
       AND PV_ID = nPv_id;

END Update_Unit_Test;

/
--------------------------------------------------------
--  DDL for Procedure UPDATE_UNIT_TEST_ACCEPTANCE
--------------------------------------------------------
set define off;

  CREATE OR REPLACE PROCEDURE "RELEASE_MANAGER"."UPDATE_UNIT_TEST_ACCEPTANCE" ( pnTest_id IN NUMBER,
														  pnPv_id IN NUMBER,
					                                      sAccepted IN UNIT_TESTS.TEST_ACCEPTED%TYPE,
														  sAcceptanceDate IN VARCHAR2,
														  sAcceptedBy IN NUMBER,
					                                      sReviewComments IN UNIT_TESTS.REVIEW_COMMENTS%TYPE,
														  cUpdateAcceptedStateOnly IN CHAR
					                                     ) IS
/* ---------------------------------------------------------------------------
    Version: 3.0.0
   --------------------------------------------------------------------------- */



BEGIN
	IF cUpdateAcceptedStateOnly = 'Y'
	THEN
		--- Update Accepted State Only ---
		IF ( sAccepted IS NULL )
		THEN
			-- Clear alleptance
			UPDATE UNIT_TESTS SET
		           TEST_ACCEPTED = NULL,
		           ACCEPTANCE_DATE = NULL,
				   ACCEPTED_BY = NULL,
				   REVIEW_COMMENTS = NULL
		     WHERE TEST_ID = pnTest_id
		       AND PV_ID = pnPv_id;

	    ELSE
			UPDATE UNIT_TESTS SET
		           TEST_ACCEPTED = sAccepted,
		           ACCEPTANCE_DATE = TO_DATE( sAcceptanceDate,'DD/MM/YYYY' ),
				   ACCEPTED_BY = sAcceptedBy
		     WHERE TEST_ID = pnTest_id
		       AND PV_ID = pnPv_id;

		END IF;


	ELSE
		--- Update Unit Test Acceptance ---
	    UPDATE UNIT_TESTS SET
	           TEST_ACCEPTED = sAccepted,
			   REVIEW_COMMENTS = sReviewComments,
	           ACCEPTANCE_DATE = TO_DATE( sAcceptanceDate,'DD/MM/YYYY' ),
			   ACCEPTED_BY = sAcceptedBy
	     WHERE TEST_ID = pnTest_id
	       AND PV_ID = pnPv_id;

	END IF;

END Update_Unit_Test_Acceptance;

/
--------------------------------------------------------
--  DDL for Package PK_APP_UTILS
--------------------------------------------------------

  CREATE OR REPLACE PACKAGE "RELEASE_MANAGER"."PK_APP_UTILS" IS
/*
------------------------------
||  Last Modified:  S.Vukovic
||  Modified Date:  26/Apr/2005
||  Spec Version:   1.0
------------------------------
*/

	TYPE typeCur IS REF CURSOR;

    /*================================================================================================*/

	PROCEDURE GET_CURRENT_PARAMETERS ( ProjId IN VARCHAR2, RtagId IN VARCHAR2, records OUT typeCur);

	/*================================================================================================*/

END PK_APP_UTILS;

/

  GRANT EXECUTE ON "RELEASE_MANAGER"."PK_APP_UTILS" TO "DEPLOYMENT_MANAGER";
--------------------------------------------------------
--  DDL for Package PK_BLATAPI
--------------------------------------------------------

  CREATE OR REPLACE PACKAGE "RELEASE_MANAGER"."PK_BLATAPI" 
IS

   /*================================================================================================*/
   PROCEDURE add_pkg_replica (
      sdisplay_name          IN   VARCHAR2,
      sserver_name           IN   VARCHAR2,
      sdescription           IN   VARCHAR2,
      sactive                IN   CHAR,
      smode                  IN   CHAR
   );

   /*================================================================================================*/
   PROCEDURE delete_pkg_replica (sserver_id_list IN VARCHAR2);

   /*================================================================================================*/
   PROCEDURE update_pkg_replica (
      nserver_id             IN   NUMBER,
      sdisplay_name          IN   VARCHAR2,
      sserver_name           IN   VARCHAR2,
      sdescription           IN   VARCHAR2,
      sactive                IN   CHAR,
      smode                  IN   CHAR
   );

   /*================================================================================================*/
   PROCEDURE set_pkg_replica_changed( nserver_id IN   NUMBER);

END PK_BLATAPI;

/
--------------------------------------------------------
--  DDL for Package PK_BUILDAPI
--------------------------------------------------------

  CREATE OR REPLACE PACKAGE "RELEASE_MANAGER"."PK_BUILDAPI" 
IS
   /*================================================================================================*/
   PROCEDURE add_product_component (
      npvid           IN   NUMBER,
      sosname         IN   VARCHAR2,
      sorigfilepath   IN   VARCHAR2,
      sfilename       IN   VARCHAR2,
      sdestfilepath   IN   VARCHAR2,
      nbytesize       IN   NUMBER,
      scrccksum       IN   VARCHAR2
   );

   PROCEDURE remove_all_product_components (
      npvid     IN   NUMBER,
      sosname   IN   VARCHAR2
   );

   /*================================================================================================*/
   FUNCTION get_osid (sosname IN VARCHAR2)
      RETURN NUMBER;

  /*================================================================================================*/
    PROCEDURE update_build_service_info (
      sdatabaseserver   IN   VARCHAR2,
      sarchiveserver    IN   VARCHAR2,
      smailserver       IN   VARCHAR2,
      smailsender       IN   VARCHAR2,
      faultmlist        IN   VARCHAR2,
      sdiskspace        IN   VARCHAR2,
      ssbommanagement   IN   VARCHAR2,
      lxrserver         IN   VARCHAR2
   );

   /*================================================================================================*/
   PROCEDURE add_gbe_machtype (sgbevalue IN VARCHAR2, sgbeclass IN NUMBER);

   /*================================================================================================*/
   PROCEDURE remove_gbe_machtype (ngbe_id IN NUMBER);

   /*================================================================================================*/
   PROCEDURE update_gbe_machtype (ngbe_id IN NUMBER, sgbevalue IN VARCHAR2, sgbeclass IN NUMBER);

  /*================================================================================================*/
   PROCEDURE add_buildmachine (sbmvalue IN VARCHAR2);

   /*================================================================================================*/
   PROCEDURE remove_buildmachine (nbm_id IN NUMBER);

   /*================================================================================================*/
   PROCEDURE update_buildmachine (nbm_id IN NUMBER, sbmvalue IN VARCHAR2);

   /*================================================================================================*/
   PROCEDURE delete_daemon (srconidlist IN VARCHAR2);

   /*================================================================================================*/
   PROCEDURE remove_daemon (srconidlist IN VARCHAR2);

   /*================================================================================================*/
   PROCEDURE insert_schedule_info (
      dschedulepause     IN   DATE,
      dscheduleresume    IN   DATE,
      crepeat            IN   VARCHAR2,
      cindefinitepause   IN   VARCHAR2
   );

   /*================================================================================================*/
   PROCEDURE delete_schedule (nscheduleid IN NUMBER);

   /*================================================================================================*/
   PROCEDURE set_infinite_pause;

   /*================================================================================================*/
   PROCEDURE set_resume;

   /*================================================================================================*/
   PROCEDURE delete_out_of_date_schedule;

   /*================================================================================================*/
   PROCEDURE set_daemon_resume (nrconid IN NUMBER);

   /*================================================================================================*/
   PROCEDURE set_daemon_pause (nrconid IN NUMBER);

   /*================================================================================================*/
   PROCEDURE set_daemon_disable (nrconid NUMBER);

   /*================================================================================================*/
   PROCEDURE set_daemon_states (nrtagid NUMBER, nstate NUMBER);

   /*================================================================================================*/
   PROCEDURE mark_daemon_inst_in_progress( nInstId IN NUMBER );
   /*================================================================================================*/
   PROCEDURE mark_daemon_inst_completed( nInstId IN NUMBER );
   /*================================================================================================*/
   FUNCTION get_daemon_inst(
      nRtag_id IN NUMBER,
      nInst_id IN OUT NUMBER,
      nOp_code IN OUT NUMBER,
      nPv_id OUT NUMBER,
      nUser_id OUT NUMBER,
      nInProgress OUT NUMBER,
      bExpired IN NUMBER default 1
   ) RETURN NUMBER;
   /*================================================================================================*/
   PROCEDURE cleanup_stranded_daemon_insts;
   /*================================================================================================*/
   PROCEDURE insert_daemon_inst(
      nOp_code IN NUMBER,
      nRtag_id IN NUMBER,
      nPv_id IN NUMBER,
      nSchedDate IN DATE,
      nRepeatSecs IN NUMBER,
      nAddedDate IN DATE,
      nUser_id IN NUMBER
   );
   /*================================================================================================*/
   PROCEDURE del_daemon_inst( nInstId IN NUMBER );
   /*================================================================================================*/
   PROCEDURE del_daemon_inst_by_rtag_pvid(
      nOp_code IN NUMBER,
      nRtag_id IN NUMBER,
      nPv_id IN NUMBER
   );
   /*================================================================================================*/
   PROCEDURE update_daemon_inst(
      nInstId IN NUMBER,
      nOp_code IN NUMBER,
      nRtag_id IN NUMBER,
      nPv_id IN NUMBER,
      nSchedDate IN DATE,
      nRepeatSecs IN NUMBER,
      nAddedDate IN DATE,
      nUser_id IN NUMBER
   );
   /*================================================================================================*/
   FUNCTION daemon_ops_for_rtag_pvid(
      nRtag_id IN NUMBER,
      nPv_id IN NUMBER
   ) RETURN VARCHAR2;
   /*================================================================================================*/
   FUNCTION daemon_ops_for_rtag(
      nRtag_id IN NUMBER
   ) RETURN VARCHAR2;
   /*================================================================================================*/
   PROCEDURE add_daemon_config (
      nrtagid           IN   NUMBER,
      nbmcon_id         IN   NUMBER,
      sdaemon_mode      IN   VARCHAR2,
      sgbebuildfilter   IN   VARCHAR2
   );
   /*================================================================================================*/
   PROCEDURE update_daemon_config (
      nrconid           IN   NUMBER,
      nbmcon_id         IN   NUMBER,
      sdaemon_mode      IN   VARCHAR2,
      sgbebuildfilter   IN   VARCHAR2
   );

 /*================================================================================================*/
   PROCEDURE duplicate_daemon_config (
      nrtagid           IN   NUMBER,
      nbmcon_id         IN   NUMBER,
      sdaemonhostname   IN   VARCHAR2,
      ngbe_id           IN   NUMBER,
      sdaemon_mode      IN   VARCHAR2,
      sgbebuildfilter   IN   VARCHAR2
   );

   /*================================================================================================*/
   PROCEDURE add_build_machine (
      sdisplay_name          IN   VARCHAR2,
      smachine_hostname      IN   VARCHAR2,
      ngbeid                 IN   NUMBER,
      sdescription           IN   VARCHAR2,
      sactive                IN   CHAR,
      splatform_list         IN  VARCHAR2 default '0'
   );
   /*================================================================================================*/
   PROCEDURE delete_build_machine (sbmcon_id_list IN VARCHAR2);
   /*================================================================================================*/
   PROCEDURE update_build_machine (
      nbmcon_id              IN   NUMBER,
      sdisplay_name          IN   VARCHAR2,
      smachine_hostname      IN   VARCHAR2,
      ngbeid                 IN   NUMBER,
      sdescription           IN   VARCHAR2,
      sactive                IN   CHAR,
      splatform_list         IN  VARCHAR2 default '0'
   );
   /*================================================================================================*/
   PROCEDURE import_daemons ( nSourceRtagId IN NUMBER, nTargetRtagId IN NUMBER, nUserId IN NUMBER  );
   /*================================================================================================*/
   PROCEDURE set_finite_pause ( duration IN NUMBER  );
   PROCEDURE set_build_plan (rtagId IN NUMBER, nStartIndex IN NUMBER, pvList IN VARCHAR2);

   /*================================================================================================*/
   PROCEDURE add_build_platform ( sname IN VARCHAR2,sdescription IN VARCHAR2, sactive IN CHAR, sMachType_list IN VARCHAR2);
   PROCEDURE delete_build_platform (bp_id_list IN VARCHAR2);
   PROCEDURE update_build_platform ( nbp_id IN NUMBER, sname IN VARCHAR2, sdescription IN VARCHAR2, sactive IN CHAR, sMachType_list IN VARCHAR2);
   /*================================================================================================*/

    FUNCTION insert_bi_platforms (nbuildid IN NUMBER, splatforms IN VARCHAR2, bClear IN NUMBER) RETURN VARCHAR2;
    FUNCTION insert_pv_platforms (npvid IN NUMBER, splatforms IN VARCHAR2, bClear IN NUMBER) RETURN VARCHAR2;

END pk_buildapi;

/
--------------------------------------------------------
--  DDL for Package PK_ENVIRONMENT
--------------------------------------------------------

  CREATE OR REPLACE PACKAGE "RELEASE_MANAGER"."PK_ENVIRONMENT" IS
/*
------------------------------
||  Last Modified:  G.Huddy
||  Modified Date:  28/May/2008
||  Spec Version:   1.2
------------------------------
*/

	TYPE typeCur IS REF CURSOR;

	/*================================================================================================*/

	FUNCTION SELECT_ENVIRONMENT_AREA ( cDlock IN PACKAGE_VERSIONS.DLOCKED%TYPE ) RETURN NUMBER;
	FUNCTION GET_PACKAGE_AREA ( PvId IN NUMBER, RtagId IN NUMBER ) RETURN NUMBER;
	FUNCTION GET_VIEW_LOCATION ( PvId IN NUMBER, RtagId IN NUMBER ) RETURN NUMBER;
	PROCEDURE ADD_PACKAGE ( PvId IN NUMBER, ViewId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER, imode IN   CHAR default NULL );
	PROCEDURE ADD_PACKAGE_BULK ( PvIdList IN VARCHAR2, ViewId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER, imode IN CHAR default NULL );
	PROCEDURE REPLACE_PACKAGE ( newPvId IN NUMBER, oldPvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER );
	FUNCTION REMOVE_PACKAGE ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER, ForceRemove IN CHAR ) RETURN NUMBER;

	PROCEDURE GET_ENVIRONMENT_ITEMS ( ViewType IN NUMBER, UserId IN NUMBER, RtagId IN NUMBER,  sViewIdShowList IN VARCHAR2, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );
	PROCEDURE GET_RELEASED_ITEMS ( ViewType IN NUMBER, UserId IN NUMBER, RtagId IN NUMBER,  sViewIdShowList IN VARCHAR2, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );
	PROCEDURE GET_PENDING_ITEMS ( ViewType IN NUMBER, UserId IN NUMBER, RtagId IN NUMBER,  sViewIdShowList IN VARCHAR2, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );
	PROCEDURE GET_WORK_IN_PROGRESS_ITEMS ( ViewType IN NUMBER, UserId IN NUMBER, RtagId IN NUMBER,  sViewIdShowList IN VARCHAR2, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );

	PROCEDURE GET_VIEW_CONTENT ( RtagId IN NUMBER, ViewId IN NUMBER, RecordSet OUT typeCur );

	FUNCTION GET_PACKAGE_VIEW ( PvId IN NUMBER, RtagId IN NUMBER ) RETURN NUMBER;


	PROCEDURE MAKE_RELEASE ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER );
	PROCEDURE MAKE_UNRELEASE ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER );

	PROCEDURE MAKE_PENDING ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER );
	PROCEDURE MAKE_APPROVED ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER, sched in VARCHAR2 default NULL );
	PROCEDURE MAKE_REJECT ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER );
	PROCEDURE APPROVE_MERGE ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER );

	PROCEDURE CHANGE_PACKAGE_VIEW ( PvId IN NUMBER, RtagId IN NUMBER, NewViewId IN NUMBER );

	PROCEDURE FIND_PACKAGE ( sKeyword IN VARCHAR2, nRtagId IN NUMBER, nSearchArea IN NUMBER, RecordSet OUT typeCur );
	PROCEDURE FIND_FILE ( sKeyword IN VARCHAR2, nRtagId IN NUMBER, nSearchArea IN NUMBER, nPageSize IN NUMBER, RecordSet OUT typeCur );

	PROCEDURE AUTO_MAKE_RELEASE ( PvId IN NUMBER, RtagId IN NUMBER, UserId IN NUMBER, VExt IN
							 PACKAGE_VERSIONS.V_EXT%TYPE, SSV_EXT IN PACKAGE_VERSIONS.V_EXT%TYPE,
							 CloneFromPvId IN NUMBER );

	PROCEDURE GET_PRODRELEASE_ITEMS ( RtagId IN NUMBER, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );

	PROCEDURE GET_INTEGRATION_ITEMS ( RtagId IN NUMBER, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );

	PROCEDURE GET_TEST_ITEMS ( RtagId IN NUMBER, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );

	PROCEDURE GET_DEPLOY_ITEMS ( RtagId IN NUMBER, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );

	PROCEDURE GET_REJECT_ITEMS ( RtagId IN NUMBER, nTrueRecordCount OUT NUMBER, RecordSet OUT typeCur );
	/*================================================================================================*/

END PK_ENVIRONMENT;

/
--------------------------------------------------------
--  DDL for Package PK_LICENCING
--------------------------------------------------------

