CREATE SEQUENCE FDDB.BASELINE_SEQ INCREMENT BY 1 MAXVALUE 9999999999999999999999999999 MINVALUE 1 CACHE 10 ;

CREATE SEQUENCE FDDB.OBJTREE_SEQ INCREMENT BY 1 MAXVALUE 9999999999999999999999999999 MINVALUE 1 CACHE 200 ;

CREATE TABLE FDDB.FD_AQ_AGENTS
  (
    SCHEMA_VERSION NUMBER (20) NOT NULL ,
    AGENT_NAME     VARCHAR2 (128 BYTE) NOT NULL ,
    HTTP_ENABLED   VARCHAR2 (4 BYTE) NOT NULL ,
    SMTP_ENABLED   VARCHAR2 (4 BYTE) NOT NULL
  )
  TABLESPACE USERS LOGGING ;
CREATE UNIQUE INDEX FDDB.FD_QUEUE_AGENTS_PK ON FDDB.FD_AQ_AGENTS
  (
    SCHEMA_VERSION ASC , AGENT_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_AQ_AGENTS ADD CONSTRAINT FD_QUEUE_AGENTS_PK PRIMARY KEY ( SCHEMA_VERSION, AGENT_NAME ) USING INDEX FDDB.FD_QUEUE_AGENTS_PK ;

CREATE TABLE FDDB.FD_BASELINE
  (
    BASELINE_ID          NUMBER (20) NOT NULL ,
    ENVIRONMENT_ID       NUMBER (20) NOT NULL ,
    INSTANCE_ID          NUMBER (20) NOT NULL ,
    CREATED_ON           TIMESTAMP NOT NULL ,
    CREATED_BY           VARCHAR2 (128 BYTE) NOT NULL ,
    VERSION_NUMBER       NUMBER (8) ,
    BASELINE_TYPE        VARCHAR2 (20 BYTE) ,
    SCHEMA               VARCHAR2 (128 BYTE) NOT NULL ,
    PROJECT_VERSION_NAME VARCHAR2 (255 BYTE) NOT NULL ,
    PROJECT_NAME         VARCHAR2 (50 BYTE) NOT NULL ,
    INSTANCE_CODE        VARCHAR2 (50 BYTE) NOT NULL ,
    ENVIRONMENT_CODE     VARCHAR2 (50 BYTE) NOT NULL
  )
  TABLESPACE USERS LOGGING ;
CREATE UNIQUE INDEX FDDB.FD_BASELINE_PK ON FDDB.FD_BASELINE
  (
    BASELINE_ID ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_BASELINE ADD CONSTRAINT FD_BASELINE_PK PRIMARY KEY ( BASELINE_ID ) USING INDEX FDDB.FD_BASELINE_PK ;

CREATE TABLE FDDB.FD_BASELINE_DDL
  (
    BASELINE_ID NUMBER (20) NOT NULL ,
    DDL_TEXT CLOB NOT NULL ,
    CREATED_ON      TIMESTAMP DEFAULT SYSDATE NOT NULL ,
    CREATED_BY      VARCHAR2 (128 BYTE) DEFAULT 'SYSTEM' NOT NULL ,
    VERSION_NUMBER  NUMBER (8) DEFAULT 1 ,
    SEQUENCE        NUMBER (20) ,
    OWNER           VARCHAR2 (128 BYTE) NOT NULL ,
    OBJECT_NAME     VARCHAR2 (128 BYTE) NOT NULL ,
    OBJECT_TYPE     VARCHAR2 (30 BYTE) ,
    SUB_OBJECT_NAME VARCHAR2 (128 BYTE)
  )
   LOB (DDL_TEXT) STORE AS BASICFILE;

CREATE INDEX FDDB.FD_BASELINE_DDL_INDEX1 ON FDDB.FD_BASELINE_DDL
  (
    BASELINE_ID ASC ,
    OWNER ASC ,
    OBJECT_NAME ASC ,
    OBJECT_TYPE ASC ,
    SUB_OBJECT_NAME ASC
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_BASELINE_DIFF
  (
    DELTA_DDL_ID       NUMBER (20) NOT NULL ,
    SOURCE_BASELINE_ID NUMBER (20) NOT NULL ,
    TARGET_BASELINE_ID NUMBER (20) NOT NULL ,
    DDL_TEXT CLOB NOT NULL ,
    CREATED_ON      TIMESTAMP NOT NULL ,
    CREATED_BY      VARCHAR2 (128 BYTE) NOT NULL ,
    VERSION_NUMBER  NUMBER (8) ,
    SEQUENCE        NUMBER (20) ,
    OWNER           VARCHAR2 (128 BYTE) ,
    OBJECT_NAME     VARCHAR2 (128 BYTE) ,
    OBJECT_TYPE     VARCHAR2 (30 BYTE) ,
    STATEMENT_TYPE  VARCHAR2 (20 BYTE) ,
    SUB_OBJECT_NAME VARCHAR2 (128 BYTE)
  )
  LOB (DDL_TEXT) STORE AS BASICFILE;

CREATE INDEX FDDB.FD_BASELINE_DIFF_INDEX1 ON FDDB.FD_BASELINE_DIFF
  (
    DELTA_DDL_ID ASC ,
    SOURCE_BASELINE_ID ASC ,
    TARGET_BASELINE_ID ASC ,
    OWNER ASC ,
    OBJECT_NAME ASC ,
    OBJECT_TYPE ASC ,
    SUB_OBJECT_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_BASELINE_DIFF_INDEX2 ON FDDB.FD_BASELINE_DIFF
  (
    OWNER ASC ,
    OBJECT_NAME ASC ,
    SUB_OBJECT_NAME ASC ,
    OBJECT_TYPE ASC ,
    STATEMENT_TYPE ASC
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_BASELINE_PARAMETERS
  (
    BASELINE_ID          NUMBER (20) NOT NULL ,
    PARAMETER_NAME       VARCHAR2 (20 BYTE) NOT NULL ,
    BASELINE_TYPE        VARCHAR2 (20 BYTE) ,
    SCHEMA               VARCHAR2 (128 BYTE) NOT NULL ,
    OBJECT_NAME          VARCHAR2 (128 BYTE) ,
    OLD_OBJECT_NAME      VARCHAR2 (128 BYTE) ,
    CREATED_ON           TIMESTAMP NOT NULL ,
    CREATED_BY           VARCHAR2 (128 BYTE) NOT NULL ,
    VERSION_NUMBER       NUMBER (8) ,
    OBJECT_TYPE          VARCHAR2 (30 BYTE) ,
    PROJECT_VERSION_NAME VARCHAR2 (255 BYTE) NOT NULL ,
    SUB_OBJECT_NAME      VARCHAR2 (128 BYTE) ,
    OLD_SUB_OBJECT_NAME  VARCHAR2 (128 BYTE)
  )
  TABLESPACE USERS LOGGING ;

  CREATE INDEX FDDB.FD_BASELINE_PARAMETERS_INDEX1 ON FDDB.FD_BASELINE_PARAMETERS
  (
    BASELINE_ID ASC ,
    PARAMETER_NAME ASC ,
    SCHEMA ASC ,
    OBJECT_NAME ASC ,
    SUB_OBJECT_NAME ASC ,
    OBJECT_TYPE ASC
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_BASELINE_PARAMETERS_INDEX2 ON FDDB.FD_BASELINE_PARAMETERS
  (
    SCHEMA ASC ,
    OBJECT_NAME ASC ,
    OBJECT_TYPE ASC ,
    SUB_OBJECT_NAME ASC
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_CONSTRAINTS
  (
    SCHEMA_VERSION  NUMBER (20) NOT NULL ,
    OWNER           VARCHAR2 (128 BYTE) NOT NULL ,
    CONSTRAINT_NAME VARCHAR2 (128 BYTE) NOT NULL ,
    CONSTRAINT_TYPE VARCHAR2 (1 BYTE) NOT NULL ,
    TABLE_NAME      VARCHAR2 (128 BYTE) NOT NULL ,
    SEARCH_CONDITION CLOB ,
    R_OWNER             VARCHAR2 (128 BYTE) ,
    R_CONSTRAINT_NAME   VARCHAR2 (128 BYTE) ,
    DELETE_RULE         VARCHAR2 (9 BYTE) ,
    STATUS              VARCHAR2 (8 BYTE) ,
    DEFERRABLE          VARCHAR2 (14 BYTE) ,
    DEFERRED            VARCHAR2 (9 BYTE) ,
    VALIDATED           VARCHAR2 (13 BYTE) ,
    GENERATED           VARCHAR2 (14 BYTE) ,
    BAD                 VARCHAR2 (3 BYTE) ,
    RELY                VARCHAR2 (4 BYTE) ,
    INDEX_OWNER         VARCHAR2 (128 BYTE) ,
    INDEX_NAME          VARCHAR2 (128 BYTE) ,
    INVALID             VARCHAR2 (7 BYTE) ,
    VIEW_RELATED        VARCHAR2 (14 BYTE) ,
    OLD_CONSTRAINT_NAME VARCHAR2 (128 BYTE) ,
    OLD_TABLE_NAME      VARCHAR2 (128 BYTE) 
  )
   LOB (SEARCH_CONDITION) STORE AS BASICFILE;

CREATE INDEX FDDB.FD_CONSTRAINTS_INDEX1 ON FDDB.FD_CONSTRAINTS
  (
    SCHEMA_VERSION ASC ,
    OWNER ASC ,
    CONSTRAINT_NAME ASC ,
    CONSTRAINT_TYPE ASC ,
    TABLE_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_CONSTRAINTS_INDEX2 ON FDDB.FD_CONSTRAINTS
  (
    OWNER ASC ,
    CONSTRAINT_NAME ASC ,
    TABLE_NAME ASC ,
    CONSTRAINT_TYPE ASC
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_CONSTRAINTS_INDEX3 ON FDDB.FD_CONSTRAINTS
  (
    R_OWNER ASC ,
    R_CONSTRAINT_NAME ASC
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_CONS_COLUMNS
  (
    SCHEMA_VERSION  NUMBER NOT NULL ,
    OWNER           VARCHAR2 (128 BYTE) NOT NULL ,
    CONSTRAINT_NAME VARCHAR2 (128 BYTE) NOT NULL ,
    TABLE_NAME      VARCHAR2 (128 BYTE) NOT NULL ,
    COLUMN_NAME     VARCHAR2 (4000 BYTE) ,
    POSITION        NUMBER
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_CONS_COLUMNS_INDEX1 ON FDDB.FD_CONS_COLUMNS
  (
    SCHEMA_VERSION ASC ,
    OWNER ASC ,
    CONSTRAINT_NAME ASC ,
    TABLE_NAME ASC ,
    COLUMN_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_CONS_COLUMNS_INDEX2 ON FDDB.FD_CONS_COLUMNS
  (
    OWNER ASC ,
    CONSTRAINT_NAME ASC ,
    TABLE_NAME ASC ,
    COLUMN_NAME ASC
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_DEPENDENCIES
  (
    SCHEMA_VERSION       NUMBER (20) NOT NULL ,
    OWNER                VARCHAR2 (128 BYTE) NOT NULL ,
    NAME                 VARCHAR2 (128 BYTE) NOT NULL ,
    TYPE                 VARCHAR2 (18 BYTE) ,
    REFERENCED_OWNER     VARCHAR2 (128 BYTE) ,
    REFERENCED_NAME      VARCHAR2 (128 BYTE) ,
    REFERENCED_TYPE      VARCHAR2 (18 BYTE) ,
    REFERENCED_LINK_NAME VARCHAR2 (128 BYTE) ,
    DEPENDENCY_TYPE      VARCHAR2 (4 BYTE)
  )
  TABLESPACE USERS LOGGING ;

CREATE INDEX FDDB.FD_DEPENDENCIES_INDEX1 ON FDDB.FD_DEPENDENCIES
  (
    SCHEMA_VERSION ASC ,
    OWNER ASC ,
    NAME ASC ,
    TYPE ASC
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_DEPENDENCIES_INDEX2 ON FDDB.FD_DEPENDENCIES
  (
    OWNER ASC ,
    NAME ASC ,
    REFERENCED_OWNER ASC ,
    REFERENCED_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_DEPENDENCIES_INDEX3 ON FDDB.FD_DEPENDENCIES
  (
    SCHEMA_VERSION ASC ,
    OWNER ASC ,
    NAME ASC ,
    REFERENCED_OWNER ASC ,
    REFERENCED_NAME ASC
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_DEPLOYED_BASELINE
  (
    BASELINE_ID    NUMBER (20) NOT NULL ,
    ENVIRONMENT_ID NUMBER (20) NOT NULL ,
    INSTANCE_ID    NUMBER (20) NOT NULL ,
    DEPLOYED_ON    TIMESTAMP NOT NULL ,
    CREATED_ON     TIMESTAMP NOT NULL ,
    CREATED_BY     VARCHAR2 (128 BYTE) NOT NULL ,
    VERSION_NUMBER NUMBER (8)
  )
  TABLESPACE USERS LOGGING ;
CREATE UNIQUE INDEX FDDB.FD_DEPLOYED_BASELINE_PK ON FDDB.FD_DEPLOYED_BASELINE
  (
    BASELINE_ID ASC , ENVIRONMENT_ID ASC , INSTANCE_ID ASC , DEPLOYED_ON ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_DEPLOYED_BASELINE ADD CONSTRAINT FD_DEPLOYED_BASELINE_PK PRIMARY KEY ( BASELINE_ID, ENVIRONMENT_ID, INSTANCE_ID, DEPLOYED_ON ) USING INDEX FDDB.FD_DEPLOYED_BASELINE_PK ;

CREATE TABLE FDDB.FD_INDEXES
  (
    SCHEMA_VERSION          NUMBER (20) NOT NULL ,
    OWNER                   VARCHAR2 (128 BYTE) NOT NULL ,
    INDEX_NAME              VARCHAR2 (128 BYTE) NOT NULL ,
    INDEX_TYPE              VARCHAR2 (27 BYTE) ,
    TABLE_OWNER             VARCHAR2 (128 BYTE) NOT NULL ,
    TABLE_NAME              VARCHAR2 (128 BYTE) NOT NULL ,
    TABLE_TYPE              VARCHAR2 (11 BYTE) ,
    UNIQUENESS              VARCHAR2 (9 BYTE) ,
    COMPRESSION             VARCHAR2 (8 BYTE) ,
    PREFIX_LENGTH           NUMBER ,
    TABLESPACE_NAME         VARCHAR2 (30 BYTE) ,
    INI_TRANS               NUMBER ,
    MAX_TRANS               NUMBER ,
    INITIAL_EXTENT          NUMBER ,
    NEXT_EXTENT             NUMBER ,
    MIN_EXTENTS             NUMBER ,
    MAX_EXTENTS             NUMBER ,
    PCT_INCREASE            NUMBER ,
    PCT_THRESHOLD           NUMBER ,
    INCLUDE_COLUMN          NUMBER ,
    FREELISTS               NUMBER ,
    FREELIST_GROUPS         NUMBER ,
    PCT_FREE                NUMBER ,
    LOGGING                 VARCHAR2 (3 BYTE) ,
    BLEVEL                  NUMBER ,
    LEAF_BLOCKS             NUMBER ,
    DISTINCT_KEYS           NUMBER ,
    AVG_LEAF_BLOCKS_PER_KEY NUMBER ,
    AVG_DATA_BLOCKS_PER_KEY NUMBER ,
    CLUSTERING_FACTOR       NUMBER ,
    STATUS                  VARCHAR2 (8 BYTE) ,
    NUM_ROWS                NUMBER ,
    SAMPLE_SIZE             NUMBER ,
    DEGREE                  VARCHAR2 (40 BYTE) ,
    INSTANCES               VARCHAR2 (40 BYTE) ,
    PARTITIONED             VARCHAR2 (3 BYTE) ,
    TEMPORARY               VARCHAR2 (1 BYTE) ,
    GENERATED               VARCHAR2 (1 BYTE) ,
    SECONDARY               VARCHAR2 (1 BYTE) ,
    BUFFER_POOL             VARCHAR2 (7 BYTE) ,
    FLASH_CACHE             VARCHAR2 (7 BYTE) ,
    CELL_FLASH_CACHE        VARCHAR2 (7 BYTE) ,
    USER_STATS              VARCHAR2 (3 BYTE) ,
    DURATION                VARCHAR2 (15 BYTE) ,
    PCT_DIRECT_ACCESS       NUMBER ,
    ITYP_OWNER              VARCHAR2 (30 BYTE) ,
    ITYP_NAME               VARCHAR2 (30 BYTE) ,
    PARAMETERS              VARCHAR2 (1000 BYTE) ,
    GLOBAL_STATS            VARCHAR2 (3 BYTE) ,
    DOMIDX_STATUS           VARCHAR2 (12 BYTE) ,
    DOMIDX_OPSTATUS         VARCHAR2 (6 BYTE) ,
    FUNCIDX_STATUS          VARCHAR2 (8 BYTE) ,
    JOIN_INDEX              VARCHAR2 (3 BYTE) ,
    IOT_REDUNDANT_PKEY_ELIM VARCHAR2 (3 BYTE) ,
    DROPPED                 VARCHAR2 (3 BYTE) ,
    VISIBILITY              VARCHAR2 (9 BYTE) ,
    DOMIDX_MANAGEMENT       VARCHAR2 (14 BYTE) ,
    SEGMENT_CREATED         VARCHAR2 (3 BYTE) ,
    OLD_INDEX_NAME          VARCHAR2 (128 BYTE)
  )
  TABLESPACE USERS LOGGING ;
CREATE UNIQUE INDEX FDDB.FD_INDEXES_PK ON FDDB.FD_INDEXES
  (
    SCHEMA_VERSION ASC , OWNER ASC , INDEX_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_INDEXES ADD CONSTRAINT FD_INDEXES_PK PRIMARY KEY ( SCHEMA_VERSION, OWNER, INDEX_NAME ) USING INDEX FDDB.FD_INDEXES_PK ;

CREATE TABLE FDDB.FD_IND_COLUMNS
  (
    SCHEMA_VERSION  NUMBER (20) NOT NULL ,
    INDEX_OWNER     VARCHAR2 (128 BYTE) NOT NULL ,
    INDEX_NAME      VARCHAR2 (128 BYTE) NOT NULL ,
    TABLE_OWNER     VARCHAR2 (128 BYTE) NOT NULL ,
    TABLE_NAME      VARCHAR2 (128 BYTE) NOT NULL ,
    COLUMN_NAME     VARCHAR2 (4000 BYTE) NOT NULL ,
    COLUMN_POSITION NUMBER NOT NULL ,
    COLUMN_LENGTH   NUMBER NOT NULL ,
    CHAR_LENGTH     NUMBER ,
    DESCEND         VARCHAR2 (4 BYTE)
  )
  TABLESPACE USERS LOGGING ;
CREATE UNIQUE INDEX FDDB.FD_IND_COLUMNS_PK ON FDDB.FD_IND_COLUMNS
  (
    SCHEMA_VERSION ASC , INDEX_OWNER ASC , INDEX_NAME ASC , COLUMN_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_IND_COLUMNS ADD CONSTRAINT FD_IND_COLUMNS_PK PRIMARY KEY ( SCHEMA_VERSION, INDEX_OWNER, INDEX_NAME, COLUMN_NAME ) USING INDEX FDDB.FD_IND_COLUMNS_PK ;

CREATE TABLE FDDB.FD_MVIEWS
  (
    SCHEMA_VERSION NUMBER (20) NOT NULL ,
    OWNER          VARCHAR2 (128 BYTE) NOT NULL ,
    MVIEW_NAME     VARCHAR2 (128 BYTE) NOT NULL ,
    CONTAINER_NAME VARCHAR2 (128 BYTE) NOT NULL ,
    QUERY CLOB ,
    QUERY_LEN              NUMBER (*,0) ,
    UPDATABLE              VARCHAR2 (1 BYTE) ,
    UPDATE_LOG             VARCHAR2 (128 BYTE) ,
    MASTER_ROLLBACK_SEG    VARCHAR2 (128 BYTE) ,
    MASTER_LINK            VARCHAR2 (128 BYTE) ,
    REWRITE_ENABLED        VARCHAR2 (1 BYTE) ,
    REWRITE_CAPABILITY     VARCHAR2 (9 BYTE) ,
    REFRESH_MODE           VARCHAR2 (6 BYTE) ,
    REFRESH_METHOD         VARCHAR2 (8 BYTE) ,
    BUILD_MODE             VARCHAR2 (9 BYTE) ,
    FAST_REFRESHABLE       VARCHAR2 (18 BYTE) ,
    AFTER_FAST_REFRESH     VARCHAR2 (19 BYTE) ,
    UNKNOWN_PREBUILT       VARCHAR2 (1 BYTE) ,
    UNKNOWN_PLSQL_FUNC     VARCHAR2 (1 BYTE) ,
    UNKNOWN_EXTERNAL_TABLE VARCHAR2 (1 BYTE) ,
    UNKNOWN_CONSIDER_FRESH VARCHAR2 (1 BYTE) ,
    UNKNOWN_IMPORT         VARCHAR2 (1 BYTE) ,
    UNKNOWN_TRUSTED_FD     VARCHAR2 (1 BYTE) ,
    COMPILE_STATE          VARCHAR2 (19 BYTE) ,
    USE_NO_INDEX           VARCHAR2 (1 BYTE) ,
    NUM_PCT_TABLES         NUMBER ,
    NUM_FRESH_PCT_REGIONS  NUMBER ,
    NUM_STALE_PCT_REGIONS  NUMBER ,
    SEGMENT_CREATED        VARCHAR2 (3 BYTE) ,
    EVALUATION_EDITION     VARCHAR2 (128 BYTE) ,
    UNUSABLE_BEFORE        VARCHAR2 (128 BYTE) ,
    UNUSABLE_BEGINNING     VARCHAR2 (128 BYTE)
  )
  LOB (QUERY) STORE AS SECUREFILE;

CREATE INDEX FDDB.FD_MVIEWS_INDEX1 ON FDDB.FD_MVIEWS
  (
    SCHEMA_VERSION ASC ,
    OWNER ASC ,
    MVIEW_NAME ASC ,
    CONTAINER_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_MVIEWS_INDEX2 ON FDDB.FD_MVIEWS
  (
    OWNER ASC ,
    MVIEW_NAME ASC ,
    CONTAINER_NAME ASC
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_MVIEW_LOGS
  (
    SCHEMA_VERSION     NUMBER (20) ,
    LOG_OWNER          VARCHAR2 (128 BYTE) ,
    MASTER             VARCHAR2 (128 BYTE) ,
    LOG_TABLE          VARCHAR2 (128 BYTE) ,
    LOG_TRIGGER        VARCHAR2 (128 BYTE) ,
    ROWIDS             VARCHAR2 (3 BYTE) ,
    PRIMARY_KEY        VARCHAR2 (3 BYTE) ,
    OBJECT_ID          VARCHAR2 (3 BYTE) ,
    FILTER_COLUMNS     VARCHAR2 (3 BYTE) ,
    SEQUENCE           VARCHAR2 (3 BYTE) ,
    INCLUDE_NEW_VALUES VARCHAR2 (3 BYTE) ,
    PURGE_ASYNCHRONOUS VARCHAR2 (3 BYTE) ,
    PURGE_DEFERRED     VARCHAR2 (3 BYTE) ,
    PURGE_INTERVAL     VARCHAR2 (200 BYTE) ,
    LAST_PURGE_STATUS  NUMBER ,
    NUM_ROWS_PURGED    NUMBER ,
    COMMIT_SCN_BASED   VARCHAR2 (3 BYTE) ,
    STAGING_LOG        VARCHAR2 (3 BYTE)
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_MVIEW_LOGS_INDEX1 ON FDDB.FD_MVIEW_LOGS
  (
    SCHEMA_VERSION ASC ,
    LOG_OWNER ASC ,
    MASTER ASC ,
    LOG_TABLE ASC
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_OBJECT_DEPENDENCY
  (
    OWNER            VARCHAR2 (128 BYTE) ,
    OBJECT_NAME      VARCHAR2 (128 BYTE) ,
    OBJECT_TYPE      VARCHAR2 (30 BYTE) ,
    REF_OBJECT_OWNER VARCHAR2 (128 BYTE) ,
    REF_OBJECT_NAME  VARCHAR2 (128 BYTE) ,
    REF_OBJECT_TYPE  VARCHAR2 (30 BYTE) ,
    NEST_LEVEL       NUMBER ,
    SEQ#             NUMBER ,
    SCHEMA_VERSION   NUMBER
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_OBJECT_DEPENDENCY_INDEX1 ON FDDB.FD_OBJECT_DEPENDENCY
  (
    OWNER ASC ,
    OBJECT_NAME ASC ,
    OBJECT_TYPE ASC ,
    REF_OBJECT_OWNER ASC ,
    REF_OBJECT_NAME ASC ,
    REF_OBJECT_TYPE ASC ,
    SCHEMA_VERSION ASC
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_OBJECT_TREE
  (
    OWNER            VARCHAR2 (128 BYTE) NOT NULL ,
    OBJECT_NAME      VARCHAR2 (128 BYTE) NOT NULL ,
    OBJECT_TYPE      VARCHAR2 (18 BYTE) ,
    REFERENCED_OWNER VARCHAR2 (128 BYTE) ,
    REFERENCED_NAME  VARCHAR2 (128 BYTE) ,
    REFERENCED_TYPE  VARCHAR2 (18 BYTE) ,
    NEST_LEVEL       NUMBER ,
    SEQ#             NUMBER ,
    SCHEMA_VERSION   NUMBER
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_OBJECT_TREE_INDEX1 ON FDDB.FD_OBJECT_TREE
  (
    OWNER ASC ,
    OBJECT_NAME ASC ,
    REFERENCED_OWNER ASC ,
    REFERENCED_NAME ASC ,
    SCHEMA_VERSION ASC
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_PROCEDURES
  (
    SCHEMA_VERSION  NUMBER (20) NOT NULL ,
    OWNER           VARCHAR2 (128 BYTE) NOT NULL ,
    OBJECT_NAME     VARCHAR2 (128 BYTE) NOT NULL ,
    PROCEDURE_NAME  VARCHAR2 (128 BYTE) ,
    OVERLOAD        VARCHAR2 (40 BYTE) ,
    OBJECT_TYPE     VARCHAR2 (30 BYTE) NOT NULL ,
    AGGREGATE       VARCHAR2 (3 BYTE) ,
    PIPELINED       VARCHAR2 (3 BYTE) ,
    IMPLTYPEOWNER   VARCHAR2 (30 BYTE) ,
    IMPLTYPENAME    VARCHAR2 (30 BYTE) ,
    PARALLEL        VARCHAR2 (3 BYTE) ,
    INTERFACE       VARCHAR2 (3 BYTE) ,
    DETERMINISTIC   VARCHAR2 (3 BYTE) ,
    AUTHID          VARCHAR2 (12 BYTE) ,
    OLD_OBJECT_NAME VARCHAR2 (128 BYTE)
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_PROCEDURES_INDEX1 ON FDDB.FD_PROCEDURES
  (
    SCHEMA_VERSION ASC ,
    OWNER ASC ,
    OBJECT_NAME ASC ,
    PROCEDURE_NAME ASC ,
    OBJECT_TYPE ASC
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_PROCEDURES_INDEX2 ON FDDB.FD_PROCEDURES
  (
    OWNER ASC ,
    OBJECT_NAME ASC ,
    PROCEDURE_NAME ASC ,
    OBJECT_TYPE ASC
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_QUEUES
  (
    SCHEMA_VERSION  NUMBER (20) NOT NULL ,
    OWNER           VARCHAR2 (128 BYTE) NOT NULL ,
    NAME            VARCHAR2 (128 BYTE) NOT NULL ,
    QUEUE_TABLE     VARCHAR2 (128 BYTE) NOT NULL ,
    QID             NUMBER NOT NULL ,
    QUEUE_TYPE      VARCHAR2 (20 BYTE) ,
    MAX_RETRIES     NUMBER ,
    RETRY_DELAY     NUMBER ,
    ENQUEUE_ENABLED VARCHAR2 (7 BYTE) ,
    DEQUEUE_ENABLED VARCHAR2 (7 BYTE) ,
    RETENTION       VARCHAR2 (40 BYTE) ,
    USER_COMMENT    VARCHAR2 (50 BYTE) ,
    NETWORK_NAME    VARCHAR2 (512 BYTE) ,
    SHARDED         VARCHAR2 (5 BYTE)
  )
  TABLESPACE USERS LOGGING ;
CREATE UNIQUE INDEX FDDB.FD_DB_QUEUES_PK ON FDDB.FD_QUEUES
  (
    SCHEMA_VERSION ASC , OWNER ASC , NAME ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_QUEUES ADD CONSTRAINT FD_DB_QUEUES_PK PRIMARY KEY ( SCHEMA_VERSION, OWNER, NAME ) USING INDEX FDDB.FD_DB_QUEUES_PK ;

CREATE TABLE FDDB.FD_QUEUE_PUBLISHERS
  (
    SCHEMA_VERSION           NUMBER (20) NOT NULL ,
    QUEUE_OWNER              VARCHAR2 (128 BYTE) NOT NULL ,
    QUEUE_NAME               VARCHAR2 (128 BYTE) NOT NULL ,
    PUBLISHER_NAME           VARCHAR2 (128 BYTE) ,
    PUBLISHER_ADDRESS        VARCHAR2 (1024 BYTE) ,
    PUBLISHER_PROTOCOL       NUMBER ,
    PUBLISHER_RULE           VARCHAR2 (2000 BYTE) ,
    PUBLISHER_RULE_NAME      VARCHAR2 (257 BYTE) ,
    PUBLISHER_RULESET        VARCHAR2 (257 BYTE) ,
    PUBLISHER_TRANSFORMATION VARCHAR2 (257 BYTE)
  )
  TABLESPACE USERS LOGGING ;
CREATE UNIQUE INDEX FDDB.FD_DB_QUEUE_PUB_PK ON FDDB.FD_QUEUE_PUBLISHERS
  (
    SCHEMA_VERSION ASC , QUEUE_OWNER ASC , QUEUE_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_QUEUE_PUBLISHERS ADD CONSTRAINT FD_DB_QUEUE_PUB_PK PRIMARY KEY ( SCHEMA_VERSION, QUEUE_OWNER, QUEUE_NAME ) USING INDEX FDDB.FD_DB_QUEUE_PUB_PK ;

CREATE TABLE FDDB.FD_QUEUE_SCHEDULES
  (
    SCHEMA_VERSION        NUMBER (20) NOT NULL ,
    SCHEMA                VARCHAR2 (128 BYTE) ,
    QNAME                 VARCHAR2 (128 BYTE) ,
    DESTINATION           VARCHAR2 (128 BYTE) ,
    START_DATE            TIMESTAMP WITH TIME ZONE ,
    START_TIME            VARCHAR2 (8 BYTE) ,
    PROPAGATION_WINDOW    NUMBER ,
    NEXT_TIME             VARCHAR2 (4000 BYTE) ,
    LATENCY               NUMBER ,
    SCHEDULE_DISABLED     VARCHAR2 (1 BYTE) ,
    MESSAGE_DELIVERY_MODE VARCHAR2 (10 BYTE) ,
    JOB_NAME              VARCHAR2 (128 BYTE)
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_QUEUE_SUBSCRIBERS
  (
    SCHEMA_VERSION NUMBER (20) NOT NULL ,
    OWNER          VARCHAR2 (128 BYTE) NOT NULL ,
    QUEUE_NAME     VARCHAR2 (128 BYTE) NOT NULL ,
    QUEUE_TABLE    VARCHAR2 (128 BYTE) NOT NULL ,
    CONSUMER_NAME  VARCHAR2 (30 BYTE) NOT NULL ,
    ADDRESS        VARCHAR2 (1024 BYTE) NOT NULL ,
    PROTOCOL       NUMBER ,
    TRANSFORMATION VARCHAR2 (61 BYTE) ,
    RULE CLOB ,
    DELIVERY_MODE            VARCHAR2 (22 BYTE) ,
    IF_NONDURABLE_SUBSCRIBER VARCHAR2 (3 BYTE) ,
    QUEUE_TO_QUEUE           VARCHAR2 (5 BYTE) ,
    SUBSCRIBER_ID            NUMBER ,
    POS_BITMAP               NUMBER
  )
  LOB (RULE) STORE AS SECUREFILE;

CREATE TABLE FDDB.FD_QUEUE_TABLES
  (
    SCHEMA_VERSION     NUMBER (20) NOT NULL ,
    OWNER              VARCHAR2 (128 BYTE) NOT NULL ,
    QUEUE_TABLE        VARCHAR2 (128 BYTE) NOT NULL ,
    TYPE               VARCHAR2 (7 BYTE) ,
    OBJECT_TYPE        VARCHAR2 (257 BYTE) ,
    SORT_ORDER         VARCHAR2 (22 BYTE) ,
    RECIPIENTS         VARCHAR2 (8 BYTE) ,
    MESSAGE_GROUPING   VARCHAR2 (13 BYTE) ,
    COMPATIBLE         VARCHAR2 (6 BYTE) ,
    PRIMARY_INSTANCE   NUMBER ,
    SECONDARY_INSTANCE NUMBER ,
    OWNER_INSTANCE     NUMBER ,
    USER_COMMENT       VARCHAR2 (50 BYTE) ,
    SECURE             VARCHAR2 (3 BYTE)
  )
  TABLESPACE USERS LOGGING ;
CREATE UNIQUE INDEX FDDB.FD_DB_QUEUE_TBL_PK ON FDDB.FD_QUEUE_TABLES
  (
    SCHEMA_VERSION ASC , OWNER ASC , QUEUE_TABLE ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_QUEUE_TABLES ADD CONSTRAINT FD_DB_QUEUE_TBL_PK PRIMARY KEY ( SCHEMA_VERSION, OWNER, QUEUE_TABLE ) USING INDEX FDDB.FD_DB_QUEUE_TBL_PK ;

CREATE TABLE FDDB.FD_SCHEDULER_JOBS
  (
    SCHEMA_VERSION      NUMBER (20) NOT NULL ,
    OWNER               VARCHAR2 (128 BYTE) NOT NULL ,
    JOB_NAME            VARCHAR2 (128 BYTE) NOT NULL ,
    JOB_SUBNAME         VARCHAR2 (128 BYTE) ,
    JOB_STYLE           VARCHAR2 (17 BYTE) ,
    JOB_CREATOR         VARCHAR2 (128 BYTE) ,
    CLIENT_ID           VARCHAR2 (65 BYTE) ,
    GLOBAL_UID          VARCHAR2 (33 BYTE) ,
    PROGRAM_OWNER       VARCHAR2 (4000 BYTE) ,
    PROGRAM_NAME        VARCHAR2 (4000 BYTE) ,
    JOB_TYPE            VARCHAR2 (16 BYTE) ,
    JOB_ACTION          VARCHAR2 (4000 BYTE) ,
    NUMBER_OF_ARGUMENTS NUMBER ,
    SCHEDULE_OWNER      VARCHAR2 (4000 BYTE) ,
    SCHEDULE_NAME       VARCHAR2 (4000 BYTE) ,
    SCHEDULE_TYPE       VARCHAR2 (12 BYTE) ,
    START_DATE          TIMESTAMP WITH TIME ZONE ,
    REPEAT_INTERVAL     VARCHAR2 (4000 BYTE) ,
    EVENT_QUEUE_OWNER   VARCHAR2 (128 BYTE) ,
    EVENT_QUEUE_NAME    VARCHAR2 (128 BYTE) ,
    EVENT_QUEUE_AGENT   VARCHAR2 (256 BYTE) ,
    EVENT_CONDITION     VARCHAR2 (4000 BYTE) ,
    EVENT_RULE          VARCHAR2 (261 BYTE) ,
    FILE_WATCHER_OWNER  VARCHAR2 (261 BYTE) ,
    FILE_WATCHER_NAME   VARCHAR2 (261 BYTE) ,
    END_DATE            TIMESTAMP WITH TIME ZONE ,
    JOB_CLASS           VARCHAR2 (128 BYTE) ,
    ENABLED             VARCHAR2 (5 BYTE) ,
    AUTO_DROP           VARCHAR2 (5 BYTE) ,
    RESTART_ON_RECOVERY VARCHAR2 (5 BYTE) ,
    RESTART_ON_FAILURE  VARCHAR2 (5 BYTE) ,
    STATE               VARCHAR2 (15 BYTE) ,
    JOB_PRIORITY        NUMBER ,
    RUN_COUNT           NUMBER ,
    MAX_RUNS            NUMBER ,
    FAILURE_COUNT       NUMBER ,
    MAX_FAILURES        NUMBER ,
    RETRY_COUNT         NUMBER ,
    LAST_START_DATE     TIMESTAMP WITH TIME ZONE ,
    LAST_RUN_DURATION INTERVAL DAY (9) TO SECOND ,
    NEXT_RUN_DATE TIMESTAMP WITH TIME ZONE ,
    SCHEDULE_LIMIT INTERVAL DAY (3) TO SECOND (0) ,
    MAX_RUN_DURATION INTERVAL DAY (3) TO SECOND (0) ,
    LOGGING_LEVEL                 VARCHAR2 (11 BYTE) ,
    STORE_OUTPUT                  VARCHAR2 (5 BYTE) ,
    STOP_ON_WINDOW_CLOSE          VARCHAR2 (5 BYTE) ,
    INSTANCE_STICKINESS           VARCHAR2 (5 BYTE) ,
    RAISE_EVENTS                  VARCHAR2 (4000 BYTE) ,
    SYSTEM                        VARCHAR2 (5 BYTE) ,
    JOB_WEIGHT                    NUMBER ,
    NLS_ENV                       VARCHAR2 (4000 BYTE) ,
    SOURCE                        VARCHAR2 (128 BYTE) ,
    NUMBER_OF_DESTINATIONS        NUMBER ,
    DESTINATION_OWNER             VARCHAR2 (128 BYTE) ,
    DESTINATION                   VARCHAR2 (128 BYTE) ,
    CREDENTIAL_OWNER              VARCHAR2 (128 BYTE) ,
    CREDENTIAL_NAME               VARCHAR2 (128 BYTE) ,
    INSTANCE_ID                   NUMBER ,
    DEFERRED_DROP                 VARCHAR2 (5 BYTE) ,
    ALLOW_RUNS_IN_RESTRICTED_MODE VARCHAR2 (5 BYTE) ,
    COMMENTS                      VARCHAR2 (240 BYTE) ,
    FLAGS                         NUMBER ,
    RESTARTABLE                   VARCHAR2 (5 BYTE) ,
    CONNECT_CREDENTIAL_OWNER      VARCHAR2 (128 BYTE) ,
    CONNECT_CREDENTIAL_NAME       VARCHAR2 (128 BYTE)
  )
  TABLESPACE USERS LOGGING ;
CREATE UNIQUE INDEX FDDB.FD_JOBS_PK ON FDDB.FD_SCHEDULER_JOBS
  (
    SCHEMA_VERSION ASC , OWNER ASC , JOB_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_SCHEDULER_JOBS ADD CONSTRAINT FD_JOBS_PK PRIMARY KEY ( SCHEMA_VERSION, OWNER, JOB_NAME ) USING INDEX FDDB.FD_JOBS_PK ;

CREATE TABLE FDDB.FD_SCHEDULER_PROGRAMS
  (
    SCHEMA_VERSION      NUMBER (20) NOT NULL ,
    OWNER               VARCHAR2 (128 BYTE) NOT NULL ,
    PROGRAM_NAME        VARCHAR2 (128 BYTE) NOT NULL ,
    PROGRAM_TYPE        VARCHAR2 (16 BYTE) ,
    PROGRAM_ACTION      VARCHAR2 (4000 BYTE) ,
    NUMBER_OF_ARGUMENTS NUMBER ,
    ENABLED             VARCHAR2 (5 BYTE) ,
    DETACHED            VARCHAR2 (5 BYTE) ,
    SCHEDULE_LIMIT INTERVAL DAY (3) TO SECOND (0) ,
    PRIORITY     NUMBER ,
    WEIGHT       NUMBER ,
    MAX_RUNS     NUMBER ,
    MAX_FAILURES NUMBER ,
    MAX_RUN_DURATION INTERVAL DAY (3) TO SECOND (0) ,
    NLS_ENV  VARCHAR2 (4000 BYTE) ,
    COMMENTS VARCHAR2 (240 BYTE)
  )
  TABLESPACE USERS LOGGING ;
CREATE UNIQUE INDEX FDDB.FD_PROGRAMS_PK ON FDDB.FD_SCHEDULER_PROGRAMS
  (
    SCHEMA_VERSION ASC , OWNER ASC , PROGRAM_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_SCHEDULER_PROGRAMS ADD CONSTRAINT FD_PROGRAMS_PK PRIMARY KEY ( SCHEMA_VERSION, OWNER, PROGRAM_NAME ) USING INDEX FDDB.FD_PROGRAMS_PK ;

CREATE TABLE FDDB.FD_SCHEDULER_SCHEDULES
  (
    SCHEMA_VERSION     NUMBER (20) NOT NULL ,
    OWNER              VARCHAR2 (128 BYTE) NOT NULL ,
    SCHEDULE_NAME      VARCHAR2 (128 BYTE) NOT NULL ,
    SCHEDULE_TYPE      VARCHAR2 (12 BYTE) ,
    START_DATE         TIMESTAMP WITH TIME ZONE ,
    REPEAT_INTERVAL    VARCHAR2 (4000 BYTE) ,
    EVENT_QUEUE_OWNER  VARCHAR2 (128 BYTE) ,
    EVENT_QUEUE_NAME   VARCHAR2 (128 BYTE) ,
    EVENT_QUEUE_AGENT  VARCHAR2 (128 BYTE) ,
    EVENT_CONDITION    VARCHAR2 (4000 BYTE) ,
    FILE_WATCHER_OWNER VARCHAR2 (261 BYTE) ,
    FILE_WATCHER_NAME  VARCHAR2 (261 BYTE) ,
    END_DATE           TIMESTAMP WITH TIME ZONE ,
    COMMENTS           VARCHAR2 (240 BYTE)
  )
  TABLESPACE USERS LOGGING ;
CREATE UNIQUE INDEX FDDB.FD_SCHEDULES_PK ON FDDB.FD_SCHEDULER_SCHEDULES
  (
    SCHEMA_VERSION ASC , OWNER ASC , SCHEDULE_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_SCHEDULER_SCHEDULES ADD CONSTRAINT FD_SCHEDULES_PK PRIMARY KEY ( SCHEMA_VERSION, OWNER, SCHEDULE_NAME ) USING INDEX FDDB.FD_SCHEDULES_PK ;

CREATE TABLE FDDB.FD_SEQUENCES
  (
    SCHEMA_VERSION    NUMBER (20) NOT NULL ,
    SEQUENCE_OWNER    VARCHAR2 (128 BYTE) NOT NULL ,
    SEQUENCE_NAME     VARCHAR2 (128 BYTE) NOT NULL ,
    MIN_VALUE         NUMBER (38) ,
    MAX_VALUE         NUMBER (38) ,
    INCREMENT_BY      NUMBER (38) NOT NULL ,
    CYCLE_FLAG        VARCHAR2 (1 BYTE) ,
    ORDER_FLAG        VARCHAR2 (1 BYTE) ,
    CACHE_SIZE        NUMBER (38) NOT NULL ,
    LAST_NUMBER       NUMBER (38) NOT NULL ,
    OLD_SEQUENCE_NAME VARCHAR2 (128 BYTE)
  )
  TABLESPACE USERS LOGGING ;
CREATE UNIQUE INDEX FDDB.FD_SEQUENCES_PK ON FDDB.FD_SEQUENCES
  (
    SCHEMA_VERSION ASC , SEQUENCE_OWNER ASC , SEQUENCE_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_SEQUENCES ADD CONSTRAINT FD_SEQUENCES_PK PRIMARY KEY ( SCHEMA_VERSION, SEQUENCE_OWNER, SEQUENCE_NAME ) USING INDEX FDDB.FD_SEQUENCES_PK ;

CREATE TABLE FDDB.FD_SOURCE
  (
    SCHEMA_VERSION NUMBER (20) NOT NULL ,
    OWNER          VARCHAR2 (128 BYTE) NOT NULL ,
    NAME           VARCHAR2 (128 BYTE) NOT NULL ,
    TYPE           VARCHAR2 (30 BYTE) NOT NULL ,
    LINE           NUMBER NOT NULL ,
    TEXT           VARCHAR2 (4000 BYTE)
  )
  TABLESPACE USERS LOGGING ;

CREATE UNIQUE INDEX FDDB.FD_SOURCE_PK ON FDDB.FD_SOURCE ( SCHEMA_VERSION ASC , OWNER ASC , NAME ASC , TYPE ASC , LINE ASC ) TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_SOURCE ADD CONSTRAINT FD_SOURCE_PK PRIMARY KEY ( SCHEMA_VERSION, OWNER, NAME, TYPE, LINE ) USING INDEX FDDB.FD_SOURCE_PK ;

CREATE TABLE FDDB.FD_SYNONYMS
  (
    SCHEMA_VERSION   NUMBER NOT NULL ,
    OWNER            VARCHAR2 (128 BYTE) NOT NULL ,
    SYNONYM_NAME     VARCHAR2 (128 BYTE) NOT NULL ,
    TABLE_OWNER      VARCHAR2 (128 BYTE) ,
    TABLE_NAME       VARCHAR2 (128 BYTE) NOT NULL ,
    DB_LINK          VARCHAR2 (128 BYTE) ,
    OLD_SYNONYM_NAME VARCHAR2 (128 BYTE)
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_SYNONYMS_INDEX1 ON FDDB.FD_SYNONYMS
  (
    SCHEMA_VERSION ASC ,
    OWNER ASC ,
    SYNONYM_NAME ASC ,
    TABLE_OWNER ASC ,
    TABLE_NAME ASC
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_TABLES
  (
    SCHEMA_VERSION            NUMBER (20) NOT NULL ,
    OWNER                     VARCHAR2 (128 BYTE) NOT NULL ,
    TABLE_NAME                VARCHAR2 (128 BYTE) NOT NULL ,
    TABLESPACE_NAME           VARCHAR2 (30 BYTE) ,
    CLUSTER_NAME              VARCHAR2 (30 BYTE) ,
    IOT_NAME                  VARCHAR2 (30 BYTE) ,
    STATUS                    VARCHAR2 (8 BYTE) ,
    PCT_FREE                  NUMBER ,
    PCT_USED                  NUMBER ,
    INI_TRANS                 NUMBER ,
    MAX_TRANS                 NUMBER ,
    INITIAL_EXTENT            NUMBER ,
    NEXT_EXTENT               NUMBER ,
    MIN_EXTENTS               NUMBER ,
    MAX_EXTENTS               NUMBER ,
    PCT_INCREASE              NUMBER ,
    FREELISTS                 NUMBER ,
    FREELIST_GROUPS           NUMBER ,
    LOGGING                   VARCHAR2 (3 BYTE) ,
    BACKED_UP                 VARCHAR2 (1 BYTE) ,
    NUM_ROWS                  NUMBER ,
    BLOCKS                    NUMBER ,
    EMPTY_BLOCKS              NUMBER ,
    AVG_SPACE                 NUMBER ,
    CHAIN_CNT                 NUMBER ,
    AVG_ROW_LEN               NUMBER ,
    AVG_SPACE_FREELIST_BLOCKS NUMBER ,
    NUM_FREELIST_BLOCKS       NUMBER ,
    DEGREE                    VARCHAR2 (40 BYTE) ,
    INSTANCES                 VARCHAR2 (40 BYTE) ,
    CACHE                     VARCHAR2 (20 BYTE) ,
    TABLE_LOCK                VARCHAR2 (8 BYTE) ,
    SAMPLE_SIZE               NUMBER ,
    PARTITIONED               VARCHAR2 (3 BYTE) ,
    IOT_TYPE                  VARCHAR2 (12 BYTE) ,
    TEMPORARY                 VARCHAR2 (1 BYTE) ,
    SECONDARY                 VARCHAR2 (1 BYTE) ,
    NESTED                    VARCHAR2 (3 BYTE) ,
    BUFFER_POOL               VARCHAR2 (7 BYTE) ,
    FLASH_CACHE               VARCHAR2 (7 BYTE) ,
    CELL_FLASH_CACHE          VARCHAR2 (7 BYTE) ,
    ROW_MOVEMENT              VARCHAR2 (8 BYTE) ,
    GLOBAL_STATS              VARCHAR2 (3 BYTE) ,
    USER_STATS                VARCHAR2 (3 BYTE) ,
    DURATION                  VARCHAR2 (15 BYTE) ,
    SKIP_CORRUPT              VARCHAR2 (8 BYTE) ,
    MONITORING                VARCHAR2 (3 BYTE) ,
    CLUSTER_OWNER             VARCHAR2 (30 BYTE) ,
    DEPENDENCIES              VARCHAR2 (8 BYTE) ,
    COMPRESSION               VARCHAR2 (8 BYTE) ,
    COMPRESS_FOR              VARCHAR2 (12 BYTE) ,
    DROPPED                   VARCHAR2 (3 BYTE) ,
    READ_ONLY                 VARCHAR2 (3 BYTE) ,
    SEGMENT_CREATED           VARCHAR2 (3 BYTE) ,
    RESULT_CACHE              VARCHAR2 (7 BYTE) ,
    OLD_TABLE_NAME            VARCHAR2 (128 BYTE)
  )
  TABLESPACE USERS LOGGING ;
CREATE UNIQUE INDEX FDDB.FD_TABLES_PK ON FDDB.FD_TABLES
  (
    SCHEMA_VERSION ASC , OWNER ASC , TABLE_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_TABLES ADD CONSTRAINT FD_TABLES_PK PRIMARY KEY ( SCHEMA_VERSION, OWNER, TABLE_NAME ) USING INDEX FDDB.FD_TABLES_PK ;

CREATE TABLE FDDB.FD_TAB_COLUMNS
  (
    SCHEMA_VERSION       NUMBER (20) NOT NULL ,
    OWNER                VARCHAR2 (128 BYTE) NOT NULL ,
    TABLE_NAME           VARCHAR2 (128 BYTE) NOT NULL ,
    COLUMN_NAME          VARCHAR2 (128 BYTE) NOT NULL ,
    DATA_TYPE            VARCHAR2 (106 BYTE) ,
    DATA_TYPE_MOD        VARCHAR2 (3 BYTE) ,
    DATA_TYPE_OWNER      VARCHAR2 (120 BYTE) ,
    DATA_LENGTH          NUMBER NOT NULL ,
    DATA_PRECISION       NUMBER ,
    DATA_SCALE           NUMBER ,
    NULLABLE             VARCHAR2 (1 BYTE) ,
    COLUMN_ID            NUMBER ,
    DEFAULT_LENGTH       NUMBER ,
    CHARACTER_SET_NAME   VARCHAR2 (44 BYTE) ,
    CHAR_COL_DECL_LENGTH NUMBER ,
    CHAR_LENGTH          NUMBER ,
    CHAR_USED            VARCHAR2 (1 BYTE) ,
    DATA_DEFAULT CLOB ,
    HIDDEN_COLUMN   VARCHAR2 (3 BYTE) ,
    VIRTUAL_COLUMN  VARCHAR2 (3 BYTE) ,
    OLD_COLUMN_NAME VARCHAR2 (128 BYTE) ,
    OLD_TABLE_NAME  VARCHAR2 (128 BYTE)
  )
  LOB (DATA_DEFAULT) STORE AS BASICFILE;
  
CREATE UNIQUE INDEX FDDB.FD_TAB_COLUMNS_PK ON FDDB.FD_TAB_COLUMNS ( SCHEMA_VERSION ASC , OWNER ASC , TABLE_NAME ASC , COLUMN_NAME ASC ) TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_TAB_COLUMNS ADD CONSTRAINT FD_TAB_COLUMNS_PK PRIMARY KEY ( SCHEMA_VERSION, OWNER, TABLE_NAME, COLUMN_NAME ) USING INDEX FDDB.FD_TAB_COLUMNS_PK ;

CREATE TABLE FDDB.FD_TAB_PRIVS
  (
    SCHEMA_VERSION NUMBER NOT NULL ,
    GRANTEE        VARCHAR2 (128 BYTE) NOT NULL ,
    OWNER          VARCHAR2 (128 BYTE) NOT NULL ,
    TABLE_NAME     VARCHAR2 (128 BYTE) NOT NULL ,
    GRANTOR        VARCHAR2 (128 BYTE) NOT NULL ,
    PRIVILEGE      VARCHAR2 (40 BYTE) NOT NULL ,
    GRANTABLE      VARCHAR2 (3 BYTE) ,
    HIERARCHY      VARCHAR2 (3 BYTE) ,
    OBJECT_TYPE    VARCHAR2 (30 BYTE)
  )
  TABLESPACE USERS LOGGING ;
CREATE INDEX FDDB.FD_TAB_PRIVS_INDEX1 ON FDDB.FD_TAB_PRIVS
  (
    SCHEMA_VERSION ASC ,
    GRANTEE ASC ,
    OWNER ASC ,
    TABLE_NAME ASC
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_TRANSFORMATIONS
  (
    SCHEMA_VERSION           NUMBER (20) NOT NULL ,
    OWNER                    VARCHAR2 (30 BYTE) NOT NULL ,
    NAME                     VARCHAR2 (30 BYTE) NOT NULL ,
    FROM_TYPE                VARCHAR2 (61 BYTE) ,
    TO_TYPE                  VARCHAR2 (61 BYTE) ,
    ATTRIBUTE_TRANSFORMATION VARCHAR2 (4000 BYTE) ,
    ATTRIBUTE                NUMBER (20)
  )
  TABLESPACE USERS LOGGING ;
CREATE UNIQUE INDEX FDDB.FD_DB_TRANSFORM_PK ON FDDB.FD_TRANSFORMATIONS
  (
    SCHEMA_VERSION ASC , OWNER ASC , NAME ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_TRANSFORMATIONS ADD CONSTRAINT FD_DB_TRANSFORM_PK PRIMARY KEY ( SCHEMA_VERSION, OWNER, NAME ) USING INDEX FDDB.FD_DB_TRANSFORM_PK ;

CREATE TABLE FDDB.FD_TRIGGERS
  (
    SCHEMA_VERSION    NUMBER NOT NULL ,
    OWNER             VARCHAR2 (128 BYTE) ,
    TRIGGER_NAME      VARCHAR2 (128 BYTE) ,
    TRIGGER_TYPE      VARCHAR2 (16 BYTE) ,
    TRIGGERING_EVENT  VARCHAR2 (227 BYTE) ,
    TABLE_OWNER       VARCHAR2 (128 BYTE) ,
    BASE_OBJECT_TYPE  VARCHAR2 (16 BYTE) ,
    TABLE_NAME        VARCHAR2 (128 BYTE) ,
    COLUMN_NAME       VARCHAR2 (4000 BYTE) ,
    REFERENCING_NAMES VARCHAR2 (128 BYTE) ,
    WHEN_CLAUSE       VARCHAR2 (4000 BYTE) ,
    STATUS            VARCHAR2 (8 BYTE) ,
    DESCRIPTION       VARCHAR2 (4000 BYTE) ,
    ACTION_TYPE       VARCHAR2 (11 BYTE) ,
    TRIGGER_BODY CLOB ,
    CROSSEDITION      VARCHAR2 (7 BYTE) ,
    BEFORE_STATEMENT  VARCHAR2 (3 BYTE) ,
    BEFORE_ROW        VARCHAR2 (3 BYTE) ,
    AFTER_ROW         VARCHAR2 (3 BYTE) ,
    AFTER_STATEMENT   VARCHAR2 (3 BYTE) ,
    INSTEAD_OF_ROW    VARCHAR2 (3 BYTE) ,
    FIRE_ONCE         VARCHAR2 (3 BYTE) ,
    APPLY_SERVER_ONLY VARCHAR2 (3 BYTE) ,
    OLD_TRIGGER_NAME  VARCHAR2 (128 BYTE) ,
    OLD_TABLE_NAME    VARCHAR2 (128 BYTE)
  )
  LOB (TRIGGER_BODY) STORE AS BASICFILE;

CREATE INDEX FDDB.FD_TRIGGERS_INDEX1 ON FDDB.FD_TRIGGERS
  (
    SCHEMA_VERSION ASC ,
    OWNER ASC ,
    TRIGGER_NAME ASC ,
    TRIGGER_TYPE ASC
  )
  TABLESPACE USERS LOGGING ;

CREATE TABLE FDDB.FD_VIEWS
  (
    SCHEMA_VERSION NUMBER (20) NOT NULL ,
    OWNER          VARCHAR2 (128 BYTE) NOT NULL ,
    VIEW_NAME      VARCHAR2 (128 BYTE) NOT NULL ,
    TEXT_LENGTH    NUMBER ,
    TEXT CLOB ,
    TYPE_TEXT_LENGTH NUMBER ,
    TYPE_TEXT        VARCHAR2 (4000 BYTE) ,
    OID_TEXT_LENGTH  NUMBER ,
    OID_TEXT         VARCHAR2 (4000 BYTE) ,
    VIEW_TYPE_OWNER  VARCHAR2 (30 BYTE) ,
    VIEW_TYPE        VARCHAR2 (30 BYTE) ,
    SUPERVIEW_NAME   VARCHAR2 (30 BYTE) ,
    EDITIONING_VIEW  VARCHAR2 (1 BYTE) ,
    READ_ONLY        VARCHAR2 (1 BYTE) ,
    OLD_VIEW_NAME    VARCHAR2 (128 BYTE)
  )
  LOB (TEXT) STORE AS BASICFILE;
CREATE UNIQUE INDEX FDDB.FD_VIEWS_PK ON FDDB.FD_VIEWS
  (
    SCHEMA_VERSION ASC , OWNER ASC , VIEW_NAME ASC
  )
  TABLESPACE USERS LOGGING ;
  ALTER TABLE FDDB.FD_VIEWS ADD CONSTRAINT FD_VIEWS_PK PRIMARY KEY ( SCHEMA_VERSION, OWNER, VIEW_NAME ) USING INDEX FDDB.FD_VIEWS_PK ;