Dissecting 180717 BP, PSU, RU and RUR

Since Oct-2017 I am quarterly writing a post dissecting the changes implemented by Oracle CPUs so we can understand better the modifications implemented by Oracle in our Databases.

This is the first one to include change on 18c version.

So what oracle internal objects were changed in 180717?

VERSION    PATCH           OWNER      TYPE                 TOTAL
---------- --------------- ---------- --------------- ----------
11.2.0.4   PSU             CTXSYS     PACKAGE                  1
11.2.0.4   PSU             CTXSYS     PACKAGE BODY             1
12.1.0.2   BP              DVSYS      TYPE                     8
12.1.0.2   BP              DVSYS      VIEW                     2
12.1.0.2   BP              SYS        PACKAGE                  3
12.1.0.2   BP              SYS        PACKAGE BODY             3
12.1.0.2   BP              SYS        VIEW                     4
12.1.0.2   PSU             SYS        PACKAGE                  1
12.1.0.2   PSU             SYS        PACKAGE BODY             2
12.1.0.2   PSU & BP        CTXSYS     PACKAGE                  1
12.1.0.2   PSU & BP        CTXSYS     PACKAGE BODY             1
12.2.0.1   APR2018RUR      SYS        PACKAGE BODY             6
12.2.0.1   JAN2018RUR      CTXSYS     PACKAGE BODY             1
12.2.0.1   RU              SYS        PACKAGE                  3
12.2.0.1   RU              SYS        PACKAGE BODY             7
12.2.0.1   RU              SYS        TYPE BODY                1
12.2.0.1   RU              SYS        VIEW                     2
18.0.0.0   18.2RUR         SYS        PACKAGE                  2
18.0.0.0   18.2RUR         SYS        PACKAGE BODY             1
18.0.0.0   RU              AUDSYS     PACKAGE BODY             1
18.0.0.0   RU              CTXSYS     PACKAGE                  5
18.0.0.0   RU              CTXSYS     PACKAGE BODY            10
18.0.0.0   RU              MDSYS      PACKAGE BODY             4
18.0.0.0   RU              SYS        FUNCTION                 4
18.0.0.0   RU              SYS        PACKAGE                 11
18.0.0.0   RU              SYS        PACKAGE BODY            17
18.0.0.0   RU              SYS        TYPE                     1
18.0.0.0   RU              SYS        TYPE BODY                1
18.0.0.0   RU              SYS        VIEW                    14
18.0.0.0   RU              XDB        PACKAGE                  3
18.0.0.0   RU              XDB        PACKAGE BODY             7
18.0.0.0   RU              XDB        VIEW                     1

And created?

VERSION    PATCH           OWNER      TYPE                 TOTAL
---------- --------------- ---------- --------------- ----------
12.1.0.2   BP              SYS        TYPE                     3
12.1.0.2   PSU             SYS        PACKAGE BODY             1
12.2.0.1   RU              SYS        PACKAGE                  1
12.2.0.1   RU              SYS        PACKAGE BODY             1
12.2.0.1   RU              SYS        TRIGGER                  1
12.2.0.1   RU              SYS        VIEW                     1

P.S: Nothing was added  for 11.2.0.4 / 18.0.0.0 in Oracle objects.

So which are exactly the objects modified by 180417?

VERSION    PATCH           OWNER      TYPE            NAME                           ACTION
---------- --------------- ---------- --------------- ------------------------------ ------
12.1.0.2   BP              SYS        TYPE            SYS_PLSQL_C80B37C8_157_1       NEW
12.1.0.2   BP              SYS        TYPE            SYS_PLSQL_C80B37C8_170_1       NEW
12.1.0.2   BP              SYS        TYPE            SYS_PLSQL_C80B37C8_DUMMY_1     NEW
12.1.0.2   PSU             SYS        PACKAGE BODY    DBMS_ASH                       NEW
12.2.0.1   RU              SYS        PACKAGE         DBMS_JAVA_DEV                  NEW
12.2.0.1   RU              SYS        PACKAGE BODY    DBMS_JAVA_DEV                  NEW
12.2.0.1   RU              SYS        TRIGGER         DBMS_JAVA_DEV_TRG              NEW
12.2.0.1   RU              SYS        VIEW            JAVA_DEV_STATUS                NEW
11.2.0.4   PSU             CTXSYS     PACKAGE         CTX_DDL                        MOD
11.2.0.4   PSU             CTXSYS     PACKAGE BODY    CTX_DDL                        MOD
12.1.0.2   BP              DVSYS      TYPE            KU$_DV_REALM_MEMBER_T          MOD
12.1.0.2   BP              DVSYS      TYPE            KU$_DV_RULE_SET_MEMBER_T       MOD
12.1.0.2   BP              DVSYS      TYPE            SYS_YOID0000091408$            MOD
12.1.0.2   BP              DVSYS      TYPE            SYS_YOID0000091420$            MOD
12.1.0.2   BP              DVSYS      TYPE            SYS_YOID0000091443$            MOD
12.1.0.2   BP              DVSYS      TYPE            SYS_YOID0000091455$            MOD
12.1.0.2   BP              DVSYS      VIEW            KU$_DV_REALM_MEMBER_VIEW       MOD
12.1.0.2   BP              DVSYS      VIEW            KU$_DV_RULE_SET_MEMBER_VIEW    MOD
12.1.0.2   BP              SYS        PACKAGE         DBMS_STATS                     MOD
12.1.0.2   BP              SYS        PACKAGE         PRVT_COMPRESSION               MOD
12.1.0.2   BP              SYS        PACKAGE         PRVT_ILM                       MOD
12.1.0.2   BP              SYS        PACKAGE BODY    DBMS_COMPRESSION               MOD
12.1.0.2   BP              SYS        PACKAGE BODY    DBMS_STATS                     MOD
12.1.0.2   BP              SYS        PACKAGE BODY    PRVT_ILM                       MOD
12.1.0.2   BP              SYS        VIEW            AQ$KUPC$DATAPUMP_QUETAB_1      MOD
12.1.0.2   BP              SYS        VIEW            CDB_ILMOBJECTS                 MOD
12.1.0.2   BP              SYS        VIEW            DBA_ILMOBJECTS                 MOD
12.1.0.2   BP              SYS        VIEW            USER_ILMOBJECTS                MOD
12.1.0.2   PSU             SYS        PACKAGE         DBMS_BACKUP_RESTORE            MOD
12.1.0.2   PSU             SYS        PACKAGE BODY    DBMS_BACKUP_RESTORE            MOD
12.1.0.2   PSU             SYS        PACKAGE BODY    DBMS_LOGREP_EXP                MOD
12.1.0.2   PSU & BP        CTXSYS     PACKAGE         CTX_DDL                        MOD
12.1.0.2   PSU & BP        CTXSYS     PACKAGE BODY    CTX_DDL                        MOD
12.2.0.1   APR2018RUR      SYS        PACKAGE BODY    DBMS_RCVMAN                    MOD
12.2.0.1   APR2018RUR      SYS        PACKAGE BODY    DBMS_XSTREAM_ADM_INTERNAL      MOD
12.2.0.1   APR2018RUR      SYS        PACKAGE BODY    DBMS_XSTREAM_ADM_UTL           MOD
12.2.0.1   APR2018RUR      SYS        PACKAGE BODY    DBMS_XSTREAM_AUTH_IVK          MOD
12.2.0.1   APR2018RUR      SYS        PACKAGE BODY    DBMS_XSTREAM_GG_INTERNAL       MOD
12.2.0.1   APR2018RUR      SYS        PACKAGE BODY    DBMS_XSTREAM_UTL_IVK           MOD
12.2.0.1   JAN2018RUR      CTXSYS     PACKAGE BODY    DRIPARSE                       MOD
12.2.0.1   RU              SYS        PACKAGE         DBMS_QOPATCH                   MOD
12.2.0.1   RU              SYS        PACKAGE         DBMS_SHARED_POOL               MOD
12.2.0.1   RU              SYS        PACKAGE         DBMS_SQLPATCH                  MOD
12.2.0.1   RU              SYS        PACKAGE BODY    DBMS_QOPATCH                   MOD
12.2.0.1   RU              SYS        PACKAGE BODY    DBMS_SHARED_POOL               MOD
12.2.0.1   RU              SYS        PACKAGE BODY    DBMS_SQLPATCH                  MOD
12.2.0.1   RU              SYS        PACKAGE BODY    DBMS_WORKLOAD_REPLAY           MOD
12.2.0.1   RU              SYS        PACKAGE BODY    DBMS_WRR_INTERNAL              MOD
12.2.0.1   RU              SYS        PACKAGE BODY    LOGMNR_DICT_CACHE              MOD
12.2.0.1   RU              SYS        PACKAGE BODY    PRVT_ADVISOR                   MOD
12.2.0.1   RU              SYS        TYPE BODY       WRI$_ADV_SQLTUNE               MOD
12.2.0.1   RU              SYS        VIEW            CDB_REGISTRY_SQLPATCH          MOD
12.2.0.1   RU              SYS        VIEW            DBA_REGISTRY_SQLPATCH          MOD
18.0.0.0   RU              AUDSYS     PACKAGE BODY    DBMS_AUDIT_MGMT                MOD
18.0.0.0   RU              CTXSYS     PACKAGE         DRIG                           MOD
18.0.0.0   RU              CTXSYS     PACKAGE         DRIIMP                         MOD
18.0.0.0   RU              CTXSYS     PACKAGE         DRIUTL                         MOD
18.0.0.0   RU              CTXSYS     PACKAGE         DRIXMD                         MOD
18.0.0.0   RU              CTXSYS     PACKAGE         DRVDISP                        MOD
18.0.0.0   RU              CTXSYS     PACKAGE BODY    CTX_CLS                        MOD
18.0.0.0   RU              CTXSYS     PACKAGE BODY    DRIIMP                         MOD
18.0.0.0   RU              CTXSYS     PACKAGE BODY    DRIUTL                         MOD
18.0.0.0   RU              CTXSYS     PACKAGE BODY    DRIXMD                         MOD
18.0.0.0   RU              CTXSYS     PACKAGE BODY    DRUE                           MOD
18.0.0.0   RU              CTXSYS     PACKAGE BODY    DRVDDL                         MOD
18.0.0.0   RU              CTXSYS     PACKAGE BODY    DRVDISP                        MOD
18.0.0.0   RU              CTXSYS     PACKAGE BODY    DRVLSB                         MOD
18.0.0.0   RU              CTXSYS     PACKAGE BODY    DRVPARX                        MOD
18.0.0.0   RU              CTXSYS     PACKAGE BODY    DRVTMT                         MOD
18.0.0.0   RU              MDSYS      PACKAGE BODY    MDPRVT_IDX                     MOD
18.0.0.0   RU              MDSYS      PACKAGE BODY    MD_NFE                         MOD
18.0.0.0   RU              MDSYS      PACKAGE BODY    SDO_IDX                        MOD
18.0.0.0   RU              MDSYS      PACKAGE BODY    SDO_NFE                        MOD
18.0.0.0   RU              SYS        FUNCTION        ORA12C_STIG_VERIFY_FUNCTION    MOD
18.0.0.0   RU              SYS        FUNCTION        ORA12C_STRONG_VERIFY_FUNCTION  MOD
18.0.0.0   RU              SYS        FUNCTION        ORA_COMPLEXITY_CHECK           MOD
18.0.0.0   RU              SYS        FUNCTION        ORA_STRING_DISTANCE            MOD
18.0.0.0   RU              SYS        PACKAGE         DBMS_IR                        MOD
18.0.0.0   RU              SYS        PACKAGE         DBMS_PRVTAQIS                  MOD
18.0.0.0   RU              SYS        PACKAGE         DBMS_REDEFINITION_INTERNAL     MOD
18.0.0.0   RU              SYS        PACKAGE         DBMS_SMB_INTERNAL              MOD
18.0.0.0   RU              SYS        PACKAGE         DBMS_SODA_UTIL                 MOD
18.0.0.0   RU              SYS        PACKAGE         DBMS_SPM_INTERNAL              MOD
18.0.0.0   RU              SYS        PACKAGE         DBMS_SQLDIAG                   MOD
18.0.0.0   RU              SYS        PACKAGE         DBMS_SQLDIAG_INTERNAL          MOD
18.0.0.0   RU              SYS        PACKAGE         DBMS_SQLTCB_INTERNAL           MOD
18.0.0.0   RU              SYS        PACKAGE BODY    AMGT$DATAPUMP                  MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_IR                        MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_JSON0                     MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_PRVTAQIS                  MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_REDEFINITION              MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_REGISTRY                  MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_SMB                       MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_SMB_INTERNAL              MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_SODA_UTIL                 MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_SPM                       MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_SPM_INTERNAL              MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_SQLDIAG                   MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_SQLDIAG_INTERNAL          MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_SQLTCB_INTERNAL           MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_STATS                     MOD
18.0.0.0   RU              SYS        PACKAGE BODY    DBMS_WORKLOAD_CAPTURE_I        MOD
18.0.0.0   RU              SYS        TYPE            SODA_COLLECTION_T              MOD
18.0.0.0   RU              SYS        TYPE BODY       SODA_COLLECTION_T              MOD
18.0.0.0   RU              SYS        VIEW            AWR_CDB_CLUSTER_INTERCON       MOD
18.0.0.0   RU              SYS        VIEW            AWR_PDB_CLUSTER_INTERCON       MOD
18.0.0.0   RU              SYS        VIEW            AWR_ROOT_CLUSTER_INTERCON      MOD
18.0.0.0   RU              SYS        VIEW            DBA_GOLDENGATE_SUPPORT_MODE    MOD
18.0.0.0   RU              SYS        VIEW            DBA_XSTREAM_OUT_SUPPORT_MODE   MOD
18.0.0.0   RU              SYS        VIEW            LOGSTDBY_RU_UNSUPPORT_TAB_12_2 MOD
18.0.0.0   RU              SYS        VIEW            LOGSTDBY_RU_UN_TAB_12_2_0_2    MOD
18.0.0.0   RU              SYS        VIEW            LOGSTDBY_SUPPORT_TAB_12_2      MOD
18.0.0.0   RU              SYS        VIEW            LOGSTDBY_SUPPORT_TAB_12_2_0_2  MOD
18.0.0.0   RU              SYS        VIEW            LOGSTDBY_UNSUPPORT_TAB_12_2    MOD
18.0.0.0   RU              SYS        VIEW            LOGSTDBY_UNSUPP_TAB_12_2_0_2   MOD
18.0.0.0   RU              SYS        VIEW            OGG_SUPPORT_TAB_12_2           MOD
18.0.0.0   RU              SYS        VIEW            OGG_SUPPORT_TAB_12_2_0_2       MOD
18.0.0.0   RU              SYS        VIEW            _DBA_OGG_ALL_TABLES            MOD
18.0.0.0   RU              XDB        PACKAGE         DBMS_JSON_INT                  MOD
18.0.0.0   RU              XDB        PACKAGE         DBMS_SODA_ADMIN                MOD
18.0.0.0   RU              XDB        PACKAGE         DBMS_SODA_DOM                  MOD
18.0.0.0   RU              XDB        PACKAGE BODY    DBMS_JSON                      MOD
18.0.0.0   RU              XDB        PACKAGE BODY    DBMS_JSON_INT                  MOD
18.0.0.0   RU              XDB        PACKAGE BODY    DBMS_SODA_ADMIN                MOD
18.0.0.0   RU              XDB        PACKAGE BODY    DBMS_SODA_DOM                  MOD
18.0.0.0   RU              XDB        PACKAGE BODY    DBMS_XDB                       MOD
18.0.0.0   RU              XDB        PACKAGE BODY    DBMS_XDBZ0                     MOD
18.0.0.0   RU              XDB        PACKAGE BODY    DBMS_XDB_CONFIG                MOD
18.0.0.0   RU              XDB        VIEW            JSON$COLLECTION_METADATA_V     MOD
18.0.0.0   RU & 18.2RUR    SYS        PACKAGE         DBMS_BACKUP_RESTORE            MOD
18.0.0.0   RU & 18.2RUR    SYS        PACKAGE         DBMS_REGISTRY                  MOD
18.0.0.0   RU & 18.2RUR    SYS        PACKAGE BODY    DBMS_RCVMAN                    MOD

What changed for each? (click to see the changes)

P.S: 

>  = Added Lines

<  = Removed Lines

Changed Objects

 

CTXSYS.CTX_DDL - PACKAGE (PSU):
1379a1380,1385
> /*----------------------- remove_overlap_dollars ---------------------------*/
> PROCEDURE remove_overlap_dollars(
>   idx_name  in varchar2,
>   part_name in varchar2 default null
> );
> 
CTXSYS.CTX_DDL - PACKAGE BODY (PSU):
2636a2637,2811
> FUNCTION BITOR (X IN NUMBER, Y IN NUMBER) RETURN NUMBER AS
> BEGIN
>   RETURN (X + Y - BITAND(X, Y));
> END BITOR;
> 
> PROCEDURE REMOVE_OVERLAP_DOLLARS(
>   IDX_NAME  IN VARCHAR2,
>   PART_NAME IN VARCHAR2 DEFAULT NULL
> ) IS
>   IDX      DR_DEF.IDX_REC;
>   IXP      DR_DEF.IXP_REC;
>   DEL_NULL_STMT VARCHAR2(512);
>   STMT     VARCHAR2(4192);
>   DEL_STMT VARCHAR2(512);
>   SID_STMT VARCHAR2(512);
>   TAB_NAME VARCHAR2(261);
>   INFO     RAW(2000);
>   SDATA_ID NUMBER;
>   SID      NUMBER;
>   SLAST    NUMBER;
>   LEN      NUMBER;
>   IDX_ID   NUMBER;
>   SDTYPE   NUMBER;
>   TYPE T_CUR IS REF CURSOR;
>   CUR      T_CUR;
>   CUR1     T_CUR;
>   BITOP    BINARY_INTEGER;
>   FBIT     RAW(1);
>   SBIT     RAW(1);
>   TWOBITS  RAW(2);
>   DOCCNT   BINARY_INTEGER;
>   CURR_LAST NUMBER := -1;
>   NEXT_LAST NUMBER;
>   COMMIT_BATCH  NUMBER := 0;
>   FETCHED  NUMBER := 0;
> BEGIN
>   IDX := DRIXMD.GETINDEXREC(IDX_NAME);
>   IXP := DRIXMD.GETPARTITIONREC(PART_NAME, IDX);
> 
>   TAB_NAME := DBMS_ASSERT.QUALIFIED_SQL_NAME(DRVXTAB.GET_OBJECT_NAME(
>                             DBMS_ASSERT.ENQUOTE_NAME(IDX.IDX_OWNER, FALSE),
>                             IDX.IDX_NAME, IDX.IDX_ID, IXP.IXP_ID, 'S'));
>  
>   DRVUTL.WRITE_TO_LOG('Starting procedure REMOVE_OVERLAP_DOLLARS for table '
>                       || TAB_NAME);
> 
>   DEL_NULL_STMT := 'delete from ' || TAB_NAME ||
>                    ' where sdata_data is null or ' ||
>                    '       utl_raw.length(sdata_data) = 0';
> 
>   SID_STMT := 'select distinct(sdata_id) from ' || TAB_NAME ||
>               ' order by sdata_id';
> 
>   STMT := 'select sdata_id, sdata_last, sdata_data, utl_raw.length(sdata_data)'
>           || ' from ' || TAB_NAME ||
>           ' where sdata_id = :sdata_id and sdata_last > :prev_last' ||
>           ' order by sdata_last, sdata_data asc';
> 
>   DEL_STMT := 'delete from ' || TAB_NAME ||
>               ' where sdata_id = :sdata_id and sdata_last = :sdata_last';
> 
>   
>   EXECUTE IMMEDIATE DEL_NULL_STMT;
>   DRVUTL.WRITE_TO_LOG('Deleted ' || SQL%ROWCOUNT ||
>                       ' rows with empty sdata_data from ' || TAB_NAME);
>   COMMIT;
> 
>   
>   OPEN CUR1 FOR SID_STMT;
>   LOOP
>     FETCH CUR1 INTO SDATA_ID;
>     EXIT WHEN CUR1%NOTFOUND;
>     DRVUTL.WRITE_TO_LOG('Starting to process rows with sdata_id: ' || SDATA_ID);
>   
>     CURR_LAST := -1;
>     OPEN CUR FOR STMT USING SDATA_ID, CURR_LAST;
>     LOOP
>       FETCH CUR INTO SID, SLAST, INFO, LEN;
>       IF (CUR%NOTFOUND) THEN
>         IF (COMMIT_BATCH > 0) THEN
>           
>           COMMIT;
>         END IF; 
>         CLOSE CUR;
>         EXIT;
>       END IF;
> 
>       FETCHED := FETCHED + 1;
>       IF (MOD(FETCHED, 10000) = 0) THEN
>         DRVUTL.WRITE_TO_LOG(TO_CHAR(FETCHED)||' $S rows fetched');
>       END IF;
> 
>       IF (CURR_LAST = -1) THEN
>         CURR_LAST := SLAST;
>       ELSE
>         NEXT_LAST := SLAST;
> 
>         
>         SDTYPE := DRVXMD.GETSECDATATYPE(IDX.IDX_ID, SID);
> 
>         
>         IF (SDTYPE = DRISGP.SEC_DATATYPE_DATE) THEN
>           IF (MOD(LEN, 7) > 0) THEN  
>             EXECUTE IMMEDIATE DEL_STMT USING SID, SLAST;
>             DRVUTL.WRITE_TO_LOG('Deleted DATE row of invalid sdata_data length'
>                 || ' with sdata_last:' || SLAST);
>             COMMIT_BATCH := COMMIT_BATCH + 1;
>             CONTINUE;
>           ELSE
>             DOCCNT := LEN / 7;
>           END IF;
>         ELSE
>           TWOBITS := UTL_RAW.SUBSTR(INFO, 1, 2);
>           FBIT := UTL_RAW.SUBSTR(INFO, 1, 1);
>           SBIT := UTL_RAW.SUBSTR(INFO, 2, 1);
>           
>           
>           IF (BITAND(TO_NUMBER(FBIT, 'xxxx'), TO_NUMBER('80', 'xxxx')) = 0)
>           THEN
>             DOCCNT := TO_NUMBER(FBIT, 'xxxx');
>           ELSE
>             DOCCNT := TO_NUMBER(BITOR(BITAND(127, TO_NUMBER(FBIT, 'xxxx'))
>                                       * 128,
>                                      TO_NUMBER(SBIT, 'xxxx'))
>                                );
>           END IF;
>         END IF;
> 
>         IF ((NEXT_LAST - DOCCNT) < CURR_LAST) THEN
>           
>           EXECUTE IMMEDIATE DEL_STMT USING SID, SLAST;
>           DRVUTL.WRITE_TO_LOG('Deleted row with sdata_last:' || SLAST);
>           COMMIT_BATCH := COMMIT_BATCH + 1;
>         ELSE
>           
>           CURR_LAST := NEXT_LAST;
>         END IF;
> 
>         
>         IF (COMMIT_BATCH = 1000) THEN
>           COMMIT;
>           CLOSE CUR;
>           
>           OPEN CUR FOR STMT USING SDATA_ID, CURR_LAST;
>           COMMIT_BATCH := 0;
>         END IF;
>       END IF;
>     END LOOP;
> 
>     IF (CUR%ISOPEN) THEN
>       CLOSE CUR;
>     END IF;
>   END LOOP;
>   CLOSE CUR1;
>   DRVUTL.WRITE_TO_LOG(TO_CHAR(FETCHED)||' $S rows fetched');
>   DRVUTL.WRITE_TO_LOG('End of procedure REMOVE_OVERLAP_DOLLARS');
> EXCEPTION
>   WHEN DR_DEF.TEXTILE_ERROR THEN
>     DRUE.RAISE;
>     GOTO CLEANUP;
>   WHEN OTHERS THEN
>     DRUE.TEXT_ON_STACK(SQLERRM, 'ctx_ddl.remove_overlap_dollars');
>     DRUE.RAISE;
>     GOTO CLEANUP;
> <<CLEANUP>>
>   ROLLBACK;
>   IF (CUR%ISOPEN) THEN
>     CLOSE CUR;
>   END IF;
>   IF (CUR1%ISOPEN) THEN
>     CLOSE CUR1;
>   END IF;
> END REMOVE_OVERLAP_DOLLARS;
> 
> 
CTXSYS.CTX_DDL - PACKAGE (PSU):
1483a1484,1489
> /*----------------------- remove_overlap_dollars ---------------------------*/
> PROCEDURE remove_overlap_dollars(
>   idx_name  in varchar2,
>   part_name in varchar2 default null
> );
> 
CTXSYS.CTX_DDL - PACKAGE BODY (PSU):
2777a2778,2952
> FUNCTION BITOR (X IN NUMBER, Y IN NUMBER) RETURN NUMBER AS
> BEGIN
>   RETURN (X + Y - BITAND(X, Y));
> END BITOR;
> 
> PROCEDURE REMOVE_OVERLAP_DOLLARS(
>   IDX_NAME  IN VARCHAR2,
>   PART_NAME IN VARCHAR2 DEFAULT NULL
> ) IS
>   IDX      DR_DEF.IDX_REC;
>   IXP      DR_DEF.IXP_REC;
>   DEL_NULL_STMT DRVUTL.DR_LONGBUF;
>   STMT     DRVUTL.DR_EXTRABUF;
>   DEL_STMT DRVUTL.DR_LONGBUF;
>   SID_STMT DRVUTL.DR_LONGBUF;
>   TAB_NAME DRVUTL.DR_QLID2;
>   INFO     RAW(2000);
>   SDATA_ID NUMBER;
>   SID      NUMBER;
>   SLAST    NUMBER;
>   LEN      NUMBER;
>   IDX_ID   NUMBER;
>   SDTYPE   NUMBER;
>   TYPE T_CUR IS REF CURSOR;
>   CUR      T_CUR;
>   CUR1     T_CUR;
>   BITOP    BINARY_INTEGER;
>   FBIT     RAW(1);
>   SBIT     RAW(1);
>   TWOBITS  RAW(2);
>   DOCCNT   BINARY_INTEGER;
>   CURR_LAST NUMBER := -1;
>   NEXT_LAST NUMBER;
>   COMMIT_BATCH  NUMBER := 0;
>   FETCHED  NUMBER := 0;
> BEGIN
>   IDX := DRIXMD.GETINDEXREC(IDX_NAME);
>   IXP := DRIXMD.GETPARTITIONREC(PART_NAME, IDX);
> 
>   TAB_NAME := DBMS_ASSERT.QUALIFIED_SQL_NAME(DRVXTAB.GET_OBJECT_NAME(
>                             DBMS_ASSERT.ENQUOTE_NAME(IDX.IDX_OWNER, FALSE),
>                             IDX.IDX_NAME, IDX.IDX_ID, IXP.IXP_ID, 'S'));
>  
>   DRVUTL.WRITE_TO_LOG('Starting procedure REMOVE_OVERLAP_DOLLARS for table '
>                       || TAB_NAME);
> 
>   DEL_NULL_STMT := 'delete from ' || TAB_NAME ||
>                    ' where sdata_data is null or ' ||
>                    '       utl_raw.length(sdata_data) = 0';
> 
>   SID_STMT := 'select distinct(sdata_id) from ' || TAB_NAME ||
>               ' order by sdata_id';
> 
>   STMT := 'select sdata_id, sdata_last, sdata_data, utl_raw.length(sdata_data)'
>           || ' from ' || TAB_NAME ||
>           ' where sdata_id = :sdata_id and sdata_last > :prev_last' ||
>           ' order by sdata_last, sdata_data asc';
> 
>   DEL_STMT := 'delete from ' || TAB_NAME ||
>               ' where sdata_id = :sdata_id and sdata_last = :sdata_last';
> 
>   
>   EXECUTE IMMEDIATE DEL_NULL_STMT;
>   DRVUTL.WRITE_TO_LOG('Deleted ' || SQL%ROWCOUNT ||
>                       ' rows with empty sdata_data from ' || TAB_NAME);
>   COMMIT;
> 
>   
>   OPEN CUR1 FOR SID_STMT;
>   LOOP
>     FETCH CUR1 INTO SDATA_ID;
>     EXIT WHEN CUR1%NOTFOUND;
>     DRVUTL.WRITE_TO_LOG('Starting to process rows with sdata_id: ' || SDATA_ID);
>   
>     CURR_LAST := -1;
>     OPEN CUR FOR STMT USING SDATA_ID, CURR_LAST;
>     LOOP
>       FETCH CUR INTO SID, SLAST, INFO, LEN;
>       IF (CUR%NOTFOUND) THEN
>         IF (COMMIT_BATCH > 0) THEN
>           
>           COMMIT;
>         END IF; 
>         CLOSE CUR;
>         EXIT;
>       END IF;
> 
>       FETCHED := FETCHED + 1;
>       IF (MOD(FETCHED, 10000) = 0) THEN
>         DRVUTL.WRITE_TO_LOG(TO_CHAR(FETCHED)||' $S rows fetched');
>       END IF;
> 
>       IF (CURR_LAST = -1) THEN
>         CURR_LAST := SLAST;
>       ELSE
>         NEXT_LAST := SLAST;
> 
>         
>         SDTYPE := DRVXMD.GETSECDATATYPE(IDX.IDX_ID, SID);
> 
>         
>         IF (SDTYPE = DRISGP.SEC_DATATYPE_DATE) THEN
>           IF (MOD(LEN, 7) > 0) THEN  
>             EXECUTE IMMEDIATE DEL_STMT USING SID, SLAST;
>             DRVUTL.WRITE_TO_LOG('Deleted DATE row of invalid sdata_data length'
>                 || ' with sdata_last:' || SLAST);
>             COMMIT_BATCH := COMMIT_BATCH + 1;
>             CONTINUE;
>           ELSE
>             DOCCNT := LEN / 7;
>           END IF;
>         ELSE
>           TWOBITS := UTL_RAW.SUBSTR(INFO, 1, 2);
>           FBIT := UTL_RAW.SUBSTR(INFO, 1, 1);
>           SBIT := UTL_RAW.SUBSTR(INFO, 2, 1);
>           
>           
>           IF (BITAND(TO_NUMBER(FBIT, 'xxxx'), TO_NUMBER('80', 'xxxx')) = 0)
>           THEN
>             DOCCNT := TO_NUMBER(FBIT, 'xxxx');
>           ELSE
>             DOCCNT := TO_NUMBER(BITOR(BITAND(127, TO_NUMBER(FBIT, 'xxxx'))
>                                       * 128,
>                                      TO_NUMBER(SBIT, 'xxxx'))
>                                );
>           END IF;
>         END IF;
> 
>         IF ((NEXT_LAST - DOCCNT) < CURR_LAST) THEN
>           
>           EXECUTE IMMEDIATE DEL_STMT USING SID, SLAST;
>           DRVUTL.WRITE_TO_LOG('Deleted row with sdata_last:' || SLAST);
>           COMMIT_BATCH := COMMIT_BATCH + 1;
>         ELSE
>           
>           CURR_LAST := NEXT_LAST;
>         END IF;
> 
>         
>         IF (COMMIT_BATCH = 1000) THEN
>           COMMIT;
>           CLOSE CUR;
>           
>           OPEN CUR FOR STMT USING SDATA_ID, CURR_LAST;
>           COMMIT_BATCH := 0;
>         END IF;
>       END IF;
>     END LOOP;
> 
>     IF (CUR%ISOPEN) THEN
>       CLOSE CUR;
>     END IF;
>   END LOOP;
>   CLOSE CUR1;
>   DRVUTL.WRITE_TO_LOG(TO_CHAR(FETCHED)||' $S rows fetched');
>   DRVUTL.WRITE_TO_LOG('End of procedure REMOVE_OVERLAP_DOLLARS');
> EXCEPTION
>   WHEN DR_DEF.TEXTILE_ERROR THEN
>     DRUE.RAISE;
>     GOTO CLEANUP;
>   WHEN OTHERS THEN
>     DRUE.TEXT_ON_STACK(SQLERRM, 'ctx_ddl.remove_overlap_dollars');
>     DRUE.RAISE;
>     GOTO CLEANUP;
> <<CLEANUP>>
>   ROLLBACK;
>   IF (CUR%ISOPEN) THEN
>     CLOSE CUR;
>   END IF;
>   IF (CUR1%ISOPEN) THEN
>     CLOSE CUR1;
>   END IF;
> END REMOVE_OVERLAP_DOLLARS;
> 
> 
DVSYS.KU$_DV_REALM_MEMBER_T - TYPE (BP):
4a5
>   oidval        raw(16),                                       /* unique id */
DVSYS.KU$_DV_RULE_SET_MEMBER_T - TYPE (BP):
4a5
>   oidval          raw(16),                                     /* unique id */
DVSYS.SYS_YOID0000091408$ - TYPE (BP):
1,2c1,2
< type         "SYS_YOID0000091408$"              as object( "SYS_NC00001$" VARCHAR2(128 BYTE), "SYS_NC00002$" VARCHAR2(128 BYTE))
< type         "SYS_YOID0000091408$"              as object( "SYS_NC00001$" VARCHAR2(128 BYTE), "SYS_NC00002$" VARCHAR2(128 BYTE))
---
> type         "SYS_YOID0000091408$"              as object( "SYS_NC00001$" RAW(16))
> type         "SYS_YOID0000091408$"              as object( "SYS_NC00001$" RAW(16))
DVSYS.SYS_YOID0000091420$ - TYPE (BP):
1,2c1,2
< type         "SYS_YOID0000091420$"              as object( "SYS_NC00001$" VARCHAR2(128 BYTE), "SYS_NC00002$" VARCHAR2(128 BYTE))
< type         "SYS_YOID0000091420$"              as object( "SYS_NC00001$" VARCHAR2(128 BYTE), "SYS_NC00002$" VARCHAR2(128 BYTE))
---
> type         "SYS_YOID0000091420$"              as object( "SYS_NC00001$" RAW(16))
> type         "SYS_YOID0000091420$"              as object( "SYS_NC00001$" RAW(16))
DVSYS.SYS_YOID0000091443$ - TYPE (BP):
1c1
< type         "SYS_YOID0000091443$"              as object( "SYS_NC00001$" VARCHAR2(128 BYTE), "SYS_NC00002$" VARCHAR2(128 BYTE))
---
> type         "SYS_YOID0000091443$"              as object( "SYS_NC00001$" RAW(16))
DVSYS.SYS_YOID0000091455$ - TYPE (BP):
1c1
< type         "SYS_YOID0000091455$"              as object( "SYS_NC00001$" VARCHAR2(128 BYTE), "SYS_NC00002$" VARCHAR2(128 BYTE))
---
> type         "SYS_YOID0000091455$"              as object( "SYS_NC00001$" RAW(16))
DVSYS.KU$_DV_REALM_MEMBER_VIEW - VIEW (BP):
1c1
< select '0','0',
---
> select '0','0',sys_guid(),
DVSYS.KU$_DV_RULE_SET_MEMBER_VIEW - VIEW (BP):
1c1
< select '0','0',
---
> select '0','0', sys_guid(),
SYS.DBMS_BACKUP_RESTORE - PACKAGE (PSU):
8156a8157,8189
>   PROCEDURE backupBackupPiece( bpname         IN   varchar2
>                               ,fname          IN   varchar2
>                               ,handle         OUT  varchar2
>                               ,comment        OUT  varchar2
>                               ,media          OUT  varchar2
>                               ,concur         OUT  boolean
>                               ,recid          OUT  number
>                               ,stamp          OUT  number
>                               ,tag            IN   varchar2       default NULL
>                               ,params         IN   varchar2       default NULL
>                               ,media_pool     IN   binary_integer default 0
>                               ,reuse          IN   boolean        default FALSE
>                               ,check_logical  IN   boolean
>                               ,copyno         IN   binary_integer
>                               ,deffmt         IN   binary_integer
>                               ,copy_recid     IN   number
>                               ,copy_stamp     IN   number
>                               ,npieces        IN   binary_integer
>                               ,dest           IN   binary_integer
>                               ,pltfrmfr       IN   binary_integer
>                               ,ors            IN   boolean
>                               ,bpsize         OUT  number
>                               ,encrypt        IN   number
>                               ,enc_algorithm  IN   number
>                               ,allowTDE       IN   number
>                               ,password       IN   varchar2);
>   --
>   -- Description and return values can be found with original declaration
>   -- above.  The new arguments are:
>   --   encrypt flag
>   --   algorithm used for encryption
>   --   allow TDE
>   --   password
SYS.DBMS_STATS - PACKAGE (BP):
540a541
> --                WAIT_TIME_TO_UPDATE_STATS
706a708,714
> --  WAIT_TIME_TO_UPDATE_STATS
> --    This preference specifies the wait time, in minutes, before
> --    timing out for locks and pins required for updating statistics.
> --    It accepts values in the range, [0, 65535]. The default value is
> --    15 minutes. The special value  0 can be used to get the locks and
> --    pins in no-wait mode.
> --
753c761
< --
---
> --                WAIT_TIME_TO_UPDATE_STATS
SYS.PRVT_COMPRESSION - PACKAGE (BP):
2a3,4
> 
> 
SYS.PRVT_ILM - PACKAGE (BP):
234a235
>       
358a360,362
> 
>       
>       ILM_DICT_CLEANUP_ATTR                  CONSTANT NUMBER  := 4;
645c649,675
<  
---
> 
>       
>       TYPE ILMOBJ IS RECORD (
>           OBJ#            NUMBER,
>           POLICY#         NUMBER,
>           ACTION          NUMBER,
>           SCOPE           NUMBER,
>           DAYS            NUMBER,
>           CONDITION       NUMBER,
>           CLEVEL          NUMBER,
>           CTYPE           NUMBER,
>           FLAG            NUMBER,
>           OBJ_TYP         NUMBER,
>           OBJ_TYP_ORIG    NUMBER,
>           POBJN_ORIG      NUMBER
>       );
> 
>       TYPE TAB_ILMOBJ IS TABLE OF ILMOBJ;
> 
>       
>       TYPE ILMOBJ_DEL IS RECORD (
>         OBJ#            NUMBER,
>         POLICY#         NUMBER
>       );
> 
>       TYPE TAB_ILMOBJ_DEL IS TABLE OF ILMOBJ_DEL;
> 
1043a1074,1105
> 
>      
>        FUNCTION GET_ILMOBJ_TAB RETURN TAB_ILMOBJ;
>      
>      
>        PROCEDURE PRINT_ILMOBJ(
>            OBJ IN ILMOBJ);
> 
>      
> 
> 
> 
> 
> 
> 
>        FUNCTION CHECK_CONFLICT(
>           OBJ1 IN ILMOBJ,
>           OBJ2 IN ILMOBJ)
>                 RETURN NUMBER;
> 
>      
> 
> 
> 
> 
> 
> 
> 
>        FUNCTION DETERMINE_CONFLICT(
>           OBJ1 IN ILMOBJ,
>           OBJ2 IN ILMOBJ)
>                 RETURN NUMBER;
1075,1076c1137,1146
<        PROCEDURE ILM_CLEANUP;  
<     
---
>        PROCEDURE ILM_CLEANUP;
> 
>       PROCEDURE ILM_DICT_CLEANUP_CHECK(
>            ILM_UPGRADE IN BOOLEAN DEFAULT FALSE,
>            ASSERT_ONLY IN BOOLEAN DEFAULT FALSE);
> 
>      
>        PROCEDURE ILM_DICT_CLEANUP(
>            ASSERT_ONLY IN BOOLEAN DEFAULT TRUE);
> 
SYS.DBMS_BACKUP_RESTORE - PACKAGE BODY (PSU):
1588c1588,1592
<                      ,BPSIZE        OUT  NUMBER);
---
>                      ,BPSIZE        OUT  NUMBER
>                      ,ENCRYPT       IN   NUMBER
>                      ,ENC_ALGORITHM IN   NUMBER
>                      ,ALLOWTDE      IN   NUMBER
>                      ,PASSWORD      IN   VARCHAR2);
1750a1755,1787
>   BEGIN
>         BACKUPBACKUPPIECE(BPNAME, FNAME, HANDLE, COMMENT, MEDIA, CONCUR,
>                           RECID, STAMP, TAG, PARAMS, MEDIA_POOL, REUSE,
>                           CHECK_LOGICAL, COPYNO, DEFFMT, COPY_RECID, COPY_STAMP,
>                           NPIECES, DEST, PLTFRMFR, ORS, BPSIZE, 
>                           0, 0, 0, NULL);
>   END;
>   PROCEDURE BACKUPBACKUPPIECE( BPNAME          IN  VARCHAR2
>                               ,FNAME           IN  VARCHAR2
>                               ,HANDLE          OUT VARCHAR2
>                               ,COMMENT         OUT VARCHAR2
>                               ,MEDIA           OUT VARCHAR2
>                               ,CONCUR          OUT BOOLEAN
>                               ,RECID           OUT NUMBER
>                               ,STAMP           OUT NUMBER
>                               ,TAG             IN  VARCHAR2       DEFAULT NULL
>                               ,PARAMS          IN  VARCHAR2       DEFAULT NULL
>                               ,MEDIA_POOL      IN  BINARY_INTEGER DEFAULT 0
>                               ,REUSE           IN  BOOLEAN        DEFAULT FALSE
>                               ,CHECK_LOGICAL   IN  BOOLEAN
>                               ,COPYNO          IN  BINARY_INTEGER
>                               ,DEFFMT          IN  BINARY_INTEGER
>                               ,COPY_RECID      IN  NUMBER
>                               ,COPY_STAMP      IN  NUMBER
>                               ,NPIECES         IN  BINARY_INTEGER
>                               ,DEST            IN  BINARY_INTEGER
>                               ,PLTFRMFR        IN  BINARY_INTEGER
>                               ,ORS             IN  BOOLEAN
>                               ,BPSIZE          OUT NUMBER
>                               ,ENCRYPT         IN  NUMBER
>                               ,ENC_ALGORITHM   IN  NUMBER
>                               ,ALLOWTDE        IN  NUMBER
>                               ,PASSWORD        IN  VARCHAR2) IS
1760c1797,1798
<                  NPIECES, FALSE, DEST, PLTFRMFR, ORS, BPSIZE);
---
>                  NPIECES, FALSE, DEST, PLTFRMFR, ORS, BPSIZE,
>                  ENCRYPT, ENC_ALGORITHM, ALLOWTDE, PASSWORD);
1808c1846,1850
<                 ,BPSIZE        => BPSIZE);
---
>                 ,BPSIZE        => BPSIZE
>                 ,ENCRYPT       => 0
>                 ,ENC_ALGORITHM => 0
>                 ,ALLOWTDE      => 0
>                 ,PASSWORD      => NULL);
SYS.DBMS_COMPRESSION - PACKAGE BODY (BP):
2a3,14
> 
> 
> 
> KDZACMPLVL_MIN                CONSTANT NUMBER := 0;
> KDZACMPLVL_BASIC              CONSTANT NUMBER := 0;
> KDZACMPLVL_UNCMP              CONSTANT NUMBER := 1;
> KDZACMPLVL_ADVANCED           CONSTANT NUMBER := 2;
> KDZACMPLVL_HCCQL              CONSTANT NUMBER := 3;
> KDZACMPLVL_HCCQH              CONSTANT NUMBER := 4;
> KDZACMPLVL_HCCAL              CONSTANT NUMBER := 5;
> KDZACMPLVL_HCCAH              CONSTANT NUMBER := 6;
> 
331,332c343,344
<        
<      IF COMP_LEVEL = 1 THEN 
---
>      
>      IF COMP_LEVEL = KDZACMPLVL_UNCMP THEN 
334c346
<      ELSIF COMP_LEVEL = 2 THEN          
---
>      ELSIF (COMP_LEVEL IN (KDZACMPLVL_BASIC, KDZACMPLVL_ADVANCED)) THEN
391c403,407
<                   FOR_COMPRESSION :=COMP_BASIC; 
---
>                   IF (COMP_LEVEL = KDZACMPLVL_BASIC) THEN 
>                     FOR_COMPRESSION :=COMP_BASIC; 
>                   ELSIF COMP_LEVEL = KDZACMPLVL_ADVANCED THEN
>                     FOR_COMPRESSION := COMP_ADVANCED;
>                   END IF;   
403c419
<      ELSIF COMP_LEVEL = 3 THEN
---
>      ELSIF COMP_LEVEL = KDZACMPLVL_HCCQL THEN
405c421
<      ELSIF COMP_LEVEL = 4 THEN
---
>      ELSIF COMP_LEVEL = KDZACMPLVL_HCCQH THEN
407c423
<      ELSIF COMP_LEVEL = 5 THEN
---
>      ELSIF COMP_LEVEL = KDZACMPLVL_HCCAL THEN
409c425
<      ELSIF COMP_LEVEL = 6 THEN
---
>      ELSIF COMP_LEVEL = KDZACMPLVL_HCCAH THEN
SYS.DBMS_LOGREP_EXP - PACKAGE BODY (PSU):
2967d2966
< 
2970,2974d2968
<     SELECT NVL(MAX(CO.SCN), 0) INTO IGNORE_SCN
<     FROM SYS.ALL_CAPTURE_PREPARED_TABLES CO
<     WHERE CO.TABLE_OWNER = INSTANCE_EXTENDED_INFO_EXP.SCHEMA
<     AND   CO.TABLE_NAME = INSTANCE_EXTENDED_INFO_EXP.NAME;
< 
2976,2980c2970,2971
<     IF (IGNORE_SCN = 0) THEN
<       DBMS_LOGREP_UTIL.DUMP_TRACE(
<         'Warning: ignore_scn is 0 for object '||SCHEMA||'.'||NAME);
<     END IF;
< 
---
>  
>     IGNORE_SCN := 0;
SYS.DBMS_STATS - PACKAGE BODY (BP):
2934c2934,2947
<       PARRECCONSTRUCT('AUTO_STAT_EXTENSIONS', AUTO_STAT_EXT_DEF, NULL, 1, TRUE)
---
>       PARRECCONSTRUCT('AUTO_STAT_EXTENSIONS', AUTO_STAT_EXT_DEF, NULL, 1, TRUE),
> 
>       
>       
>       
>       
>       
>       
>       
>       
>       
>       
>       
>       PARRECCONSTRUCT('WAIT_TIME_TO_UPDATE_STATS', '15', NULL, 1, TRUE)
44900a44914,44940
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   PROCEDURE VALIDATE_WAIT_TO_UPDATE_STATS(
>    WAIT_TO_UPDATE_STATS_VCHAR IN VARCHAR2) IS
>    TIMEOUT NUMBER;
>   BEGIN
>     TIMEOUT := TO_NUMBER(WAIT_TO_UPDATE_STATS_VCHAR);
> 
>     IF (TIMEOUT < 0 OR TIMEOUT > 65535) THEN
>       RAISE_APPLICATION_ERROR(-20001, 'Illegal wait_time_to_update_stats ' ||
>          TIMEOUT || ': must be in the range [0, 65535]');
>     END IF;
>   END VALIDATE_WAIT_TO_UPDATE_STATS;
> 
44994a45035,45036
>       WHEN 'WAIT_TIME_TO_UPDATE_STATS' THEN
>         VALIDATE_WAIT_TO_UPDATE_STATS(PVALU);
SYS.PRVT_ILM - PACKAGE BODY (BP):
3939a3940,4119
>     FUNCTION GET_ILMOBJ_TAB
>     RETURN TAB_ILMOBJ
>     IS
>       V_TAB_ILMOBJ TAB_ILMOBJ;
>       CURSOR CUR_ILMOBJ IS
>         SELECT B.OBJ#, A.POLICY#, A.ACTION, A.SCOPE,
>                A.DAYS, A.CONDITION, A.CLEVEL, A.CTYPE,
>                A.FLAG, B.OBJ_TYP, NVL(B.OBJ_TYP_ORIG, 0), B.POBJN_ORIG
>         FROM ILMPOLICY$ A, ILMOBJ$ B
>         WHERE A.POLICY# = B.POLICY#
>         ORDER BY OBJ#, POLICY#;
>     BEGIN
>       OPEN CUR_ILMOBJ;
>       FETCH CUR_ILMOBJ BULK COLLECT INTO V_TAB_ILMOBJ;
>       CLOSE CUR_ILMOBJ;
>       RETURN V_TAB_ILMOBJ;
>     END;
> 
>     PROCEDURE PRINT_ILMOBJ(OBJ IN ILMOBJ)
>     IS
>     BEGIN
>       TRACE(ILM_DEBUG_ERROR_INFO, 'obj#:      ' || OBJ.OBJ#);
>       TRACE(ILM_DEBUG_ERROR_INFO, 'policy#:   ' || OBJ.POLICY#);
>       TRACE(ILM_DEBUG_ERROR_INFO, 'action:    ' || OBJ.ACTION);
>       TRACE(ILM_DEBUG_ERROR_INFO, 'scope:     ' || OBJ.SCOPE);
>       TRACE(ILM_DEBUG_ERROR_INFO, 'days:      ' || OBJ.DAYS);
>       TRACE(ILM_DEBUG_ERROR_INFO, 'condition: ' || OBJ.CONDITION);
>       TRACE(ILM_DEBUG_ERROR_INFO, 'clevel:    ' || OBJ.CLEVEL);
>       TRACE(ILM_DEBUG_ERROR_INFO, 'ctype:     ' || OBJ.CTYPE);
>       TRACE(ILM_DEBUG_ERROR_INFO, 'flag:      ' || OBJ.FLAG);
>       TRACE(ILM_DEBUG_ERROR_INFO, 'obj_typ:   ' || OBJ.OBJ_TYP);
>       TRACE(ILM_DEBUG_ERROR_INFO, 'obj_typ_o: ' || OBJ.OBJ_TYP_ORIG);
>       TRACE(ILM_DEBUG_ERROR_INFO, 'pobjn_o:   ' || OBJ.POBJN_ORIG);
>     END;
> 
>    
> 
> 
> 
> 
> 
> 
>     FUNCTION CHECK_CONFLICT(OBJ1 IN ILMOBJ, OBJ2 IN ILMOBJ)
>     RETURN NUMBER
>     IS
>       OBJ1_CUSTPOL BOOLEAN := FALSE;
>       OBJ2_CUSTPOL BOOLEAN := FALSE;
>     BEGIN
>       
>       IF(BITAND(OBJ1.FLAG, ILM_CUSTOM) != 0) THEN
>         OBJ1_CUSTPOL := TRUE;
>       END IF;
>       IF(BITAND(OBJ2.FLAG, ILM_CUSTOM) != 0) THEN
>         OBJ2_CUSTPOL := TRUE;
>       END IF;
> 
>       
> 
> 
>       IF(OBJ1.ACTION = OBJ2.ACTION AND OBJ1.CONDITION != OBJ2.CONDITION) THEN
>         IF(OBJ1_CUSTPOL OR OBJ2_CUSTPOL) THEN
>           NULL;
>           
>         ELSE
>           
>           RETURN DETERMINE_CONFLICT(OBJ1, OBJ2);
>         END IF;
>       END IF;
> 
>       
> 
> 
> 
>       IF(BITAND(OBJ1.ACTION, ACTION_COMP) != 0 AND
>          BITAND(OBJ2.ACTION, ACTION_COMP) != 0) THEN
>         IF(OBJ1_CUSTPOL OR OBJ2_CUSTPOL) THEN
>           NULL;
>           
>         ELSE
>           IF(OBJ1.CTYPE < OBJ2.CTYPE) THEN
>             IF(OBJ1.DAYS >= OBJ2.DAYS) THEN
>               
>               RETURN DETERMINE_CONFLICT(OBJ1, OBJ2);
>             END IF;
>           ELSIF(OBJ1.CTYPE > OBJ2.CTYPE) THEN
>             IF(OBJ1.DAYS <= OBJ2.DAYS) THEN
>               
>               RETURN DETERMINE_CONFLICT(OBJ1, OBJ2);
>             END IF;
>           ELSIF(OBJ1.CTYPE = OBJ2.CTYPE AND OBJ1.CTYPE = CTYPE_ARCH_COMPRESSION) THEN
>             IF(OBJ1.CLEVEL > OBJ2.CLEVEL) THEN
>               IF(OBJ1.DAYS <= OBJ2.DAYS) THEN
>                 
>                 RETURN DETERMINE_CONFLICT(OBJ1, OBJ2);
>               END IF;
>             ELSIF(OBJ1.CLEVEL < OBJ2.CLEVEL) THEN
>               IF(OBJ1.DAYS >= OBJ2.DAYS) THEN
>                 
>                 RETURN DETERMINE_CONFLICT(OBJ1, OBJ2);
>               END IF;
>             ELSE
>               
>               RETURN DETERMINE_CONFLICT(OBJ1, OBJ2);
>             END IF;
>           ELSIF(OBJ1.CTYPE = OBJ2.CTYPE AND OBJ1.CTYPE = CTYPE_OLTP_COMPRESSION) THEN
>             IF(OBJ1.SCOPE != OBJ2.SCOPE) THEN
>               IF((OBJ2.SCOPE IN (POLICY_SCOPE_SEGMENT, POLICY_SCOPE_GROUP) AND
>                   OBJ2.DAYS > OBJ1.DAYS) OR
>                  (OBJ2.SCOPE = POLICY_SCOPE_ROW AND OBJ2.DAYS < OBJ1.DAYS)) THEN
>                 
>                 NULL;
>               ELSE
>                 
>                 RETURN DETERMINE_CONFLICT(OBJ1, OBJ2);
>               END IF;
>             ELSE
>               
>               RETURN DETERMINE_CONFLICT(OBJ1, OBJ2);
>             END IF;
>           ELSE
>             
>             RETURN DETERMINE_CONFLICT(OBJ1, OBJ2);
>           END IF;
>         END IF;
>       END IF;
> 
>       
> 
> 
>       IF(OBJ1.ACTION = OBJ2.ACTION AND
>          OBJ1.CLEVEL = OBJ2.CLEVEL AND
>          OBJ1.CTYPE = OBJ2.CTYPE) THEN
>         IF(OBJ1.SCOPE = OBJ2.SCOPE OR
>           (OBJ1.SCOPE IN (POLICY_SCOPE_SEGMENT, POLICY_SCOPE_GROUP) AND
>             OBJ2.SCOPE IN (POLICY_SCOPE_SEGMENT, POLICY_SCOPE_GROUP))) THEN
>           
>           RETURN DETERMINE_CONFLICT(OBJ1, OBJ2);
>         END IF;
>       END IF;
> 
>       
>       IF(OBJ1.ACTION = OBJ2.ACTION AND OBJ1.ACTION = ACTION_STORAGE) THEN
>         
>         RETURN DETERMINE_CONFLICT(OBJ1, OBJ2);
>       END IF;
> 
>       RETURN 0;
>     END;
> 
> 
>    
> 
> 
> 
> 
> 
> 
> 
>     FUNCTION DETERMINE_CONFLICT(OBJ1 IN ILMOBJ, OBJ2 IN ILMOBJ)
>     RETURN NUMBER
>     IS
>     BEGIN
>       IF(OBJ1.OBJ_TYP_ORIG > OBJ2.OBJ_TYP_ORIG) THEN
>         
>         TRACE(ILM_DEBUG_OTHER, 'obj1 wins. deleting ' ||
>                        OBJ2.OBJ# || ', ' || OBJ2.POLICY#);
>         RETURN 1;
>       ELSIF(OBJ1.OBJ_TYP_ORIG < OBJ2.OBJ_TYP_ORIG) THEN
>         
>         TRACE(ILM_DEBUG_OTHER, 'obj2 wins. deleting ' ||
>                        OBJ1.OBJ# || ', ' || OBJ1.POLICY#);
>         RETURN 2;
>       ELSE
>         
>         TRACE(ILM_DEBUG_ERROR_INFO, 'check_conflict should not be here!');
>         RETURN -1;
>       END IF;
>     END;
> 
> 
4011a4192,4194
> 
>       TRACE(ILM_DEBUG_OTHER, 'ilm_cleanup: check state of ilmobj$');
>       ILM_DICT_CLEANUP_CHECK();
4016,4017c4199,4412
<  
<    
---
> 
>     
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>     PROCEDURE ILM_DICT_CLEANUP_CHECK(
>           ILM_UPGRADE IN BOOLEAN DEFAULT FALSE,
>           ASSERT_ONLY IN BOOLEAN DEFAULT FALSE)
>     AS
>       V_COUNT   NUMBER;
>       EXEC_TIME VARCHAR2(50);
>     BEGIN
> 
>       SELECT COUNT(*) INTO V_COUNT FROM SYS.ILM_CONCURRENCY$
>           WHERE ATTRIBUTE = ILM_DICT_CLEANUP_ATTR;
> 
>       
>       IF(V_COUNT = 0) THEN
>         INSERT INTO SYS.ILM_CONCURRENCY$ (ATTRIBUTE)
>           VALUES (ILM_DICT_CLEANUP_ATTR);
>         COMMIT;
>       END IF;
> 
>       IF(ILM_UPGRADE = FALSE AND ASSERT_ONLY = FALSE) THEN
>         IF(V_COUNT = 1) THEN
>           
> 
>           SELECT NVL(TO_CHAR(LAST_EXEC_TIME), '0') INTO EXEC_TIME
>             FROM SYS.ILM_CONCURRENCY$
>           WHERE ATTRIBUTE = ILM_DICT_CLEANUP_ATTR;
>           IF(EXEC_TIME != '0') THEN
>             
>             TRACE(ILM_DEBUG_OTHER, 'ilm_dict_cleanup cleanup was run before');
>             RETURN;
>           ELSE
>             
>             TRACE(ILM_DEBUG_OTHER, 'ilm_dict_cleanup row found ' ||
>                       'in ilm_concurrency$ with null last_exec_time');
>           END IF;
>         ELSIF(V_COUNT = 0) THEN
>           
>           TRACE(ILM_DEBUG_OTHER, 'ilm_dict_cleanup run from ilm_cleanup');
>         END IF;
>       END IF;
> 
>       
>       SELECT NVL(TO_CHAR(LAST_EXEC_TIME), '0') INTO EXEC_TIME
>         FROM SYS.ILM_CONCURRENCY$
>       WHERE ATTRIBUTE = ILM_DICT_CLEANUP_ATTR FOR UPDATE NOWAIT;
> 
>       
>       ILM_DICT_CLEANUP(ASSERT_ONLY);
> 
>     EXCEPTION
>     WHEN RESOURCE_BUSY THEN
>       
> 
> 
>       TRACE(ILM_DEBUG_OTHER, 'ilm_dict_cleanup_check: row_locked');
>     WHEN DUP_VAL_ON_INDEX THEN
>       
> 
> 
>       TRACE(ILM_DEBUG_OTHER, 'ilm_dict_cleanup_check: dup_val_on_index');
>     WHEN OTHERS THEN
>       TRACE(ILM_DEBUG_ERROR_INFO, 'ilm_dict_cleanup_check: '
>                                 || SQLCODE || ' --- ' || SQLERRM);
>     END;
> 
>     
> 
> 
> 
>     PROCEDURE ILM_DICT_CLEANUP(ASSERT_ONLY IN BOOLEAN DEFAULT TRUE)
>     IS
>       V_TAB_ILMOBJ      TAB_ILMOBJ;
>       V_TAB_ILMOBJ_DEL  TAB_ILMOBJ_DEL := TAB_ILMOBJ_DEL(); 
>       CUR_OBJ           ILMOBJ;
>       I                 NUMBER;
>       J                 NUMBER;
>       K                 NUMBER := 1;
>       RETVAL            NUMBER;
>       TOT_COUNT         NUMBER;
>       SQLTEXT           VARCHAR2(300);
>       DEL_POLICY#       NUMBER;
>       DEL_OBJ#          NUMBER;
>       DEL_POBJN_ORIG    NUMBER;
>       V_COUNT           NUMBER;
>       INV_STATE         EXCEPTION;
>     BEGIN
>       V_TAB_ILMOBJ := GET_ILMOBJ_TAB();
>       TOT_COUNT    := V_TAB_ILMOBJ.COUNT;
> 
>       SELECT COUNT(*) INTO V_COUNT
>         FROM SYS.ILM_CONCURRENCY$
>       WHERE ATTRIBUTE = ILM_DICT_CLEANUP_ATTR;
> 
>       IF(V_COUNT = 0) THEN
>         TRACE(ILM_DEBUG_ERROR_INFO, 'ilm_dict_cleanup: attribute does not ' ||
>                                     'exist in ilm_concurrency$');
>         RAISE INV_STATE;
>       END IF;
> 
>       
>       STOPJOBS(P_EXECUTION_ID => -1, DROP_RUNNING_JOBS => TRUE);
> 
>       FOR I IN 1..TOT_COUNT
>       LOOP
>         IF(V_TAB_ILMOBJ.EXISTS(I) = FALSE) THEN
>           
>           CONTINUE;
>         END IF;
> 
>         CUR_OBJ := V_TAB_ILMOBJ(I);
>         FOR J IN (I+1)..TOT_COUNT
>         LOOP
>           IF(V_TAB_ILMOBJ.EXISTS(J) = FALSE) THEN
>             
>             CONTINUE;
>           END IF;
> 
>           IF(V_TAB_ILMOBJ(J).OBJ# != CUR_OBJ.OBJ#) THEN
>             
>             EXIT;
>           END IF;
> 
>           
>           RETVAL := CHECK_CONFLICT(V_TAB_ILMOBJ(J), CUR_OBJ);
> 
>           IF(RETVAL = -1) THEN
>             
>             RAISE INV_STATE;
>           END IF;
> 
>           IF(ASSERT_ONLY = TRUE) THEN
>             
> 
> 
>             IF(RETVAL != 0) THEN
>               TRACE(ILM_DEBUG_ERROR_INFO, '===========================');
>               TRACE(ILM_DEBUG_ERROR_INFO, 'ilm_dict_cleanup: ' ||
>                     'found conflicting policies');
>               TRACE(ILM_DEBUG_ERROR_INFO, 'Printing conflicting policy info');
>               TRACE(ILM_DEBUG_ERROR_INFO, 'Policy1');
>               PRINT_ILMOBJ(V_TAB_ILMOBJ(J));
>               TRACE(ILM_DEBUG_ERROR_INFO, 'Policy2');
>               PRINT_ILMOBJ(CUR_OBJ);
>               TRACE(ILM_DEBUG_ERROR_INFO, '===========================');
>             END IF;
>           ELSE
>             
>             
> 
> 
>             IF(RETVAL = 1) THEN
>               
>               DEL_POLICY# := CUR_OBJ.POLICY#;
>               DEL_OBJ# := CUR_OBJ.OBJ#;
>               DEL_POBJN_ORIG := CUR_OBJ.POBJN_ORIG;
>               V_TAB_ILMOBJ.DELETE(I);
>             ELSIF(RETVAL = 2) THEN
>               
>               DEL_POLICY# := V_TAB_ILMOBJ(J).POLICY#;
>               DEL_OBJ# := V_TAB_ILMOBJ(J).OBJ#;
>               DEL_POBJN_ORIG := V_TAB_ILMOBJ(J).POBJN_ORIG;
>               V_TAB_ILMOBJ.DELETE(J);
>             END IF;
> 
>             IF(RETVAL = 1 OR RETVAL = 2) THEN
>               
>               V_TAB_ILMOBJ_DEL.EXTEND(1);
>               V_TAB_ILMOBJ_DEL(K).OBJ# := DEL_OBJ#;
>               V_TAB_ILMOBJ_DEL(K).POLICY# := DEL_POLICY#;
>               K := K + 1;
>             END IF;
> 
>             IF(RETVAL = 1) THEN
>               
>               EXIT;
>             END IF;
>           END IF;
>         END LOOP;
>       END LOOP;
> 
>       IF(ASSERT_ONLY = FALSE) THEN
>         
>         FORALL I IN 1..(K-1)
>           DELETE FROM SYS.ILMOBJ$ WHERE POLICY# = V_TAB_ILMOBJ_DEL(I).POLICY#
>                                     AND OBJ# = V_TAB_ILMOBJ_DEL(I).OBJ#;
> 
>         
>         UPDATE SYS.ILM_CONCURRENCY$ SET LAST_EXEC_TIME = SYSTIMESTAMP
>           WHERE ATTRIBUTE = ILM_DICT_CLEANUP_ATTR;
>         COMMIT;
>       END IF;
> 
>       EXCEPTION
>       WHEN INV_STATE THEN
>         TRACE(ILM_DEBUG_ERROR_INFO, 'ilm_dict_cleanup: invalid state');
>       WHEN OTHERS THEN
>         TRACE(ILM_DEBUG_ERROR_INFO, 'ilm_dict_cleanup: '
>                                   || SQLCODE || ' --- ' || SQLERRM);
>     END;
> 
>     
5376,5377d5770
<         TYPE TAB_NONINHERITED_ACTION IS TABLE OF NUMBER INDEX BY PLS_INTEGER;
<         V_TAB_NONINHERITED_ACTION TAB_NONINHERITED_ACTION;
5485,5496d5877
<              V_TAB_NONINHERITED_ACTION(ACTION_COMP)    := 
<                                                    POLICY_INHERITED_TABLESPACE;
<              V_TAB_NONINHERITED_ACTION(ACTION_STORAGE) := 
<                                                    POLICY_INHERITED_TABLESPACE;
< 
<            
< 
< 
< 
< 
< 
< 
5500,5506d5880
<                  TRACE(ILM_DEBUG_OTHER, ('obj: ' 
<                           || P_TAB_OBJPOLICY_INFO(FIRST_PASS).OBJECT_NAME
<                           || ' subobj ' 
<                           || P_TAB_OBJPOLICY_INFO(FIRST_PASS).SUBOBJECT_NAME
<                           || ' inherited from : '
<                           || P_TAB_OBJPOLICY_INFO(FIRST_PASS).INHERITED_FROM));
< 
5513,5565c5887
< 
<                CASE (P_TAB_OBJPOLICY_INFO(FIRST_PASS).INHERITED_FROM)
<                 
<                  WHEN POLICY_INHERITED_TABLESPACE THEN
<                       
< 
< 
<                        NULL; 
< 
<                  WHEN POLICY_INHERITED_TABLE THEN
<                      IF (V_TAB_NONINHERITED_ACTION(
<                            P_TAB_OBJPOLICY_INFO(FIRST_PASS).ACTION) IN
<                           (POLICY_INHERITED_TABLESPACE))
<                      THEN   
<                
< 
<   
<                  V_TAB_NONINHERITED_ACTION(
<                                    P_TAB_OBJPOLICY_INFO(FIRST_PASS).ACTION) 
<                                                := POLICY_INHERITED_TABLE;
<                      END IF;
< 
<                   WHEN POLICY_INHERITED_TABPART THEN
<                        IF (V_TAB_NONINHERITED_ACTION(
<                            P_TAB_OBJPOLICY_INFO(FIRST_PASS).ACTION) IN
<                          (POLICY_INHERITED_TABLESPACE, POLICY_INHERITED_TABLE))
<                        THEN   
<                
< 
<   
<                  V_TAB_NONINHERITED_ACTION(
<                                    P_TAB_OBJPOLICY_INFO(FIRST_PASS).ACTION) 
<                                                := POLICY_INHERITED_TABPART;
<                        END IF;
< 
<                   WHEN POLICY_NOT_INHERITED THEN
<                 
< 
<       
<                   V_TAB_NONINHERITED_ACTION(
<                                    P_TAB_OBJPOLICY_INFO(FIRST_PASS).ACTION) 
<                                                := POLICY_NOT_INHERITED;
<                   
<                   ELSE
<                    
<                       TRACE(ILM_DEBUG_OTHER, 'err in verify_precondition');     
<                       PRINT_OBJPOLICY_INFO(P_TAB_OBJPOLICY_INFO(FIRST_PASS),
<                                            PRINT_ALL_COL);
<                   
<                   RAISE DBMS_ILM.INTERNAL_ILM_ERROR;
<                   
<                   END CASE;
<                
---
>                               
5571,5574d5892
<                TRACE(ILM_DEBUG_OTHER, 'Policy_inherited_from : ' ||
<                V_TAB_NONINHERITED_ACTION(
<                       P_TAB_OBJPOLICY_INFO(SECOND_PASS).ACTION)); 
< 
5637,5645d5954
<               IF(P_TAB_OBJPOLICY_INFO(SECOND_PASS).INHERITED_FROM
<                               <>
<                   V_TAB_NONINHERITED_ACTION(
<                       P_TAB_OBJPOLICY_INFO(SECOND_PASS).ACTION)) THEN
<                      V_FILTER  := TRUE;
<                      P_TAB_OBJPOLICY_INFO(SECOND_PASS).JOBSCHEDULED  
<                                          := INHERITEDPOLICY_OVERRIDDEN;
<               END IF;
< 
SYS.AQ$KUPC$DATAPUMP_QUETAB_1 - VIEW (BP):
14c14,16
<                  decode(l.transaction_id, NULL, TO_DATE(NULL), l.dequeue_time),
---
>                  decode(l.transaction_id, NULL,
>                  decode(qt.deq_tid, NULL, TO_DATE(NULL),cast(FROM_TZ(qt.deq_time, '00:00')
>                  at time zone sessiontimezone as date)), l.dequeue_time),
17c19,21
<             decode(l.transaction_id, NULL, TO_TIMESTAMP(NULL), l.dequeue_time),
---
>                  decode(l.transaction_id, NULL,
>                  decode(qt.deq_tid, NULL, TO_TIMESTAMP(NULL), cast(FROM_TZ(qt.deq_time, '00:00')
>                  at time zone sessiontimezone as timestamp)), l.dequeue_time),
SYS.CDB_ILMOBJECTS - VIEW (BP):
1c1
< SELECT "POLICY_NAME","OBJECT_OWNER","OBJECT_NAME","SUBOBJECT_NAME","OBJECT_TYPE","INHERITED_FROM","ENABLED","DELETED","CON_ID" FROM CONTAINERS("SYS"."DBA_ILMOBJECTS")
---
> SELECT "POLICY_NAME","OBJECT_OWNER","OBJECT_NAME","SUBOBJECT_NAME","OBJECT_TYPE","INHERITED_FROM","TBS_INHERITED_FROM","ENABLED","DELETED","CON_ID" FROM CONTAINERS("SYS"."DBA_ILMOBJECTS")
SYS.DBA_ILMOBJECTS - VIEW (BP):
13a14
>        f.name,
27c28,29
<        sys.user$ e
---
>        sys.user$ e,
>        sys.ts$ f
32a35
>    and f.ts# (+) = a.ts#
46a50
>        g.name,
61c65,66
<        sys.redef_object$ f
---
>        sys.redef_object$ f,
>        sys.ts$ g
67a73
>    AND g.ts# (+) = a.ts#
SYS.USER_ILMOBJECTS - VIEW (BP):
13a14
>        f.name,
49c50,51
<            where priv_number = -15 /* UNLIMITED TABLESPACE */)) e
---
>            where priv_number = -15 /* UNLIMITED TABLESPACE */)) e,
>        sys.ts$ f
55a58
>    AND f.ts# (+) = a.ts#
69a73
>        g.name,
106c110,111
<          sys.redef_object$ f
---
>          sys.redef_object$ f,
>        sys.ts$ g
113a119
>    AND g.ts# (+) = a.ts#
CTXSYS.DRIPARSE - PACKAGE BODY (JAN2018RUR):

SYS.DBMS_QOPATCH - PACKAGE (RU):
2a3,6
>   -- 25425451: For intelligent bootstrap
>   build_header VARCHAR2(200) := '$Header: rdbms/admin/dbmsqopi.sql /st_rdbms_12.2.0.1.0dbbp/1 2018/05/02 15:37:00 surman Exp $';
>   FUNCTION body_build_header RETURN VARCHAR2;
> 
SYS.DBMS_SHARED_POOL - PACKAGE (RU):
75c75
<                  heaps number);
---
>                  heaps number, edition_name varchar2 DEFAULT null);
87a88,90
>   --    edition_name
>   --      This is an optional parameter. When it is specified it is used to
>   --      denote the name of the edition that the target object resides in.
116c119,120
<   procedure unkeep(schema varchar2, objname varchar2, namespace number);
---
>   procedure unkeep(schema varchar2, objname varchar2, namespace number,
>                    edition_name varchar2 DEFAULT null);
125a130,132
>   --    edition_name
>   --      This is an optional parameter. When it is specified it is used to
>   --      denote the name of the edition that the target object resides in.
153c160,161
<                   namespace number, heaps number);
---
>                   namespace number, heaps number,
>                   edition_name varchar2 DEFAULT null);
166a175,177
>   --    edition_name
>   --      This is an optional parameter. When it is specified it is used to
>   --      denote the name of the edition that the target object resides in.
185c196,197
<                     global boolean DEFAULT true);
---
>                     global boolean DEFAULT true,
>                     edition_name varchar2 DEFAULT null);
196a209,211
>   --    edition_name
>   --      This is an optional parameter. When it is specified it is used to
>   --      denote the name of the edition that the target object resides in.
215c230,231
<                       global boolean DEFAULT true);
---
>                       global boolean DEFAULT true,
>                       edition_name varchar2 DEFAULT null);
226a243,245
>   --    edition_name
>   --      This is an optional parameter. When it is specified it is used to
>   --      denote the name of the edition that the target object resides in.
SYS.DBMS_SQLPATCH - PACKAGE (RU):
2a3,6
>   -- 25425451: For intelligent bootstrap
>   build_header VARCHAR2(200) := '$Header: rdbms/admin/dbmssqlpatch.sql /st_rdbms_12.2.0.1.0dbbp/2 2018/05/02 15:37:00 surman Exp $';
>   FUNCTION body_build_header RETURN VARCHAR2;
> 
48a53,54
>   -- 25425451: Pass nothing_script and notok_components to remove the
>   -- dependency on dbms_registry
51c57,60
<                                p_debug IN BOOLEAN := FALSE);
---
>                                p_debug IN BOOLEAN := FALSE,
>                                p_nothing_sql IN VARCHAR2 := NULL,
>                                p_notok_components IN VARCHAR2 := NULL,
>                                p_attempt IN NUMBER := NULL);
SYS.DBMS_QOPATCH - PACKAGE BODY (RU):
73a74,80
> 
> FUNCTION BODY_BUILD_HEADER
>   RETURN VARCHAR2 IS
> BEGIN
>   RETURN '$Header: rdbms/src/client/tools/qpinv/prvtqopi.sql /st_rdbms_12.2.0.1.0dbbp/3 2018/05/02 15:37:07 surman Exp $';
> END BODY_BUILD_HEADER;
> 
SYS.DBMS_RCVMAN - PACKAGE BODY (APR2018RUR):
26424c26424,26425
<                 ELSIF (LISTBACKUPINMKS(LBSTATE.LBDFRECTABUS, LBREC,
---
>                 ELSIF (LBREC.FILE_TYPE <> SPFILE_TXT AND
>                        LISTBACKUPINMKS(LBSTATE.LBDFRECTABUS, LBREC,
SYS.DBMS_SHARED_POOL - PACKAGE BODY (RU):
8c8
<                       HEAPS NUMBER, KEEP BOOLEAN);
---
>                       HEAPS NUMBER, KEEP BOOLEAN, EDITION_NAME VARCHAR2);
19c19,20
<                       HASH VARCHAR2, NAMESPACE NUMBER, HEAPS NUMBER);
---
>                       HASH VARCHAR2, NAMESPACE NUMBER, HEAPS NUMBER,
>                       EDITION_NAME VARCHAR2);
23c24,25
<                    HASH VARCHAR2, NAMESPACE NUMBER, GLOBAL BOOLEAN);
---
>                    HASH VARCHAR2, NAMESPACE NUMBER, GLOBAL BOOLEAN,
>                    EDITION_NAME VARCHAR2);
27c29,30
<                      HASH VARCHAR2, NAMESPACE NUMBER, GLOBAL BOOLEAN);
---
>                      HASH VARCHAR2, NAMESPACE NUMBER, GLOBAL BOOLEAN,
>                      EDITION_NAME VARCHAR2);
88c91
<                  HEAPS NUMBER) IS
---
>                  HEAPS NUMBER, EDITION_NAME VARCHAR2) IS
90c93
<     PSDKEPNEW(SCHEMA, OBJNAME, '', NAMESPACE, HEAPS, TRUE);
---
>     PSDKEPNEW(SCHEMA, OBJNAME, '', NAMESPACE, HEAPS, TRUE, EDITION_NAME);
93c96,97
<   PROCEDURE KEEP(HASH VARCHAR2, NAMESPACE NUMBER, HEAPS NUMBER) IS
---
>   PROCEDURE KEEP(HASH VARCHAR2, NAMESPACE NUMBER, HEAPS NUMBER)
>   IS
95c99
<     PSDKEPNEW('', '', SUBSTR(HASH,1,32), NAMESPACE, HEAPS, TRUE);
---
>     PSDKEPNEW('', '', SUBSTR(HASH,1,32), NAMESPACE, HEAPS, TRUE, '');
103c107,108
<   PROCEDURE UNKEEP(SCHEMA VARCHAR2, OBJNAME VARCHAR2, NAMESPACE NUMBER) IS
---
>   PROCEDURE UNKEEP(SCHEMA VARCHAR2, OBJNAME VARCHAR2, NAMESPACE NUMBER,
>                    EDITION_NAME VARCHAR2) IS
105c110
<     PSDKEPNEW(SCHEMA, OBJNAME, '', NAMESPACE, 0, FALSE);
---
>     PSDKEPNEW(SCHEMA, OBJNAME, '', NAMESPACE, 0, FALSE, EDITION_NAME);
110c115
<     PSDKEPNEW('', '', SUBSTR(HASH,1,32), NAMESPACE, 0, FALSE);
---
>     PSDKEPNEW('', '', SUBSTR(HASH,1,32), NAMESPACE, 0, FALSE, '');
119c124
<                   HEAPS NUMBER) IS
---
>                   HEAPS NUMBER, EDITION_NAME VARCHAR2) IS
121c126
<      PSDPURNEW(SCHEMA, OBJNAME, '', NAMESPACE, HEAPS);
---
>      PSDPURNEW(SCHEMA, OBJNAME, '', NAMESPACE, HEAPS, EDITION_NAME);
126,127c131
<     PSDPURNEW('', '', SUBSTR(HASH,1,32),
<               NAMESPACE, HEAPS);
---
>     PSDPURNEW('', '', SUBSTR(HASH,1,32), NAMESPACE, HEAPS, '');
131c135
<                     GLOBAL BOOLEAN) IS
---
>                     GLOBAL BOOLEAN, EDITION_NAME VARCHAR2) IS
133c137
<     PSDHOT(SCHEMA, OBJNAME, '', NAMESPACE, GLOBAL);
---
>     PSDHOT(SCHEMA, OBJNAME, '', NAMESPACE, GLOBAL, EDITION_NAME);
138c142
<     PSDHOT('', '', SUBSTR(HASH,1,32), NAMESPACE, GLOBAL);
---
>     PSDHOT('', '', SUBSTR(HASH,1,32), NAMESPACE, GLOBAL, '');
142c146
<                       GLOBAL BOOLEAN) IS
---
>                       GLOBAL BOOLEAN, EDITION_NAME VARCHAR2) IS
144c148
<     PSDNOHOT(SCHEMA, OBJNAME, '', NAMESPACE, GLOBAL);
---
>     PSDNOHOT(SCHEMA, OBJNAME, '', NAMESPACE, GLOBAL, EDITION_NAME);
149c153
<     PSDNOHOT('', '', SUBSTR(HASH,1,32), NAMESPACE, GLOBAL);
---
>     PSDNOHOT('', '', SUBSTR(HASH,1,32), NAMESPACE, GLOBAL, '');
SYS.DBMS_SQLPATCH - PACKAGE BODY (RU):
63a64,75
>   
>   NOTOK_COMPONENTS VARCHAR2(2000);
> 
>   
> 
>   
>   PROCEDURE DEBUG_PUT_LINE(L IN VARCHAR2) IS
>   BEGIN
>     IF DEBUG THEN
>       DBMS_OUTPUT.PUT_LINE(L);
>     END IF;
>   END DEBUG_PUT_LINE;
136c148,150
<           S_APPLICATION_PATCH = L_APPLICATION_PATCH
---
>           S_APPLICATION_PATCH = L_APPLICATION_PATCH,
>           S_PATCH_DIRECTORY_ZIP = PATCH_DIRECTORY_ZIP,
>           S_NOTOK_COMPONENTS = NOTOK_COMPONENTS
179c193,194
<            S_PATCH_DIRECTORY_ZIP
---
>            S_PATCH_DIRECTORY_ZIP,
>            S_NOTOK_COMPONENTS
208c223,224
<       PATCH_DIRECTORY_ZIP
---
>       PATCH_DIRECTORY_ZIP,
>       NOTOK_COMPONENTS
223c239,242
<       NULL;
---
>      
>       IF NOTHING_SQL IS NULL THEN
>         NOTHING_SQL := '?/rdbms/admin/nothing.sql';
>       END IF;
242,249d260
<   PROCEDURE DEBUG_PUT_LINE(L IN VARCHAR2) IS
<   BEGIN
<     IF DEBUG THEN
<       DBMS_OUTPUT.PUT_LINE(L);
<     END IF;
<   END DEBUG_PUT_LINE;
< 
< 
252a264,265
> 
>     POS NUMBER;
256,269c269,271
<     IF APPLICATION_PATCH THEN
<       DEBUG_PUT_LINE('component_ok(' || COMPONENT || ') application patch, always returning TRUE');
<       RETURN TRUE;
<     END IF;
< 
<     
<     IF (COMPONENT = 'UNKNOWN') OR 
<        (DBMS_REGISTRY.IS_IN_REGISTRY(COMPONENT) AND
<         DBMS_REGISTRY.STATUS(COMPONENT) NOT IN
<           ('REMOVING', 'REMOVED', 'DOWNGRADED', 'DOWNGRADING',
<            'NO SCRIPT', 'OPTION OFF') AND
<         VERSION_TRIM(DBMS_REGISTRY.VERSION(COMPONENT)) = DATABASE_VERSION)
<     THEN
<       DEBUG_PUT_LINE('component_ok(' || COMPONENT || ') returning TRUE');
---
>     POS := INSTR( ',' || NOTOK_COMPONENTS || ',', ',' || COMPONENT || ',' );
>     IF POS = 0 THEN
>       DEBUG_PUT_LINE('component_ok pos = ' || POS || ', returning TRUE');
272c274
<       DEBUG_PUT_LINE('component_ok(' || COMPONENT || ') returning FALSE');
---
>       DEBUG_PUT_LINE('component_ok pos = ' || POS || ', returning FALSE');
279a282,288
>   FUNCTION BODY_BUILD_HEADER
>     RETURN VARCHAR2 IS
>   BEGIN
>     RETURN '$Header: rdbms/src/server/dict/plsicds/prvtsqlpatch.sql /st_rdbms_12.2.0.1.0dbbp/3 2018/05/02 15:37:07 surman Exp $';
>   END BODY_BUILD_HEADER;
> 
>   
484,496c493,526
<         SELECT BUNDLE_DATA
<           INTO BUNDLEDATA
<           FROM (SELECT BUNDLE_DATA,
<                        RANK() OVER (PARTITION BY PATCH_ID, PATCH_UID
<                                     ORDER BY ACTION_TIME DESC) R
<                   FROM DBA_REGISTRY_SQLPATCH
<                     WHERE VERSION =
<                      (SELECT SUBSTR(VERSION, 1, INSTR(VERSION, '.', 1, 4) - 1)
<                         FROM V$INSTANCE)
<                     AND PATCH_ID = CURRENT_PATCH.PATCH_ID 
<                     AND PATCH_UID = CURRENT_PATCH.PATCH_UID
<                     AND ACTION = 'APPLY')
<           WHERE R = 1;
---
>         BEGIN
>           SELECT BUNDLE_DATA
>             INTO BUNDLEDATA
>             FROM (SELECT BUNDLE_DATA,
>                          RANK() OVER (PARTITION BY PATCH_ID, PATCH_UID
>                                       ORDER BY ACTION_TIME DESC) R
>                     FROM DBA_REGISTRY_SQLPATCH
>                       WHERE VERSION =
>                        (SELECT SUBSTR(VERSION, 1, INSTR(VERSION, '.', 1, 4) - 1)
>                           FROM V$INSTANCE)
>                       AND PATCH_ID = CURRENT_PATCH.PATCH_ID 
>                       AND PATCH_UID = CURRENT_PATCH.PATCH_UID
>                       AND ACTION = 'APPLY')
>             WHERE R = 1;
>         EXCEPTION
>           WHEN NO_DATA_FOUND THEN
>             
>             
>             
>             
>             SELECT BUNDLE_DATA
>               INTO BUNDLEDATA
>               FROM (SELECT BUNDLE_DATA, BUNDLE_SERIES, BUNDLE_ID,
>                            RANK() OVER (PARTITION BY BUNDLE_SERIES
>                                         ORDER BY ACTION_TIME DESC) R
>                       FROM DBA_REGISTRY_SQLPATCH
>                         WHERE VERSION =
>                          (SELECT SUBSTR(VERSION, 1, INSTR(VERSION, '.', 1, 4) - 1)
>                             FROM V$INSTANCE)
>                         AND BUNDLE_SERIES = CURRENT_PATCH.BUNDLE_SERIES
>                         AND BUNDLE_ID >= INSTALLED_BUNDLE
>                         AND ACTION = 'APPLY')
>               WHERE R = 1;
>         END;
583c613,615
<     DELETE DBMS_SQLPATCH_STATE
---
>     
>     UPDATE DBMS_SQLPATCH_STATE
>       SET ACTIVE = 'N'
641a674,682
>     
>     IF SQL_FILE = 'rdbms/admin/dbmssqlpatch.sql' OR
>        SQL_FILE = 'rdbms/admin/prvtsqlpatch.plb' OR
>        SQL_FILE = 'rdbms/admin/dbmsqopi.sql' OR
>        SQL_FILE = 'rdbms/admin/prvtqopi.plb' THEN
>       DEBUG_PUT_LINE(SQL_FILE || ': infrastructure file, never install');
>       RETURN NOTHING_SQL;
>     END IF;
> 
736a778
>           
758a801,804
>                 AND BUNDLE_ID <= (CASE CURRENT_PATCH.ACTION
>                                     WHEN 'ROLLBACK' THEN INSTALLED_BUNDLE
>                                     ELSE BUNDLE_ID
>                                   END)
927a974,976
>   
>   
>   
930c979,982
<                                P_DEBUG IN BOOLEAN := FALSE) IS
---
>                                P_DEBUG IN BOOLEAN := FALSE,
>                                P_NOTHING_SQL IN VARCHAR2 := NULL,
>                                P_NOTOK_COMPONENTS IN VARCHAR2 := NULL,
>                                P_ATTEMPT IN NUMBER := NULL) IS
936,938c988,1006
<     SELECT NVL(MAX(INSTALL_ID), 0) + 1
<       INTO SESSION_INSTALL_ID
<       FROM DBA_REGISTRY_SQLPATCH;
---
>     IF P_NOTHING_SQL IS NOT NULL THEN
>       NOTHING_SQL := P_NOTHING_SQL;
>     ELSE
>       NOTHING_SQL := '?/rdbms/admin/nothing.sql';
>     END IF;
> 
>     NOTOK_COMPONENTS := P_NOTOK_COMPONENTS;
> 
>     IF P_ATTEMPT = 1 THEN
>       
>       SELECT NVL(MAX(INSTALL_ID), 0) + 1
>         INTO SESSION_INSTALL_ID
>         FROM DBA_REGISTRY_SQLPATCH;
>     ELSE
>       
>       SELECT NVL(MAX(INSTALL_ID), 1)
>         INTO SESSION_INSTALL_ID
>         FROM DBA_REGISTRY_SQLPATCH;
>     END IF;
1006,1011d1073
<   DBMS_REGISTRY.SET_SESSION_NAMESPACE('SERVER');
< 
<   
<   NOTHING_SQL := DBMS_REGISTRY.NOTHING_SCRIPT;
< 
<   
SYS.DBMS_WORKLOAD_REPLAY - PACKAGE BODY (RU):
6749,6753c6749,6755
<         USING (SELECT DISTINCT OBJECT_ID AS OID
<                FROM WRR$_CAPTURE_FILE_DETAILS
<                WHERE OBJECT_ID NOT IN (SELECT OBJECT_ID
<                                        FROM WRR$_CAPTURE_FILE_DETAILS
<                                        WHERE ACTION_CODE <> 'R'))
---
>       USING ( SELECT OBJECT_ID AS OID
>               FROM WRR$_CAPTURE_FILE_DETAILS
>               WHERE ACTION_CODE = 'R'
>                 MINUS
>               SELECT OBJECT_ID AS OID
>               FROM WRR$_CAPTURE_FILE_DETAILS
>               WHERE ACTION_CODE <> 'R' )
SYS.DBMS_WRR_INTERNAL - PACKAGE BODY (RU):
5263,5265c5263
<   BEGIN
<     RETURN SYS_CONTEXT('USERENV', 'CDB_NAME') IS NOT NULL;
<   END IS_CONSOLIDATED_DATABASE;
---
>   BEGIN  RETURN (SYS_CONTEXT('USERENV', 'CON_ID') > 0);  END;
5272,5278c5270
<   BEGIN
<     IF NOT IS_CONSOLIDATED_DATABASE() THEN
<       RETURN FALSE;
<     END IF;
<  
<     RETURN SYS_CONTEXT('USERENV', 'CON_NAME') = 'CDB$ROOT';
<   END IS_CONTAINER_CDBROOT;
---
>   BEGIN  RETURN (SYS_CONTEXT('USERENV', 'CON_ID') = 1);  END;
5285,5291c5277
<   BEGIN
<     IF NOT IS_CONSOLIDATED_DATABASE() OR IS_CONTAINER_CDBROOT() THEN
<       RETURN FALSE;
<     END IF;
< 
<     RETURN TRUE;
<   END IS_CONTAINER_PDB;
---
>   BEGIN  RETURN (SYS_CONTEXT('USERENV', 'CON_ID') > 1);  END;
SYS.DBMS_XSTREAM_ADM_INTERNAL - PACKAGE BODY (APR2018RUR):
445c445
<         END IF;
---
>       END IF;
496c496
<       INCREMENT := INCREMENT + 1;      
---
>       INCREMENT := INCREMENT + 1;
583c583
<       END IF;
---
>     END IF;
2727c2727
< 
---
>     
3310c3310
<     HAS_ROLE            NUMBER := 0;
---
>     HAS_ROLE        NUMBER := 0;
3433c3433
< 
---
>       
3484c3484
<  
---
> 
SYS.DBMS_XSTREAM_ADM_UTL - PACKAGE BODY (APR2018RUR):
687c687
<                SCN     OCINUMBER,  SCN INDICATOR SB2,
---
>                SCN OCINUMBER, SCN INDICATOR SB2,
689,690c689,690
<                POS     OCIRAW,     POS  INDICATOR SB2,
<                POS     MAXLEN SB4, POS LENGTH SB4)
---
>                POS OCIRAW, POS  INDICATOR SB2,
>                POS MAXLEN SB4, POS LENGTH SB4)
1526c1526
<       DBMS_XSTREAM_ADM_UTL.CONVERT_SCN_TO_POS(PROCESSED_LWM_SCN,
---
>       DBMS_XSTREAM_ADM_UTL.CONVERT_SCN_TO_POS(PROCESSED_LWM_SCN, 
SYS.DBMS_XSTREAM_AUTH_IVK - PACKAGE BODY (APR2018RUR):
792c792
<     INCREMENT := INCREMENT + 1;     
---
>     INCREMENT := INCREMENT + 1; 
908c908
<     END IF;    
---
>     END IF;
SYS.DBMS_XSTREAM_GG_INTERNAL - PACKAGE BODY (APR2018RUR):
77a78
>       PRBA NUMBER := RBA;
87c88
<           SEQ# = SEQNO AND RBA = RBA AND INDEX# = INDEX_NUM;
---
>           SEQ# = SEQNO AND RBA = PRBA AND INDEX# = INDEX_NUM;
91c92
<           SEQ# = SEQNO AND RBA = RBA AND INDEX# = INDEX_NUM;
---
>           SEQ# = SEQNO AND RBA = PRBA AND INDEX# = INDEX_NUM;
SYS.DBMS_XSTREAM_UTL_IVK - PACKAGE BODY (APR2018RUR):
1438c1438
<       ' queue=' || QUEUE_NAME || ' src_db=' || SOURCE_DATABASE || 
---
>       ' queue=' || QUEUE_NAME || ' src_db=' || SOURCE_DATABASE ||
2908c2908
<         END IF;
---
>       END IF; 
SYS.LOGMNR_DICT_CACHE - PACKAGE BODY (RU):
11850c11850
<         FOR CUR2 IN REVERSE CUR..1
---
>         FOR CUR2 IN REVERSE 1..CUR
SYS.PRVT_ADVISOR - PACKAGE BODY (RU):
2162c2162
<    
---
> 
2171c2171
<     
---
> 
2185c2185
<     EXECUTE IMMEDIATE SUBST_QRY USING  EXECUTION_NAME, TASK_ID_NUM, 
---
>     EXECUTE IMMEDIATE SUBST_QRY USING  TASK_ID_NUM, EXECUTION_NAME,  
2195c2195
<     
---
> 
2203c2203
<     
---
>        
2220,2221c2220,2221
<     
<     
---
> 
>         
SYS.WRI$_ADV_SQLTUNE - TYPE BODY (RU):
247c247
< 
---
>     
256c256
<              'WHERE task_id = :tid AND exec_name = :execution_name';
---
>                  ' WHERE task_id = :tid AND exec_name = :execution_name';
260c260
<    
---
>       
SYS.CDB_REGISTRY_SQLPATCH - VIEW (RU):
1c1
< SELECT k."PATCH_ID",k."PATCH_UID",k."VERSION",k."FLAGS",k."ACTION",k."STATUS",k."INSTALL_ID",k."ACTION_TIME",k."DESCRIPTION",k."BUNDLE_SERIES",k."BUNDLE_ID",k."PATCH_DIRECTORY",k."LOGFILE",k."CON_ID", k.CON$NAME, k.CDB$NAME FROM CONTAINERS("SYS"."DBA_REGISTRY_SQLPATCH") k
---
> SELECT k."PATCH_ID",k."PATCH_UID",k."VERSION",k."FLAGS",k."ACTION",k."STATUS",k."INSTALL_ID",k."ACTION_TIME",k."DESCRIPTION",k."BUNDLE_SERIES",k."BUNDLE_ID",k."PATCH_DIRECTORY",k."POST_LOGFILE",k."LOGFILE",k."CON_ID", k.CON$NAME, k.CDB$NAME FROM CONTAINERS("SYS"."DBA_REGISTRY_SQLPATCH") k
SYS.DBA_REGISTRY_SQLPATCH - VIEW (RU):
1,4c1,5
< SELECT patch_id, patch_uid, version, flags, action, status, install_id,
<          action_time, description, bundle_series, bundle_id,
<          bundle_data, patch_descriptor, patch_directory, logfile
<     FROM registry$sqlpatch
---
> SELECT patch_id, patch_uid, version, flags, action, status,
>              install_id, action_time, description, bundle_series,
>              bundle_id, bundle_data, patch_descriptor, patch_directory,
>              post_logfile, logfile
>            FROM registry$sqlpatch
AUDSYS.DBMS_AUDIT_MGMT - PACKAGE BODY (RU):
23,25c23,27
<   CALLER_RESTORE  CONSTANT PLS_INTEGER := 1;
<   CALLER_MOVE     CONSTANT PLS_INTEGER := 2;
<   CALLER_TBS_CHK  CONSTANT PLS_INTEGER := 3;
---
>   CALLER_RESTORE           CONSTANT PLS_INTEGER := 1;
>   CALLER_MOVE              CONSTANT PLS_INTEGER := 2;
>   CALLER_TBS_CHK           CONSTANT PLS_INTEGER := 3;
>   MAX_TBS_LENGTH           CONSTANT PLS_INTEGER := 32;
>   MAX_PURGE_JOB_INTERVAL   CONSTANT PLS_INTEGER := 1000;
98a101,104
>   FUNCTION IS_VALID_AUDIT_TRAIL
>           (AUDIT_TRAIL_TYPE           IN PLS_INTEGER)
>   RETURN   BOOLEAN;
> 
1270c1276
<     'dba_tab_partitions where table_owner = ''AUDSYS'' and ' ||
---
>     'sys.dba_tab_partitions where table_owner = ''AUDSYS'' and ' ||
1294c1300
<     'dba_tab_partitions where table_owner = ''AUDSYS'' and ' ||
---
>     'sys.dba_tab_partitions where table_owner = ''AUDSYS'' and ' ||
1485c1491,1492
<     M_NEW_JOB_NAME     DBMS_ID;
---
>     M_NEW_JOB_NAME     DBMS_QUOTED_ID;
>     M_NEW_JOB_CAN_NAME DBMS_QUOTED_ID;
1491,1492c1498,1499
<        LENGTH(AUDIT_TRAIL_PURGE_NAME) = 0 OR
<        LENGTH(AUDIT_TRAIL_PURGE_NAME) > 128
---
>        LENGTHB(AUDIT_TRAIL_PURGE_NAME) = 0 OR
>        LENGTHB(AUDIT_TRAIL_PURGE_NAME) > ORA_MAX_NAME_LEN+2
1498c1505,1508
<       M_NEW_JOB_NAME := DBMS_ASSERT.SIMPLE_SQL_NAME(AUDIT_TRAIL_PURGE_NAME);
---
>       
>      M_NEW_JOB_NAME := SYS.DBMS_ASSERT.SIMPLE_SQL_NAME(AUDIT_TRAIL_PURGE_NAME);
>      SYS.DBMS_UTILITY.CANONICALIZE(M_NEW_JOB_NAME, M_NEW_JOB_CAN_NAME, 
>                                    ORA_MAX_NAME_LEN+2);
1511c1521
<     JOB_NAME = NLS_UPPER(M_NEW_JOB_NAME);
---
>     JOB_NAME = M_NEW_JOB_CAN_NAME;
1520c1530
<         DBMS_SCHEDULER.ENABLE(M_NEW_JOB_NAME);       
---
>         SYS.DBMS_SCHEDULER.ENABLE(M_NEW_JOB_NAME);       
1522c1532
<         WHERE JOB_NAME = NLS_UPPER(M_NEW_JOB_NAME);
---
>         WHERE JOB_NAME = M_NEW_JOB_CAN_NAME;
1528c1538
<         DBMS_SCHEDULER.DISABLE(M_NEW_JOB_NAME);
---
>         SYS.DBMS_SCHEDULER.DISABLE(M_NEW_JOB_NAME);
1530c1540
<         WHERE JOB_NAME = NLS_UPPER(M_NEW_JOB_NAME);
---
>         WHERE JOB_NAME = M_NEW_JOB_CAN_NAME;
1555,1557c1565,1568
<     M_INTERVAL      VARCHAR2(200);
<     M_JOBS          NUMBER;
<     M_NEW_JOB_NAME  DBMS_ID;
---
>     M_INTERVAL          VARCHAR2(200);
>     M_JOBS              NUMBER;
>     M_NEW_JOB_NAME      DBMS_QUOTED_ID;
>     M_NEW_JOB_CAN_NAME  DBMS_QUOTED_ID;
1563,1564c1574,1575
<        LENGTH(AUDIT_TRAIL_PURGE_NAME) = 0 OR
<        LENGTH(AUDIT_TRAIL_PURGE_NAME) > 128
---
>        LENGTHB(AUDIT_TRAIL_PURGE_NAME) = 0 OR
>        LENGTHB(AUDIT_TRAIL_PURGE_NAME) > ORA_MAX_NAME_LEN+2
1570c1581,1584
<       M_NEW_JOB_NAME := DBMS_ASSERT.SIMPLE_SQL_NAME(AUDIT_TRAIL_PURGE_NAME);
---
>       
>      M_NEW_JOB_NAME := SYS.DBMS_ASSERT.SIMPLE_SQL_NAME(AUDIT_TRAIL_PURGE_NAME);
>      SYS.DBMS_UTILITY.CANONICALIZE(M_NEW_JOB_NAME, M_NEW_JOB_CAN_NAME,
>                                    ORA_MAX_NAME_LEN+2);
1577c1591
<        AUDIT_TRAIL_INTERVAL_VALUE >= 1000
---
>        AUDIT_TRAIL_INTERVAL_VALUE >= MAX_PURGE_JOB_INTERVAL 
1583c1597
<     JOB_NAME = NLS_UPPER(M_NEW_JOB_NAME);
---
>     JOB_NAME = M_NEW_JOB_CAN_NAME;
1591,1592c1605,1606
<     DBMS_SCHEDULER.SET_ATTRIBUTE(M_NEW_JOB_NAME, 'REPEAT_INTERVAL',
<                                  M_INTERVAL);
---
>     SYS.DBMS_SCHEDULER.SET_ATTRIBUTE(M_NEW_JOB_NAME, 'REPEAT_INTERVAL',
>                                      M_INTERVAL);
1596,1597c1610,1611
<         JOB_FREQUENCY = M_INTERVAL
<     WHERE JOB_NAME = NLS_UPPER(M_NEW_JOB_NAME);
---
>     JOB_FREQUENCY = M_INTERVAL
>     WHERE JOB_NAME = M_NEW_JOB_CAN_NAME;
1615c1629,1630
<     M_NEW_JOB_NAME     DBMS_ID;
---
>     M_NEW_JOB_NAME     DBMS_QUOTED_ID;
>     M_NEW_JOB_CAN_NAME DBMS_QUOTED_ID;
1621,1622c1636,1637
<        LENGTH(AUDIT_TRAIL_PURGE_NAME) = 0 OR
<        LENGTH(AUDIT_TRAIL_PURGE_NAME) > 128
---
>        LENGTHB(AUDIT_TRAIL_PURGE_NAME) = 0 OR
>        LENGTHB(AUDIT_TRAIL_PURGE_NAME) > ORA_MAX_NAME_LEN+2 
1628c1643,1646
<       M_NEW_JOB_NAME := DBMS_ASSERT.SIMPLE_SQL_NAME(AUDIT_TRAIL_PURGE_NAME);
---
>       
>      M_NEW_JOB_NAME := SYS.DBMS_ASSERT.SIMPLE_SQL_NAME(AUDIT_TRAIL_PURGE_NAME);
>      SYS.DBMS_UTILITY.CANONICALIZE(M_NEW_JOB_NAME, M_NEW_JOB_CAN_NAME,
>                                    ORA_MAX_NAME_LEN+2);
1635c1653
<     JOB_NAME = NLS_UPPER(M_NEW_JOB_NAME);
---
>     JOB_NAME = M_NEW_JOB_CAN_NAME;
1641c1659
<     DBMS_SCHEDULER.DROP_JOB(M_NEW_JOB_NAME);
---
>     SYS.DBMS_SCHEDULER.DROP_JOB(M_NEW_JOB_NAME);
1644c1662
<     WHERE JOB_NAME = NLS_UPPER(M_NEW_JOB_NAME);
---
>     WHERE JOB_NAME = M_NEW_JOB_CAN_NAME;
2156a2175,2201
>   
> 
>   
>   
>   
>   
>   FUNCTION IS_VALID_AUDIT_TRAIL
>            (AUDIT_TRAIL_TYPE                   IN PLS_INTEGER)
>   RETURN   BOOLEAN
>   IS
>   
>   BEGIN
>     IF AUDIT_TRAIL_TYPE = AUDIT_TRAIL_AUD_STD OR
>        AUDIT_TRAIL_TYPE = AUDIT_TRAIL_FGA_STD OR
>        AUDIT_TRAIL_TYPE = AUDIT_TRAIL_DB_STD OR
>        AUDIT_TRAIL_TYPE = AUDIT_TRAIL_OS OR
>        AUDIT_TRAIL_TYPE = AUDIT_TRAIL_XML OR
>        AUDIT_TRAIL_TYPE = AUDIT_TRAIL_FILES OR
>        AUDIT_TRAIL_TYPE = AUDIT_TRAIL_ALL THEN
>       RETURN TRUE;
>  
>     ELSE
>       RETURN FALSE;
> 
>     END IF;
>     
>   END;
2172c2217
<     M_TBSPACE        DBMS_ID;
---
>     M_TBSPACE        DBMS_QUOTED_ID;
2188,2192c2233,2237
<     M_TBS_TEMP       DBMS_ID;
<     M_AUD_CURTBS     DBMS_ID;
<     M_FGA_CURTBS     DBMS_ID;
<     M_AUD_DSTTBS     DBMS_ID;
<     M_FGA_DSTTBS     DBMS_ID;
---
>     M_TBS_TEMP       DBMS_QUOTED_ID;
>     M_AUD_CURTBS     DBMS_QUOTED_ID;
>     M_FGA_CURTBS     DBMS_QUOTED_ID;
>     M_AUD_DSTTBS     DBMS_QUOTED_ID;
>     M_FGA_DSTTBS     DBMS_QUOTED_ID;
2194a2240,2245
>     M_PLSQL_BLOCK    VARCHAR2(120);
>     M_PLSQL_BLOCK2   VARCHAR2(100);
>     AUDIT_TYPE       NUMBER;
>     TABLE_NAME       VARCHAR2(20);
>     OWNER_NAME       VARCHAR2(20);
>     PARAM_ID         NUMBER;
2198,2199c2249
<     IF AUDIT_TRAIL_TYPE < AUDIT_TRAIL_AUD_STD OR
<        AUDIT_TRAIL_TYPE > AUDIT_TRAIL_ALL THEN
---
>     IF IS_VALID_AUDIT_TRAIL(AUDIT_TRAIL_TYPE) = FALSE THEN
2227,2231c2277,2282
<       SELECT STRING_VALUE INTO M_TEMP_VCHAR FROM SYS.DAM_CONFIG_PARAM$
<       WHERE PARAM_ID = DB_AUDIT_TABLEPSACE
<             AND AUDIT_TRAIL_TYPE# = AUDIT_TRAIL_AUD_STD;
<       M_AUD_DSTTBS := DBMS_ASSERT.SIMPLE_SQL_NAME(M_TEMP_VCHAR);
<       M_AUD_DSTTBS := NLS_UPPER(M_AUD_DSTTBS);
---
>       
>       AUDIT_TYPE := AUDIT_TRAIL_AUD_STD;
>       PARAM_ID   := DB_AUDIT_TABLEPSACE;
>       M_PLSQL_BLOCK := 'SELECT STRING_VALUE FROM SYS.DAM_CONFIG_PARAM$ ' ||
>                         'WHERE PARAM_ID = :param_id ' ||
>                         'AND AUDIT_TRAIL_TYPE# = :audit_type';
2232a2284,2286
>       EXECUTE IMMEDIATE M_PLSQL_BLOCK INTO M_AUD_DSTTBS USING PARAM_ID, 
>                         AUDIT_TYPE;
>       
2235,2251c2289,2310
<       SELECT TABLESPACE_NAME INTO M_TBS_TEMP FROM DBA_TABLES WHERE
<       TABLE_NAME='AUD$' AND OWNER=AUDIT_SCHEMA;
<       M_AUD_CURTBS := DBMS_ASSERT.SIMPLE_SQL_NAME(M_TBS_TEMP);
<       M_AUD_CURTBS := NLS_UPPER(M_AUD_CURTBS);
<   
<       
<       SELECT STRING_VALUE INTO M_TEMP_VCHAR FROM SYS.DAM_CONFIG_PARAM$
<       WHERE PARAM_ID = DB_AUDIT_TABLEPSACE
<             AND AUDIT_TRAIL_TYPE# = AUDIT_TRAIL_FGA_STD;
<       M_FGA_DSTTBS := DBMS_ASSERT.SIMPLE_SQL_NAME(M_TEMP_VCHAR);
<       M_FGA_DSTTBS := NLS_UPPER(M_FGA_DSTTBS);
< 
<       
<       SELECT TABLESPACE_NAME INTO M_TBS_TEMP FROM DBA_TABLES WHERE
<       TABLE_NAME='FGA_LOG$' AND OWNER='SYS';
<       M_FGA_CURTBS := DBMS_ASSERT.SIMPLE_SQL_NAME(M_TBS_TEMP);
<       M_FGA_CURTBS := NLS_UPPER(M_FGA_CURTBS);
---
>       OWNER_NAME := AUDIT_SCHEMA;
>       TABLE_NAME := 'AUD$';
>       M_PLSQL_BLOCK2 := 'SELECT TABLESPACE_NAME FROM sys.dba_tables where '||
>                          'TABLE_NAME= :table_name  AND OWNER = :owner_name';
> 
>       EXECUTE IMMEDIATE M_PLSQL_BLOCK2 INTO M_AUD_CURTBS USING TABLE_NAME,
>                         OWNER_NAME;
>       
>       
>       PARAM_ID   := DB_AUDIT_TABLEPSACE;
>       AUDIT_TYPE := AUDIT_TRAIL_FGA_STD;
> 
>       EXECUTE IMMEDIATE M_PLSQL_BLOCK INTO M_FGA_DSTTBS USING PARAM_ID, 
>                         AUDIT_TYPE;
> 
>       
>       OWNER_NAME := 'SYS';
>       TABLE_NAME := 'FGA_LOG$';
> 
>       EXECUTE IMMEDIATE M_PLSQL_BLOCK2 INTO M_FGA_CURTBS USING TABLE_NAME,
>                         OWNER_NAME;
>     
2353c2412
<           SELECT STATUS INTO M_TBS_STATUS FROM DBA_TABLESPACES 
---
>           SELECT STATUS INTO M_TBS_STATUS FROM SYS.DBA_TABLESPACES 
2468c2527
<           SELECT STATUS INTO M_TBS_STATUS FROM DBA_TABLESPACES 
---
>           SELECT STATUS INTO M_TBS_STATUS FROM SYS.DBA_TABLESPACES 
2609,2611c2668,2670
<     M_TBSPACE        DBMS_ID;
<     M_TBS_CUR        DBMS_ID;
<     M_TBS_TEMP       DBMS_ID;
---
>     M_TBSPACE        DBMS_QUOTED_ID;
>     M_TBS_CUR        DBMS_QUOTED_ID;
>     M_TBS_TEMP       DBMS_QUOTED_ID;
2620a2680,2685
>     M_PLSQL_BLOCK    VARCHAR2(120);
>     M_PLSQL_BLOCK2   VARCHAR2(100);
>     AUDIT_TYPE       NUMBER;
>     TABLE_NAME       VARCHAR2(20);
>     OWNER_NAME       VARCHAR2(20);
>     PARAM_ID         NUMBER;
2627,2628c2692
<     IF AUDIT_TRAIL_TYPE < AUDIT_TRAIL_AUD_STD OR
<        AUDIT_TRAIL_TYPE > AUDIT_TRAIL_ALL THEN
---
>     IF IS_VALID_AUDIT_TRAIL(AUDIT_TRAIL_TYPE) = FALSE THEN
2728a2793,2801
>         
>         PARAM_ID   := DB_AUDIT_TABLEPSACE;
>         AUDIT_TYPE := AUDIT_TRAIL_AUD_STD;
>         M_PLSQL_BLOCK := 'SELECT STRING_VALUE FROM SYS.DAM_CONFIG_PARAM$ ' ||
>                           'WHERE PARAM_ID = :param_id ' ||
>                           'AND AUDIT_TRAIL_TYPE# = :audit_type';
> 
>         EXECUTE IMMEDIATE M_PLSQL_BLOCK INTO M_TBSPACE USING PARAM_ID, 
>                           AUDIT_TYPE; 
2730,2736c2803
<         SELECT STRING_VALUE INTO M_TBS_TEMP FROM SYS.DAM_CONFIG_PARAM$
<         WHERE PARAM_ID = DB_AUDIT_TABLEPSACE
<               AND AUDIT_TRAIL_TYPE# = AUDIT_TRAIL_AUD_STD;
<         M_TBSPACE := SYS.DBMS_ASSERT.SIMPLE_SQL_NAME(M_TBS_TEMP);
<         M_TBSPACE := NLS_UPPER(M_TBSPACE);
<   
<         SELECT U.USERNAME INTO M_TBSCHEMA FROM SYS.OBJ$ O, DBA_USERS U
---
>         SELECT U.USERNAME INTO M_TBSCHEMA FROM SYS.OBJ$ O, SYS.DBA_USERS U
2744c2811
<           SELECT STATUS INTO M_TBS_STATUS FROM DBA_TABLESPACES 
---
>           SELECT STATUS INTO M_TBS_STATUS FROM SYS.DBA_TABLESPACES 
2758,2762c2825,2831
<         SELECT TABLESPACE_NAME INTO M_TBS_TEMP FROM DBA_TABLES WHERE
<         TABLE_NAME='AUD$' AND OWNER=AUDIT_SCHEMA;
<         M_TBS_CUR := DBMS_ASSERT.SIMPLE_SQL_NAME(M_TBS_TEMP);
<         M_TBS_CUR := NLS_UPPER(M_TBS_CUR);
<   
---
>         
>         OWNER_NAME := AUDIT_SCHEMA;
>         M_PLSQL_BLOCK2 := 'SELECT TABLESPACE_NAME FROM sys.dba_tables where '||
>                            'TABLE_NAME= ''AUD$''  AND OWNER = :owner_name';
>  
>         EXECUTE IMMEDIATE M_PLSQL_BLOCK2 INTO M_TBS_CUR USING OWNER_NAME;
>  
2823,2827c2892,2898
<         SELECT STRING_VALUE INTO M_TBS_TEMP FROM SYS.DAM_CONFIG_PARAM$
<         WHERE PARAM_ID = DB_AUDIT_TABLEPSACE
<               AND AUDIT_TRAIL_TYPE# = AUDIT_TRAIL_FGA_STD;
<         M_TBSPACE := DBMS_ASSERT.SIMPLE_SQL_NAME(M_TBS_TEMP);
<         M_TBSPACE := NLS_UPPER(M_TBSPACE);
---
>         AUDIT_TYPE := AUDIT_TRAIL_FGA_STD;
>         PARAM_ID   := DB_AUDIT_TABLEPSACE;
>         M_PLSQL_BLOCK := 'SELECT STRING_VALUE FROM SYS.DAM_CONFIG_PARAM$ ' ||
>                           'WHERE PARAM_ID = :param_id ' ||
>                           'AND AUDIT_TRAIL_TYPE# = :audit_type';
>         EXECUTE IMMEDIATE M_PLSQL_BLOCK INTO M_TBSPACE USING PARAM_ID, 
>                           AUDIT_TYPE;
2832c2903
<           SELECT STATUS INTO M_TBS_STATUS FROM DBA_TABLESPACES 
---
>           SELECT STATUS INTO M_TBS_STATUS FROM SYS.DBA_TABLESPACES 
2845,2849c2916,2919
<         SELECT TABLESPACE_NAME INTO M_TBS_TEMP FROM DBA_TABLES WHERE
<         TABLE_NAME='FGA_LOG$' AND OWNER='SYS';
<         M_TBS_CUR := DBMS_ASSERT.SIMPLE_SQL_NAME(M_TBS_TEMP);
<         M_TBS_CUR := NLS_UPPER(M_TBS_CUR);
<   
---
>         M_PLSQL_BLOCK2 := 'SELECT TABLESPACE_NAME FROM sys.dba_tables where '||
>                            'TABLE_NAME= ''FGA_LOG$''  AND OWNER = ''SYS''';
>         EXECUTE IMMEDIATE M_PLSQL_BLOCK2 INTO M_TBS_CUR;  
> 
2951c3021,3022
<     M_TBS_NAME       DBMS_ID;
---
>     M_TBS_NAME       DBMS_QUOTED_ID;
>     M_TBS_CANON_NAME DBMS_QUOTED_ID;
2958,2959c3029,3030
<     M_AUD_CURTBS     DBMS_ID;
<     M_FGA_CURTBS     DBMS_ID;
---
>     M_AUD_CURTBS     DBMS_QUOTED_ID;
>     M_FGA_CURTBS     DBMS_QUOTED_ID;
2963a3035,3037
>     M_PLSQL_BLOCK    VARCHAR2(100);
>     TABLE_NAME       VARCHAR2(20);
>     OWNER_NAME       VARCHAR2(20);
2975,2976c3049,3051
<     IF AUDIT_TRAIL_TYPE < AUDIT_TRAIL_AUD_STD OR
<        AUDIT_TRAIL_TYPE > AUDIT_TRAIL_DB_STD
---
>     IF AUDIT_TRAIL_TYPE = AUDIT_TRAIL_AUD_STD OR
>        AUDIT_TRAIL_TYPE = AUDIT_TRAIL_FGA_STD OR
>        AUDIT_TRAIL_TYPE = AUDIT_TRAIL_DB_STD
2977a3053,3054
>        NULL;
>     ELSE
2983,2984c3060,3061
<        LENGTH(AUDIT_TRAIL_LOCATION_VALUE) = 0 OR
<        LENGTH(AUDIT_TRAIL_LOCATION_VALUE) > 30
---
>        LENGTHB(AUDIT_TRAIL_LOCATION_VALUE) = 0 OR
>        LENGTHB(AUDIT_TRAIL_LOCATION_VALUE) > MAX_TBS_LENGTH
2992,2993c3069,3072
<       M_TBS_NAME := DBMS_ASSERT.SIMPLE_SQL_NAME(AUDIT_TRAIL_LOCATION_VALUE);
<       M_TBS_NAME := NLS_UPPER(M_TBS_NAME);
---
>       
>      M_TBS_NAME := SYS.DBMS_ASSERT.SIMPLE_SQL_NAME(AUDIT_TRAIL_LOCATION_VALUE);
>      SYS.DBMS_UTILITY.CANONICALIZE(M_TBS_NAME, M_TBS_CANON_NAME, 
>                                    MAX_TBS_LENGTH);
3002,3005c3081,3087
<     SELECT TABLESPACE_NAME INTO M_TBS_TEMP FROM DBA_TABLES WHERE
<     TABLE_NAME='AUD$' AND OWNER=AUDIT_SCHEMA;
<     M_AUD_CURTBS := DBMS_ASSERT.SIMPLE_SQL_NAME(M_TBS_TEMP);
<     M_AUD_CURTBS := NLS_UPPER(M_AUD_CURTBS);
---
>     OWNER_NAME := AUDIT_SCHEMA;
>     TABLE_NAME := 'AUD$';
>     M_PLSQL_BLOCK := 'SELECT TABLESPACE_NAME FROM sys.dba_tables where '||
>                       'TABLE_NAME= :table_name  AND OWNER = :owner_name';
> 
>     EXECUTE IMMEDIATE M_PLSQL_BLOCK INTO M_AUD_CURTBS USING TABLE_NAME, 
>                       OWNER_NAME; 
3008,3011c3090,3094
<     SELECT TABLESPACE_NAME INTO M_TBS_TEMP FROM DBA_TABLES WHERE
<     TABLE_NAME='FGA_LOG$' AND OWNER='SYS';
<     M_FGA_CURTBS := DBMS_ASSERT.SIMPLE_SQL_NAME(M_TBS_TEMP);
<     M_FGA_CURTBS := NLS_UPPER(M_FGA_CURTBS);
---
>     OWNER_NAME := 'SYS';
>     TABLE_NAME := 'FGA_LOG$';
>      
>     EXECUTE IMMEDIATE M_PLSQL_BLOCK INTO M_FGA_CURTBS USING TABLE_NAME, 
>                       OWNER_NAME;
3016,3017c3099,3100
<       SELECT STATUS INTO M_TBS_STATUS FROM DBA_TABLESPACES
<       WHERE TABLESPACE_NAME = M_TBS_NAME;
---
>       SELECT STATUS INTO M_TBS_STATUS FROM SYS.DBA_TABLESPACES
>       WHERE TABLESPACE_NAME = M_TBS_CANON_NAME;
3021c3104
<         RAISE_ORA_ERROR(46262, M_TBS_NAME);
---
>         RAISE_ORA_ERROR(46262, M_TBS_CANON_NAME);
3025,3026c3108,3110
<         WRITE_TRACE_MESSAGE(TRACE_LEVEL_ERROR, 'TS error');
<         RAISE_ORA_ERROR(46262, M_TBS_NAME);
---
>         WRITE_TRACE_MESSAGE(TRACE_LEVEL_ERROR, 'TS error'); 
>         RAISE_ORA_ERROR(46262, M_TBS_CANON_NAME);
>         
3047c3131
<         SELECT U.USERNAME INTO M_TBSCHEMA FROM SYS.OBJ$ O, DBA_USERS U
---
>         SELECT U.USERNAME INTO M_TBSCHEMA FROM SYS.OBJ$ O, SYS.DBA_USERS U
3056c3140
<         IF M_AUD_CURTBS <> M_TBS_NAME
---
>         IF M_AUD_CURTBS <> M_TBS_CANON_NAME
3059,3062c3143,3145
<           TBS_HAS_SPACE := TBS_SPACE_CHECK(M_TBS_NAME, M_TBSCHEMA, 'AUD$',
<                                            5, M_SP_OCC_AUD, M_SP_REQ_AUD,
<                                            M_SP_AVAILABLE);
<   
---
>           TBS_HAS_SPACE := TBS_SPACE_CHECK(M_TBS_CANON_NAME, M_TBSCHEMA,
>                                            'AUD$', 5, M_SP_OCC_AUD,
>                                            M_SP_REQ_AUD, M_SP_AVAILABLE);
3065c3148
<             RAISE_ORA_ERROR(46267, M_TBS_NAME);
---
>             RAISE_ORA_ERROR(46267, M_TBS_CANON_NAME);
3069c3152
<               M_FGA_CURTBS <> M_TBS_NAME)
---
>               M_FGA_CURTBS <> M_TBS_CANON_NAME)
3073,3076c3156,3158
<             TBS_HAS_SPACE := TBS_SPACE_CHECK(M_TBS_NAME, 'SYS', 'FGA_LOG$', 
<                                              5, M_SP_OCC_FGA, M_SP_REQ_FGA,
<                                              M_SP_AVAILABLE);
<   
---
>             TBS_HAS_SPACE := TBS_SPACE_CHECK(M_TBS_CANON_NAME, 'SYS',
>                                              'FGA_LOG$', 5, M_SP_OCC_FGA,
>                                              M_SP_REQ_FGA, M_SP_AVAILABLE);
3081c3163
<               RAISE_ORA_ERROR(46267, M_TBS_NAME);
---
>               RAISE_ORA_ERROR(46267, M_TBS_CANON_NAME);
3091,3092c3173
< 
<           MOVE_TABLESPACES(AUDIT_TRAIL_AUD_STD, M_TBS_NAME, M_PART_CNT,
---
>           MOVE_TABLESPACES(AUDIT_TRAIL_AUD_STD, M_TBS_CANON_NAME, M_PART_CNT,
3094d3174
< 
3114c3194
<         IF M_FGA_CURTBS <> M_TBS_NAME
---
>         IF M_FGA_CURTBS <> M_TBS_CANON_NAME
3118,3121c3198,3200
<             TBS_HAS_SPACE := TBS_SPACE_CHECK(M_TBS_NAME, 'SYS', 'FGA_LOG$', 
<                                              5, M_SP_OCC_FGA, M_SP_REQ_FGA,
<                                              M_SP_AVAILABLE);
<   
---
>             TBS_HAS_SPACE := TBS_SPACE_CHECK(M_TBS_CANON_NAME, 'SYS',
>                                              'FGA_LOG$', 5, M_SP_OCC_FGA,
>                                              M_SP_REQ_FGA, M_SP_AVAILABLE);
3124c3203
<               RAISE_ORA_ERROR(46267, M_TBS_NAME);
---
>               RAISE_ORA_ERROR(46267, M_TBS_CANON_NAME);
3132,3133c3211
< 
<           MOVE_TABLESPACES(AUDIT_TRAIL_FGA_STD, M_TBS_NAME, M_PART_CNT,
---
>           MOVE_TABLESPACES(AUDIT_TRAIL_FGA_STD, M_TBS_CANON_NAME, M_PART_CNT,
3135d3212
< 
3299,3300c3376
<       IF AUDIT_TRAIL_TYPE < AUDIT_TRAIL_AUD_STD OR
<          AUDIT_TRAIL_TYPE > AUDIT_TRAIL_ALL
---
>       IF IS_VALID_AUDIT_TRAIL(AUDIT_TRAIL_TYPE) = FALSE
3438,3439c3514,3515
<       IF AUDIT_TRAIL_TYPE < AUDIT_TRAIL_AUD_STD OR
<          AUDIT_TRAIL_TYPE > AUDIT_TRAIL_FGA_STD
---
>       IF AUDIT_TRAIL_TYPE <> AUDIT_TRAIL_AUD_STD AND
>          AUDIT_TRAIL_TYPE <> AUDIT_TRAIL_FGA_STD
3476,3477c3552,3553
<       IF AUDIT_TRAIL_TYPE < AUDIT_TRAIL_OS OR
<          AUDIT_TRAIL_TYPE > AUDIT_TRAIL_XML
---
>       IF AUDIT_TRAIL_TYPE <> AUDIT_TRAIL_OS AND
>          AUDIT_TRAIL_TYPE <> AUDIT_TRAIL_XML
3759,3760c3835
<     IF AUDIT_TRAIL_TYPE < AUDIT_TRAIL_AUD_STD OR
<        AUDIT_TRAIL_TYPE > AUDIT_TRAIL_ALL THEN
---
>     IF IS_VALID_AUDIT_TRAIL(AUDIT_TRAIL_TYPE) = FALSE THEN
3888,3895c3963,3972
<     M_INTERVAL         VARCHAR2(200);
<     M_SQL_STMT         VARCHAR2(1000);
<     M_JOBS             NUMBER := 0;
<     M_TRAIL_COUNT      NUMBER := 0;
<     M_SETUP_COUNT      NUMBER := 0;
<     M_ATRAIL_TYPE      NUMBER := AUDIT_TRAIL_TYPE;
<     M_NEW_JOB_NAME     DBMS_ID;
<     M_JOB_FLAGS        NUMBER := 0;
---
>     M_INTERVAL          VARCHAR2(200);
>     M_SQL_STMT          VARCHAR2(1000);
>     M_JOBS              NUMBER := 0;
>     M_TRAIL_COUNT       NUMBER := 0;
>     M_SETUP_COUNT       NUMBER := 0;
>     M_ATRAIL_TYPE       NUMBER := AUDIT_TRAIL_TYPE;
>     M_NEW_JOB_NAME      DBMS_QUOTED_ID;
>     M_NEW_JOB_CAN_NAME  DBMS_QUOTED_ID;
>     M_NEW_JOB_MASK_NAME DBMS_QUOTED_ID;
>     M_JOB_FLAGS         NUMBER := 0;
3899,3900c3976
<     IF AUDIT_TRAIL_TYPE < AUDIT_TRAIL_AUD_STD OR
<        AUDIT_TRAIL_TYPE > AUDIT_TRAIL_ALL THEN
---
>     IF IS_VALID_AUDIT_TRAIL(AUDIT_TRAIL_TYPE) = FALSE THEN
3902a3979,3986
>  
>     
>     IF CONTAINER = CONTAINER_CURRENT OR
>        CONTAINER = CONTAINER_ALL THEN 
>       NULL;
>     ELSE
>       RAISE_ORA_ERROR(46250, 'CONTAINER');
>     END IF;
3906,3907c3990,3991
<        LENGTH(AUDIT_TRAIL_PURGE_NAME) = 0 OR
<        LENGTH(AUDIT_TRAIL_PURGE_NAME) > 128
---
>        LENGTHB(AUDIT_TRAIL_PURGE_NAME) = 0 OR
>        LENGTHB(AUDIT_TRAIL_PURGE_NAME) > ORA_MAX_NAME_LEN+2
3913c3997,4001
<       M_NEW_JOB_NAME := SYS.DBMS_ASSERT.SIMPLE_SQL_NAME(AUDIT_TRAIL_PURGE_NAME);
---
>       
>      M_NEW_JOB_NAME := SYS.DBMS_ASSERT.SIMPLE_SQL_NAME(AUDIT_TRAIL_PURGE_NAME);
>      SYS.DBMS_UTILITY.CANONICALIZE(M_NEW_JOB_NAME, M_NEW_JOB_CAN_NAME, 
>                                    ORA_MAX_NAME_LEN+2);
>       M_NEW_JOB_MASK_NAME := REPLACE(M_NEW_JOB_NAME, '''', '''''');
3920c4008
<        AUDIT_TRAIL_PURGE_INTERVAL >= 1000
---
>        AUDIT_TRAIL_PURGE_INTERVAL >= MAX_PURGE_JOB_INTERVAL 
3926,3927c4014,4015
<     SELECT COUNT(JOB_NAME) INTO M_JOBS FROM SYS.DAM_CLEANUP_JOBS$ 
<     WHERE JOB_NAME = NLS_UPPER(M_NEW_JOB_NAME);
---
>     SELECT COUNT(JOB_NAME) INTO M_JOBS FROM SYS.DAM_CLEANUP_JOBS$
>     WHERE JOB_NAME = M_NEW_JOB_CAN_NAME;
3930c4018
<       RAISE_ORA_ERROR(46254, M_NEW_JOB_NAME);
---
>       RAISE_ORA_ERROR(46254, M_NEW_JOB_CAN_NAME);
4093c4181
<                                 M_NEW_JOB_NAME || '''');
---
>                                 M_NEW_JOB_MASK_NAME || '''');
4105c4193
<     (NLS_UPPER(M_NEW_JOB_NAME), 1 , M_ATRAIL_TYPE,
---
>     (M_NEW_JOB_CAN_NAME, 1 , M_ATRAIL_TYPE,
4169c4257
<          SELECT U.USERNAME INTO M_TBSCHEMA_TMP FROM SYS.OBJ$ O, DBA_USERS U
---
>          SELECT U.USERNAME INTO M_TBSCHEMA_TMP FROM SYS.OBJ$ O, SYS.DBA_USERS U
4173c4261
<          M_TBSCHEMA := DBMS_ASSERT.ENQUOTE_NAME(M_TBSCHEMA_TMP, FALSE);
---
>          M_TBSCHEMA := SYS.DBMS_ASSERT.ENQUOTE_NAME(M_TBSCHEMA_TMP, FALSE);
4183c4271
<                          DBMS_ASSERT.SIMPLE_SQL_NAME(PART_INFO.PARTITION_NAME)
---
>                       SYS.DBMS_ASSERT.SIMPLE_SQL_NAME(PART_INFO.PARTITION_NAME)
4265c4353
<                           || ' in sys.dma_temp_fga_log$');
---
>                           || ' in sys.dam_temp_fga_log$');
4271c4359,4360
<       M_SQLERRM:= SUBSTR(SQLERRM||DBMS_UTILITY.FORMAT_ERROR_BACKTRACE(),0,999);
---
>       M_SQLERRM:= SUBSTR(SQLERRM||SYS.DBMS_UTILITY.FORMAT_ERROR_BACKTRACE(),0,
>                          999);
4289,4293c4378,4382
<     M_TMP_SQL     VARCHAR2(4000);
<     M_FGA_COLS    VARCHAR2(1000);
<     M_FGA_COLS2   VARCHAR2(1000);
<     M_MAX_TSTMP   TIMESTAMP;
<     M_TBS_NAME    DBMS_ID;
---
>     M_TMP_SQL      VARCHAR2(4000);
>     M_FGA_COLS     VARCHAR2(1000);
>     M_FGA_COLS2    VARCHAR2(1000);
>     M_MAX_TSTMP    TIMESTAMP;
>     M_TBS_NAME     DBMS_QUOTED_ID;
4298,4299c4387,4388
<          LENGTH(TBS_NAME) = 0 OR
<          LENGTH(TBS_NAME) > 128
---
>          LENGTHB(TBS_NAME) = 0 OR
>          LENGTHB(TBS_NAME) > ORA_MAX_NAME_LEN + 2
4306c4395,4396
<         M_TBS_NAME := DBMS_ASSERT.SIMPLE_SQL_NAME(TBS_NAME);
---
>         M_TBS_NAME := SYS.DBMS_ASSERT.ENQUOTE_NAME(TBS_NAME,FALSE);
>         M_TBS_NAME := REPLACE(M_TBS_NAME, '''', '''''');
4325c4415,4416
<         'rls$info clob, current_user varchar2(128)) tablespace ' || M_TBS_NAME;
---
>         'rls$info clob, current_user varchar2(128)) tablespace ' || 
>         M_TBS_NAME; 
4476,4477c4567
<     IF AUDIT_TRAIL_TYPE < AUDIT_TRAIL_AUD_STD OR
<        AUDIT_TRAIL_TYPE > AUDIT_TRAIL_ALL
---
>     IF IS_VALID_AUDIT_TRAIL(AUDIT_TRAIL_TYPE) = FALSE
4562c4652,4653
<     L_TBSCHEMA       DBMS_QUOTED_ID := DBMS_ASSERT.ENQUOTE_NAME(TBSCHEMA, FALSE);
---
>     L_TBSCHEMA       DBMS_QUOTED_ID := 
>                                 SYS.DBMS_ASSERT.ENQUOTE_NAME(TBSCHEMA, FALSE);
4782c4873
<       M_TBS_NAME := DBMS_ASSERT.SIMPLE_SQL_NAME(TBSPACE_DEST);
---
>       M_TBS_NAME := SYS.DBMS_ASSERT.SIMPLE_SQL_NAME(TBSPACE_DEST);
4967c5058
<       FROM DBA_TAB_PARTITIONS 
---
>       FROM SYS.DBA_TAB_PARTITIONS 
5012,5013c5103,5104
<       SELECT BLOCK_SIZE INTO TBS_BLK_SIZE FROM DBA_TABLESPACES
<       WHERE TABLESPACE_NAME = NLS_UPPER(AUDIT_TRAIL_TBS);
---
>       SELECT BLOCK_SIZE INTO TBS_BLK_SIZE FROM SYS.DBA_TABLESPACES
>       WHERE TABLESPACE_NAME = AUDIT_TRAIL_TBS;
5050c5141
<     FROM DBA_TAB_PARTITIONS
---
>     FROM SYS.DBA_TAB_PARTITIONS
5056c5147
<       SELECT BLOCK_SIZE INTO BLOCK_SIZE FROM DBA_TABLESPACES
---
>       SELECT BLOCK_SIZE INTO BLOCK_SIZE FROM SYS.DBA_TABLESPACES
5058c5149
<       (SELECT TABLESPACE_NAME FROM DBA_TABLES WHERE TABLE_NAME =
---
>       (SELECT TABLESPACE_NAME FROM SYS.DBA_TABLES WHERE TABLE_NAME =
5061c5152
<       SELECT BLOCKS INTO BLOCKS_USED FROM DBA_TABLES
---
>       SELECT BLOCKS INTO BLOCKS_USED FROM SYS.DBA_TABLES
5067c5158
<       SELECT NUM_ROWS INTO TAB_ROWS FROM DBA_TABLES 
---
>       SELECT NUM_ROWS INTO TAB_ROWS FROM SYS.DBA_TABLES 
5084c5175
<         SELECT BLOCK_SIZE INTO BLOCK_SIZE FROM DBA_TABLESPACES
---
>         SELECT BLOCK_SIZE INTO BLOCK_SIZE FROM SYS.DBA_TABLESPACES
5088c5179
<         FROM DBA_TAB_PARTITIONS
---
>         FROM SYS.DBA_TAB_PARTITIONS
5124,5125c5215,5216
<     SELECT SUM(BYTES) INTO TBS_SPACE_AVAIL FROM DBA_FREE_SPACE
<     WHERE TABLESPACE_NAME = NLS_UPPER(AUDIT_TRAIL_TBS);
---
>     SELECT SUM(BYTES) INTO TBS_SPACE_AVAIL FROM SYS.DBA_FREE_SPACE
>     WHERE TABLESPACE_NAME = AUDIT_TRAIL_TBS;
5157c5248,5249
<     M_TBS_NAME       DBMS_ID;
---
>     M_TBS_NAME       DBMS_QUOTED_ID;
>     M_TBS_CANON_NAME DBMS_QUOTED_ID;
5172,5173c5264,5265
<        LENGTH(AUDIT_TRAIL_LOCATION_VALUE) = 0 OR
<        LENGTH(AUDIT_TRAIL_LOCATION_VALUE) > 30
---
>        LENGTHB(AUDIT_TRAIL_LOCATION_VALUE) = 0 OR
>        LENGTHB(AUDIT_TRAIL_LOCATION_VALUE) > MAX_TBS_LENGTH
5181,5182c5273,5276
<       M_TBS_NAME := DBMS_ASSERT.SIMPLE_SQL_NAME(AUDIT_TRAIL_LOCATION_VALUE);
<       M_TBS_NAME := NLS_UPPER(M_TBS_NAME);
---
>       
>      M_TBS_NAME := SYS.DBMS_ASSERT.SIMPLE_SQL_NAME(AUDIT_TRAIL_LOCATION_VALUE);
>      SYS.DBMS_UTILITY.CANONICALIZE(M_TBS_NAME, M_TBS_CANON_NAME, 
>                                    MAX_TBS_LENGTH);
5188d5281
< 
5204c5297
<       FROM DBA_TABLESPACES WHERE TABLESPACE_NAME = M_TBS_NAME;
---
>       FROM SYS.DBA_TABLESPACES WHERE TABLESPACE_NAME = M_TBS_CANON_NAME;
5208c5301
<         RAISE_ORA_ERROR(46262, M_TBS_NAME);
---
>         RAISE_ORA_ERROR(46262, M_TBS_CANON_NAME);
5213c5306,5307
<         RAISE_ORA_ERROR(46262, M_TBS_NAME);
---
>         RAISE_ORA_ERROR(46262, M_TBS_CANON_NAME);
> 
5218c5312
<          SETUP_NG_AUDIT_TSPACE(M_TBS_NAME, 1 );
---
>         SETUP_NG_AUDIT_TSPACE(M_TBS_CANON_NAME, 1 );
5220c5314
<          SETUP_NG_AUDIT_TSPACE(M_TBS_NAME, 2 );
---
>         SETUP_NG_AUDIT_TSPACE(M_TBS_CANON_NAME, 2 );
5225c5319
<         RAISE_ORA_ERROR(46267, M_TBS_NAME); 
---
>         RAISE_ORA_ERROR(46267, M_TBS_CANON_NAME); 
5238c5332
<          UPDATE SET D.STRING_VALUE = M_TBS_NAME
---
>          UPDATE SET D.STRING_VALUE = M_TBS_CANON_NAME
5243c5337
<                        M_TBS_NAME);
---
>                        M_TBS_CANON_NAME);
5468,5475c5562,5571
<     M_INTERVAL         VARCHAR2(200);
<     M_SQL_STMT         VARCHAR2(1000);
<     M_JOBS             NUMBER := 0;
<     M_TRAIL_COUNT      NUMBER := 0;
<     M_SETUP_COUNT      NUMBER := 0;
<     M_ATRAIL_TYPE      NUMBER := AUDIT_TRAIL_TYPE;
<     M_NEW_JOB_NAME     DBMS_ID;
<     M_JOB_FLAGS        NUMBER := 0;
---
>     M_INTERVAL          VARCHAR2(200);
>     M_SQL_STMT          VARCHAR2(1000);
>     M_JOBS              NUMBER := 0;
>     M_TRAIL_COUNT       NUMBER := 0;
>     M_SETUP_COUNT       NUMBER := 0;
>     M_ATRAIL_TYPE       NUMBER := AUDIT_TRAIL_TYPE;
>     M_NEW_JOB_NAME      DBMS_QUOTED_ID;
>     M_NEW_JOB_CAN_NAME  DBMS_QUOTED_ID;
>     M_NEW_JOB_MASK_NAME DBMS_QUOTED_ID;
>     M_JOB_FLAGS         NUMBER := 0;
5481,5482c5577,5578
<        LENGTH(AUDIT_TRAIL_PURGE_NAME) = 0 OR
<        LENGTH(AUDIT_TRAIL_PURGE_NAME) > 128
---
>        LENGTHB(AUDIT_TRAIL_PURGE_NAME) = 0 OR
>        LENGTHB(AUDIT_TRAIL_PURGE_NAME) > ORA_MAX_NAME_LEN+2
5486a5583,5590
>     
>     IF CONTAINER = CONTAINER_CURRENT OR
>        CONTAINER = CONTAINER_ALL THEN
>       NULL;
>     ELSE
>       RAISE_ORA_ERROR(46250, 'CONTAINER');
>     END IF;
> 
5488c5592,5596
<       M_NEW_JOB_NAME := SYS.DBMS_ASSERT.SIMPLE_SQL_NAME(AUDIT_TRAIL_PURGE_NAME);
---
>       
>      M_NEW_JOB_NAME := SYS.DBMS_ASSERT.SIMPLE_SQL_NAME(AUDIT_TRAIL_PURGE_NAME);
>      SYS.DBMS_UTILITY.CANONICALIZE(M_NEW_JOB_NAME, M_NEW_JOB_CAN_NAME, 
>                                    ORA_MAX_NAME_LEN+2);
>      M_NEW_JOB_MASK_NAME := REPLACE(M_NEW_JOB_NAME, '''', '''''');
5495c5603
<        AUDIT_TRAIL_PURGE_INTERVAL >= 1000
---
>        AUDIT_TRAIL_PURGE_INTERVAL >= MAX_PURGE_JOB_INTERVAL 
5501,5502c5609,5610
<     SELECT COUNT(JOB_NAME) INTO M_JOBS FROM SYS.DAM_CLEANUP_JOBS$ 
<     WHERE JOB_NAME = NLS_UPPER(M_NEW_JOB_NAME);
---
>     SELECT COUNT(JOB_NAME) INTO M_JOBS FROM SYS.DAM_CLEANUP_JOBS$
>     WHERE JOB_NAME = M_NEW_JOB_CAN_NAME;
5505c5613
<       RAISE_ORA_ERROR(46254, M_NEW_JOB_NAME);
---
>       RAISE_ORA_ERROR(46254, M_NEW_JOB_CAN_NAME);
5542c5650
<                                 M_NEW_JOB_NAME || '''');
---
>                                 M_NEW_JOB_MASK_NAME || '''');
5552c5660
<     (NLS_UPPER(M_NEW_JOB_NAME), 1 , M_ATRAIL_TYPE,
---
>     (M_NEW_JOB_CAN_NAME, 1 , M_ATRAIL_TYPE,
5575a5684
>     M_PLSQL_BLOCK      VARCHAR2(160);
5594,5597c5703,5707
<     
<     SELECT PARAMETER_VALUE INTO M_SELVALUE FROM DBA_AUDIT_MGMT_CONFIG_PARAMS
<     WHERE PARAMETER_NAME = 'DB AUDIT TABLESPACE' AND 
<           AUDIT_TRAIL = 'UNIFIED AUDIT TRAIL';
---
>    
>     M_PLSQL_BLOCK := 'SELECT PARAMETER_VALUE FROM ' || 
>                       'SYS.DBA_AUDIT_MGMT_CONFIG_PARAMS WHERE ' ||
>                       'PARAMETER_NAME = ''DB AUDIT TABLESPACE'' AND ' || 
>                       'AUDIT_TRAIL = ''UNIFIED AUDIT TRAIL''';
5599c5709
<     M_TBS := DBMS_ASSERT.SIMPLE_SQL_NAME(M_SELVALUE);
---
>     EXECUTE IMMEDIATE M_PLSQL_BLOCK INTO M_TBS;
5602c5712
<       SELECT STATUS INTO M_SELVALUE FROM DBA_TABLESPACES 
---
>       SELECT STATUS INTO M_SELVALUE FROM SYS.DBA_TABLESPACES 
CTXSYS.DRIG - PACKAGE (RU):
1042a1043
>    IE_INVALID_PRIV               constant number := 52213;
CTXSYS.DRIIMP - PACKAGE (RU):
1c1,2
< package driimp as
---
> package driimp authid current_user AS
> 
CTXSYS.DRIUTL - PACKAGE (RU):
528,542d527
< /* ------------------------------ enquote_parts ----------------------------*/
< /* Given a (possibly quoted) spec, return a string which has each portion quoted.
<    For example:
<      Input                         Output
<      "abc"."def"                   "abc"."def"
<      abc.def                       "abc"."def"
<      abc.def.hij                   "abc"."def"."hij"
<      "abc.def"                     "abc.def"
< 
<   If the input starts with a quote, we assume that the entire string is already
<   properly quoted.
< */
< FUNCTION enquote_parts(p_spec IN VARCHAR2, capitalize IN BOOLEAN := TRUE)
<   RETURN VARCHAR2;
< 
CTXSYS.DRIXMD - PACKAGE (RU):
1198a1199,1300
> /*---------------------------------- insert_index ------------------------*/
> PROCEDURE insert_index(
>    p_idx_type        IN  number,
>    p_idx_owner_id    IN  number,
>    p_idx_name        IN  varchar2,
>    p_tab_owner_id    IN  number,
>    p_obj_id          IN  number,
>    p_idx_key_name    IN  varchar2,
>    p_idx_key_type    IN  varchar2,
>    p_idx_text_name   IN  varchar2,
>    p_idx_text_type   IN  varchar2,
>    p_idx_text_length IN  varchar2,
>    p_idx_docid_count IN  varchar2,
>    p_idx_status      IN  varchar2,
>    p_idx_version     IN  varchar2,
>    p_idx_nextid      IN  varchar2,
>    p_idx_langcol     in  varchar2,
>    p_idx_fmtcol      in  varchar2,
>    p_idx_csetcol     in  varchar2,
>    p_idx_configcol   in  varchar2,
>    p_idx_option      in  varchar2,
>    p_idx_sync_type   in  varchar2,
>    p_idx_sync_memory      in varchar2,
>    p_idx_sync_para_degree in number,
>    p_idx_sync_interval    in varchar2,
>    p_idx_auto_opt_type        in varchar2,
>    p_idx_auto_opt_interval    in varchar2,
>    p_idx_auto_opt_para_degree in number
> 
> ) accessible by (ctxsys.driimp);
> 
> /*------------------------------ insert_partition -------------------------*/
> PROCEDURE insert_partition(
>      p_ixp_id    IN number,
>      p_ixp_name  IN varchar2,
>      p_table_part#      IN number,
>      p_ixp_docid_count  IN number,
>      p_ixp_status       IN varchar2,
>      p_ixp_nextid       IN number,
>      p_ixp_opt_token    IN varchar2,
>      p_ixp_opt_type     IN number,
>      p_ixp_opt_count    IN number,
>      p_ixp_sync_type    IN varchar2,
>      p_ixp_sync_memory  IN varchar2,
>      p_ixp_sync_para_degree  IN number,
>      p_ixp_sync_interval     IN varchar2,
>      p_ixp_auto_opt_type     IN varchar2,
>      p_ixp_auto_opt_interval IN varchar2,
>      p_ixp_auto_opt_para_degree IN number
> ) accessible by (ctxsys.driimp);
> 
> /*------------------------------ insert_object ----------------------------*/
> PROCEDURE insert_object(
>       p_cla_name  IN  varchar2,
>       p_obj_name  IN  varchar2,
>       p_acnt      IN  varchar2
> ) accessible by (ctxsys.driimp);
> 
> /*-------------------------- insert_value --------------------------*/
> PROCEDURE insert_value(
>   p_att_name   IN  varchar2,
>   p_att_value  IN  varchar2
> ) accessible by (ctxsys.driimp);
> 
> /*-------------------------- insert_sub_value ----------------------------*/
> PROCEDURE insert_sub_value(
>   p_att_name   IN   varchar2,
>   p_sub_group  IN   number,
>   p_sub_obj    IN   varchar2,
>   p_sub_att    IN   varchar2,
>   p_sub_value  IN   varchar2
> ) accessible by (ctxsys.driimp);
> 
> /*-------------------------- insert_pending ----------------------------*/
> PROCEDURE insert_pending(
>   p_pid    IN   number,
>   p_rowid  IN   rowid
> ) accessible by (ctxsys.driimp);
> 
> /*-------------------------- insert_cdicol ----------------------------*/
> PROCEDURE insert_cdicol(
>   p_cdi_column_position    IN   number,
>   p_cdi_column_name        IN   varchar2,
>   p_cdi_column_type        IN   varchar2,
>   p_cdi_column_type#       IN   number,
>   p_cdi_column_length      IN   number,
>   p_cdi_section_name       IN   varchar2,
>   p_cdi_section_type       IN   number,
>   p_cdi_section_id         IN   number,
>   p_cdi_sort_order         IN   varchar2
> ) accessible by (ctxsys.driimp);
> 
> /*-------------------------- insert_user_extract_rule ----------------------*/
> PROCEDURE insert_user_extract_rule(
>   p_erl_rule_id     IN  number,
>   p_erl_language    IN  varchar2,
>   p_erl_rule        IN  varchar2,
>   p_erl_modifier    IN  varchar2,
>   p_erl_type        IN  varchar2,
>   p_erl_status      IN  number,
>   p_erl_comments    IN  varchar2
> ) accessible by (ctxsys.driimp);
CTXSYS.DRVDISP - PACKAGE (RU):
346,363d345
< 
< /*-------------------------- getmsg ---------------------------------*/
< /*
<   NAME
<     getmsg
<   DESCRIPTION
< 
<   ARGUMENTS
< 
<   NOTES
< 
<   EXCEPTIONS
< 
<   RETURNS
<     none
< */
< procedure getmsg(msgid in binary_integer, msgtext out varchar2);
< 
CTXSYS.CTX_CLS - PACKAGE BODY (RU):
50,53c50,53
<   LV_RESCATID    DRVUTL.DR_ID; 
<   LV_RESQUERY    DRVUTL.DR_ID; 
<   LV_RESCONFID   DRVUTL.DR_ID; 
<   LV_PREF_NAME   DRVUTL.DR_ID; 
---
>   LV_RESCATID    DRVUTL.DR_QID; 
>   LV_RESQUERY    DRVUTL.DR_QID; 
>   LV_RESCONFID   DRVUTL.DR_QID; 
>   LV_PREF_NAME   DRVUTL.DR_QID; 
77d76
< 
81c80
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(DOCID));
---
>     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(DOCID);
83c82
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(CATID));
---
>     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(CATID);
85c84
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(RESTAB));
---
>     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(RESTAB);
87c86
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(RESCATID));
---
>     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(RESCATID);
89c88
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(RESQUERY));
---
>     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(RESQUERY);
91c90
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(RESCONFID));
---
>     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(RESCONFID);
93c92
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(PREF_NAME));
---
>     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(PREF_NAME);
559c558
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(DOCTAB_NAME));
---
>     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(DOCTAB_NAME);
561c560
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(CLSTAB_NAME));
---
>     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(CLSTAB_NAME);
563c562
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(PREF_NAME));
---
>     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(PREF_NAME);
565c564
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(DOCID));
---
>     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(DOCID);
605c604
<                     DRIUTL.ENQUOTE_PARTS(LV_DOCID, FALSE),
---
>                     LV_DOCID,
652c651
<   LV_PREF_NAME   DRVUTL.DR_ID; 
---
>   LV_PREF_NAME   DRVUTL.DR_QID; 
705c704
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(DOCID));
---
>     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(DOCID);
708c707
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(PREF_NAME));
---
>     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(PREF_NAME);
CTXSYS.DRIIMP - PACKAGE BODY (RU):
2d1
<    PV_IDX_ID         NUMBER := 0;             
4,10c3,25
<    
<    PV_CLA_ID         NUMBER;            
<    PV_OBJ_ID         NUMBER;
<    
<    
<    PV_OAT_ID         NUMBER;
<    PV_PRE_ATT_NAME   DRVUTL.DR_ID := '$$';  
---
> PV_IDX_OWNER DRVUTL.DR_ID;
> 
> 
> 
> FUNCTION USER_HAS_PRIVILEGES RETURN BOOLEAN
> IS
>   LV_USER_NAME DRVUTL.DR_ID := SYS_CONTEXT('USERENV', 'CURRENT_USER'); 
>   RET_VAL      BOOLEAN;
> BEGIN
>   IF (NOT SYS.DBMS_DATAPUMP.DATAPUMP_JOB()) THEN
>     
>     IF (SYS.DBMS_PRIV_CAPTURE.SES_HAS_ROLE_PRIV('IMP_FULL_DATABASE') = 0) THEN
>       
> 	    IF (NOT (LV_USER_NAME = PV_IDX_OWNER)) THEN
>       RET_VAL := FALSE;
>       END IF;
>     END IF;
>   END IF;
> 
>   RET_VAL := TRUE;
> 
> RETURN RET_VAL;
> END USER_HAS_PRIVILEGES;
43a59
>   LV_USER_NAME     DRVUTL.DR_ID;
50,52d65
<   
<   
<   SELECT DR_ID_SEQ.NEXTVAL INTO PV_IDX_ID FROM DUAL;
53a67,73
>   PV_IDX_OWNER := P_IDX_TABLE_OWNER;
> 
>   
>   IF (NOT USER_HAS_PRIVILEGES) THEN
>     DRUE.PUSH(DRIG.IE_INVALID_PRIV);
>     RAISE DR_DEF.TEXTILE_ERROR;
>   END IF;
55,85c75
<   INSERT INTO DR$INDEX
<                  (IDX_ID, 
<                   IDX_TYPE,
<                   IDX_OWNER#,
<                   IDX_NAME, 
<                   IDX_TABLE_OWNER#,
<                   IDX_TABLE#, 
<                   IDX_KEY_NAME, 
<                   IDX_KEY_TYPE, 
<                   IDX_TEXT_NAME, 
<                   IDX_TEXT_TYPE, 
<                   IDX_TEXT_LENGTH, 
<                   IDX_DOCID_COUNT, 
<                   IDX_STATUS, 
<                   IDX_VERSION, 
<                   IDX_NEXTID,
<                   IDX_LANGUAGE_COLUMN,
<                   IDX_FORMAT_COLUMN,
<                   IDX_CHARSET_COLUMN,
<                   IDX_CONFIG_COLUMN,
<                   IDX_OPTION,
<                   IDX_SYNC_TYPE,
<                   IDX_SYNC_MEMORY,
<                   IDX_SYNC_PARA_DEGREE,
<                   IDX_SYNC_INTERVAL,
<                   IDX_AUTO_OPT_TYPE,
<                   IDX_AUTO_OPT_INTERVAL,
<                   IDX_AUTO_OPT_PARA_DEGREE
<               )
<               VALUES
<                  (PV_IDX_ID,
---
>   DRIXMD.INSERT_INDEX(
113d102
< 
117,120c106
<      GOTO TIDYUP;
<   WHEN DUP_VAL_ON_INDEX THEN
<      DRUE.PUSH(DRIG.DL_DUP_POLICY_NAME, P_IDX_NAME||', owner: '||USER);
<      GOTO TIDYUP;
---
>      DRUE.RAISE;
122,124c108
<      DRUE.TEXT_ON_STACK(SQLERRM);
< <<TIDYUP>>
<      DRUE.PUSH(DRIG.IE_CREATE_INDEX_FAILED);
---
>      DRUE.TEXT_ON_STACK(SQLERRM, 'driimp.create_index');
147a132,136
>   
>   IF (NOT USER_HAS_PRIVILEGES) THEN
>     DRUE.PUSH(DRIG.IE_INVALID_PRIV);
>     RAISE DR_DEF.TEXTILE_ERROR;
>   END IF;
149,168c138,139
<   INSERT INTO DR$INDEX_PARTITION
<     (IXP_ID, 
<      IXP_NAME,
<      IXP_IDX_ID,
<      IXP_TABLE_PARTITION#,
<      IXP_DOCID_COUNT,
<      IXP_STATUS, 
<      IXP_NEXTID,
<      IXP_OPT_TOKEN,
<      IXP_OPT_TYPE,
<      IXP_OPT_COUNT,
<      IXP_SYNC_TYPE,
<      IXP_SYNC_MEMORY,
<      IXP_SYNC_PARA_DEGREE,
<      IXP_SYNC_INTERVAL,
<      IXP_AUTO_OPT_TYPE,
<      IXP_AUTO_OPT_INTERVAL,
<      IXP_AUTO_OPT_PARA_DEGREE)
<   VALUES
<     (P_IXP_ID,
---
>   DRIXMD.INSERT_PARTITION(
>      P_IXP_ID,
170d140
<      PV_IDX_ID,
189c159
<      GOTO TIDYUP;
---
>      DRUE.RAISE;
191,193c161
<      DRUE.TEXT_ON_STACK(SQLERRM);
< <<TIDYUP>>
<      DRUE.PUSH(DRIG.IE_CREATE_PART_FAILED);
---
>      DRUE.TEXT_ON_STACK(SQLERRM, 'driimp.create_partition');
205,214c173,175
<   PV_CLA_ID := 0; 
<   PV_OBJ_ID := 0;
< 
<   FOR C1 IN (SELECT CLA_ID FROM DR$CLASS WHERE CLA_NAME = P_CLA_NAME) LOOP
<       PV_CLA_ID := C1.CLA_ID;
<   END LOOP;
< 
<   IF (PV_CLA_ID = 0) THEN
<      DRUE.PUSH(DRIG.IE_INVALID_CLASS, P_CLA_NAME);
<      DRUE.RAISE;
---
>   IF (NOT USER_HAS_PRIVILEGES) THEN
>     DRUE.PUSH(DRIG.IE_INVALID_PRIV);
>     RAISE DR_DEF.TEXTILE_ERROR;
217,236c178
<   FOR C1 IN (SELECT OBJ_ID FROM DR$OBJECT WHERE OBJ_CLA_ID = PV_CLA_ID 
<                 AND OBJ_NAME = P_OBJ_NAME) LOOP
<      PV_OBJ_ID := C1.OBJ_ID;
<   END LOOP;
< 
<   IF (PV_OBJ_ID = 0) THEN
<      DRUE.PUSH(DRIG.IE_INVALID_OBJECT, P_OBJ_NAME);
<      DRUE.RAISE;
<   END IF;
< 
<   INSERT INTO DR$INDEX_OBJECT 
<                           (IXO_IDX_ID, 
<                            IXO_CLA_ID, 
<                            IXO_OBJ_ID, 
<                            IXO_ACNT)
<                        VALUES  
<                           (PV_IDX_ID, 
<                            PV_CLA_ID, 
<                            PV_OBJ_ID, 
<                            P_ACNT);
---
>   DRIXMD.INSERT_OBJECT(P_CLA_NAME, P_OBJ_NAME, P_ACNT);
241,244c183
<      GOTO TIDYUP;
<   WHEN DUP_VAL_ON_INDEX THEN
<      DRUE.PUSH(DRIG.IE_DUP_INDEX_OBJECT, P_CLA_NAME, P_OBJ_NAME);
<      GOTO TIDYUP;
---
>      DRUE.RAISE;
246,248c185
<      DRUE.TEXT_ON_STACK(SQLERRM);
< <<TIDYUP>>
<      DRUE.PUSH(DRIG.IE_SET_OBJECT_FAILED);
---
>      DRUE.TEXT_ON_STACK(SQLERRM, 'driimp.set_object');
260,279c197,199
< 
<   IF (P_ATT_NAME <> PV_PRE_ATT_NAME) THEN
< 
<      PV_OAT_ID       := 0; 
< 
<      
<      PV_PRE_ATT_NAME := P_ATT_NAME;
< 
<      FOR C1 IN (SELECT OAT_ID 
<                   FROM DR$OBJECT_ATTRIBUTE
<                  WHERE OAT_CLA_ID = PV_CLA_ID
<                    AND OAT_OBJ_ID = PV_OBJ_ID
<                    AND OAT_NAME   = P_ATT_NAME) LOOP
<         PV_OAT_ID := C1.OAT_ID;
<      END LOOP;
< 
<      IF (PV_OAT_ID = 0) THEN
<         DRUE.PUSH(DRIG.IE_INVALID_ATTRIBUTE, P_ATT_NAME);
<         DRUE.RAISE;
<      END IF;
---
>   IF (NOT USER_HAS_PRIVILEGES) THEN
>     DRUE.PUSH(DRIG.IE_INVALID_PRIV);
>     RAISE DR_DEF.TEXTILE_ERROR;
282,295c202,203
<   IF (P_ATT_NAME IN ('SDATA', 'MDATA', 'FIELD', 'ZONE', 'SPECIAL',
<                      'COLUMN_SDATA', 'COLUMN_MDATA', 'NDATA', 'MVDATA')
<       AND P_ATT_VALUE LIKE '%:%:%') THEN
<     DRISGP.CSV_TO_SECTION_ATTR(PV_IDX_ID, P_ATT_NAME, P_ATT_VALUE);
<   ELSE
<   INSERT INTO DR$INDEX_VALUE 
<                          (IXV_IDX_ID, 
<                           IXV_OAT_ID, 
<                           IXV_VALUE)
<                       VALUES 
<                          (PV_IDX_ID, 
<                           PV_OAT_ID, 
<                           P_ATT_VALUE);
<   END IF;
---
> 
>   DRIXMD.INSERT_VALUE(P_ATT_NAME, P_ATT_VALUE);
300,303c208
<      GOTO TIDYUP;
<   WHEN DUP_VAL_ON_INDEX THEN
<      DRUE.PUSH(DRIG.IE_DUP_ATTRIBUTE, P_ATT_NAME);
<      GOTO TIDYUP;
---
>      DRUE.RAISE;
305,307c210
<      DRUE.TEXT_ON_STACK(SQLERRM);
< <<TIDYUP>>
<      DRUE.PUSH(DRIG.IE_SET_ATT_FAILED, P_ATT_NAME);
---
>      DRUE.TEXT_ON_STACK(SQLERRM, 'driimp.set_value');
320,322d222
<   L_SUB_OAT_ID      NUMBER;
<   T_CLA_ID          NUMBER;
<   USE_TEMP_CLA_ID   BOOLEAN;
325,389c225,227
<   USE_TEMP_CLA_ID := FALSE;
< 
<   IF (P_SUB_ATT = 'SEARCHABLE') THEN
<     SELECT CLA_ID INTO T_CLA_ID FROM DR$CLASS WHERE CLA_NAME = 'SECTION_GROUP';
<     UPDATE DR$INDEX_OBJECT
<     SET    IXO_ACNT = IXO_ACNT - 1
<     WHERE
<            IXO_IDX_ID = PV_IDX_ID
<        AND IXO_CLA_ID = T_CLA_ID;
<     RETURN;
<   END IF;
< 
<   
<   IF (P_ATT_NAME <> PV_PRE_ATT_NAME) THEN
< 
<      PV_OAT_ID       := 0; 
< 
<      
<      PV_PRE_ATT_NAME := P_ATT_NAME;
< 
<      FOR C1 IN (SELECT OAT_ID 
<                   FROM DR$OBJECT_ATTRIBUTE
<                  WHERE OAT_CLA_ID = PV_CLA_ID
<                    AND OAT_OBJ_ID = PV_OBJ_ID
<                    AND OAT_NAME   = P_ATT_NAME) LOOP
<         PV_OAT_ID := C1.OAT_ID;
<      END LOOP;
< 
<      IF (PV_OAT_ID = 0) THEN
<         DRUE.PUSH(DRIG.IE_INVALID_ATTRIBUTE, P_ATT_NAME);
<         DRUE.RAISE;
<      END IF;
<   END IF;
< 
<   
<   L_SUB_OAT_ID := 0;
<   IF (P_SUB_ATT IS NOT NULL) THEN
<     IF (P_ATT_NAME = 'SECTION_ATTRIBUTE') THEN
<       SELECT CLA_ID INTO T_CLA_ID FROM DR$CLASS WHERE CLA_NAME = 'SECTION';
<       USE_TEMP_CLA_ID := TRUE; 
< 
<     END IF;
<     IF (P_SUB_ATT = 'SORTABLE') THEN
<       L_SUB_OAT_ID := 240110;
< 
<       UPDATE DR$INDEX
<       SET   IDX_OPTION = IDX_OPTION || 's'
<       WHERE
<             IDX_ID = PV_IDX_ID;
<     ELSE
<       
<       IF NOT USE_TEMP_CLA_ID THEN 
<          T_CLA_ID := PV_CLA_ID;
<       END IF;
< 
<       FOR C1 IN (SELECT OAT_ID 
<                    FROM DR$OBJECT_ATTRIBUTE, DR$OBJECT
<                   WHERE OAT_CLA_ID = T_CLA_ID
<                     AND OAT_OBJ_ID = OBJ_ID
<                     AND OAT_NAME   = P_SUB_ATT
<                     AND OBJ_NAME   = P_SUB_OBJ) 
<       LOOP
<          L_SUB_OAT_ID := C1.OAT_ID;
<       END LOOP;
<     END IF;
---
>   IF (NOT USER_HAS_PRIVILEGES) THEN
>     DRUE.PUSH(DRIG.IE_INVALID_PRIV);
>     RAISE DR_DEF.TEXTILE_ERROR;
391,404d228
<  
<   INSERT INTO DR$INDEX_VALUE 
<                          (IXV_IDX_ID, 
<                           IXV_OAT_ID, 
<                           IXV_VALUE,
<                           IXV_SUB_GROUP,
<                           IXV_SUB_OAT_ID)
<                       VALUES 
<                          (PV_IDX_ID, 
<                           PV_OAT_ID, 
<                           P_SUB_VALUE,
<                           P_SUB_GROUP,
<                           L_SUB_OAT_ID);
< 
405a230,235
>   DRIXMD.INSERT_SUB_VALUE
>                       (P_ATT_NAME,
>                        P_SUB_GROUP,
>                        P_SUB_OBJ,
>                        P_SUB_ATT,
>                        P_SUB_VALUE);
409c239
<      GOTO TIDYUP;
---
>      DRUE.RAISE;
411,413c241
<      DRUE.TEXT_ON_STACK(SQLERRM);
< <<TIDYUP>>
<      DRUE.PUSH(DRIG.IE_SET_ATT_FAILED, P_ATT_NAME);
---
>      DRUE.TEXT_ON_STACK(SQLERRM, 'driimp.set_sub_value');
425,427c253,259
<   INSERT INTO DR$PENDING 
<    (PND_CID, PND_PID, PND_ROWID, PND_TIMESTAMP, PND_LOCK_FAILED)
<    VALUES (PV_IDX_ID, P_PID, P_ROWID, SYSDATE, 'N');
---
>   
>   IF (NOT USER_HAS_PRIVILEGES) THEN
>     DRUE.PUSH(DRIG.IE_INVALID_PRIV);
>     RAISE DR_DEF.TEXTILE_ERROR;
>   END IF;
> 
>   DRIXMD.INSERT_PENDING(P_PID, P_ROWID);
429,430d260
<   WHEN DUP_VAL_ON_INDEX THEN
<      NULL;
451c281
< IS 
---
> IS
453,466c283,290
<   INSERT INTO DR$INDEX_CDI_COLUMN
<     (CDI_IDX_ID,
<      CDI_COLUMN_POSITION,
<      CDI_COLUMN_NAME,
<      CDI_COLUMN_TYPE,
<      CDI_COLUMN_TYPE#,
<      CDI_COLUMN_LENGTH,
<      CDI_SECTION_NAME,
<      CDI_SECTION_TYPE,
<      CDI_SECTION_ID,
<      CDI_SORT_ORDER)
<   VALUES
<     (PV_IDX_ID,
<      P_CDI_COLUMN_POSITION,
---
>   
>   IF (NOT USER_HAS_PRIVILEGES) THEN
>     DRUE.PUSH(DRIG.IE_INVALID_PRIV);
>     RAISE DR_DEF.TEXTILE_ERROR;
>   END IF;
> 
>   DRIXMD.INSERT_CDICOL
>     (P_CDI_COLUMN_POSITION,
479c303
<      GOTO TIDYUP;
---
>      DRUE.RAISE;
481,483c305
<      DRUE.TEXT_ON_STACK(SQLERRM);
< <<TIDYUP>>
<      DRUE.PUSH(DRIG.IE_CREATE_CDI_FAILED);
---
>      DRUE.TEXT_ON_STACK(SQLERRM, 'driimp.add_cdicol');
496a319
>   LV_IDX_OWNER_ID  NUMBER := -USERENV('SESSIONID');
498,509c321,328
<   INSERT INTO DR$USER_EXTRACT_RULE
<     (ERL_POL_ID,
<      ERL_RULE_ID,
<      ERL_LANGUAGE,
<      ERL_RULE,
<      ERL_MODIFIER,
<      ERL_TYPE,
<      ERL_STATUS,
<      ERL_COMMENTS)
<    VALUES
<     (PV_IDX_ID,
<      P_ERL_RULE_ID,
---
>   
>   IF (NOT USER_HAS_PRIVILEGES) THEN
>     DRUE.PUSH(DRIG.IE_INVALID_PRIV);
>     RAISE DR_DEF.TEXTILE_ERROR;
>   END IF;
> 
>   DRIXMD.INSERT_USER_EXTRACT_RULE
>     (P_ERL_RULE_ID,
CTXSYS.DRIUTL - PACKAGE BODY (RU):
1525a1526,1534
> 
> 
> 
> 
> 
> 
> 
> 
> 
1537c1546
< BEGIN
---
> BEGIN 
1539c1548,1550
<     LV_OBJECT_NAME := DBMS_ASSERT.QUALIFIED_SQL_NAME(OBJECT_NAME);
---
>     IF (OBJECT_NAME = '' OR OBJECT_NAME IS NULL) THEN
>       RETURN '';
>     END IF;
1540a1552
>     LV_OBJECT_NAME := DBMS_ASSERT.QUALIFIED_SQL_NAME(OBJECT_NAME);
1542d1553
< 
1561a1573,1580
> EXCEPTION
>   WHEN DR_DEF.TEXTILE_ERROR THEN
>     DRIUTL.DRUEBRK;
>     GOTO CLEANUP;
>   WHEN OTHERS THEN
>     DRUE.TEXT_ON_STACK(SQLERRM, OBJECT_NAME);
>  <<CLEANUP>>
>     RAISE DR_DEF.TEXTILE_ERROR;
2185,2230d2203
< FUNCTION ENQUOTE_PARTS(P_SPEC IN VARCHAR2, CAPITALIZE IN BOOLEAN := TRUE)
<   RETURN VARCHAR2 IS
<   L_SPEC DRVUTL.DR_QLID3;
<   L_PERIOD1 NUMBER;
<   L_PERIOD2 NUMBER;
< BEGIN
<   IF INSTR(P_SPEC, '"') = 1 THEN
<     
<     L_SPEC := P_SPEC;
<   ELSIF INSTR(P_SPEC, '.') = 0 THEN
<     
<     L_SPEC := DBMS_ASSERT.ENQUOTE_NAME(P_SPEC, CAPITALIZE);
<   ELSE
<     
<     L_PERIOD1 := INSTR(P_SPEC, '.');
<     L_PERIOD2 := INSTR(P_SPEC, '.', L_PERIOD1 + 1);
<     
<     L_SPEC :=
<       DBMS_ASSERT.ENQUOTE_NAME(SUBSTR(P_SPEC, 1, L_PERIOD1 - 1), CAPITALIZE) || '.';
<     IF L_PERIOD2 = 0 THEN
<       L_SPEC := L_SPEC ||
<         DBMS_ASSERT.ENQUOTE_NAME(SUBSTR(P_SPEC, L_PERIOD1 + 1), CAPITALIZE);
<     ELSE
<       L_SPEC := L_SPEC ||
<         DBMS_ASSERT.ENQUOTE_NAME(SUBSTR(P_SPEC, L_PERIOD1 + 1,
<                                         (L_PERIOD2 - L_PERIOD1 - 1)), CAPITALIZE) ||
<         '.' ||
<         DBMS_ASSERT.ENQUOTE_NAME(SUBSTR(P_SPEC, L_PERIOD2 + 1), CAPITALIZE);
<     END IF;
<   END IF;
< 
<   RETURN L_SPEC;
< END ENQUOTE_PARTS;
< 
< 
< 
< 
< 
< 
< 
< 
< 
< 
< 
< 
< 
2238c2211
<   RETURN RTRIM(LTRIM(STR, '"'), '"');
---
>     RETURN RTRIM(LTRIM(STR, '"'), '"');
CTXSYS.DRIXMD - PACKAGE BODY (RU):
9a10,20
> 
> PV_IDX_ID       NUMBER := -1; 
> 
> 
> PV_CLA_ID         NUMBER;            
> PV_OBJ_ID         NUMBER;
> 
> 
> PV_OAT_ID         NUMBER;
> PV_PRE_ATT_NAME   DRVUTL.DR_ID := '$$';  
> 
82c93,94
< 
---
>   
>   
84c96
<       P_INVOKER = PV_CTXSYS_ID ) 
---
>       (P_INVOKER = PV_CTXSYS_ID) OR (P_INVOKER = PV_SYS_ID) )
295c307
<   LV_INDEX_NAME := DRIUTL.ENQUOTE_PARTS(P_IDX_NAME);
---
>   LV_INDEX_NAME := DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(P_IDX_NAME);
6589a6602,7143
> PROCEDURE INSERT_INDEX(
>    P_IDX_TYPE        IN  NUMBER,
>    P_IDX_OWNER_ID    IN  NUMBER,
>    P_IDX_NAME        IN  VARCHAR2,
>    P_TAB_OWNER_ID    IN  NUMBER,
>    P_OBJ_ID          IN  NUMBER,
>    P_IDX_KEY_NAME    IN  VARCHAR2,
>    P_IDX_KEY_TYPE    IN  VARCHAR2,
>    P_IDX_TEXT_NAME   IN  VARCHAR2,
>    P_IDX_TEXT_TYPE   IN  VARCHAR2,
>    P_IDX_TEXT_LENGTH IN  VARCHAR2,
>    P_IDX_DOCID_COUNT IN  VARCHAR2,
>    P_IDX_STATUS      IN  VARCHAR2,
>    P_IDX_VERSION     IN  VARCHAR2,
>    P_IDX_NEXTID      IN  VARCHAR2,
>    P_IDX_LANGCOL     IN  VARCHAR2,
>    P_IDX_FMTCOL      IN  VARCHAR2,
>    P_IDX_CSETCOL     IN  VARCHAR2,
>    P_IDX_CONFIGCOL   IN  VARCHAR2,
>    P_IDX_OPTION      IN  VARCHAR2,
>    P_IDX_SYNC_TYPE   IN  VARCHAR2,
>    P_IDX_SYNC_MEMORY          IN VARCHAR2,
>    P_IDX_SYNC_PARA_DEGREE     IN NUMBER,
>    P_IDX_SYNC_INTERVAL        IN VARCHAR2,
>    P_IDX_AUTO_OPT_TYPE        IN VARCHAR2,
>    P_IDX_AUTO_OPT_INTERVAL    IN VARCHAR2,
>    P_IDX_AUTO_OPT_PARA_DEGREE IN NUMBER
> ) ACCESSIBLE BY (CTXSYS.DRIIMP) IS
> BEGIN
>   
>   SELECT DR_ID_SEQ.NEXTVAL INTO PV_IDX_ID FROM DUAL;
>  
>   
>   INSERT INTO DR$INDEX
>                  (IDX_ID, 
>                   IDX_TYPE,
>                   IDX_OWNER#,
>                   IDX_NAME, 
>                   IDX_TABLE_OWNER#,
>                   IDX_TABLE#, 
>                   IDX_KEY_NAME, 
>                   IDX_KEY_TYPE, 
>                   IDX_TEXT_NAME, 
>                   IDX_TEXT_TYPE, 
>                   IDX_TEXT_LENGTH, 
>                   IDX_DOCID_COUNT, 
>                   IDX_STATUS, 
>                   IDX_VERSION, 
>                   IDX_NEXTID,
>                   IDX_LANGUAGE_COLUMN,
>                   IDX_FORMAT_COLUMN,
>                   IDX_CHARSET_COLUMN,
>                   IDX_CONFIG_COLUMN,
>                   IDX_OPTION,
>                   IDX_SYNC_TYPE,
>                   IDX_SYNC_MEMORY,
>                   IDX_SYNC_PARA_DEGREE,
>                   IDX_SYNC_INTERVAL,
>                   IDX_AUTO_OPT_TYPE,
>                   IDX_AUTO_OPT_INTERVAL,
>                   IDX_AUTO_OPT_PARA_DEGREE
>               )
>               VALUES
>                  (PV_IDX_ID,
>                   P_IDX_TYPE,
>                   P_IDX_OWNER_ID,
>                   P_IDX_NAME,
>                   P_TAB_OWNER_ID,
>                   P_OBJ_ID,
>                   P_IDX_KEY_NAME, 
>                   P_IDX_KEY_TYPE, 
>                   P_IDX_TEXT_NAME,
>                   P_IDX_TEXT_TYPE, 
>                   P_IDX_TEXT_LENGTH, 
>                   P_IDX_DOCID_COUNT,
>                   P_IDX_STATUS, 
>                   P_IDX_VERSION, 
>                   P_IDX_NEXTID,
>                   P_IDX_LANGCOL,
>                   P_IDX_FMTCOL,
>                   P_IDX_CSETCOL,
>                   P_IDX_CONFIGCOL,
>                   P_IDX_OPTION,
>                   P_IDX_SYNC_TYPE,
>                   P_IDX_SYNC_MEMORY,
>                   P_IDX_SYNC_PARA_DEGREE,
>                   P_IDX_SYNC_INTERVAL,
>                   P_IDX_AUTO_OPT_TYPE,
>                   P_IDX_AUTO_OPT_INTERVAL,
>                   P_IDX_AUTO_OPT_PARA_DEGREE
>                );
> 
> EXCEPTION
>   WHEN DR_DEF.TEXTILE_ERROR THEN
>      DRIUTL.DRUEBRK;  
>      GOTO TIDYUP;
>   WHEN DUP_VAL_ON_INDEX THEN
>      DRUE.PUSH(DRIG.DL_DUP_POLICY_NAME, P_IDX_NAME||', owner: '||USER);
>      GOTO TIDYUP;
>   WHEN OTHERS THEN
>      DRUE.TEXT_ON_STACK(SQLERRM, 'drixmd.insert_index');
> <<TIDYUP>>
>      DRUE.PUSH(DRIG.IE_CREATE_INDEX_FAILED);
>      DRUE.RAISE;
> END INSERT_INDEX;
> 
> 
> 
> PROCEDURE INSERT_PARTITION(
>      P_IXP_ID    IN NUMBER,
>      P_IXP_NAME  IN VARCHAR2,
>      P_TABLE_PART#      IN NUMBER,
>      P_IXP_DOCID_COUNT  IN NUMBER,
>      P_IXP_STATUS       IN VARCHAR2,
>      P_IXP_NEXTID       IN NUMBER,
>      P_IXP_OPT_TOKEN    IN VARCHAR2,
>      P_IXP_OPT_TYPE     IN NUMBER,
>      P_IXP_OPT_COUNT   IN NUMBER,
>      P_IXP_SYNC_TYPE    IN VARCHAR2,
>      P_IXP_SYNC_MEMORY  IN VARCHAR2,
>      P_IXP_SYNC_PARA_DEGREE  IN NUMBER,
>      P_IXP_SYNC_INTERVAL     IN VARCHAR2,
>      P_IXP_AUTO_OPT_TYPE     IN VARCHAR2,
>      P_IXP_AUTO_OPT_INTERVAL IN VARCHAR2,
>      P_IXP_AUTO_OPT_PARA_DEGREE IN NUMBER
> ) ACCESSIBLE BY (CTXSYS.DRIIMP) IS
>   LV_USER_ID NUMBER;
> BEGIN
>   
>   IF (PV_IDX_ID = -1) THEN
>     RAISE DR_DEF.TEXTILE_ERROR;
>   END IF;
> 
>   INSERT INTO DR$INDEX_PARTITION
>     (IXP_ID, 
>      IXP_NAME,
>      IXP_IDX_ID,
>      IXP_TABLE_PARTITION#,
>      IXP_DOCID_COUNT,
>      IXP_STATUS, 
>      IXP_NEXTID,
>      IXP_OPT_TOKEN,
>      IXP_OPT_TYPE,
>      IXP_OPT_COUNT,
>      IXP_SYNC_TYPE,
>      IXP_SYNC_MEMORY,
>      IXP_SYNC_PARA_DEGREE,
>      IXP_SYNC_INTERVAL,
>      IXP_AUTO_OPT_TYPE,
>      IXP_AUTO_OPT_INTERVAL,
>      IXP_AUTO_OPT_PARA_DEGREE)
>   VALUES
>     (P_IXP_ID,
>      P_IXP_NAME,
>      PV_IDX_ID,
>      P_TABLE_PART#,
>      P_IXP_DOCID_COUNT,
>      P_IXP_STATUS,
>      P_IXP_NEXTID,
>      P_IXP_OPT_TOKEN,
>      P_IXP_OPT_TYPE,
>      P_IXP_OPT_COUNT,
>      P_IXP_SYNC_TYPE,
>      P_IXP_SYNC_MEMORY,
>      P_IXP_SYNC_PARA_DEGREE,
>      P_IXP_SYNC_INTERVAL,
>      P_IXP_AUTO_OPT_TYPE,
>      P_IXP_AUTO_OPT_INTERVAL,
>      P_IXP_AUTO_OPT_PARA_DEGREE
>     );
> 
> EXCEPTION
>   WHEN DR_DEF.TEXTILE_ERROR THEN
>      DRIUTL.DRUEBRK;  
>      GOTO TIDYUP;
>   WHEN OTHERS THEN
>      DRUE.TEXT_ON_STACK(SQLERRM, 'drixmd.insert_partition');
> <<TIDYUP>>
>      DRUE.PUSH(DRIG.IE_CREATE_PART_FAILED);
>      DRUE.RAISE;
> END INSERT_PARTITION;
> 
> 
> 
> PROCEDURE INSERT_OBJECT(
>       P_CLA_NAME  IN  VARCHAR2,
>       P_OBJ_NAME  IN  VARCHAR2,
>       P_ACNT      IN  VARCHAR2
> ) ACCESSIBLE BY (CTXSYS.DRIIMP) IS
>   LV_USER_ID NUMBER;
> BEGIN
>   
>   IF (PV_IDX_ID = -1) THEN
>     RAISE DR_DEF.TEXTILE_ERROR;
>   END IF;
> 
>   
>   PV_CLA_ID := 0; 
>   PV_OBJ_ID := 0;
> 
>   FOR C1 IN (SELECT CLA_ID FROM DR$CLASS WHERE CLA_NAME = P_CLA_NAME) LOOP
>       PV_CLA_ID := C1.CLA_ID;
>   END LOOP;
> 
>   IF (PV_CLA_ID = 0) THEN
>      DRUE.PUSH(DRIG.IE_INVALID_CLASS, P_CLA_NAME);
>      DRUE.RAISE;
>   END IF;
> 
>   FOR C1 IN (SELECT OBJ_ID FROM DR$OBJECT WHERE OBJ_CLA_ID = PV_CLA_ID 
>                 AND OBJ_NAME = P_OBJ_NAME) LOOP
>      PV_OBJ_ID := C1.OBJ_ID;
>   END LOOP;
> 
>   IF (PV_OBJ_ID = 0) THEN
>      DRUE.PUSH(DRIG.IE_INVALID_OBJECT, P_OBJ_NAME);
>      DRUE.RAISE;
>   END IF;
> 
>   INSERT INTO DR$INDEX_OBJECT 
>                           (IXO_IDX_ID, 
>                            IXO_CLA_ID, 
>                            IXO_OBJ_ID, 
>                            IXO_ACNT)
>                        VALUES  
>                           (PV_IDX_ID, 
>                            PV_CLA_ID, 
>                            PV_OBJ_ID, 
>                            P_ACNT);
> 
> EXCEPTION
>   WHEN DR_DEF.TEXTILE_ERROR THEN
>      DRIUTL.DRUEBRK;  
>      GOTO TIDYUP;
>   WHEN DUP_VAL_ON_INDEX THEN
>      DRUE.PUSH(DRIG.IE_DUP_INDEX_OBJECT, P_CLA_NAME, P_OBJ_NAME);
>      GOTO TIDYUP;
>   WHEN OTHERS THEN
>      DRUE.TEXT_ON_STACK(SQLERRM, 'drixmd.insert_object');
> <<TIDYUP>>
>      DRUE.PUSH(DRIG.IE_SET_OBJECT_FAILED);
>      DRUE.RAISE;
> END INSERT_OBJECT;
> 
> 
> 
> PROCEDURE INSERT_VALUE(
>   P_ATT_NAME   IN  VARCHAR2,
>   P_ATT_VALUE  IN  VARCHAR2
> ) ACCESSIBLE BY (CTXSYS.DRIIMP) IS
>   LV_USER_ID NUMBER;
> BEGIN
>   
>   IF (PV_IDX_ID = -1) THEN
>     RAISE DR_DEF.TEXTILE_ERROR;
>   END IF;
> 
>   
>   IF (P_ATT_NAME <> PV_PRE_ATT_NAME) THEN
>      PV_OAT_ID       := 0; 
>      
>      PV_PRE_ATT_NAME := P_ATT_NAME;
> 
>      FOR C1 IN (SELECT OAT_ID 
>                   FROM DR$OBJECT_ATTRIBUTE
>                  WHERE OAT_CLA_ID = PV_CLA_ID
>                    AND OAT_OBJ_ID = PV_OBJ_ID
>                    AND OAT_NAME   = P_ATT_NAME) LOOP
>         PV_OAT_ID := C1.OAT_ID;
>      END LOOP;
> 
>      IF (PV_OAT_ID = 0) THEN
>         DRUE.PUSH(DRIG.IE_INVALID_ATTRIBUTE, P_ATT_NAME);
>         DRUE.RAISE;
>      END IF;
>   END IF;
> 
>   IF (P_ATT_NAME IN ('SDATA', 'MDATA', 'FIELD', 'ZONE', 'SPECIAL',
>                      'COLUMN_SDATA', 'COLUMN_MDATA', 'NDATA', 'MVDATA')
>       AND P_ATT_VALUE LIKE '%:%:%') THEN
>     DRISGP.CSV_TO_SECTION_ATTR(PV_IDX_ID, P_ATT_NAME, P_ATT_VALUE);
>   ELSE
>   INSERT INTO DR$INDEX_VALUE 
>                          (IXV_IDX_ID, 
>                           IXV_OAT_ID, 
>                           IXV_VALUE)
>                       VALUES 
>                          (PV_IDX_ID, 
>                           PV_OAT_ID, 
>                           P_ATT_VALUE);
>   END IF;
> 
> EXCEPTION
>   WHEN DR_DEF.TEXTILE_ERROR THEN
>      DRIUTL.DRUEBRK;  
>      GOTO TIDYUP;
>   WHEN DUP_VAL_ON_INDEX THEN
>      DRUE.PUSH(DRIG.IE_DUP_ATTRIBUTE, P_ATT_NAME);
>      GOTO TIDYUP;
>   WHEN OTHERS THEN
>      DRUE.TEXT_ON_STACK(SQLERRM, 'drixmd.insert_value');
> <<TIDYUP>>
>      DRUE.PUSH(DRIG.IE_SET_ATT_FAILED, P_ATT_NAME);
>      DRUE.RAISE;
> END INSERT_VALUE;
> 
> 
> 
> PROCEDURE INSERT_SUB_VALUE(
>   P_ATT_NAME   IN   VARCHAR2,
>   P_SUB_GROUP  IN   NUMBER,
>   P_SUB_OBJ    IN   VARCHAR2,
>   P_SUB_ATT    IN   VARCHAR2,
>   P_SUB_VALUE  IN   VARCHAR2
> ) ACCESSIBLE BY (CTXSYS.DRIIMP) IS
>   L_SUB_OAT_ID      NUMBER;
>   T_CLA_ID          NUMBER;
>   USE_TEMP_CLA_ID   BOOLEAN;
>   LV_USER_ID NUMBER;
> BEGIN
>   
>   IF (PV_IDX_ID = -1) THEN
>     RAISE DR_DEF.TEXTILE_ERROR;
>   END IF;
> 
>   USE_TEMP_CLA_ID := FALSE;
> 
>   IF (P_SUB_ATT = 'SEARCHABLE') THEN
>     SELECT CLA_ID INTO T_CLA_ID FROM DR$CLASS WHERE CLA_NAME = 'SECTION_GROUP';
>     UPDATE DR$INDEX_OBJECT
>     SET    IXO_ACNT = IXO_ACNT - 1
>     WHERE
>            IXO_IDX_ID = PV_IDX_ID
>        AND IXO_CLA_ID = T_CLA_ID;
>     RETURN;
>   END IF;
> 
>   
>   IF (P_ATT_NAME <> PV_PRE_ATT_NAME) THEN
> 
>      PV_OAT_ID       := 0; 
> 
>      
>      PV_PRE_ATT_NAME := P_ATT_NAME;
> 
>      FOR C1 IN (SELECT OAT_ID 
>                   FROM DR$OBJECT_ATTRIBUTE
>                  WHERE OAT_CLA_ID = PV_CLA_ID
>                    AND OAT_OBJ_ID = PV_OBJ_ID
>                    AND OAT_NAME   = P_ATT_NAME) LOOP
>         PV_OAT_ID := C1.OAT_ID;
>      END LOOP;
> 
>      IF (PV_OAT_ID = 0) THEN
>         DRUE.PUSH(DRIG.IE_INVALID_ATTRIBUTE, P_ATT_NAME);
>         DRUE.RAISE;
>      END IF;
>   END IF;
> 
>   
>   L_SUB_OAT_ID := 0;
>   IF (P_SUB_ATT IS NOT NULL) THEN
>     IF (P_ATT_NAME = 'SECTION_ATTRIBUTE') THEN
>       SELECT CLA_ID INTO T_CLA_ID FROM DR$CLASS WHERE CLA_NAME = 'SECTION';
>       USE_TEMP_CLA_ID := TRUE; 
> 
>     END IF;
>     IF (P_SUB_ATT = 'SORTABLE') THEN
>       L_SUB_OAT_ID := 240110;
> 
>       UPDATE DR$INDEX
>       SET   IDX_OPTION = IDX_OPTION || 's'
>       WHERE
>             IDX_ID = PV_IDX_ID;
>     ELSE
>       
>       IF NOT USE_TEMP_CLA_ID THEN 
>          T_CLA_ID := PV_CLA_ID;
>       END IF;
> 
>       FOR C1 IN (SELECT OAT_ID 
>                    FROM DR$OBJECT_ATTRIBUTE, DR$OBJECT
>                   WHERE OAT_CLA_ID = T_CLA_ID
>                     AND OAT_OBJ_ID = OBJ_ID
>                     AND OAT_NAME   = P_SUB_ATT
>                     AND OBJ_NAME   = P_SUB_OBJ) 
>       LOOP
>          L_SUB_OAT_ID := C1.OAT_ID;
>       END LOOP;
>     END IF;
>   END IF;
>  
>   INSERT INTO DR$INDEX_VALUE 
>                          (IXV_IDX_ID, 
>                           IXV_OAT_ID, 
>                           IXV_VALUE,
>                           IXV_SUB_GROUP,
>                           IXV_SUB_OAT_ID)
>                       VALUES 
>                          (PV_IDX_ID, 
>                           PV_OAT_ID, 
>                           P_SUB_VALUE,
>                           P_SUB_GROUP,
>                           L_SUB_OAT_ID);
> 
> 
> EXCEPTION
>   WHEN DR_DEF.TEXTILE_ERROR THEN
>      DRIUTL.DRUEBRK;  
>      GOTO TIDYUP;
>   WHEN OTHERS THEN
>      DRUE.TEXT_ON_STACK(SQLERRM, 'drixmd.insert_sub_value');
> <<TIDYUP>>
>      DRUE.PUSH(DRIG.IE_SET_ATT_FAILED, P_ATT_NAME);
>      DRUE.RAISE;
> END INSERT_SUB_VALUE;
> 
> 
> 
> PROCEDURE INSERT_PENDING(
>   P_PID    IN   NUMBER,
>   P_ROWID  IN   ROWID
> ) ACCESSIBLE BY (CTXSYS.DRIIMP) IS
>   LV_USER_ID NUMBER;
> BEGIN
>   
>   IF (PV_IDX_ID = -1) THEN
>     RAISE DR_DEF.TEXTILE_ERROR;
>   END IF;
> 
>   INSERT INTO DR$PENDING 
>    (PND_CID, PND_PID, PND_ROWID, PND_TIMESTAMP, PND_LOCK_FAILED)
>    VALUES (PV_IDX_ID, P_PID, P_ROWID, SYSDATE, 'N');
> EXCEPTION
>   WHEN DUP_VAL_ON_INDEX THEN
>      NULL;
>   WHEN DR_DEF.TEXTILE_ERROR THEN
>      DRIUTL.DRUEBRK;  
>      DRUE.RAISE;
>   WHEN OTHERS THEN
>      DRUE.TEXT_ON_STACK(SQLERRM, 'drixmd.add_pending');
>      DRUE.RAISE;
> END INSERT_PENDING;
> 
> 
> PROCEDURE INSERT_CDICOL(
>   P_CDI_COLUMN_POSITION    IN   NUMBER,
>   P_CDI_COLUMN_NAME        IN   VARCHAR2,
>   P_CDI_COLUMN_TYPE        IN   VARCHAR2,
>   P_CDI_COLUMN_TYPE#       IN   NUMBER,
>   P_CDI_COLUMN_LENGTH      IN   NUMBER,
>   P_CDI_SECTION_NAME       IN   VARCHAR2,
>   P_CDI_SECTION_TYPE       IN   NUMBER,
>   P_CDI_SECTION_ID         IN   NUMBER,
>   P_CDI_SORT_ORDER         IN   VARCHAR2
> ) ACCESSIBLE BY (CTXSYS.DRIIMP) IS 
>   LV_USER_ID NUMBER;
> BEGIN
>   
>   IF (PV_IDX_ID = -1) THEN
>     RAISE DR_DEF.TEXTILE_ERROR;
>   END IF;
> 
>   INSERT INTO DR$INDEX_CDI_COLUMN
>     (CDI_IDX_ID,
>      CDI_COLUMN_POSITION,
>      CDI_COLUMN_NAME,
>      CDI_COLUMN_TYPE,
>      CDI_COLUMN_TYPE#,
>      CDI_COLUMN_LENGTH,
>      CDI_SECTION_NAME,
>      CDI_SECTION_TYPE,
>      CDI_SECTION_ID,
>      CDI_SORT_ORDER)
>   VALUES
>     (PV_IDX_ID,
>      P_CDI_COLUMN_POSITION,
>      P_CDI_COLUMN_NAME,
>      P_CDI_COLUMN_TYPE,
>      P_CDI_COLUMN_TYPE#,
>      P_CDI_COLUMN_LENGTH,
>      P_CDI_SECTION_NAME,
>      P_CDI_SECTION_TYPE,
>      P_CDI_SECTION_ID,
>      P_CDI_SORT_ORDER);  
> 
> EXCEPTION
>   WHEN DR_DEF.TEXTILE_ERROR THEN
>      DRIUTL.DRUEBRK;  
>      GOTO TIDYUP;
>   WHEN OTHERS THEN
>      DRUE.TEXT_ON_STACK(SQLERRM, 'drixmd.insert_cdicol');
> <<TIDYUP>>
>      DRUE.PUSH(DRIG.IE_CREATE_CDI_FAILED);
>      DRUE.RAISE;
> END INSERT_CDICOL;
> 
> 
> PROCEDURE INSERT_USER_EXTRACT_RULE(
>   P_ERL_RULE_ID     IN  NUMBER,
>   P_ERL_LANGUAGE    IN  VARCHAR2,
>   P_ERL_RULE        IN  VARCHAR2,
>   P_ERL_MODIFIER    IN  VARCHAR2,
>   P_ERL_TYPE        IN  VARCHAR2,
>   P_ERL_STATUS      IN  NUMBER,
>   P_ERL_COMMENTS    IN  VARCHAR2
> ) ACCESSIBLE BY (CTXSYS.DRIIMP) IS
> BEGIN
>   
>   IF (PV_IDX_ID = -1) THEN
>     RAISE DR_DEF.TEXTILE_ERROR;
>   END IF;
> 
>   INSERT INTO DR$USER_EXTRACT_RULE
>     (ERL_POL_ID,
>      ERL_RULE_ID,
>      ERL_LANGUAGE,
>      ERL_RULE,
>      ERL_MODIFIER,
>      ERL_TYPE,
>      ERL_STATUS,
>      ERL_COMMENTS)
>    VALUES
>     (PV_IDX_ID,
>      P_ERL_RULE_ID,
>      P_ERL_LANGUAGE,
>      P_ERL_RULE,
>      P_ERL_MODIFIER,
>      P_ERL_TYPE,
>      P_ERL_STATUS,
>      P_ERL_COMMENTS);    
> EXCEPTION
>   WHEN DR_DEF.TEXTILE_ERROR THEN
>      DRIUTL.DRUEBRK;  
>      DRUE.RAISE;
>   WHEN OTHERS THEN
>      DRUE.TEXT_ON_STACK(SQLERRM, 'drixmd.add_user_extract_rule');
>      DRUE.RAISE;
> END INSERT_USER_EXTRACT_RULE;
> 
> 
> 
CTXSYS.DRUE - PACKAGE BODY (RU):
42a43,54
> PROCEDURE GETMSG(MSGID IN BINARY_INTEGER, MSGTEXT OUT VARCHAR2)
>             IS LANGUAGE C
>             NAME "message"
>             LIBRARY DR$LIB
>             WITH CONTEXT
>             PARAMETERS (
>              CONTEXT,
>              MSGID   UB4,
>              MSGTEXT STRING
>             );
> 
> 
56c68
<   DRVDISP.GETMSG(ID, TEXT);
---
>   GETMSG(ID, TEXT);
CTXSYS.DRVDDL - PACKAGE BODY (RU):
7014a7015
>   L_IXP_NAME DRVUTL.DR_QLID := NULL;
7070a7072,7074
>   IF IXP.IXP_NAME IS NOT NULL THEN
>     L_IXP_NAME := DBMS_ASSERT.ENQUOTE_NAME(IXP.IXP_NAME, FALSE);
>   END IF;
7075c7079,7081
<                            IDX.IDX_OWNER, IDX.IDX_NAME, IXP.IXP_NAME,
---
>                            DBMS_ASSERT.ENQUOTE_NAME(IDX.IDX_OWNER, FALSE), 
>                            DBMS_ASSERT.ENQUOTE_NAME(IDX.IDX_NAME, FALSE), 
>                            L_IXP_NAME,
CTXSYS.DRVDISP - PACKAGE BODY (RU):
829,840d828
< 
< PROCEDURE GETMSG(MSGID IN BINARY_INTEGER, MSGTEXT OUT VARCHAR2)
<             IS LANGUAGE C
<             NAME "message"
<             LIBRARY DR$LIB
<             WITH CONTEXT
<             PARAMETERS (
<              CONTEXT,
<              MSGID   UB4,
<              MSGTEXT STRING
<             );
< 
CTXSYS.DRVLSB - PACKAGE BODY (RU):
1557c1557
<     L_IDX_NAME := DRIUTL.GET_SHADOW_INDEX(DRIUTL.ENQUOTE_PARTS(IDX_NAME, FALSE), IDX_SUFFIX);
---
>     L_IDX_NAME := DRIUTL.GET_SHADOW_INDEX(DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(IDX_NAME), IDX_SUFFIX);
1631c1631
<     L_IDX_NAME := DRIUTL.ENQUOTE_PARTS(DRIUTL.GET_SHADOW_INDEX(IDX_NAME, IDX_SUFFIX));
---
>     L_IDX_NAME := DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(DRIUTL.GET_SHADOW_INDEX(IDX_NAME, IDX_SUFFIX));
1779c1779
<                     DRIUTL.ENQUOTE_PARTS(IDX_NAME, FALSE),
---
>                     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(IDX_NAME),
1900c1900
<     L_IDX_NAME := DRIUTL.GET_SHADOW_INDEX(DRIUTL.ENQUOTE_PARTS(IDX_NAME, FALSE), IDX_SUFFIX);
---
>     L_IDX_NAME := DRIUTL.GET_SHADOW_INDEX(DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(IDX_NAME), IDX_SUFFIX);
2012c2012
<                     DRIUTL.ENQUOTE_PARTS(IDX_NAME, FALSE), 
---
>                     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(IDX_NAME), 
2128c2128
<     L_IDX_NAME := DRIUTL.GET_SHADOW_INDEX(DRIUTL.ENQUOTE_PARTS(IDX_NAME, FALSE), IDX_SUFFIX);
---
>     L_IDX_NAME := DRIUTL.GET_SHADOW_INDEX(DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(IDX_NAME), IDX_SUFFIX);
2253c2253
<     L_IDX_NAME := DRIUTL.GET_SHADOW_INDEX(DRIUTL.ENQUOTE_PARTS(IDX_NAME, FALSE), IDX_SUFFIX);
---
>     L_IDX_NAME := DRIUTL.GET_SHADOW_INDEX(DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(IDX_NAME), IDX_SUFFIX);
CTXSYS.DRVPARX - PACKAGE BODY (RU):
222a223,227
>   L_OWNER DRVUTL.DR_QLID;
>   L_IDXNAME DRVUTL.DR_QLID;
>   L_PARTNAME DRVUTL.DR_QLID := NULL;
>   IDX_ACCESS NUMBER;
>   VALID_USER NUMBER;
226a232,237
> 
>   IF ((OWNER IS NULL) OR (IDXNAME IS NULL)) THEN  
>     DRUE.PUSH(DRIG.PF_INV_PARAM_VALUE);
>     DRUE.RAISE;
>   END IF;
> 
228,231c239,241
<   
<   IF ((LENGTHB(OWNER) > 130) OR
<       (LENGTHB(IDXNAME) > 130) OR
<       (LENGTHB(OWNER) > 130)) THEN
---
>   IF ((LENGTHB(OWNER) > DRVUTL.DR_QLID_LEN) OR
>       (LENGTHB(IDXNAME) > DRVUTL.DR_QLID_LEN) OR
>       (LENGTHB(PARTNAME) > DRVUTL.DR_QLID_LEN)) THEN
235a246,264
>   DBMS_UTILITY.CANONICALIZE(OWNER, L_OWNER, DRVUTL.DR_QLID_LEN);
>   DBMS_UTILITY.CANONICALIZE(IDXNAME, L_IDXNAME, DRVUTL.DR_QLID_LEN);
>   IF PARTNAME IS NOT NULL THEN
>     DBMS_UTILITY.CANONICALIZE(PARTNAME, L_PARTNAME, DRVUTL.DR_QLID_LEN);
>   END IF;
> 
>   BEGIN
>     
>     SELECT 1 INTO VALID_USER FROM SYS.ALL_USERS
>     WHERE USERNAME = L_OWNER AND USER_ID = OWNID AND ROWNUM = 1; 
> 
>     
>     SELECT 1 INTO IDX_ACCESS FROM SYS.ALL_INDEXES 
>     WHERE OWNER = L_OWNER AND INDEX_NAME = L_IDXNAME AND ROWNUM = 1;
>   EXCEPTION
>   WHEN OTHERS THEN
>     DRUE.RAISE;
>   END;
> 
237c266
<   TRET := INDEXMAPDOCUMENTS2(CRSR, OWNID, OWNER, IDXNAME, PARTNAME,
---
>   TRET := INDEXMAPDOCUMENTS2(CRSR, OWNID, L_OWNER, L_IDXNAME, L_PARTNAME,
CTXSYS.DRVTMT - PACKAGE BODY (RU):
64c64
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(TABNAME, FALSE));
---
>     DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(TABNAME);
78,79d77
< 	DRIACC.SPLIT_SPEC(LV_RESTAB, 'TABLE', LV_OWNER,LV_OBJECT, LV_FUNC,
<                           LV_LINK);
242c240
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(TABNAME, FALSE));
---
>     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(TABNAME));
256,257d253
<         DRIACC.SPLIT_SPEC(LV_TABNAME, 'TABLE', LV_OWNER,LV_OBJECT, LV_FUNC,
<                           LV_LINK);
385c381
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(CATTAB));
---
>     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(CATTAB));
387c383
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(CATDOCID));
---
>     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(CATDOCID));
389c385
<     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTE_PARTS(CATID));
---
>     DBMS_ASSERT.QUALIFIED_SQL_NAME(DRIUTL.ENQUOTECOMPOUNDOBJECTNAME(CATID));
MDSYS.MDPRVT_IDX - PACKAGE BODY (RU):
943a944,958
>     
>     
>     
>     IF ( BITAND(SDO_PARTITIONED,
>                 MDIDX_MODEL_SYSTEM_MANAGED) = MDIDX_MODEL_SYSTEM_MANAGED ) THEN
>       IF (INDEX_AGGREGATES%NOTFOUND) THEN
>         CLOSE INDEX_AGGREGATES;
>         OPEN INDEX_AGGREGATES(IA.INDEXSCHEMA, IA.INDEXNAME);
>         FETCH INDEX_AGGREGATES INTO
>           SDO_INDEX_OWNER,
>           SDO_INDEX_NAME,
>           SDO_INDEX_OID;
>       END IF;
>     END IF;
> 
1138c1153,1158
<               '); END;' || NEWLINE;
---
>               '); ' || NEWLINE;
>       STMT1 := STMT1 || 'exception when others then' || NEWLINE;
>       STMT1 := STMT1 || '  dbms_output.put_line(''Unexpected failure inserting metadata'');' || NEWLINE;
>       STMT1 := STMT1 || '  dbms_output.put_line(''Error='' || SQLERRM);' || NEWLINE;
>       STMT1 := STMT1 || '  RAISE;' || NEWLINE;
>       STMT1 := STMT1 || 'END;' || NEWLINE;
MDSYS.MD_NFE - PACKAGE BODY (RU):
908c908
<       V_STMT := GET_LL_INTERSECTION_PTS_QRY (MODEL_ID, RULE_ID, PTS_AUX_GEOM_COLUMN);
---
>       V_STMT := SYS.DBMS_ASSERT.NOOP(GET_LL_INTERSECTION_PTS_QRY (MODEL_ID, RULE_ID, PTS_AUX_GEOM_COLUMN));
910c910
<       V_STMT := GET_LP_INTERSECTION_PTS_QRY (MODEL_ID, RULE_ID, PTS_AUX_GEOM_COLUMN);
---
>       V_STMT := SYS.DBMS_ASSERT.NOOP(GET_LP_INTERSECTION_PTS_QRY (MODEL_ID, RULE_ID, PTS_AUX_GEOM_COLUMN));
924c924
<     EXECUTE IMMEDIATE 'CREATE TABLE ' || PTS_AUX_TAB_NAME || ' AS ' || V_STMT;
---
>     EXECUTE IMMEDIATE 'CREATE TABLE ' || PTS_AUX_TAB_NAME || ' AS ' || SYS.DBMS_ASSERT.NOOP(V_STMT);
1000,1001c1000,1001
<     QRY := GET_UNDELYING_NET_ELEMS_QRY(MODEL_ID, LINE_FT_LAYER_ID, LINE_FT_CLASS_ID, LINE_ATTR_COND, SDO_NET.FEAT_ELEM_TYPE_LINE);
<     QRY := 'SELECT COUNT(*) FROM (' || QRY || ' AND lk.end_node_id = :P1' || ')';
---
>     QRY := SYS.DBMS_ASSERT.NOOP(GET_UNDELYING_NET_ELEMS_QRY(MODEL_ID, LINE_FT_LAYER_ID, LINE_FT_CLASS_ID, LINE_ATTR_COND, SDO_NET.FEAT_ELEM_TYPE_LINE));
>     QRY := 'SELECT COUNT(*) FROM (' || SYS.DBMS_ASSERT.NOOP(QRY) || ' AND lk.end_node_id = :P1' || ')';
1012,1013c1012,1013
<     QRY := GET_UNDELYING_NET_ELEMS_QRY(MODEL_ID, LINE_FT_LAYER_ID, LINE_FT_CLASS_ID, LINE_ATTR_COND, SDO_NET.FEAT_ELEM_TYPE_LINE);
<     QRY := 'SELECT COUNT(*) FROM (' || QRY || ' AND lk.start_node_id = :P1' || ')';
---
>     QRY := SYS.DBMS_ASSERT.NOOP(GET_UNDELYING_NET_ELEMS_QRY(MODEL_ID, LINE_FT_LAYER_ID, LINE_FT_CLASS_ID, LINE_ATTR_COND, SDO_NET.FEAT_ELEM_TYPE_LINE));
>     QRY := 'SELECT COUNT(*) FROM (' || SYS.DBMS_ASSERT.NOOP(QRY) || ' AND lk.start_node_id = :P1' || ')';
1484c1484
<         V_STMT := 'UPDATE ' || SYS.DBMS_ASSERT.QUALIFIED_SQL_NAME(FT_TAB_NAME) || ' SET ' || ATTR_COLS || ' WHERE feature_id = :p1';
---
>         V_STMT := 'UPDATE ' || SYS.DBMS_ASSERT.QUALIFIED_SQL_NAME(FT_TAB_NAME) || ' SET ' || SYS.DBMS_ASSERT.NOOP(ATTR_COLS) || ' WHERE feature_id = :p1';
1575c1575
<             V_STMT := ' SELECT count(*) FROM ' || SYS.DBMS_ASSERT.QUALIFIED_SQL_NAME(FEAT_TAB_NAME) || ' WHERE feature_id = :p1 AND ' || LPR_PT_ATTR_COND;
---
>             V_STMT := ' SELECT count(*) FROM ' || SYS.DBMS_ASSERT.QUALIFIED_SQL_NAME(FEAT_TAB_NAME) || ' WHERE feature_id = :p1 AND ' || SYS.DBMS_ASSERT.NOOP(LPR_PT_ATTR_COND);
MDSYS.SDO_IDX - PACKAGE BODY (RU):
262a263,264
>     OBJECT_EXISTS EXCEPTION;
>     PRAGMA EXCEPTION_INIT(OBJECT_EXISTS, -00955);
356,361c358,370
<       EXECUTE IMMEDIATE 'CREATE SEQUENCE '|| 
<         SYS.DBMS_ASSERT.ENQUOTE_NAME(SYS.DBMS_ASSERT.SCHEMA_NAME(
<            SCHEMA_NAME)) || '.' || 
<         SYS.DBMS_ASSERT.ENQUOTE_NAME(SYS.DBMS_ASSERT.SIMPLE_SQL_NAME(
<            SDO_RTREE_SEQ_NAME)) || ' ORDER CACHE 100 START WITH ' || 
<         SYS.DBMS_ASSERT.NOOP(SDO_UTIL.NUMBER_TO_CHAR(SDO_RTREE_NUM_NODES));
---
>       BEGIN
>         
>         
>         EXECUTE IMMEDIATE 'CREATE SEQUENCE ' || 
>           SYS.DBMS_ASSERT.ENQUOTE_NAME(SYS.DBMS_ASSERT.SCHEMA_NAME(
>              SCHEMA_NAME)) || '.' || 
>           SYS.DBMS_ASSERT.ENQUOTE_NAME(SYS.DBMS_ASSERT.SIMPLE_SQL_NAME(
>              SDO_RTREE_SEQ_NAME)) || ' ORDER CACHE 100 START WITH ' || 
>           SYS.DBMS_ASSERT.NOOP(SDO_UTIL.NUMBER_TO_CHAR(SDO_RTREE_NUM_NODES));
>         EXCEPTION
>           WHEN OBJECT_EXISTS THEN NULL;
>           WHEN OTHERS THEN RAISE;
>       END;
MDSYS.SDO_NFE - PACKAGE BODY (RU):
1165c1165
<           V_STMT := 'SELECT count(*) FROM ' || SYS.DBMS_ASSERT.QUALIFIED_SQL_NAME(FEAT_TAB_NAME) || ' WHERE feature_id = :p1 AND ' || LPR_LN_ATTR_COND;
---
>           V_STMT := 'SELECT count(*) FROM ' || SYS.DBMS_ASSERT.QUALIFIED_SQL_NAME(FEAT_TAB_NAME) || ' WHERE feature_id = :p1 AND ' || SYS.DBMS_ASSERT.NOOP(LPR_LN_ATTR_COND);
SYS.ORA12C_STIG_VERIFY_FUNCTION - FUNCTION (RU):
16,17c16,17
<    if not ora_complexity_check(password, chars => 15, upper => 1, lower => 1,
<                            digit => 1, special => 1) then
---
>    if not ora_complexity_check(password, chars => 15, uppercase => 1,
>                            lowercase => 1, digit => 1, special => 1) then
SYS.ORA12C_STRONG_VERIFY_FUNCTION - FUNCTION (RU):
16,17c16,17
<    if not ora_complexity_check(password, chars => 9, upper => 2, lower => 2,
<                            digit => 2, special => 2) then
---
>    if not ora_complexity_check(password, chars => 9, uppercase => 2,
>                            lowercase => 2, digit => 2, special => 2) then
SYS.ORA_COMPLEXITY_CHECK - FUNCTION (RU):
5,6c5,6
<  upper    integer := null,
<  lower    integer := null,
---
>  uppercase    integer := null,
>  lowercase    integer := null,
10,11d9
<    digit_array varchar2(10) := '0123456789';
<    alpha_array varchar2(26) := 'abcdefghijklmnopqrstuvwxyz';
20,22c18,20
<    ch          char(1);
<    lang        varchar2(512);
<    message     varchar2(512);
---
>    ch          char(1 char);
>    lang        varchar2(512 byte);
>    message     varchar2(512 char);
31,39d28
<    lang := substr(lang,1,instr(lang,'_')-1);
< 
<    -- Check that the password length does not exceed 30 bytes
<    -- This limit improves the performance of the Edit Distance calculation
<    -- between old and new passwords.
<    if len > 30 then
<       ret := utl_lms.get_message(28218, 'RDBMS', 'ORA', lang, message);
<       raise_application_error(-20000, message);
<    end if;
46,53c35,57
<       elsif instr(digit_array, ch) > 0 then
<          cnt_digit := cnt_digit + 1;
<       elsif instr(alpha_array, nls_lower(ch)) > 0 then
<          cnt_letter := cnt_letter + 1;
<          if ch = nls_lower(ch) then
<             cnt_lower := cnt_lower + 1;
<          else
<             cnt_upper := cnt_upper + 1;
---
>          -- Got a delimiter, no need to validate other characters.
>          exit;
>          -- Observes alphabetic, numeric and special characters.
>          -- If a character is neither alphabetic nor numeric,
>          -- it is considered special.
>       elsif regexp_instr(ch, '[[:alnum:]]') > 0 then
>          if regexp_instr(ch, '[[:digit:]]') > 0 then
>             cnt_digit := cnt_digit + 1;
>          -- Certain characters can be both, numeric and alphabetic,
>          -- Such characters will be counted in both categories.
>          -- Ex:Roman Numerals('I'(U+2160),'II'(U+2161),'i'(U+2170),'ii'(U+2171))
>          end if;
>          if regexp_instr(ch, '[[:alpha:]]') > 0 then
>             cnt_letter := cnt_letter + 1;
>             if regexp_instr(ch, '[[:lower:]]') > 0 then
>                cnt_lower := cnt_lower + 1;
>             end if;
>             -- Certain alphabetic characters can be both upper- or lowercase.
>             -- Such characters will be counted in both categories.
>             -- Ex:Latin Digraphs and Ligatures ('Nj'(U+01CB), 'Dz'(U+01F2))
>             if regexp_instr(ch, '[[:upper:]]') > 0 then
>                cnt_upper := cnt_upper + 1;
>             end if;
73c77
<    if upper is not null and cnt_upper < upper then
---
>    if uppercase is not null and cnt_upper < uppercase then
75c79
<       raise_application_error(-20000, utl_lms.format_message(message, CAST(upper AS PLS_INTEGER)));
---
>       raise_application_error(-20000, utl_lms.format_message(message, CAST(uppercase AS PLS_INTEGER)));
77c81
<    if lower is not null and cnt_lower < lower then
---
>    if lowercase is not null and cnt_lower < lowercase then
79c83
<       raise_application_error(-20000, utl_lms.format_message(message, CAST(lower AS PLS_INTEGER)));
---
>       raise_application_error(-20000, utl_lms.format_message(message, CAST(lowercase AS PLS_INTEGER)));
SYS.ORA_STRING_DISTANCE - FUNCTION (RU):
23,28d22
<    -- Bug 18237713 : If source or target length exceeds max DB password length
<    -- that is 30 bytes, then raise exception.
<    -- Bug 21109302 : Password length cannot exceed 30 bytes
<    elsif t_len > 30 or s_len > 30 then
<      ret := utl_lms.get_message(28218, 'RDBMS', 'ORA', lang, message);
<      raise_application_error(-20000, message);
SYS.DBMS_BACKUP_RESTORE - PACKAGE (RU):
12c12
<   bannerVersion CONSTANT VARCHAR2(15) := '18.02.00.00';
---
>   bannerVersion CONSTANT VARCHAR2(15) := '18.03.00.00';
24,26c24,26
<   fsn  CONSTANT NUMBER := instr('18.02.00.00', '.');
<   msn  CONSTANT NUMBER := instr('18.02.00.00', '.', fsn + 1);
<   psn  CONSTANT NUMBER := instr('18.02.00.00', '.', msn + 1);
---
>   fsn  CONSTANT NUMBER := instr('18.03.00.00', '.');
>   msn  CONSTANT NUMBER := instr('18.03.00.00', '.', fsn + 1);
>   psn  CONSTANT NUMBER := instr('18.03.00.00', '.', msn + 1);
29c29
<                            to_number(substr('18.02.00.00', 1, fsn - 1));
---
>                            to_number(substr('18.03.00.00', 1, fsn - 1));
31c31
<                to_number(substr('18.02.00.00', fsn + 1, msn - fsn - 1));
---
>                to_number(substr('18.03.00.00', fsn + 1, msn - fsn - 1));
33c33
<               to_number(substr('18.02.00.00',  msn + 1, psn - msn - 1));
---
>               to_number(substr('18.03.00.00',  msn + 1, psn - msn - 1));
35c35
<                              to_number(substr('18.02.00.00',  psn + 1));
---
>                              to_number(substr('18.03.00.00',  psn + 1));
SYS.DBMS_BACKUP_RESTORE - PACKAGE (18.2RUR):
12c12
<   bannerVersion CONSTANT VARCHAR2(15) := '18.02.00.00';
---
>   bannerVersion CONSTANT VARCHAR2(15) := '18.02.01.00';
24,26c24,26
<   fsn  CONSTANT NUMBER := instr('18.02.00.00', '.');
<   msn  CONSTANT NUMBER := instr('18.02.00.00', '.', fsn + 1);
<   psn  CONSTANT NUMBER := instr('18.02.00.00', '.', msn + 1);
---
>   fsn  CONSTANT NUMBER := instr('18.02.01.00', '.');
>   msn  CONSTANT NUMBER := instr('18.02.01.00', '.', fsn + 1);
>   psn  CONSTANT NUMBER := instr('18.02.01.00', '.', msn + 1);
29c29
<                            to_number(substr('18.02.00.00', 1, fsn - 1));
---
>                            to_number(substr('18.02.01.00', 1, fsn - 1));
31c31
<                to_number(substr('18.02.00.00', fsn + 1, msn - fsn - 1));
---
>                to_number(substr('18.02.01.00', fsn + 1, msn - fsn - 1));
33c33
<               to_number(substr('18.02.00.00',  msn + 1, psn - msn - 1));
---
>               to_number(substr('18.02.01.00',  msn + 1, psn - msn - 1));
35c35
<                              to_number(substr('18.02.00.00',  psn + 1));
---
>                              to_number(substr('18.02.01.00',  psn + 1));
SYS.DBMS_IR - PACKAGE (RU):
1c1
< PACKAGE dbms_ir AS
---
> PACKAGE dbms_ir AUTHID current_user AS
SYS.DBMS_PRVTAQIS - PACKAGE (RU):
6a7,9
>   ADDR_LEN                  CONSTANT BINARY_INTEGER := 1024 ;
> 
>   
SYS.DBMS_REDEFINITION_INTERNAL - PACKAGE (RU):
361a362,368
>   CURSOR VPD_POLICIES(UNAME VARCHAR2, TNAME VARCHAR2) IS
>       SELECT POLICY_GROUP, POLICY_NAME
>       FROM   DBA_POLICIES
>       WHERE  OBJECT_OWNER = UNAME AND
>              OBJECT_NAME = TNAME;
> 
>   
SYS.DBMS_REGISTRY - PACKAGE (RU):
13c13
<                                '18.2.0.0.0';
---
>                                '18.3.0.0.0';
231,233c231,237
< PROCEDURE RU_apply    (comp_version IN VARCHAR2 DEFAULT NULL);
< 
< PROCEDURE RU_rollback (comp_version IN VARCHAR2 DEFAULT NULL);
---
> PROCEDURE RU_apply    (comp_version      IN VARCHAR2  DEFAULT NULL,
>                        build_description IN VARCHAR2  DEFAULT NULL,
>                        build_timestamp   IN TIMESTAMP DEFAULT NULL);
> 
> PROCEDURE RU_rollback (comp_version      IN VARCHAR2  DEFAULT NULL,
>                        build_description IN VARCHAR2  DEFAULT NULL,
>                        build_timestamp   IN TIMESTAMP DEFAULT NULL);
SYS.DBMS_REGISTRY - PACKAGE (18.2RUR):
13c13
<                                '18.2.0.0.0';
---
>                                '18.2.1.0.0';
SYS.DBMS_SMB_INTERNAL - PACKAGE (RU):
77d76
<         OTHER               LONG,
205d203
<              null other, 
SYS.DBMS_SODA_UTIL - PACKAGE (RU):
21a22,23
>                                arg2 IN VARCHAR2, arg3 IN VARCHAR2);
>   procedure raise_system_error(error_number IN INTEGER, arg1 IN VARCHAR2,
SYS.DBMS_SPM_INTERNAL - PACKAGE (RU):
31a32,37
>   AUTOCAP_SQL_TEXT CONSTANT VARCHAR2(22) := 'AUTO_CAPTURE_SQL_TEXT';
>   AUTOCAP_MODULE   CONSTANT VARCHAR2(20) := 'AUTO_CAPTURE_MODULE';
>   AUTOCAP_ACTION   CONSTANT VARCHAR2(20) := 'AUTO_CAPTURE_ACTION';
>   AUTOCAP_USER     CONSTANT VARCHAR2(33) := 'AUTO_CAPTURE_PARSING_SCHEMA_NAME';
> 
>   
49a56,76
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   PROCEDURE GET_CONFIG_FILTER_NUM_AND_LEN( NUM_FILTERS  OUT PLS_INTEGER,
>                                            LEN_FILTERS  OUT PLS_INTEGER
>   );
> 
818a846
>   
826c854,855
<                                DBID         IN NUMBER   := NULL)
---
>                                DBID         IN NUMBER   := NULL,
>                                LOAD_USER    IN VARCHAR2)
851a881
>   
858c888,889
<                                IS_EVOLVE        IN BOOLEAN
---
>                                IS_EVOLVE        IN BOOLEAN,
>                                LOAD_USER        IN VARCHAR2
912a944
>   
919c951,952
<                                    IS_EVOLVE          IN BOOLEAN  := FALSE
---
>                                    IS_EVOLVE          IN BOOLEAN  := FALSE,
>                                    LOAD_USER          IN VARCHAR2
SYS.DBMS_SQLDIAG - PACKAGE (RU):
1246a1247,1367
>   -------------------------- sql_diagnose_and_repair ------------------------
>   -- NAME:
>   --     sql_diagnose_and_repair
>   --
>   -- DESCRIPTION:
>   --     Diagnose a given sql statement for a given sql id for the given
>   --     problem type. It creates an incident, populate incident metadata with
>   --     required information like, sqlid, sql text, compilation env etc,
>   --     creates a diagnostic task, executes it and accepts SQL PATCH
>   --     recommendation for a given SQL Id.
>   --
>   -- PARAMETERS:
>   --     sql_id          (IN) - sql id to diagnose and repair
>   --     plan_hash_value (IN) - plan to be used for diagnosis
>   --     scope           (IN) - scope of diagnostic advisor
>   --                            SCOPE_LIMITED -
>   --                               Only index and plan analyze is invoked for
>   --                               a given SQL.
>   --                            SCOPE_COMPREHENSIVE -
>   --                               Besides index and plan analyze, auto-tune
>   --                               will be called first to tune the statement.
>   --     time_limit      (IN)  - time limit for diagnostic task
>   --     problem_type    (IN)  - problem type being diagnosed
>   --                             PROBLEM_TYPE_PERFORMANCE - performance problem
>   --                             PROBLEM_TYPE_WRONG_RESULTS - incorrect results
>   --                             PROBLEM_TYPE_COMPILATION_ERROR -
>   --                                  crash during compilation of the statement
>   --                             PROBLEM_TYPE_EXECUTION_ERROR -
>   --                                    crash during execution of the statement
>   --     auto_apply_patch (IN) - whether to accept recommended SQL patch
>   -----------------------------------------------------------------------------
> 
>   FUNCTION sql_diagnose_and_repair(
>     sql_id             IN   VARCHAR2,
>     plan_hash_value    IN   NUMBER   := NULL,
>     scope              IN   VARCHAR2 := SCOPE_COMPREHENSIVE,
>     time_limit         IN   NUMBER   := TIME_LIMIT_DEFAULT,
>     problem_type       IN   NUMBER   := PROBLEM_TYPE_PERFORMANCE,
>     auto_apply_patch   IN   VARCHAR2 := 'YES')
>   RETURN NUMBER;
> 
>   -------------------------- sql_diagnose_and_repair ------------------------
>   -- NAME:
>   --     sql_diagnose_and_repair
>   --
>   -- DESCRIPTION:
>   --     Diagnose a given SQL statement for the given problem type.
>   --     It creates an incident, populate incident metadata with
>   --     required information like, sqlid, sql text, compilation env etc,
>   --     creates a diagnostic task, executes it and accepts SQL PATCH
>   --     recommendation for a given SQL statement.
>   --
>   -- PARAMETERS:
>   --     sql_text        (IN) - sql text to diagnose and repair
>   --     bind_list       (IN) - binds to be used for diagnosis
>   --     scope           (IN) - scope of diagnostic advisor
>   --                            SCOPE_LIMITED -
>   --                               Only index and plan analyze is invoked for
>   --                               a given SQL.
>   --                            SCOPE_COMPREHENSIVE -
>   --                               Besides index and plan analyze, auto-tune
>   --                               will be called first to tune the statement.
>   --     time_limit      (IN)  - time limit for diagnostic task
>   --     problem_type    (IN)  - problem type being diagnosed
>   --                             PROBLEM_TYPE_PERFORMANCE - performance problem
>   --                             PROBLEM_TYPE_WRONG_RESULTS - incorrect results
>   --                             PROBLEM_TYPE_COMPILATION_ERROR -
>   --                                  crash during compilation of the statement
>   --                             PROBLEM_TYPE_EXECUTION_ERROR -
>   --                                    crash during execution of the statement
>   --     auto_apply_patch (IN) - whether to accept recommended SQL patch
>   -----------------------------------------------------------------------------
> 
>   FUNCTION sql_diagnose_and_repair(
>     sql_text           IN   CLOB,
>     bind_list          IN   sql_binds := NULL,
>     scope              IN   VARCHAR2  := SCOPE_COMPREHENSIVE,
>     time_limit         IN   NUMBER    := TIME_LIMIT_DEFAULT,
>     problem_type       IN   NUMBER    := PROBLEM_TYPE_PERFORMANCE,
>     auto_apply_patch   IN   VARCHAR2  := 'YES')
>   RETURN NUMBER;
> 
>   -------------------------- sql_diagnose_and_repair ------------------------
>   -- NAME:
>   --     sql_diagnose_and_repair
>   --
>   -- DESCRIPTION:
>   --     Diagnose a given SQL statement for the given problem type.
>   --     It creates an incident, populate incident metadata with
>   --     required information like, sqlid, sql text, compilation env etc,
>   --     creates a diagnostic task, executes it and accepts SQL PATCH
>   --     recommendation for a given SQL statement.
>   --
>   -- PARAMETERS:
>   --     incident_id     (IN) - incident to diagnose and repair
>   --     scope           (IN) - scope of diagnostic advisor
>   --                            SCOPE_LIMITED -
>   --                               Only index and plan analyze is invoked for
>   --                               a given SQL.
>   --                            SCOPE_COMPREHENSIVE -
>   --                               Besides index and plan analyze, auto-tune
>   --                               will be called first to tune the statement.
>   --     time_limit      (IN)  - time limit for diagnostic task
>   --     problem_type    (IN)  - problem type being diagnosed
>   --                             PROBLEM_TYPE_PERFORMANCE - performance problem
>   --                             PROBLEM_TYPE_WRONG_RESULTS - incorrect results
>   --                             PROBLEM_TYPE_COMPILATION_ERROR -
>   --                                  crash during compilation of the statement
>   --                             PROBLEM_TYPE_EXECUTION_ERROR -
>   --                                    crash during execution of the statement
>   --     auto_apply_patch (IN) - whether to accept recommended SQL patch
>   -----------------------------------------------------------------------------
> 
>   FUNCTION sql_diagnose_and_repair(
>     incident_id        IN   NUMBER,
>     scope              IN   VARCHAR2 := SCOPE_COMPREHENSIVE,
>     time_limit         IN   NUMBER   := TIME_LIMIT_DEFAULT,
>     problem_type       IN   NUMBER   := PROBLEM_TYPE_PERFORMANCE,
>     auto_apply_patch   IN   VARCHAR2 := 'YES')
>   RETURN NUMBER;
> 
SYS.DBMS_SQLDIAG_INTERNAL - PACKAGE (RU):
9a10
>   ERR_PTYPE_INVALID             CONSTANT NUMBER := -13796;
52a54,56
>   
>   INCIDENT_TYPE_QRY_PERF   CONSTANT VARCHAR2(17) := 'Query_Performance';
>   INCIDENT_TYPE_SQL_FAIL   CONSTANT VARCHAR2(11) := 'SQL_Failure';
74a79,85
>   PROCEDURE I_CREATE_INCIDENT(
>     INCIDENTID    OUT     NUMBER,
>     INCIDENTTYPE  IN      VARCHAR2);
> 
>   PROCEDURE I_REMOVE_INCIDENT(
>     INCIDENTID    IN     NUMBER);
> 
127a139,152
>   
>   FUNCTION I_GET_INCIDENT_TYPE(PROBLEM_TYPE IN NUMBER)
>   RETURN VARCHAR2;
> 
>   
>   FUNCTION I_VALIDATE_PROBLEM_TYPE(PROBLEM_TYPE IN NUMBER)
>   RETURN NUMBER;
> 
>   
>   PROCEDURE I_GET_INCIDENT_FOR_SQLID(
>     SQL_ID         IN  VARCHAR2,
>     PROBLEM_TYPE   IN  NUMBER,
>     INCIDENT_ID    OUT NUMBER);
> 
SYS.DBMS_SQLTCB_INTERNAL - PACKAGE (RU):
58a59
>   SQL_TCB_PARAM_COMPRESS      CONSTANT VARCHAR2(20)   := 'COMPRESS';
96c97,98
<   SQL_TCB_BIND_LIST               CONSTANT VARCHAR2(9) := 'BIND_LIST';
---
>   SQL_TCB_BIND_LIST               CONSTANT VARCHAR2(9)  := 'BIND_LIST';
>   SQL_TCB_PROBLEM_TYPE            CONSTANT VARCHAR2(12) := 'PROBLEM_TYPE';
216c218,219
<     CTRLOPTIONS              IN   VARCHAR2  :=  NULL
---
>     CTRLOPTIONS              IN   VARCHAR2  :=  NULL,
>     PROBLEM_TYPE             IN   NUMBER    :=  0
322a326,329
>   
>   FUNCTION I_COMPRESS_TESTCASE(TESTCASE_NAME   IN VARCHAR2,
>                                DIRECTORY       IN VARCHAR2)
>   RETURN BOOLEAN;
SYS.AMGT$DATAPUMP - PACKAGE BODY (RU):
310c310
<       M_PLSQL_BLOCK := 'select tablespace_name from dba_tables where
---
>       M_PLSQL_BLOCK := 'select tablespace_name from sys.dba_tables where
324c324
<         M_PLSQL_BLOCK := 'select tablespace_name from dba_tables where
---
>         M_PLSQL_BLOCK := 'select tablespace_name from sys.dba_tables where
348c348
<           M_PLSQL_BLOCK := 'select tablespace_name from dba_tables where
---
>           M_PLSQL_BLOCK := 'select tablespace_name from sys.dba_tables where
413c413
<     SEL_SQL := 'select column_name from '|| 'dba_tab_columns where '||
---
>     SEL_SQL := 'select column_name from '|| 'sys.dba_tab_columns where '||
SYS.DBMS_IR - PACKAGE BODY (RU):
343a344,367
> PROCEDURE RESTRICTPDB( PROCEDURE_NAME IN VARCHAR2 DEFAULT '')
> IS
>   CONN       VARCHAR2(128);
>   CDBNAME    VARCHAR2(128);
> BEGIN
>    CDBNAME := SYS_CONTEXT('USERENV', 'CDB_NAME');
>    CONN := SYS_CONTEXT('USERENV','CON_NAME');
>    
>    IF CDBNAME IS NULL OR
>       (CDBNAME IS NOT NULL AND LOWER(CONN) = LOWER ('CDB$ROOT')) THEN
>      NULL;
>    ELSE
>      RAISE_INTERNAL_ERROR(PROCEDURE_NAME, 'cannot run on pdb');
>    END IF;
> END RESTRICTPDB;
> 
> 
> 
> 
> 
> 
> 
> 
> 
1564a1589,1590
>    RESTRICTPDB('createScriptFile');
> 
1611a1638,1639
>    RESTRICTPDB('openScriptFile');
> 
1668a1697,1698
>    RESTRICTPDB('openScriptFile');
> 
1719a1750,1751
>    RESTRICTPDB('addLine');
> 
1778a1811,1812
>    RESTRICTPDB('getLine');
> 
1828a1863,1864
>    RESTRICTPDB('writeFile');
> 
1895a1932,1933
>    RESTRICTPDB('getFile');
> 
1947a1986,1987
>    RESTRICTPDB('closeScriptFile');
> 
2000a2041,2042
>    RESTRICTPDB('execSqlScript');
> 
2103a2146,2147
>    RESTRICTPDB('getFile');
> 
SYS.DBMS_JSON0 - PACKAGE BODY (RU):
24c24
<   MINOR := TO_NUMBER(SUBSTR(COMP, (FIRSTDOT+1), (SECDOT-FIRSTDOT)));
---
>   MINOR := TO_NUMBER(SUBSTR(COMP, (FIRSTDOT+1), (SECDOT-FIRSTDOT-1)));
SYS.DBMS_PRVTAQIS - PACKAGE BODY (RU):
10a11
>   M_IDEN_LEN            CONSTANT NATURAL := SYS.DBMS_AQADM_VAR.GETIDNLENGTH;
540a542
>    WRITE_TRACE('queue_subscribers: Queue ' || Q_SCHEMA || ' ' || Q_NAME);
567,568c569,570
<       DBMS_SQL.DEFINE_COLUMN(SUB_CURSOR, 1, NAME, 30);
<       DBMS_SQL.DEFINE_COLUMN(SUB_CURSOR, 2, ADDRESS, 1024);
---
>       DBMS_SQL.DEFINE_COLUMN(SUB_CURSOR, 1, NAME, M_IDEN_LEN);
>       DBMS_SQL.DEFINE_COLUMN(SUB_CURSOR, 2, ADDRESS, ADDR_LEN);
577a580
>           WRITE_TRACE('queue_subscribers: aq$_agent(' || NAME || ',' || ADDRESS || ', 0)');
4651,4652c4654,4656
<       SUB_TABLE := DBMS_ASSERT.ENQUOTE_NAME(DQT||QT_SCHEMA||DQT) || '.' ||
<                    DBMS_ASSERT.ENQUOTE_NAME(DQT||'AQ$_'||QT_NAME||'_S'||DQT);
---
>       WRITE_TRACE('upgrade_90_92: Queue Table : ' || QT_SCHEMA || '.' || QT_NAME);
>       SUB_TABLE := DBMS_ASSERT.ENQUOTE_NAME(QT_SCHEMA, FALSE) || '.' ||
>                    DBMS_ASSERT.ENQUOTE_NAME('AQ$_'||QT_NAME||'_S', FALSE);
4660,4661c4664,4665
<       DBMS_SQL.DEFINE_COLUMN(SUBCUR, 2, SUB_RULE_NAME, 30);
<       DBMS_SQL.DEFINE_COLUMN(SUBCUR, 3, Q_NAME, 30);      
---
>       DBMS_SQL.DEFINE_COLUMN(SUBCUR, 2, SUB_RULE_NAME, M_IDEN_LEN);
>       DBMS_SQL.DEFINE_COLUMN(SUBCUR, 3, Q_NAME, M_IDEN_LEN);      
4670a4675,4677
>             WRITE_TRACE('upgrade_90_92: sub_rule_name = ' || SUB_RULE_NAME);
>             WRITE_TRACE('upgrade_90_92: q_name = ' || Q_NAME);
> 
4721a4729,4730
>     WRITE_TRACE('downgrade_92_90: Queue table ' || QT_SCHEMA || '.' || QT_NAME);
> 
4730,4731c4739,4740
<     DBMS_SQL.DEFINE_COLUMN(SUBCUR, 2, SUB_RULE_NAME, 30);
<     DBMS_SQL.DEFINE_COLUMN(SUBCUR, 3, SUB_RULESET_NAME, 65);
---
>     DBMS_SQL.DEFINE_COLUMN(SUBCUR, 2, SUB_RULE_NAME, M_IDEN_LEN);
>     DBMS_SQL.DEFINE_COLUMN(SUBCUR, 3, SUB_RULESET_NAME, M_IDEN_LEN);
4741a4751,4753
>            WRITE_TRACE('downgrade_92_90: sub_rule_name = ' || SUB_RULE_NAME);
>            WRITE_TRACE('downgrade_92_90: sub_ruleset_name = ' || SUB_RULESET_NAME);
> 
4948a4961,4962
>    WRITE_TRACE('fix_subtab: Subscriber Table ' || RSCHEMA || '.' || SUBTAB);
> 
4953,4954c4967,4968
<    DBMS_SQL.DEFINE_COLUMN(STAB_CURSOR, 1, RSET_NAM, 30);
<    DBMS_SQL.DEFINE_COLUMN(STAB_CURSOR, 2, RULE_NAM, 30);
---
>    DBMS_SQL.DEFINE_COLUMN(STAB_CURSOR, 1, RSET_NAM, M_IDEN_LEN);
>    DBMS_SQL.DEFINE_COLUMN(STAB_CURSOR, 2, RULE_NAM, M_IDEN_LEN);
4965a4980,4982
>           WRITE_TRACE('fix_subtab: rset_nam = ' || RSET_NAM);
>           WRITE_TRACE('fix_subtab: rule_nam  = ' || RULE_NAM);
> 
4990a5008,5009
>    WRITE_TRACE('fix_subscriber_tables_2424746: Enter\n');
> 
4996,4997c5015,5016
<    DBMS_SQL.DEFINE_COLUMN(QTAB_CURSOR, 1, QTAB_SCHEMA, 30);
<    DBMS_SQL.DEFINE_COLUMN(QTAB_CURSOR, 2, QTAB_NAME, 30);
---
>    DBMS_SQL.DEFINE_COLUMN(QTAB_CURSOR, 1, QTAB_SCHEMA, M_IDEN_LEN);
>    DBMS_SQL.DEFINE_COLUMN(QTAB_CURSOR, 2, QTAB_NAME, M_IDEN_LEN);
5005a5025,5027
>       WRITE_TRACE('fix_subscriber_tables_2424746: qtab_schema ' || QTAB_SCHEMA);
>       WRITE_TRACE('fix_subscriber_tables_2424746: qtab_name  ' || QTAB_NAME);
> 
5016a5039,5044
>    
>    IF DBMS_SQL.IS_OPEN(QTAB_CURSOR) THEN
>      DBMS_SQL.CLOSE_CURSOR(QTAB_CURSOR);
>      WRITE_TRACE('fix_subscriber_tables_2424746: close_cursor');
>    END IF;
> 
5041c5069
<   SUBSELQNO       VARCHAR2(256);
---
>   SUBSELQNO       VARCHAR2(512);
5067a5096,5097
>   WRITE_TRACE('upgrade_qt_rulesub_msgs: Queue Table ' || QT_SCHEMA || '.' || QT_FLAGS);
> 
5083c5113
<   DBMS_SQL.DEFINE_COLUMN(STMT_CSR1, 2, SUBNAM, 30);
---
>   DBMS_SQL.DEFINE_COLUMN(STMT_CSR1, 2, SUBNAM, M_IDEN_LEN);
5087,5088c5117,5118
<   DBMS_SQL.DEFINE_COLUMN(STMT_CSR1, 6, RULE_NAM, 30);
<   DBMS_SQL.DEFINE_COLUMN(STMT_CSR1, 7, Q_NAME, 30);
---
>   DBMS_SQL.DEFINE_COLUMN(STMT_CSR1, 6, RULE_NAM, M_IDEN_LEN);
>   DBMS_SQL.DEFINE_COLUMN(STMT_CSR1, 7, Q_NAME, M_IDEN_LEN);
5103a5134
>      WRITE_TRACE('subnam : '     || SUBNAM);
5107,5109c5138,5139
<      
<      
<      
---
>      WRITE_TRACE('rule_nam : ' || RULE_NAM);
>      WRITE_TRACE('q_name : ' || Q_NAME);
5113,5114c5143,5144
<                    ' FROM ' || DBMS_ASSERT.ENQUOTE_NAME(DQT||QT_SCHEMA||DQT) || '.' ||
<                      DBMS_ASSERT.ENQUOTE_NAME(DQT||SUBTAB_NAME||DQT) ||
---
>                    ' FROM ' || DBMS_ASSERT.ENQUOTE_NAME(QT_SCHEMA, FALSE) || '.' ||
>                      DBMS_ASSERT.ENQUOTE_NAME(SUBTAB_NAME, FALSE) ||
5119c5149
<      
---
>      WRITE_TRACE('subselstmt : ' || SUBSELQNO);
5339c5369
<   DBMS_SQL.DEFINE_COLUMN(STMT_CSR1, 2, SUBNAM, 30);
---
>   DBMS_SQL.DEFINE_COLUMN(STMT_CSR1, 2, SUBNAM, M_IDEN_LEN);
5343,5344c5373,5374
<   DBMS_SQL.DEFINE_COLUMN(STMT_CSR1, 6, RULE_NAM, 30);
<   DBMS_SQL.DEFINE_COLUMN(STMT_CSR1, 7, Q_NAME, 30);
---
>   DBMS_SQL.DEFINE_COLUMN(STMT_CSR1, 6, RULE_NAM, M_IDEN_LEN);
>   DBMS_SQL.DEFINE_COLUMN(STMT_CSR1, 7, Q_NAME, M_IDEN_LEN);
5359a5390
>      WRITE_TRACE('subnam : '     || SUBNAM);
5363,5365c5394,5395
<      
<      
<      
---
>      WRITE_TRACE('rule_nam : ' || RULE_NAM);
>      WRITE_TRACE('q_name : ' || Q_NAME);
SYS.DBMS_RCVMAN - PACKAGE BODY (18.2RUR):
122c122
< CATALOGVERSION CONSTANT VARCHAR2(11) := '18.02.00.00'; 
---
> CATALOGVERSION CONSTANT VARCHAR2(11) := '18.02.01.00'; 
SYS.DBMS_RCVMAN - PACKAGE BODY (RU):
122c122
< CATALOGVERSION CONSTANT VARCHAR2(11) := '18.02.00.00'; 
---
> CATALOGVERSION CONSTANT VARCHAR2(11) := '18.03.00.00'; 
SYS.DBMS_REDEFINITION - PACKAGE BODY (RU):
2454a2455,2456
>     SQL_CURSOR      NUMBER;
>     ROWS            NUMBER;
2468a2471,2500
>       
>       
>       
>       FOR VPDP IN DBMS_REDEFINITION_INTERNAL.VPD_POLICIES(O_OWNER,I_TABLE) LOOP
>         BEGIN
>           SQL_CURSOR := DBMS_SQL.OPEN_CURSOR;
>           DBMS_SYS_SQL.PARSE_AS_USER(SQL_CURSOR,
>                 ' BEGIN ' ||
>                 ' DBMS_RLS.DISABLE_GROUPED_POLICY ' ||
>                 ' (:u_name, :t_name, :p_group, :p_name);' ||
>                 ' END; ',
>                 DBMS_SQL.NATIVE, 0);
> 
>           
>           DBMS_SQL.BIND_VARIABLE(SQL_CURSOR, 'u_name', O_OWNER);
>           DBMS_SQL.BIND_VARIABLE(SQL_CURSOR, 't_name', I_TABLE);
>           DBMS_SQL.BIND_VARIABLE(SQL_CURSOR, 'p_group', VPDP.POLICY_GROUP);
>           DBMS_SQL.BIND_VARIABLE(SQL_CURSOR, 'p_name', VPDP.POLICY_NAME);
> 
>           
>           ROWS := DBMS_SQL.EXECUTE(SQL_CURSOR);
>           DBMS_SQL.CLOSE_CURSOR(SQL_CURSOR);
>         EXCEPTION WHEN OTHERS THEN
>           DBMS_SQL.CLOSE_CURSOR(SQL_CURSOR);
>           RAISE;
>         END;
>       END LOOP;
> 
>       
>       
2644a2677,2709
> 
>     IF (BITAND(CTX_FLAG, DBMS_REDEFINITION.CONS_REDEF_TABLE)
>           = DBMS_REDEFINITION.CONS_REDEF_TABLE AND
>         DBMS_REDEFINITION_INTERNAL.HAS_SDO_IDX(O_OWNER, O_TABLE)) THEN
>       
>       
>       
>       FOR VPDP IN DBMS_REDEFINITION_INTERNAL.VPD_POLICIES(O_OWNER,I_TABLE) LOOP
>         BEGIN
>           SQL_CURSOR := DBMS_SQL.OPEN_CURSOR;
>           DBMS_SYS_SQL.PARSE_AS_USER(SQL_CURSOR,
>                 ' BEGIN ' ||
>                 ' DBMS_RLS.ENABLE_GROUPED_POLICY ' ||
>                 ' (:u_name, :t_name, :p_group, :p_name);' ||
>                 ' END; ',
>                 DBMS_SQL.NATIVE, 0);
> 
>           
>           DBMS_SQL.BIND_VARIABLE(SQL_CURSOR, 'u_name', O_OWNER);
>           DBMS_SQL.BIND_VARIABLE(SQL_CURSOR, 't_name', I_TABLE);
>           DBMS_SQL.BIND_VARIABLE(SQL_CURSOR, 'p_group', VPDP.POLICY_GROUP);
>           DBMS_SQL.BIND_VARIABLE(SQL_CURSOR, 'p_name', VPDP.POLICY_NAME);
> 
>           
>           ROWS := DBMS_SQL.EXECUTE(SQL_CURSOR);
>           DBMS_SQL.CLOSE_CURSOR(SQL_CURSOR);
>         EXCEPTION WHEN OTHERS THEN
>           DBMS_SQL.CLOSE_CURSOR(SQL_CURSOR);
>           RAISE;
>         END;
>       END LOOP;
>     END IF;
> 
SYS.DBMS_REGISTRY - PACKAGE BODY (RU):
2743c2743,2746
< PROCEDURE RU_APPLY      (COMP_VERSION IN VARCHAR2 DEFAULT NULL)
---
> PROCEDURE RU_APPLY      (COMP_VERSION      IN VARCHAR2  DEFAULT NULL,
>                          BUILD_DESCRIPTION IN VARCHAR2  DEFAULT NULL,
>                          BUILD_TIMESTAMP   IN TIMESTAMP DEFAULT NULL)
> 
2746c2749,2750
< CAT_VERSION SYS.REGISTRY$.VERSION_FULL%TYPE;
---
> CAT_VERSION      SYS.REGISTRY$.VERSION_FULL%TYPE;
> BUILD_STRING     VARCHAR2 (128) := NULL;
2756a2761,2767
>   IF BUILD_DESCRIPTION IS NOT NULL OR
>      BUILD_TIMESTAMP IS NOT NULL THEN  
>      BUILD_STRING := ': ' || BUILD_DESCRIPTION || ' - ' || 
>         TO_CHAR(BUILD_TIMESTAMP,'YYMMDDHH24MISS');
>   END IF;
> 
>   
2762c2773,2774
<          'Patch applied from ' || CAT_VERSION || ' to ' || P_VERSION_FULL);
---
>          'Patch applied from ' || CAT_VERSION || ' to ' || P_VERSION_FULL || 
>          BUILD_STRING);
2764c2776,2781
<   ELSIF P_VERSION_FULL != CAT_VERSION THEN  
---
>   ELSIF P_VERSION_FULL = CAT_VERSION AND
>         BUILD_STRING IS NOT NULL THEN 
>      SYS.DBMS_REGISTRY_SYS.RECORD_ACTION ('RU_APPLY', NULL,
>          'Patch applied on ' || P_VERSION_FULL ||  BUILD_STRING);
>      COMMIT;
>   ELSIF P_VERSION_FULL != CAT_VERSION THEN 
2774c2791,2793
< PROCEDURE RU_ROLLBACK     (COMP_VERSION IN VARCHAR2 DEFAULT NULL)
---
> PROCEDURE RU_ROLLBACK   (COMP_VERSION      IN VARCHAR2 DEFAULT NULL,
>                          BUILD_DESCRIPTION IN VARCHAR2  DEFAULT NULL,
>                          BUILD_TIMESTAMP   IN TIMESTAMP DEFAULT NULL)
2777a2797
> BUILD_STRING VARCHAR2 (128) := NULL;
2787a2808,2814
>   IF BUILD_DESCRIPTION IS NOT NULL OR
>      BUILD_TIMESTAMP IS NOT NULL THEN  
>      BUILD_STRING := ': ' || BUILD_DESCRIPTION || ' - ' || 
>         TO_CHAR(BUILD_TIMESTAMP,'YYMMDDHH24MISS');
>   END IF;
> 
>   
2794c2821
<           P_VERSION_FULL);
---
>           P_VERSION_FULL || BUILD_STRING);
2796c2823,2827
<   ELSIF P_VERSION_FULL != CAT_VERSION_FULL THEN  
---
>   ELSIF P_VERSION_FULL = CAT_VERSION_FULL AND
>         BUILD_STRING IS NOT NULL THEN  
>      SYS.DBMS_REGISTRY_SYS.RECORD_ACTION ('RU_ROLLBACK', NULL,
>          'Patch rolled back on ' || P_VERSION_FULL ||  BUILD_STRING);
>   ELSIF P_VERSION_FULL != CAT_VERSION_FULL THEN 
SYS.DBMS_SMB - PACKAGE BODY (RU):
61d60
<         '      other               LONG, '             ||
673c672
<          other, distribution, cpu_cost, io_cost, temp_space, 
---
>          distribution, cpu_cost, io_cost, temp_space, 
693c692
<       '         :76, :77) ';  
---
>       '         :76) ';  
768d766
<         REC.OTHER, 
1372d1369
<                  p.other,
1397c1394
<                '     parent_id,depth, position,cost, cardinality, bytes,'   || 
---
>                '     parent_id, depth, position, cost, cardinality, bytes,' || 
SYS.DBMS_SMB_INTERNAL - PACKAGE BODY (RU):
584d583
<             p.other,
SYS.DBMS_SODA_UTIL - PACKAGE BODY (RU):
139a140,146
>                              ARG2 IN VARCHAR2, ARG3 IN VARCHAR2)
> IS
> BEGIN
>   SYS.DBMS_SYS_ERROR.RAISE_SYSTEM_ERROR(ERROR_NUMBER, ARG1, ARG2, ARG3);
> END RAISE_SYSTEM_ERROR;
> 
> PROCEDURE RAISE_SYSTEM_ERROR(ERROR_NUMBER IN INTEGER, ARG1 IN VARCHAR2,
SYS.DBMS_SPM - PACKAGE BODY (RU):
130,133c130,133
<   AUTOCAP_SQL_TEXT CONSTANT VARCHAR2(22) := 'AUTO_CAPTURE_SQL_TEXT';
<   AUTOCAP_MODULE   CONSTANT VARCHAR2(20) := 'AUTO_CAPTURE_MODULE';
<   AUTOCAP_ACTION   CONSTANT VARCHAR2(20) := 'AUTO_CAPTURE_ACTION';
<   AUTOCAP_USER     CONSTANT VARCHAR2(33) := 'AUTO_CAPTURE_PARSING_SCHEMA_NAME';
---
>   AUTOCAP_SQL_TEXT CONSTANT VARCHAR2(22) := DBMS_SPM_INTERNAL.AUTOCAP_SQL_TEXT;
>   AUTOCAP_MODULE   CONSTANT VARCHAR2(20) := DBMS_SPM_INTERNAL.AUTOCAP_MODULE;
>   AUTOCAP_ACTION   CONSTANT VARCHAR2(20) := DBMS_SPM_INTERNAL.AUTOCAP_ACTION;
>   AUTOCAP_USER     CONSTANT VARCHAR2(33) := DBMS_SPM_INTERNAL.AUTOCAP_USER;
547,566c547
<     SELECT SUM(XMLQUERY('count(/filters/filter)' 
<                         PASSING XMLTYPE(C.PARAMETER_DATA)
<                         RETURNING CONTENT).GETSTRINGVAL())
<       INTO FILTER_NUM 
<       FROM SYS.SMB$CONFIG C
<       WHERE C.PARAMETER_NAME IN (AUTOCAP_USER,
<                                  AUTOCAP_ACTION,
<                                  AUTOCAP_MODULE,
<                                  AUTOCAP_SQL_TEXT);
< 
<     SELECT SUM(XMLQUERY('sum(string-length(/filters/filter/text()))'
<                         PASSING XMLTYPE(C.PARAMETER_DATA)
<                         RETURNING CONTENT).GETSTRINGVAL())
<       INTO FILTER_LEN 
<       FROM SYS.SMB$CONFIG C
<       WHERE C.PARAMETER_NAME IN (AUTOCAP_USER,
<                                  AUTOCAP_ACTION,
<                                  AUTOCAP_MODULE,
<                                  AUTOCAP_SQL_TEXT);
< 
---
>     DBMS_SPM_INTERNAL.GET_CONFIG_FILTER_NUM_AND_LEN(FILTER_NUM, FILTER_LEN);
780c761,762
<       FIXED, ENABLED, COMMIT_ROWS, FALSE);
---
>       FIXED, ENABLED, COMMIT_ROWS, FALSE,
>       SYS_CONTEXT('USERENV', 'CURRENT_USER'));
876c858,859
<                       TRACE, SQL_ID, NULL, NULL, FIXED, ENABLED, FALSE);
---
>                       TRACE, SQL_ID, NULL, NULL, FIXED, ENABLED, FALSE,
>                       SYS_CONTEXT('USERENV', 'CURRENT_USER'));
943c926,927
<                      FIXED, ENABLED, FALSE);
---
>                      FIXED, ENABLED, FALSE,
>                      SYS_CONTEXT('USERENV', 'CURRENT_USER'));
1004c988,989
<                      FIXED, ENABLED, FALSE);
---
>                      FIXED, ENABLED, FALSE,
>                      SYS_CONTEXT('USERENV', 'CURRENT_USER'));
1074c1059,1060
<                      FIXED, ENABLED, FALSE);
---
>                      FIXED, ENABLED, FALSE,
>                      SYS_CONTEXT('USERENV', 'CURRENT_USER'));
3187,3189c3173,3175
<     RETURN DBMS_SPM_INTERNAL.LOAD_PLANS_FROM_AWR(BEGIN_SNAP, END_SNAP, 
<                                                  BASIC_FILTER, FIXED, ENABLED,
<                                                  COMMIT_ROWS, FALSE, DBID);
---
>     RETURN DBMS_SPM_INTERNAL.LOAD_PLANS_FROM_AWR
>              (BEGIN_SNAP, END_SNAP, BASIC_FILTER, FIXED, ENABLED, COMMIT_ROWS,
>               FALSE, DBID, SYS_CONTEXT('USERENV', 'CURRENT_USER'));
SYS.DBMS_SPM_INTERNAL - PACKAGE BODY (RU):
242a243,279
>   
>   
>   
>   PROCEDURE GET_CONFIG_FILTER_NUM_AND_LEN( NUM_FILTERS  OUT PLS_INTEGER,
>                                            LEN_FILTERS  OUT PLS_INTEGER
>                                          )
>   IS
>   BEGIN
>     SELECT SUM(XMLQUERY('count(/filters/filter)' 
>                         PASSING XMLTYPE(C.PARAMETER_DATA)
>                         RETURNING CONTENT).GETSTRINGVAL()),
>            SUM(XMLQUERY('sum(string-length(/filters/filter/text()))'
>                         PASSING XMLTYPE(C.PARAMETER_DATA)
>                         RETURNING CONTENT).GETSTRINGVAL())
>     INTO NUM_FILTERS, NUM_FILTERS
>     FROM SYS.SMB$CONFIG C
>     WHERE C.PARAMETER_NAME IN (AUTOCAP_USER,
>                                AUTOCAP_ACTION,
>                                AUTOCAP_MODULE,
>                                AUTOCAP_SQL_TEXT);
> 
>   END GET_CONFIG_FILTER_NUM_AND_LEN;
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
3729c3766
<             NULL, 'NO', 'YES', TRUE);
---
>             NULL, 'NO', 'YES', TRUE, 'SYS');
3741c3778
<             'NO', 'YES', 1000, TRUE, DBID);
---
>             'NO', 'YES', 1000, TRUE, DBID, 'SYS');
3748c3785
<             'NO', 'YES', 1000, TRUE);
---
>             'NO', 'YES', 1000, TRUE, 'SYS');
3795a3833
>   
3802c3840,3841
<                                IS_EVOLVE        IN BOOLEAN
---
>                                IS_EVOLVE        IN BOOLEAN,
>                                LOAD_USER        IN VARCHAR2
3806d3844
<     SESS_USER   DBMS_ID := SYS_CONTEXT('USERENV', 'SESSION_USER');
3970c4008
<                           SESS_USER, 
---
>                           LOAD_USER, 
4057a4096
>   
4064c4103,4104
<                                    IS_EVOLVE          IN BOOLEAN  := FALSE
---
>                                    IS_EVOLVE          IN BOOLEAN  := FALSE,
>                                    LOAD_USER          IN VARCHAR2
4069d4108
<     SESS_USER   DBMS_ID := SYS_CONTEXT('USERENV', 'SESSION_USER');
4140c4179
<       STS_OWNER := SESS_USER;
---
>       STS_OWNER := DBMS_ASSERT.ENQUOTE_NAME(LOAD_USER, FALSE);
4179c4218
<                               SESS_USER, ORIGIN, NULL);
---
>                               LOAD_USER, ORIGIN, NULL);
4284c4323
<                                 SESS_USER, ORIGIN, NULL);
---
>                                 LOAD_USER, ORIGIN, NULL);
4452a4492
>   
4460c4500,4501
<                                DBID         IN NUMBER   := NULL)
---
>                                DBID         IN NUMBER   := NULL,
>                                LOAD_USER    IN VARCHAR2)
4489d4529
<     SESS_USER    DBMS_ID := SYS_CONTEXT('USERENV', 'SESSION_USER');
4577c4617
<                               SESS_USER, ORIGIN, NULL);
---
>                               LOAD_USER, ORIGIN, NULL);
4666c4706
<                                 SESS_USER, ORIGIN, NULL);
---
>                                 LOAD_USER, ORIGIN, NULL);
SYS.DBMS_SQLDIAG - PACKAGE BODY (RU):
67a68,461
>  
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   FUNCTION EXECUTE_AND_IMPLEMENT_ADVISOR(
>     ADVISOR_NAME     VARCHAR2,
>     TASK_NAME        VARCHAR2,
>     AUTO_APPLY_PATCH VARCHAR2)
>   RETURN NUMBER
>   IS
>     TNAME      DBMS_ID;
>     QUERY_TXT  VARCHAR2(256);
>     REC_COUNT  NUMBER;
>   BEGIN
>     IF (ADVISOR_NAME = 'SPM Evolve Advisor') THEN
>       
>       TNAME := DBMS_SPM.EXECUTE_EVOLVE_TASK(TASK_NAME => TASK_NAME,
>                                             EXECUTION_NAME => TASK_NAME);
> 
>       
>       QUERY_TXT := 'select count(*)
>                     from sys.dba_advisor_recommendations 
>                     where task_name = :task_name and type = ''EVOLVE PLAN''';
> 
>       EXECUTE IMMEDIATE QUERY_TXT INTO REC_COUNT USING TASK_NAME;
> 
>       IF (REC_COUNT > 0 AND AUTO_APPLY_PATCH = 'YES') THEN
>         
>         REC_COUNT := DBMS_SPM.IMPLEMENT_EVOLVE_TASK(TASK_NAME => TASK_NAME);
>       END IF;
>     ELSIF (ADVISOR_NAME = 'SQL Tuning Advisor') THEN
>       
>       DBMS_SQLTUNE.EXECUTE_TUNING_TASK(TASK_NAME => TASK_NAME);
> 
>       
>       
>       
>       
>       
>       QUERY_TXT := 'select count(*)
>                     from sys.dba_advisor_recommendations 
>                     where task_name = :task_name and type = ''SQL PROFILE''';
> 
>       EXECUTE IMMEDIATE QUERY_TXT INTO REC_COUNT USING TASK_NAME;
> 
>       IF (REC_COUNT > 0 AND AUTO_APPLY_PATCH = 'YES') THEN
>         
>         DBMS_SQLTUNE.IMPLEMENT_TUNING_TASK(TASK_NAME => TASK_NAME);
>       END IF;
>     END IF;
> 
>     RETURN REC_COUNT;
>   END EXECUTE_AND_IMPLEMENT_ADVISOR;
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   PROCEDURE REPAIR_PERFORMANCE_PROBLEM(
>     SQL_STMT          SQLSET_ROW,
>     SCOPE             VARCHAR2,
>     TIME_LIMIT        NUMBER,
>     TASK_NAME         VARCHAR2,
>     AUTO_APPLY_PATCH  VARCHAR2,
>     TASK_ID           NUMBER,
>     USE               VARCHAR2)
>   IS
>     SQL_HANDLE VARCHAR2(30);
>     QUERY_TXT  VARCHAR2(256);
>     PLAN_CNT   NUMBER := 0;
>     REC_COUNT  NUMBER;
>     TNAME      DBMS_ID;
>     ADVNAME    DBMS_ID;
>     TRYSQLTUNE BOOLEAN := FALSE;
>   BEGIN
>     
>     
>     
>     
>     
>     
>     
>     IF (TASK_ID <> 0) THEN
>       QUERY_TXT := 'SELECT ADVISOR_NAME, TASK_NAME FROM SYS.DBA_ADVISOR_TASKS
>                     WHERE TASK_ID = :task_id';
> 
>       EXECUTE IMMEDIATE QUERY_TXT INTO ADVNAME, TNAME USING TASK_ID;
> 
>       
>       REC_COUNT := EXECUTE_AND_IMPLEMENT_ADVISOR(
>                                     ADVISOR_NAME     => ADVNAME,
>                                     TASK_NAME        => TNAME,
>                                     AUTO_APPLY_PATCH => AUTO_APPLY_PATCH);
>       
>       RETURN;
>     END IF;
> 
>     
>     
>     
>     
>     BEGIN
>       QUERY_TXT := 'SELECT b.sql_handle 
>                     FROM  "PUBLIC".V$SQL s, sys.DBA_SQL_PLAN_BASELINES b 
>                     WHERE s.EXACT_MATCHING_SIGNATURE = b.SIGNATURE AND
>                           s.SQL_ID = :sql_id';
> 
>       EXECUTE IMMEDIATE QUERY_TXT INTO SQL_HANDLE USING SQL_STMT.SQL_ID;
>     EXCEPTION
>       WHEN OTHERS THEN NULL;
>     END;
> 
>     
>     IF (SQL_HANDLE IS NULL) THEN
>       IF (USE = 'SQL ID') THEN
>         
>         PLAN_CNT := DBMS_SPM.LOAD_PLANS_FROM_CURSOR_CACHE(
>                                   SQL_ID          => SQL_STMT.SQL_ID,
>                                   PLAN_HASH_VALUE => SQL_STMT.PLAN_HASH_VALUE);
>       ELSE
>         
>         PLAN_CNT := DBMS_SPM.LOAD_PLANS_FROM_CURSOR_CACHE(
>                                   SQL_ID   => SQL_STMT.SQL_ID,
>                                   SQL_TEXT => SQL_STMT.SQL_TEXT);
>       END IF;
>     ELSE
>       
>       
>       RETURN;
>     END IF;
> 
>     
>     
>     IF (PLAN_CNT > 0) THEN
>       
>       EXECUTE IMMEDIATE QUERY_TXT INTO SQL_HANDLE USING SQL_STMT.SQL_ID;
> 
>       
>       
>       
>       
>       
>       
>       PLAN_CNT := DBMS_SPM.ALTER_SQL_PLAN_BASELINE(
>                                       SQL_HANDLE      => SQL_HANDLE,
>                                       ATTRIBUTE_NAME  => '_accepted',
>                                       ATTRIBUTE_VALUE => 'NO');
> 
>       TNAME := DBMS_SPM.CREATE_EVOLVE_TASK(SQL_HANDLE => SQL_HANDLE,
>                                            TIME_LIMIT => TIME_LIMIT,
>                                            TASK_NAME  => TASK_NAME);
> 
>       
>       DBMS_SPM.SET_EVOLVE_TASK_PARAMETER(
>                                    TASK_NAME => TASK_NAME,
>                                    PARAMETER => 'ALTERNATE_PLAN_SOURCE',
>                                    VALUE     => 'CURSOR_CACHE+        
>                                                  AUTOMATIC_WORKLOAD_REPOSITORY+
>                                                  SQL_TUNING_SET');
>       ADVNAME := 'SPM Evolve Advisor';
>       REC_COUNT := EXECUTE_AND_IMPLEMENT_ADVISOR(
>                                          ADVISOR_NAME     => ADVNAME,
>                                          TASK_NAME        => TNAME,
>                                          AUTO_APPLY_PATCH => AUTO_APPLY_PATCH);
> 
>       IF (REC_COUNT = 0) THEN
>         
>         
>         IF (SCOPE = SCOPE_COMPREHENSIVE) THEN
>           TRYSQLTUNE := TRUE;
>           DBMS_SPM.DROP_EVOLVE_TASK(TASK_NAME => TASK_NAME);
>         END IF;
>       END IF;
>     END IF;
> 
>     
>     
>     
>     
>     
>     IF (PLAN_CNT = 0 OR
>         TRYSQLTUNE = TRUE) THEN
>       IF (USE = 'SQL ID') THEN
>         
>         TNAME := DBMS_SQLTUNE.CREATE_TUNING_TASK(
>                                   SQL_ID          => SQL_STMT.SQL_ID,
>                                   PLAN_HASH_VALUE => SQL_STMT.PLAN_HASH_VALUE,
>                                   SCOPE           => SCOPE,
>                                   TIME_LIMIT      => TIME_LIMIT,
>                                   TASK_NAME       => TASK_NAME);
>       ELSE
>         
>         TNAME := DBMS_SQLTUNE.CREATE_TUNING_TASK(
>                                   SQL_TEXT   => SQL_STMT.SQL_TEXT,
>                                   BIND_LIST  => SQL_STMT.BIND_LIST,
>                                   USER_NAME  => SQL_STMT.PARSING_SCHEMA_NAME,
>                                   SCOPE      => SCOPE,
>                                   TIME_LIMIT => TIME_LIMIT,
>                                   TASK_NAME  => TASK_NAME);
>       END IF;
> 
>       
>       ADVNAME := 'SQL Tuning Advisor';
>       REC_COUNT := EXECUTE_AND_IMPLEMENT_ADVISOR(
>                                          ADVISOR_NAME     => ADVNAME,
>                                          TASK_NAME        => TNAME,
>                                          AUTO_APPLY_PATCH => AUTO_APPLY_PATCH);
>     END IF;
>   END REPAIR_PERFORMANCE_PROBLEM;
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
> 
>   PROCEDURE EXECUTE_DIAGNOSE_AND_REPAIR(
>     TASK_NAME         VARCHAR2, 
>     AUTO_APPLY_PATCH  VARCHAR2 )
>   IS
>     REC_COUNT  NUMBER;
>     QUERY_TXT  VARCHAR2(256);
>   BEGIN
> 
>     
>     DBMS_SQLDIAG.EXECUTE_DIAGNOSIS_TASK(TASK_NAME);
> 
>     
>     IF (AUTO_APPLY_PATCH = 'YES') THEN
>       
>       
>       QUERY_TXT := 'select count(*)
>                     from sys.dba_advisor_recommendations 
>                     where task_name = :task_name and type = ''SQL PATCH''';
> 
>       EXECUTE IMMEDIATE QUERY_TXT INTO REC_COUNT USING TASK_NAME;
> 
>       IF (REC_COUNT > 0) THEN
>         
>         DBMS_SQLDIAG.ACCEPT_SQL_PATCH(TASK_NAME => TASK_NAME, 
>                                       NAME      => TASK_NAME);
>       END IF;
>     END IF;
>   END EXECUTE_DIAGNOSE_AND_REPAIR;
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   FUNCTION CREATE_INCIDENT(
>     PROBLEM_TYPE       NUMBER, 
>     SQL_STMT           SQLSET_ROW)
>   RETURN NUMBER
>   IS
>     INCIDENTID        NUMBER;                 
>     CONTROL_XML       CLOB := NULL;           
>     RES               CLOB := NULL;           
>     L_STMT            SQLSET_ROW := SQL_STMT; 
>     ERR_CODE          NUMBER;                 
>     ERR_MESG          VARCHAR2(32767);        
>     INCIDENTTYPE      VARCHAR2(64);
>   BEGIN
> 
>     
>     INCIDENTTYPE := DBMS_SQLDIAG_INTERNAL.I_GET_INCIDENT_TYPE(PROBLEM_TYPE);
> 
>     
>     DBMS_SQLDIAG_INTERNAL.I_CREATE_INCIDENT(INCIDENTID, INCIDENTTYPE);
> 
>     IF (INCIDENTID IS NULL OR INCIDENTID = 0) THEN
>       RAISE_APPLICATION_ERROR(-20001, 'incident creation failed');
>     END IF;
> 
>     
>     CONTROL_XML := CONTROL_XML ||
>       '<parameter name="update_incident">' || INCIDENTID || '</parameter>' ||
>       '<parameter name="problem_type">' || PROBLEM_TYPE || '</parameter>';
> 
>     BEGIN
>       DBMS_SQLTUNE_INTERNAL.I_PROCESS_SQL(
>                   STMT         => L_STMT,
>                   ACTION       => 'EXPLAIN_PLAN',
>                   CTRL_OPTIONS => CONTROL_XML,
>                   EXTRA_RESULT => RES,
>                   ERR_CODE     => ERR_CODE,
>                   ERR_MESG     => ERR_MESG,
>                   EXEC_USERID  => SYS_CONTEXT('USERENV', 'CURRENT_USERID'));
>       EXCEPTION
>         WHEN OTHERS THEN
>           
>           DBMS_SQLDIAG_INTERNAL.I_REMOVE_INCIDENT(INCIDENTID);
> 
>           RAISE_APPLICATION_ERROR(-20000, 
>                 'incident creation failed with error - ' || ERR_MESG);
>     END;
> 
>     
>     IF (ERR_CODE IS NOT NULL) THEN
>       DBMS_SQLDIAG_INTERNAL.I_REMOVE_INCIDENT(INCIDENTID);
> 
>       RAISE_APPLICATION_ERROR(-20000, 
>             'incident creation failed with error - ' || ERR_MESG);
>     END IF;
> 
>     RETURN INCIDENTID;
>   END CREATE_INCIDENT;
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   PROCEDURE VALIDATE_PARAMS(
>     AUTO_APPLY_PATCH IN VARCHAR2,
>     TIME_LIMIT       IN NUMBER)
>   IS
>   BEGIN
>     IF (TIME_LIMIT <= 0) THEN
>       RAISE_APPLICATION_ERROR(-20001, 'time_limit should be > 0');
>     END IF;
> 
>     IF (AUTO_APPLY_PATCH <> 'YES' AND AUTO_APPLY_PATCH <> 'NO') THEN
>        RAISE_APPLICATION_ERROR(-20001, 'auto_apply_patch should be YES or NO');
>     END IF;
>   END VALIDATE_PARAMS;
> 
248a643,644
>     
>     
253c649,650
<         BIND_LIST => BIND_LIST);
---
>         BIND_LIST => BIND_LIST,
>         OPTIMIZER_ENV => DBMS_SQLPA.GET_SESS_OPTIMIZER_ENV());
307a705
>     L_INCIDENT_ID VARCHAR2(80);
308a707,711
> 
>     
>     L_INCIDENT_ID := DBMS_SQLTCB_INTERNAL.I_VALIDATE_INCIDENTID(
>                                           TO_CHAR(INCIDENT_ID));
> 
311c714
<                                   INCIDENT_ID  => INCIDENT_ID,  
---
>                                   INCIDENT_ID  => L_INCIDENT_ID,  
326c729,730
<                           SQL_STMT              => STS_ROW, 
---
>                           SQL_STMT              => STS_ROW,
>                           INCIDENTID            => L_INCIDENT_ID,
339c743,744
<                           CTRLOPTIONS           => CTRLOPTIONS);
---
>                           CTRLOPTIONS           => CTRLOPTIONS,
>                           PROBLEM_TYPE          => PROBLEM_TYPE);
409c814,815
<                 SQL_STMT                => STS_ROW, 
---
>                 SQL_STMT                => STS_ROW,
>                 INCIDENTID              => INCIDENT_ID,
422c828,829
<                 CTRLOPTIONS             => NULL);
---
>                 CTRLOPTIONS             => NULL,
>                 PROBLEM_TYPE            => PROBLEM_TYPE);
974,1000d1380
<   
<   
<   
<   
<   
<   
<   
<   
<   
<   
<   
<   
<   
<   FUNCTION VALIDATE_PROBLEM_TYPE(PROBLEM_TYPE IN NUMBER) RETURN NUMBER
<   IS
<   BEGIN
<     IF ((PROBLEM_TYPE != PROBLEM_TYPE_PERFORMANCE) AND
<         (PROBLEM_TYPE != PROBLEM_TYPE_WRONG_RESULTS) AND
<         (PROBLEM_TYPE != PROBLEM_TYPE_COMPILATION_ERROR) AND
<         (PROBLEM_TYPE != PROBLEM_TYPE_EXECUTION_ERROR))
<     THEN 
<       DBMS_SYS_ERROR.RAISE_SYSTEM_ERROR(
<         SYS.DBMS_SQLTCB_INTERNAL.ERR_PTYPE_INVALID, PROBLEM_TYPE);
<     END IF;    
< 
<     RETURN PROBLEM_TYPE;
<   END VALIDATE_PROBLEM_TYPE;   
1044c1424
<       VALIDATE_PROBLEM_TYPE(PROBLEM_TYPE));
---
>       DBMS_SQLDIAG_INTERNAL.I_VALIDATE_PROBLEM_TYPE(PROBLEM_TYPE));
1079c1459
<       VALIDATE_PROBLEM_TYPE(PROBLEM_TYPE));
---
>       DBMS_SQLDIAG_INTERNAL.I_VALIDATE_PROBLEM_TYPE(PROBLEM_TYPE));
1159c1539
<       VALIDATE_PROBLEM_TYPE(PROBLEM_TYPE));
---
>       DBMS_SQLDIAG_INTERNAL.I_VALIDATE_PROBLEM_TYPE(PROBLEM_TYPE));
1842a2223,2614
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
> 
>   FUNCTION SQL_DIAGNOSE_AND_REPAIR(
>     SQL_ID             IN   VARCHAR2,
>     PLAN_HASH_VALUE    IN   NUMBER   := NULL,
>     SCOPE              IN   VARCHAR2 := SCOPE_COMPREHENSIVE,
>     TIME_LIMIT         IN   NUMBER   := TIME_LIMIT_DEFAULT,
>     PROBLEM_TYPE       IN   NUMBER   := PROBLEM_TYPE_PERFORMANCE,
>     AUTO_APPLY_PATCH   IN   VARCHAR2 := 'YES')
>   RETURN NUMBER
>   IS
>     INCIDENT_ID NUMBER;
>     TASK_ID     NUMBER := 0;
>     TASK_NAME   DBMS_ID;
>     SELECT_TXT  VARCHAR2(1024);                         
>     SQL_STMT    SYS.SQLSET_ROW;
>     L_AUTO_APPLY_PATCH VARCHAR2(3) := UPPER(AUTO_APPLY_PATCH);
>   BEGIN
> 
>     
>     VALIDATE_PARAMS(AUTO_APPLY_PATCH => L_AUTO_APPLY_PATCH,
>                     TIME_LIMIT       => TIME_LIMIT);
> 
>     
>     DBMS_SQLDIAG_INTERNAL.I_GET_INCIDENT_FOR_SQLID(SQL_ID, PROBLEM_TYPE, 
>                                                    INCIDENT_ID);
> 
>     
>     IF (INCIDENT_ID = 0) THEN
> 
>       
>       IF (PLAN_HASH_VALUE IS NULL) THEN
>         SELECT_TXT :=
>           'SELECT stmt
>            FROM (SELECT sqlset_row(sql_id, force_matching_signature,
>                              sql_fulltext, NULL, bind_data, 
>                              parsing_schema_name, module, action, 
>                              elapsed_time, cpu_time, buffer_gets, disk_reads, 
>                              direct_writes, rows_processed, fetches, executions, 
>                              end_of_fetch_count, optimizer_cost, optimizer_env, 
>                              null, command_type, null, null, null, null, 
>                              plan_hash_value) stmt, last_active_child_address,
>                              row_number()   
>                              over (PARTITION BY sql_id ORDER BY elapsed_time
>                                    DESC, plan_hash_value DESC) AS rnk
>                  FROM  "PUBLIC".v$sqlarea_plan_hash
>                  WHERE sql_id = :sqlid)
>            WHERE rnk = 1';
> 
>         
>         EXECUTE IMMEDIATE SELECT_TXT INTO  SQL_STMT USING SQL_ID;
>       ELSE
>         
>         SELECT_TXT :=
>           'SELECT sqlset_row(sql_id, force_matching_signature, sql_fulltext, 
>                              NULL, bind_data, parsing_schema_name, 
>                              module, action,
>                              elapsed_time, cpu_time, buffer_gets, disk_reads, 
>                              direct_writes, rows_processed, fetches, executions, 
>                              end_of_fetch_count, optimizer_cost, optimizer_env, 
>                              null, command_type, null, null, null, null, 
>                              plan_hash_value) stmt
>            FROM  "PUBLIC".v$sqlarea_plan_hash
>            WHERE sql_id = :sqlid and plan_hash_value = :phv';
> 
>         
>         EXECUTE IMMEDIATE SELECT_TXT
>                           INTO  SQL_STMT
>                           USING SQL_ID, PLAN_HASH_VALUE;
>       END IF;
> 
>       
>       INCIDENT_ID := CREATE_INCIDENT(PROBLEM_TYPE, SQL_STMT);
>     ELSE
>       
>       BEGIN
>         TASK_ID := SYS.PRVT_ADVISOR.VALIDATE_TASK(INCIDENT_ID, 0,
>                                      SYS_CONTEXT('USERENV', 'CURRENT_USERID'));
>       EXCEPTION
>         WHEN OTHERS THEN
>           IF (SQLCODE = -13605) THEN    
>             TASK_ID := 0;
>           ELSE
>             RAISE;
>           END IF;
>       END;
> 
>       
>       IF (TASK_ID <> 0) THEN 
>         DBMS_SQLDIAG.RESET_DIAGNOSIS_TASK(TASK_NAME);
>       END IF;
>     END IF;
> 
>     IF (PROBLEM_TYPE = PROBLEM_TYPE_PERFORMANCE) THEN
>       REPAIR_PERFORMANCE_PROBLEM(SQL_STMT         => SQL_STMT,
>                                  SCOPE            => SCOPE,
>                                  TIME_LIMIT       => TIME_LIMIT,
>                                  TASK_NAME        => TO_CHAR(INCIDENT_ID),
>                                  AUTO_APPLY_PATCH => L_AUTO_APPLY_PATCH,
>                                  TASK_ID          => TASK_ID,
>                                  USE              => 'SQL ID');
>     ELSE
>       
>       IF (TASK_ID = 0) THEN
>         TASK_NAME := CREATE_DIAGNOSIS_TASK(
>                                         SQL_ID          => SQL_ID,
>                                         PLAN_HASH_VALUE => PLAN_HASH_VALUE,
>                                         SCOPE           => SCOPE,
>                                         TIME_LIMIT      => TIME_LIMIT,
>                                         TASK_NAME       => TO_CHAR(INCIDENT_ID),
>                                         PROBLEM_TYPE    => PROBLEM_TYPE);
>       ELSE
>         TASK_NAME := INCIDENT_ID;
>       END IF;
> 
>       
>       EXECUTE_DIAGNOSE_AND_REPAIR(TASK_NAME, L_AUTO_APPLY_PATCH);
>     END IF;
> 
>     RETURN INCIDENT_ID;
>   END SQL_DIAGNOSE_AND_REPAIR;
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
> 
>   FUNCTION SQL_DIAGNOSE_AND_REPAIR(
>     SQL_TEXT           IN   CLOB,
>     BIND_LIST          IN   SQL_BINDS := NULL,
>     SCOPE              IN   VARCHAR2  := SCOPE_COMPREHENSIVE,
>     TIME_LIMIT         IN   NUMBER    := TIME_LIMIT_DEFAULT,
>     PROBLEM_TYPE       IN   NUMBER    := PROBLEM_TYPE_PERFORMANCE,
>     AUTO_APPLY_PATCH   IN   VARCHAR2  := 'YES')
>   RETURN NUMBER
>   IS
>     INCIDENT_ID NUMBER;
>     TASK_ID     NUMBER := 0;
>     TASK_NAME   DBMS_ID;
>     SQL_STMT    SYS.SQLSET_ROW;
>     L_AUTO_APPLY_PATCH VARCHAR2(3) := UPPER(AUTO_APPLY_PATCH);
>   BEGIN
> 
>     
>     VALIDATE_PARAMS(AUTO_APPLY_PATCH => L_AUTO_APPLY_PATCH,
>                     TIME_LIMIT       => TIME_LIMIT);
> 
>     
>     DBMS_SQLDIAG_INTERNAL.I_GET_INCIDENT_FOR_SQLID(
>                              SYS.DBMS_SQLTUNE_UTIL0.SQLTEXT_TO_SQLID(SQL_TEXT),
>                              PROBLEM_TYPE, INCIDENT_ID);
> 
>     
>     SQL_STMT := SQLSET_ROW(
>           SQL_TEXT => SQL_TEXT,
>           SQL_ID => SYS.DBMS_SQLTUNE_UTIL0.SQLTEXT_TO_SQLID(SQL_TEXT),
>           PARSING_SCHEMA_NAME => SYS_CONTEXT('USERENV', 'CURRENT_USER'),
>           BIND_LIST => BIND_LIST);
> 
>     
>     IF (INCIDENT_ID = 0) THEN
>       
>       INCIDENT_ID := CREATE_INCIDENT(PROBLEM_TYPE, SQL_STMT);
>     ELSE
>       
>       BEGIN
>         TASK_ID := SYS.PRVT_ADVISOR.VALIDATE_TASK(INCIDENT_ID, 0,
>                                      SYS_CONTEXT('USERENV', 'CURRENT_USERID'));
>       EXCEPTION
>         WHEN OTHERS THEN
>           IF (SQLCODE = -13605) THEN    
>             TASK_ID := 0;
>           ELSE
>             RAISE;
>           END IF;
>       END;
> 
>       
>       IF (TASK_ID <> 0) THEN 
>         DBMS_SQLDIAG.RESET_DIAGNOSIS_TASK(INCIDENT_ID);
>       END IF;
>     END IF;
> 
>     IF (PROBLEM_TYPE = PROBLEM_TYPE_PERFORMANCE) THEN
>       REPAIR_PERFORMANCE_PROBLEM(SQL_STMT         => SQL_STMT,
>                                  SCOPE            => SCOPE,
>                                  TIME_LIMIT       => TIME_LIMIT,
>                                  TASK_NAME        => TO_CHAR(INCIDENT_ID),
>                                  AUTO_APPLY_PATCH => L_AUTO_APPLY_PATCH,
>                                  TASK_ID          => TASK_ID,
>                                  USE              => 'SQL TEXT');
>     ELSE
>       
>       IF (TASK_ID = 0) THEN
>         TASK_NAME := CREATE_DIAGNOSIS_TASK(
>                          SQL_TEXT     => SQL_TEXT,
>                          BIND_LIST    => BIND_LIST,
>                          USER_NAME    => SYS_CONTEXT('USERENV','CURRENT_USER'),
>                          SCOPE        => SCOPE,
>                          TIME_LIMIT   => TIME_LIMIT,
>                          TASK_NAME    => TO_CHAR(INCIDENT_ID),
>                          PROBLEM_TYPE => PROBLEM_TYPE);
>       ELSE
>         TASK_NAME := INCIDENT_ID;
>       END IF;
> 
>       
>       EXECUTE_DIAGNOSE_AND_REPAIR(TASK_NAME, L_AUTO_APPLY_PATCH);
>     END IF;
> 
>     RETURN INCIDENT_ID;
>   END SQL_DIAGNOSE_AND_REPAIR;
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
> 
>   FUNCTION SQL_DIAGNOSE_AND_REPAIR(
>     INCIDENT_ID        IN   NUMBER,
>     SCOPE              IN   VARCHAR2 := SCOPE_COMPREHENSIVE,
>     TIME_LIMIT         IN   NUMBER   := TIME_LIMIT_DEFAULT,
>     PROBLEM_TYPE       IN   NUMBER   := PROBLEM_TYPE_PERFORMANCE,
>     AUTO_APPLY_PATCH   IN   VARCHAR2 := 'YES')
>   RETURN NUMBER
>   IS
>     TASK_NAME      DBMS_ID;
>     SQL_STMT       SQLSET_ROW;
>     L_PROBLEM_TYPE NUMBER;
>     ERR_CODE       BINARY_INTEGER;
>     ERR_MESG       VARCHAR2(200);
>     TASK_ID        NUMBER := 0;
>     L_AUTO_APPLY_PATCH VARCHAR2(3) := UPPER(AUTO_APPLY_PATCH);
>   BEGIN
>     
>     VALIDATE_PARAMS(AUTO_APPLY_PATCH => L_AUTO_APPLY_PATCH,
>                     TIME_LIMIT       => TIME_LIMIT);
> 
>       BEGIN
>         
>         TASK_ID := SYS.PRVT_ADVISOR.VALIDATE_TASK(INCIDENT_ID, 0,
>                                      SYS_CONTEXT('USERENV', 'CURRENT_USERID'));
>       EXCEPTION
>         WHEN OTHERS THEN
>           IF (SQLCODE = -13605) THEN    
>             TASK_ID := 0;
>           ELSE
>             RAISE;
>           END IF;
>       END;
> 
>     
>     IF (TASK_ID <> 0) THEN 
>       DBMS_SQLDIAG.RESET_DIAGNOSIS_TASK(INCIDENT_ID);
>       TASK_NAME := INCIDENT_ID;
>     ELSE
>       
>       INCIDENTID_2_SQL(INCIDENT_ID, SQL_STMT, L_PROBLEM_TYPE,
>                        ERR_CODE, ERR_MESG);
> 
>       
>       IF (SQL_STMT.SQL_TEXT IS NULL) THEN
>         RAISE_APPLICATION_ERROR(-20001, 'Non sql based incident');
>       END IF;
>     END IF;
> 
>     IF (PROBLEM_TYPE = PROBLEM_TYPE_PERFORMANCE) THEN
>       REPAIR_PERFORMANCE_PROBLEM(SQL_STMT         => SQL_STMT,
>                                  SCOPE            => SCOPE,
>                                  TIME_LIMIT       => TIME_LIMIT,
>                                  TASK_NAME        => TO_CHAR(INCIDENT_ID),
>                                  AUTO_APPLY_PATCH => L_AUTO_APPLY_PATCH,
>                                  TASK_ID          => TASK_ID,
>                                  USE              => 'SQL TEXT');
>     ELSE
>       
>       IF (TASK_ID = 0) THEN
>         TASK_NAME := CREATE_DIAGNOSIS_TASK(
>                               SQL_TEXT     => SQL_STMT.SQL_TEXT,
>                               BIND_LIST    => SQL_STMT.BIND_LIST,
>                               USER_NAME    => SQL_STMT.PARSING_SCHEMA_NAME,
>                               SCOPE        => SCOPE,
>                               TIME_LIMIT   => TIME_LIMIT,
>                               TASK_NAME    => TO_CHAR(INCIDENT_ID),
>                               PROBLEM_TYPE => PROBLEM_TYPE);
>       END IF;
> 
>       
>       EXECUTE_DIAGNOSE_AND_REPAIR(TASK_NAME, L_AUTO_APPLY_PATCH);
>     END IF;
> 
>     RETURN INCIDENT_ID;
>   END SQL_DIAGNOSE_AND_REPAIR;
> 
SYS.DBMS_SQLDIAG_INTERNAL - PACKAGE BODY (RU):
45c45,47
<     LINE              VARCHAR2(32767);             
---
>     LINE        VARCHAR2(32767);                   
>     SQLID       VARCHAR2(13);
>     SQLIDTEXT   VARCHAR2(200);
68,70c70
<             SOE.ISDEFAULT='NO' AND SOE.SQL_ID = L_SQL_ID
<       ;
< 
---
>             SOE.ISDEFAULT='NO' AND SOE.SQL_ID = SQLID;
71a72,90
>     BEGIN
>       
>       
>       
>       SQLIDTEXT := 'select sql_id from "PUBLIC".v$sql 
>                     where sql_fulltext like ' || 
>                           DBMS_ASSERT.ENQUOTE_LITERAL('/* SQL Analyze%' ||
>                                 REPLACE(L_SQL_ID, '''', '''''') || '%') ||
>                           ' and rownum < 2';
> 
>       EXECUTE IMMEDIATE SQLIDTEXT INTO SQLID;
>       EXCEPTION 
>         WHEN NO_DATA_FOUND THEN
>           
>           
>           SQLID := L_SQL_ID;
>         WHEN OTHERS THEN
>           RAISE;
>     END;
116a136,232
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
> 
>   PROCEDURE I_CREATE_INCIDENT_CALLOUT(
>     INCIDENTID    OUT     NUMBER,
>     INCIDENTTYPE  IN      VARCHAR2)
>   IS EXTERNAL
>   NAME "kesdsCreateIncidentCallout"
>   WITH CONTEXT
>   PARAMETERS (CONTEXT,
>               INCIDENTID   OCINUMBER,
>               INCIDENTID   INDICATOR SB2,
>               INCIDENTTYPE STRING,
>               INCIDENTTYPE INDICATOR SB2)
>   LIBRARY DBMS_SQLDIAG_LIB;
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
> 
>   PROCEDURE I_REMOVE_INCIDENT_CALLOUT(
>     INCIDENTID    IN    NUMBER)
>   IS EXTERNAL
>   NAME "kesdsRemoveIncidentCallout"
>   WITH CONTEXT
>   PARAMETERS (CONTEXT,
>               INCIDENTID OCINUMBER,
>               INCIDENTID INDICATOR SB2)
>   LIBRARY DBMS_SQLDIAG_LIB;
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
> 
>   PROCEDURE I_CREATE_INCIDENT(
>     INCIDENTID    OUT     NUMBER,
>     INCIDENTTYPE  IN      VARCHAR2)
>   IS
>   BEGIN
>     
>     I_CREATE_INCIDENT_CALLOUT(INCIDENTID, INCIDENTTYPE);
>   END I_CREATE_INCIDENT;
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
> 
>   PROCEDURE I_REMOVE_INCIDENT(
>     INCIDENTID    IN     NUMBER)
>   IS
>   BEGIN
>     
>     I_REMOVE_INCIDENT_CALLOUT(INCIDENTID);
>   END I_REMOVE_INCIDENT;
170a287,288
>   
>   
182a301
> 
417a537,654
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
> 
>   FUNCTION I_GET_INCIDENT_TYPE(PROBLEM_TYPE IN NUMBER)
>   RETURN VARCHAR2
>   IS
>   BEGIN
>     IF (PROBLEM_TYPE = DBMS_SQLDIAG.PROBLEM_TYPE_PERFORMANCE) THEN
>         RETURN INCIDENT_TYPE_QRY_PERF;
>     ELSIF (PROBLEM_TYPE = DBMS_SQLDIAG.PROBLEM_TYPE_WRONG_RESULTS) THEN
>         RETURN INCIDENT_TYPE_SQL_FAIL;
>     ELSIF (PROBLEM_TYPE = DBMS_SQLDIAG.PROBLEM_TYPE_COMPILATION_ERROR OR
>            PROBLEM_TYPE = DBMS_SQLDIAG.PROBLEM_TYPE_EXECUTION_ERROR) THEN
>         RETURN INCIDENT_TYPE_SQL_FAIL;
>     ELSE
>       RAISE_APPLICATION_ERROR(-20001,
>         '''' || PROBLEM_TYPE || ''' - invalid problem type');
>     END IF;
>   END I_GET_INCIDENT_TYPE;
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   FUNCTION I_VALIDATE_PROBLEM_TYPE(PROBLEM_TYPE IN NUMBER) RETURN NUMBER
>   IS
>   BEGIN
>     IF ((PROBLEM_TYPE != DBMS_SQLDIAG.PROBLEM_TYPE_PERFORMANCE) AND
>         (PROBLEM_TYPE != DBMS_SQLDIAG.PROBLEM_TYPE_WRONG_RESULTS) AND
>         (PROBLEM_TYPE != DBMS_SQLDIAG.PROBLEM_TYPE_COMPILATION_ERROR) AND
>         (PROBLEM_TYPE != DBMS_SQLDIAG.PROBLEM_TYPE_EXECUTION_ERROR))
>     THEN
>       DBMS_SYS_ERROR.RAISE_SYSTEM_ERROR(ERR_PTYPE_INVALID, PROBLEM_TYPE);
>     END IF;
> 
>     RETURN PROBLEM_TYPE;
>   END I_VALIDATE_PROBLEM_TYPE;
> 
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
> 
>   PROCEDURE I_GET_INCIDENT_FOR_SQLID(
>     SQL_ID         IN  VARCHAR2,
>     PROBLEM_TYPE   IN  NUMBER,
>     INCIDENT_ID    OUT NUMBER)
>   IS
>     SQL_STMT       SQLSET_ROW;
>     L_PROBLEM_TYPE NUMBER;
>     ERR_CODE       BINARY_INTEGER;
>     ERR_MESG       VARCHAR2(200);
>     L_SQL_ID       VARCHAR2(16);
> 
>     CURSOR INCI_CUR IS
>       SELECT INCIDENT_ID FROM "PUBLIC".V$DIAG_INCIDENT
>         WHERE FLOOD_CONTROLLED = 0;
>   BEGIN
>      
>      INCIDENT_ID := 0;
> 
>     
>     FOR INCI_REC IN INCI_CUR
>     LOOP
>        SQL_STMT := DBMS_SQLDIAG.GETSQL(INCI_REC.INCIDENT_ID);
> 
>        
>        IF (SQL_STMT.SQL_ID = SQL_ID) THEN
> 
>          
>          DBMS_SQLDIAG.INCIDENTID_2_SQL(INCI_REC.INCIDENT_ID, SQL_STMT, 
>                                        L_PROBLEM_TYPE, ERR_CODE, ERR_MESG);
> 
>          
>          IF (L_PROBLEM_TYPE = PROBLEM_TYPE) THEN
>            INCIDENT_ID := INCI_REC.INCIDENT_ID;
>            EXIT;
>          END IF;
>        END IF;
>     END LOOP;
>   END I_GET_INCIDENT_FOR_SQLID;
> 
SYS.DBMS_SQLTCB_INTERNAL - PACKAGE BODY (RU):
30c30
<   PROCEDURE I_COMPRESS_TESTCASE_CALLOUT(TESTCASE_NAME   IN VARCHAR2,
---
>   FUNCTION I_COMPRESS_TESTCASE_CALLOUT(TESTCASE_NAME   IN VARCHAR2,
31a32
>   RETURN BOOLEAN
35,36c36,40
<   PARAMETERS (CONTEXT, TESTCASE_NAME OCISTRING, TESTCASE_NAME INDICATOR SB2,
<               DIRECTORY_PATH OCISTRING, DIRECTORY_PATH INDICATOR SB2)
---
>   PARAMETERS (CONTEXT,
>               TESTCASE_NAME OCISTRING, TESTCASE_NAME INDICATOR SB2,
>               DIRECTORY_PATH OCISTRING,
>               DIRECTORY_PATH INDICATOR SB2,
>               RETURN UB1)
54c58
<   PROCEDURE I_COMPRESS_TESTCASE(TESTCASE_NAME   IN VARCHAR2,
---
>   FUNCTION I_COMPRESS_TESTCASE(TESTCASE_NAME   IN VARCHAR2,
55a60
>   RETURN BOOLEAN
58a64
>     COMPRESS_FAILED BOOLEAN;
69c75,77
<     I_COMPRESS_TESTCASE_CALLOUT(TESTCASE_NAME, DIRECTORY_PATH);
---
>     COMPRESS_FAILED := 
>                     I_COMPRESS_TESTCASE_CALLOUT(TESTCASE_NAME, DIRECTORY_PATH);
>     RETURN COMPRESS_FAILED;
656a665
>         
660c669,670
<                          DBMS_ASSERT.SIMPLE_SQL_NAME(TCB_PREFIX) || '%''';
---
>                          DBMS_ASSERT.SIMPLE_SQL_NAME(TCB_PREFIX) || 
>                          '%'' and executions > 0';
899a910,911
>     
>     
901c913
<       QRYTEXT := 'select to_char(address||'',''||hash_value) ' ||
---
>       QRYTEXT := 'select distinct to_char(address||'',''||hash_value) ' ||
1154a1167,1170
>   I_CLOB_PUT_LINE(XML, '<OPTIMIZER_ENV>' || SQL_STMT.OPTIMIZER_ENV
>                                                || '</OPTIMIZER_ENV>');
> 
>   
3960a3977,4013
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   FUNCTION I_GET_PROBLEM_TYPE(PROBLEM_TYPE  IN VARCHAR2)
>   RETURN NUMBER
>   IS
>     L_PROBLEMTYPE NUMBER;
>   BEGIN
>     CASE (PROBLEM_TYPE)
>       WHEN ('PERFORMANCE') THEN
>         L_PROBLEMTYPE := DBMS_SQLDIAG.PROBLEM_TYPE_PERFORMANCE;
>       WHEN ('WRONG_RESULTS') THEN
>         L_PROBLEMTYPE := DBMS_SQLDIAG.PROBLEM_TYPE_WRONG_RESULTS;
>       WHEN ('COMPILATION_ERROR') THEN
>         L_PROBLEMTYPE := DBMS_SQLDIAG.PROBLEM_TYPE_COMPILATION_ERROR;
>       WHEN ('EXECUTION_ERROR') THEN
>         L_PROBLEMTYPE := DBMS_SQLDIAG.PROBLEM_TYPE_EXECUTION_ERROR;
>       ELSE
>         DBMS_SYS_ERROR.RAISE_SYSTEM_ERROR(
>           SYS.DBMS_SQLTCB_INTERNAL.ERR_TCB_INVALID_EXPORT_PARAMS,
>           'problem_type can be PERFORMANCE, WRONG_RESULTS, COMPILATION_ERROR'
>           || ' or EXECUTION_ERROR only');
>       END CASE;
>     RETURN L_PROBLEMTYPE;
>   END I_GET_PROBLEM_TYPE;
> 
>   
3975c4028,4030
<     ARCHIVETCBFILES         OUT  BOOLEAN
---
>     ARCHIVETCBFILES         OUT  BOOLEAN   ,
>     PROBLEMTYPE          IN OUT  NUMBER    ,
>     INCIDENTCREATE          OUT  BOOLEAN
3983c4038,4039
< 
---
>     L_PROBLEM                    VARCHAR2(32);
>     L_INCIDENT_CREATE            VARCHAR2(3);
4098,4099c4154,4160
<                                                                 GETSTRINGVAL()
<         INTO STATS_HISTORY_SINCE, L_DIAGEVENT, L_COMPRESS
---
>                                                                 GETSTRINGVAL(),
>                F.EXTRACT('/parameters/parameter[@name="problem_type"]/text()').
>                                                                 GETSTRINGVAL(),
>             F.EXTRACT('/parameters/parameter[@name="incident_create"]/text()').
>                                                                 GETSTRINGVAL() 
>         INTO STATS_HISTORY_SINCE, L_DIAGEVENT, L_COMPRESS, L_PROBLEM,
>              L_INCIDENT_CREATE 
4115a4177,4198
>       
>       IF (L_PROBLEM IS NOT NULL) THEN
>        
>         PROBLEMTYPE := I_GET_PROBLEM_TYPE(UPPER(L_PROBLEM));
>       
>       ELSIF (PROBLEMTYPE <> 0) THEN
>         PROBLEMTYPE := DBMS_SQLDIAG_INTERNAL.I_VALIDATE_PROBLEM_TYPE(
>                                                                 PROBLEMTYPE);
>       
>       ELSE
>         PROBLEMTYPE := DBMS_SQLDIAG.PROBLEM_TYPE_PERFORMANCE;
>       END IF;
> 
>       
>       IF (INCIDENTID IS NULL AND              
>           L_INCIDENT_CREATE IS NOT NULL AND   
>           (UPPER(L_INCIDENT_CREATE) = 'YES' OR
>            UPPER(L_INCIDENT_CREATE) ='Y')) THEN
>         INCIDENTCREATE := TRUE;
>       ELSE
>         INCIDENTCREATE := FALSE;
>       END IF;
4429c4512,4514
<     DIAGEVENT    IN     NUMBER)
---
>     DIAGEVENT    IN     NUMBER,
>     INCIDENT_ID  IN     NUMBER := 0,
>     PROBLEM_TYPE IN     NUMBER := 0)
4449a4535,4543
>     IF (INCIDENT_ID <> 0 AND
>         PROBLEM_TYPE <> 0) THEN
>       
>       CONTROL_XML := '<parameter name="update_incident">' ||
>                                              INCIDENT_ID || '</parameter>' ||
>                      '<parameter name="problem_type">' ||
>                                              PROBLEM_TYPE || '</parameter>';
>     END IF;
> 
4453c4547,4548
<                   ACTION       => 'explain_plan', 
---
>                   ACTION       => 'explain_plan',
>                   CTRL_OPTIONS => CONTROL_XML,
4547d4641
<             CONTROL_XML ||
4949c5043,5044
<     CTRLOPTIONS              IN   VARCHAR2  :=  NULL
---
>     CTRLOPTIONS              IN   VARCHAR2  :=  NULL,
>     PROBLEM_TYPE             IN   NUMBER    := 0
4984a5080,5085
>     COMPRESSFAILED    BOOLEAN := FALSE;
>     INCIDENTTYPE      VARCHAR2(64);
>     L_PROBLEM_TYPE    NUMBER  := PROBLEM_TYPE;
>     L_INCIDENT_ID     NUMBER  := 0;
>     L_INCIDENT_CREATE BOOLEAN := FALSE;
>     INCIDENT_CREATED  BOOLEAN := FALSE;
4986a5088,5091
>     IF (INCIDENTID IS NOT NULL) THEN
>       L_INCIDENT_ID := TO_NUMBER(INCIDENTID);
>     END IF;
> 
5022c5127,5129
<                           ARCHIVETCBFILES     => ARCHIVETCBFILES);
---
>                           ARCHIVETCBFILES     => ARCHIVETCBFILES,
>                           PROBLEMTYPE         => L_PROBLEM_TYPE,
>                           INCIDENTCREATE      => L_INCIDENT_CREATE);
5098a5206,5215
>     IF (ARCHIVETCBFILES = TRUE) THEN
>       I_TCB_ADD_PARAMETER(SQL_TCB_PARAM_COMPRESS, 'YES', TCB_PARAM);
>     END IF;
> 
>     
>     IF (L_PROBLEM_TYPE <> 0) THEN
>       I_TCB_ADD_PARAMETER(SQL_TCB_PROBLEM_TYPE, L_PROBLEM_TYPE, TCB_PARAM);
>     END IF;
> 
>     
5127a5245
>     CONTROL_XML := '<parameter name="mode">SAFE</parameter>';
5128a5247,5250
>     
>     
>     IF (INCIDENTID IS NULL AND
>         L_INCIDENT_CREATE = TRUE) THEN
5129a5252,5260
>       
>       DBMS_SQLDIAG_INTERNAL.I_GET_INCIDENT_FOR_SQLID(SQL_STMT.SQL_ID,
>                                                      L_PROBLEM_TYPE,
>                                                      L_INCIDENT_ID);
>       
>       IF (L_INCIDENT_ID = 0) THEN
>         
>         INCIDENTTYPE := DBMS_SQLDIAG_INTERNAL.I_GET_INCIDENT_TYPE(
>                                                              L_PROBLEM_TYPE);
5131c5262,5271
<     CONTROL_XML := '<parameter name="mode">SAFE</parameter>';
---
>         
>         DBMS_SQLDIAG_INTERNAL.I_CREATE_INCIDENT(L_INCIDENT_ID, INCIDENTTYPE);
> 
>         IF (L_INCIDENT_ID IS NULL OR L_INCIDENT_ID = 0) THEN
>           RAISE_APPLICATION_ERROR(-20001, 'incident creation failed');
>         END IF;
> 
>         INCIDENT_CREATED := TRUE;
>       END IF;
>     END IF;
5134,5135c5274,5276
<     IF (INCIDENTID IS NOT NULL) THEN
<       I_TCB_ADD_PARAMETER(SQL_TCB_PARAM_INCIDENTID, INCIDENTID, TCB_PARAM);
---
>     IF (L_INCIDENT_ID IS NOT NULL AND
>         L_INCIDENT_ID <> 0) THEN
>       I_TCB_ADD_PARAMETER(SQL_TCB_PARAM_INCIDENTID, L_INCIDENT_ID, TCB_PARAM);
5140c5281
<             '<parameter name="incident_id">' || INCIDENTID || '</parameter>';
---
>             '<parameter name="incident_id">' || L_INCIDENT_ID || '</parameter>';
5456,5463c5597,5617
<     GENERATED := 
<       I_TCB_ADD_SQL_DIAGNOSTIC(
<                         DIRECTORY    => L_DIRECTORY,
<                         XPLFILE      => FNAME,
<                         SQL_STMT     => SQL_STMT,
<                         ERR_CODE     => ERR_CODE, 
<                         ERR_MESG     => ERR_MESG,
<                         DIAGEVENT    => DIAGEVENT);
---
>     IF (INCIDENT_CREATED = TRUE) THEN
>       GENERATED := 
>         I_TCB_ADD_SQL_DIAGNOSTIC(
>                           DIRECTORY    => L_DIRECTORY,
>                           XPLFILE      => FNAME,
>                           SQL_STMT     => SQL_STMT,
>                           ERR_CODE     => ERR_CODE, 
>                           ERR_MESG     => ERR_MESG,
>                           DIAGEVENT    => DIAGEVENT,
>                           INCIDENT_ID  => L_INCIDENT_ID,
>                           PROBLEM_TYPE => L_PROBLEM_TYPE);
>     ELSE
>       GENERATED :=
>         I_TCB_ADD_SQL_DIAGNOSTIC(
>                           DIRECTORY    => L_DIRECTORY,
>                           XPLFILE      => FNAME,
>                           SQL_STMT     => SQL_STMT,
>                           ERR_CODE     => ERR_CODE,
>                           ERR_MESG     => ERR_MESG,
>                           DIAGEVENT    => DIAGEVENT);
>     END IF;
5503,5507c5657,5672
<     
<     
<     
<     
<     
---
>     IF (ARCHIVETCBFILES = TRUE) THEN
>       COMPRESSFAILED:= SYS.DBMS_SQLTCB_INTERNAL.I_COMPRESS_TESTCASE(
>                                                  TESTCASE_NAME => TCB_PREFIX, 
>                                                  DIRECTORY     => L_DIRECTORY);
>       
>       
>       IF COMPRESSFAILED = TRUE THEN
>         
>         TCB_PARAM := REGEXP_REPLACE(TCB_PARAM, 
>                                     '<PARAMETER name="COMPRESS"> YES ' || 
>                                     '</PARAMETER>', '');
>         
>         TESTCASEMETADATA := I_WRITE_MAIN_XML(L_DIRECTORY, TCB_PARAM, TCB, 
>                                              'full');
>       END IF;
>     END IF;
5508a5674,5682
>     EXCEPTION
>       WHEN OTHERS THEN
>         
>         IF (INCIDENTID IS NULL AND           
>             L_INCIDENT_ID <> 0 AND           
>             L_INCIDENT_CREATE = TRUE) THEN   
>           DBMS_SQLDIAG_INTERNAL.I_REMOVE_INCIDENT(INCIDENTID);
>         END IF;
>       RAISE; 
SYS.DBMS_STATS - PACKAGE BODY (RU):
480a481,485
>   DSC_GENSELMAP_ST_NONEMPTY       CONSTANT BINARY_INTEGER := 32;
>   DSC_GENSELMAP_ST_HIST           CONSTANT BINARY_INTEGER := 64;
>   DSC_GENSELMAP_ST_STATUS         CONSTANT BINARY_INTEGER := 128;
>   DSC_GENSELMAP_TMP_TABLE         CONSTANT BINARY_INTEGER := 256;
>   DSC_GENSELMAP_TABLE_LEVEL       CONSTANT BINARY_INTEGER := 512;
23005a23011
>     NDVREQUESTED            BOOLEAN;
23123a23130
>       NDVREQUESTED := FALSE;
23140d23146
<             (CLIST(CENTRY).UNQ IS NULL) AND
23146c23152
<           NDVNEEDED := TRUE;
---
>           NDVREQUESTED := TRUE;
23148a23155,23158
>         IF (NDVREQUESTED AND CLIST(CENTRY).UNQ IS NULL) THEN
>           NDVNEEDED := TRUE;
>         END IF;
> 
23189,23193d23198
< 
<           
<           IF (INCRE_ST) THEN
<              GATHFLG := BITOR(GATHFLG, DSC_SELREC_SYN);
<           END IF;          
23195a23201,23211
>         
>         
>         
>         
>         
>         
>         
>         IF (NDVREQUESTED AND INCRE_ST) THEN
>            GATHFLG := BITOR(GATHFLG, DSC_SELREC_SYN);
>         END IF;          
> 
23206c23222,23223
<         IF (NNVNEEDED OR NOT (NDVNEEDED OR ACLNEEDED OR TOPNNEEDED)) THEN
---
>         
>         IF (NNVNEEDED OR GATHFLG = 0) THEN
31277c31294
<      
---
> 
31286,31289c31303,31314
<       ELSIF (GATHERGLOBAL AND
<              NOT SINGLEPART AND NOT SINGLESUBPART) THEN
<         
<         
---
>       END IF;
> 
>       IF (GATHERGLOBAL AND
>           (INCREVAL = 'TRUE' AND INCRELVL = 'TABLE' OR 
>            
>            
>            
>            
>            NOT ENABLED
>            
>           )
>          ) THEN
31290a31316,31317
>         
>         FLAG := BITOR(FLAG, DSC_GENSELMAP_TABLE_LEVEL);
31291a31319,31327
> 
>       TRACE(DSC_ONLINE_TRC,' increval = ' || INCREVAL ||
>                           ' partitioned: ' || BOOL2STR(PARTITIONED) || 
>                           ' gatherglobal: ' || BOOL2STR(GATHERGLOBAL) ||
>                           ' gatherpart:' || BOOL2STR(GATHERPART) ||
>                           ' singlepart:' || BOOL2STR(SINGLEPART) ||
>                           ' gathersubpart = ' || BOOL2STR(GATHERSUBPART) ||
>                           ' singlesubpart = ' || BOOL2STR(SINGLESUBPART) ||
>                           ' gathergloal = ' || BOOL2STR(GATHERGLOBAL));
31297c31333
<               GRANU || ' on ' || NAMESTR || ' can be collected');
---
>               GRANU || ' on ' || NAMESTR || ' can be collected ');
31402,31403c31438
<          INCRELVL = 'TABLE' AND GATHERGLOBAL AND 
<            NOT SINGLEPART AND NOT SINGLESUBPART
---
>          INCRELVL = 'TABLE' AND GATHERGLOBAL 
31408a31444,31445
>     ELSE
>       TRACE(DSC_ONLINE_TRC, 'no synopses gathered online: ');
31434a31472,31473
>     TRACE(DSC_ONLINE_TRC, 'gen_selmap flag: ' || FLAG);
> 
31487c31526,31527
<       TSTATS(TIND).TSTAMP := SYSTIMESTAMP;
---
>       
>       TSTATS(TIND).TSTAMP := ANALYZETIME;
34489c34529
<     ANALYZETIME  DATE;       
---
>     ANALYZETIME  DATE := SYSTIMESTAMP;       
34890d34929
<       ANALYZETIME := SYSTIMESTAMP;
35021d35059
<             ANALYZETIME := SYSTIMESTAMP;
SYS.DBMS_WORKLOAD_CAPTURE_I - PACKAGE BODY (RU):
2528,2531c2528,2531
<   PROCEDURE INVOKE_HANDLE_ENCRPTION(ACTION   IN BINARY_INTEGER,
<                                    SRC_PATH  IN VARCHAR2,
<                                    DST_PATH  IN VARCHAR2,
<                                    ALGORITHM IN VARCHAR2)
---
>   PROCEDURE INVOKE_HANDLE_ENCRYPTION(ACTION    IN BINARY_INTEGER,
>                                      SRC_PATH  IN VARCHAR2,
>                                      DST_PATH  IN VARCHAR2,
>                                      ALGORITHM IN VARCHAR2)
2592c2592
<       INVOKE_HANDLE_ENCRPTION(ACTION, SRC_PATH, DST_PATH, ENCRYPTION);
---
>       INVOKE_HANDLE_ENCRYPTION(ACTION, SRC_PATH, DST_PATH, ENCRYPTION);
2600c2600
<       INVOKE_HANDLE_ENCRPTION(ACTION, SRC_PATH, DST_PATH, ENC_ALG);
---
>       INVOKE_HANDLE_ENCRYPTION(ACTION, SRC_PATH, DST_PATH, ENC_ALG);
SYS.SODA_COLLECTION_T - TYPE (RU):
8c8
<     MEMBER FUNCTION	create_Index (specification VARCHAR2)
---
>     MEMBER FUNCTION create_Index (specification VARCHAR2)
11c11,12
<     MEMBER FUNCTION	drop_Index (index_Name VARCHAR2)
---
>     MEMBER FUNCTION drop_Index (index_Name VARCHAR2,
>                                 force      BOOLEAN DEFAULT FALSE)
SYS.SODA_COLLECTION_T - TYPE BODY (RU):
5c5
<     MEMBER FUNCTION	CREATE_INDEX (SPECIFICATION VARCHAR2)
---
>     MEMBER FUNCTION CREATE_INDEX (SPECIFICATION VARCHAR2)
19c19,20
<     MEMBER FUNCTION	DROP_INDEX (INDEX_NAME VARCHAR2)
---
>     MEMBER FUNCTION DROP_INDEX (INDEX_NAME VARCHAR2,
>                                 FORCE      BOOLEAN DEFAULT FALSE)
21c22
<     LANGUAGE C
---
>     EXTERNAL LANGUAGE C
29a31,32
>                 FORCE,
>                 FORCE        INDICATOR  SB2,
SYS.AWR_CDB_CLUSTER_INTERCON - VIEW (RU):
3c3,5
<   ci.name, ci.ip_address, ci.is_public, ci.source,
---
>   ci.name,
>   case when SYS_CONTEXT('USERENV','SYSTEM_DATA_VISIBLE')='YES' then ci.ip_address else null end ip_address, -- Use macro to mask sensitive column
>   ci.is_public, ci.source,
SYS.AWR_PDB_CLUSTER_INTERCON - VIEW (RU):
3c3,5
<   ci.name, ci.ip_address, ci.is_public, ci.source,
---
>   ci.name,
>   case when SYS_CONTEXT('USERENV','SYSTEM_DATA_VISIBLE')='YES' then ci.ip_address else null end ip_address, -- Use macro to mask sensitive column
>   ci.is_public, ci.source,
SYS.AWR_ROOT_CLUSTER_INTERCON - VIEW (RU):
3c3,5
<   ci.name, ci.ip_address, ci.is_public, ci.source,
---
>   ci.name,
>   case when SYS_CONTEXT('USERENV','SYSTEM_DATA_VISIBLE')='YES' then ci.ip_address else null end ip_address, -- Use macro to mask sensitive column
>   ci.is_public, ci.source,
SYS.DBA_GOLDENGATE_SUPPORT_MODE - VIEW (RU):
9a10,11
>      when (unsupp.gensby = -1) then
>       'INTERNAL'
SYS.DBA_XSTREAM_OUT_SUPPORT_MODE - VIEW (RU):
11a12
>   where unsupp.gensby != -1
SYS.LOGSTDBY_RU_UNSUPPORT_TAB_12_2 - VIEW (RU):
47,48c47
<     or (bitand(t.property, power(2,73)) != 0 and   /* sharded qt in ru mode */
<         sys_context( 'userenv', 'IS_DG_ROLLING_UPGRADE' ) = 'TRUE')
---
>     or  (bitand(t.property, power(2,73)) != 0)       /* Sharded queue table */
SYS.LOGSTDBY_RU_UN_TAB_12_2_0_2 - VIEW (RU):
47,48c47
<     or (bitand(t.property, power(2,73)) != 0 and   /* sharded qt in ru mode */
<         sys_context( 'userenv', 'IS_DG_ROLLING_UPGRADE' ) = 'TRUE')
---
>     or  (bitand(t.property, power(2,73)) != 0)       /* Sharded queue table */
SYS.LOGSTDBY_SUPPORT_TAB_12_2 - VIEW (RU):
44a45,46
>     or  (bitand(t.property, power(2,73)) != 0 and
>            sys_context( 'userenv', 'IS_DG_ROLLING_UPGRADE' ) = 'TRUE')       /* Sharded queue table */
SYS.LOGSTDBY_SUPPORT_TAB_12_2_0_2 - VIEW (RU):
44a45,46
>     or  (bitand(t.property, power(2,73)) != 0 and
>            sys_context( 'userenv', 'IS_DG_ROLLING_UPGRADE' ) = 'TRUE')       /* Sharded queue table */
SYS.LOGSTDBY_UNSUPPORT_TAB_12_2 - VIEW (RU):
47,48c47,48
<     or (bitand(t.property, power(2,73)) != 0 and   /* sharded qt in ru mode */
<         sys_context( 'userenv', 'IS_DG_ROLLING_UPGRADE' ) = 'TRUE')
---
>     or  (bitand(t.property, power(2,73)) != 0 and
>            sys_context( 'userenv', 'IS_DG_ROLLING_UPGRADE' ) = 'TRUE')       /* Sharded queue table */
SYS.LOGSTDBY_UNSUPP_TAB_12_2_0_2 - VIEW (RU):
47,48c47,48
<     or (bitand(t.property, power(2,73)) != 0 and   /* sharded qt in ru mode */
<         sys_context( 'userenv', 'IS_DG_ROLLING_UPGRADE' ) = 'TRUE')
---
>     or  (bitand(t.property, power(2,73)) != 0 and
>            sys_context( 'userenv', 'IS_DG_ROLLING_UPGRADE' ) = 'TRUE')       /* Sharded queue table */
SYS.OGG_SUPPORT_TAB_12_2 - VIEW (RU):
119a120
>      or  (bitand(t.property, power(2,73)) != 0)       /* Sharded queue table */
SYS.OGG_SUPPORT_TAB_12_2_0_2 - VIEW (RU):
121a122
>     or  (bitand(t.property, power(2,73)) != 0)        /* Sharded queue table */
SYS._DBA_OGG_ALL_TABLES - VIEW (RU):
48d47
<     and gensby != -1  /* Internal  - this includes many schemas */
XDB.DBMS_JSON_INT - PACKAGE (RU):
5a6
>                  TABLENAME VARCHAR2,
XDB.DBMS_SODA_ADMIN - PACKAGE (RU):
19a20,21
>   type NUMNTAB is table of number;
> 
107a110,118
> 
>   --
>   -- Create an index based on an index specification, for a
>   -- collection with the supplied URI name.
>   --
>   procedure CREATE_INDEX(P_URI_NAME    in  nvarchar2,
>                          P_INDEX_SPEC  in  varchar2,
>                          P_VERBOSE     in  boolean  default false);
> 
XDB.DBMS_SODA_DOM - PACKAGE (RU):
75a76,100
>   function JSON_MERGE_PATCH(JVAL in varchar2,
>                             JPATCH in varchar2,
>                             EXCEPTIONS in varchar2 default 'ALL')
>     return varchar2;
>   function JSON_MERGE_PATCH_N(JVAL in nvarchar2,
>                               JPATCH in varchar2,
>                               EXCEPTIONS in varchar2 default 'ALL')
>     return varchar2;
>   function JSON_MERGE_PATCH_R(JVAL in raw,
>                               JPATCH in varchar2,
>                               EXCEPTIONS in varchar2 default 'ALL')
>     return raw;
>   function JSON_MERGE_PATCH_C(JVAL in clob,
>                               JPATCH in varchar2,
>                               EXCEPTIONS in varchar2 default 'ALL')
>     return clob;
>   function JSON_MERGE_PATCH_NC(JVAL in nclob,
>                                JPATCH in varchar2,
>                                EXCEPTIONS in varchar2 default 'ALL')
>     return clob;
>   function JSON_MERGE_PATCH_B(JVAL in blob,
>                               JPATCH in varchar2,
>                               EXCEPTIONS in varchar2 default 'ALL')
>     return blob;
>   --
XDB.DBMS_JSON - PACKAGE BODY (RU):
914c914
<   DBMS_JSON_INT.RENAME(UNAME, IDX_NAME, PATH, TYPE,
---
>   DBMS_JSON_INT.RENAME(UNAME, TNAME, IDX_NAME, PATH, TYPE,
XDB.DBMS_JSON_INT - PACKAGE BODY (RU):
3a4
>                  TABLENAME VARCHAR2,
17a19,21
>               TABLENAME                     STRING,
>               TABLENAME              INDICATOR SB4,
>               TABLENAME                 LENGTH SB4,
XDB.DBMS_SODA_ADMIN - PACKAGE BODY (RU):
4a5
>   MAX_INDEX_CHAR_COLS             CONSTANT NUMBER       := 16;
23a25,48
> 
>   ALPHA_CHARS         CONSTANT VARCHAR2(128) :=
>     'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_';
> 
>   DIGITS_CHARS        CONSTANT VARCHAR2(12)  := '0123456789';
> 
>   HEX_VALS            CONSTANT VARCHAR2(512) :=
>     '000102030405060708090A0B0C0D0E0F'||
>     '101112131415161718191A1B1C1D1E1F'||
>     '202122232425262728292A2B2C2D2E2F'||
>     '303132333435363738393A3B3C3D3E3F'||
>     '404142434445464748494A4B4C4D4E4F'||
>     '505152535455565758595A5B5C5D5E5F'||
>     '606162636465666768696A6B6C6D6E6F'||
>     '707172737475767778797A7B7C7D7E7F'||
>     '808182838485868788898A8B8C8D8E8F'||
>     '909192939495969798999A9B9C9D9E9F'||
>     'A0A1A2A3A4A5A6A7A8A9AAABACADAEAF'||
>     'B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF'||
>     'C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF'||
>     'D0D1D2D3D4D5D6D7E8D9DADBDCDDDEDF'||
>     'E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF'||
>     'F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF';
> 
27a53,87
> 
>   
>   
>   
>   
>   
>   ERR_IDX_WRONG_PROP_TYPE          CONSTANT  NUMBER := -40696;
>   ERR_IDX_WRONG_DATAGUIDE_VAL      CONSTANT  NUMBER := -40697;
>   ERR_IDX_WRONG_SEARCHON_VAL       CONSTANT  NUMBER := -40698;
>   ERR_IDX_WRONG_ORDER_VAL          CONSTANT  NUMBER := -40699;  
>   ERR_IDX_MISSING_PROP             CONSTANT  NUMBER := -40700;
>   ERR_IDX_INCOMPAT_PROP            CONSTANT  NUMBER := -40711;
>   ERR_IDX_MISSING_FIELDS           CONSTANT  NUMBER := -40712;
>   ERR_IDX_LAX_SCALAR               CONSTANT  NUMBER := -40713;
>   ERR_IDX_WRONG_DATATYPE           CONSTANT  NUMBER := -40714;
>   ERR_IDX_MAXLEN_NOT_COMPAT        CONSTANT  NUMBER := -40715;
>   ERR_IDX_TEXT_NO_HETERO           CONSTANT  NUMBER := -40716;
>   ERR_IDX_FUNC_NO_HETERO           CONSTANT  NUMBER := -40717;
>   ERR_IDX_GEO_NO_HETERO            CONSTANT  NUMBER := -40718;
>   ERR_IDX_UNRECOGNIZED_PROP        CONSTANT  NUMBER := -40719;
>   ERR_IDX_TEXT_WRONG_KEY_TYPE      CONSTANT  NUMBER := -40720;
>   ERR_IDX_TEXT_WRONG_CTNT_TYPE     CONSTANT  NUMBER := -40721;
>   ERR_IDX_TEXT_WRONG_ENCRYPT       CONSTANT  NUMBER := -40722;
>   ERR_IDX_NULL_SPEC                CONSTANT  NUMBER := -40723;
>   ERR_IDX_NO_ARRAYS                CONSTANT  NUMBER := -40724;
>   ERR_IDX_FIELD_PATH_NULL          CONSTANT  NUMBER := -40725;
>   ERR_IDX_INVALID_PATH             CONSTANT  NUMBER := -40726;
>   ERR_IDX_CHAR_COLS_EXCEEDED       CONSTANT  NUMBER := -40727;
>   ERR_IDX_PATH_NO_STEP_SEP         CONSTANT  NUMBER := -40728;
>   ERR_IDX_PATH_UNCLOSED_BACKQUOT   CONSTANT  NUMBER := -40729;
>   ERR_IDX_INVALID_PATH_QUOT_CHAR   CONSTANT  NUMBER := -40730;
>   ERR_IDX_INVALID_QUOTED_PATH      CONSTANT  NUMBER := -40731;
>   ERR_IDX_PATH_INCOMPL_ESCSEQ      CONSTANT  NUMBER := -40732;
>   ERR_IDX_MISSING_FIELDS_SPATIAL   CONSTANT  NUMBER := -40749;
> 
128a189,193
>                                  P_KEY_PATH                  IN VARCHAR2,
>                                  P_PARTITION_COLUMN_NAME     IN VARCHAR2,
>                                  P_PARTITION_COLUMN_TYPE     IN VARCHAR2,
>                                  P_PARTITION_COLUMN_LEN      IN NUMBER,
>                                  P_PARTITION_PATH            IN VARCHAR2, 
143a209
>                                  P_PRE_PARSED                IN VARCHAR2,
200a267,270
>     IF (P_KEY_PATH IS NOT NULL) THEN
>       P_DESCRIPTOR := P_DESCRIPTOR||','||QUOTE_JSON_VALUE('path')||
>                       ':'||QUOTE_JSON_VALUE(P_KEY_PATH);
>     END IF;
254a325,342
>     IF (P_PARTITION_COLUMN_NAME IS NOT NULL) THEN
>       P_DESCRIPTOR := P_DESCRIPTOR||','||
>                       QUOTE_JSON_VALUE('partitionColumn')||':{'||
>                       QUOTE_JSON_VALUE('name')||':'||
>                       QUOTE_JSON_VALUE(P_PARTITION_COLUMN_NAME);
>       P_DESCRIPTOR := P_DESCRIPTOR||','||QUOTE_JSON_VALUE('sqlType')||
>                       ':'||QUOTE_JSON_VALUE(P_PARTITION_COLUMN_TYPE);
>       IF (P_PARTITION_COLUMN_LEN > 0) THEN
>         P_DESCRIPTOR := P_DESCRIPTOR||','||QUOTE_JSON_VALUE('maxLength')||
>                       ':'||TO_CHAR(P_PARTITION_COLUMN_LEN);
>       END IF;
>       IF (P_PARTITION_PATH IS NOT NULL) THEN
>         P_DESCRIPTOR := P_DESCRIPTOR||','||QUOTE_JSON_VALUE('path')||
>                         ':'||QUOTE_JSON_VALUE(P_PARTITION_PATH);
>       END IF;
>       P_DESCRIPTOR := P_DESCRIPTOR||'}';
>     END IF;
>     
273a362,366
>     IF (P_PRE_PARSED IS NOT NULL) THEN
>       P_DESCRIPTOR := P_DESCRIPTOR||','||
>                       QUOTE_JSON_VALUE('preParsed')||':'||P_PRE_PARSED;
>     END IF;
>     
342a436,583
>   FUNCTION TRANSLATE_JSON_PATH(P_PATH IN VARCHAR2) RETURN VARCHAR2
>   IS
>     V_STEP_SEP    CONSTANT VARCHAR2(10) := '.';
>     V_SQL_QUOT    CONSTANT VARCHAR2(10) := '"';
>     V_PATH        VARCHAR2(4000) := '';
>     V_CHR         VARCHAR2(10);
>     V_NXT         VARCHAR2(10);
>     V_PATH_LEN    NUMBER := LENGTH(P_PATH);
>     V_STEP_LEN    NUMBER := 0;
>     V_STEP_POS    NUMBER := 0;
>     V_HEXCHR      NUMBER;
>     V_ESC_COUNT   NUMBER := 0;
>     V_ESC_POS     NUMBER;
>     V_IS_ESCAPE   BOOLEAN := FALSE;
>     V_IN_QUOTES   BOOLEAN := FALSE;
>     V_NEED_QUOTES BOOLEAN := FALSE;
>     V_END_STEP    BOOLEAN := FALSE;
>   BEGIN
>     FOR I IN 1..V_PATH_LEN LOOP
>       V_CHR := SUBSTR(P_PATH,I,1);
>       IF (I < V_PATH_LEN) THEN
>          V_NXT := SUBSTR(P_PATH,I+1,1);
>       ELSE
>          V_NXT := NULL;
>       END IF;
>       
>       IF (V_END_STEP) THEN
>         IF (V_CHR <> V_STEP_SEP) THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_PATH_NO_STEP_SEP,
>                                                 P_PATH, TO_CHAR(I-1));
>         END IF;
>       END IF;
>       
>       IF (V_CHR = V_STEP_SEP) AND (NOT(V_IN_QUOTES)) THEN
>         IF (V_STEP_LEN = 0) THEN
>           V_PATH := V_PATH||V_SQL_QUOT;
>           V_NEED_QUOTES := TRUE;
>         END IF;
>         IF (V_NEED_QUOTES) THEN
>           V_PATH := V_PATH||V_SQL_QUOT;
>           V_NEED_QUOTES := FALSE;
>         END IF;
>         V_PATH := V_PATH||V_CHR;
>         V_END_STEP := FALSE;
>         V_STEP_LEN := 0;
>         V_STEP_POS := 0;
>         CONTINUE;
>       END IF;
>       
>       IF (V_CHR = '`') AND (NOT(V_IS_ESCAPE)) THEN
>         IF (V_IN_QUOTES) THEN
>           IF (V_NXT = V_CHR) THEN 
>             V_IS_ESCAPE := TRUE;
>           ELSE
>             V_IN_QUOTES := FALSE;
>             V_END_STEP := TRUE;
>           END IF;
>         ELSIF (V_STEP_LEN > 0) THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_INVALID_QUOTED_PATH,
>                                                   P_PATH, TO_CHAR(I-1));
>         ELSE
>           V_IN_QUOTES := TRUE;
>           V_PATH := V_PATH||V_SQL_QUOT;
>           V_NEED_QUOTES := TRUE;
>         END IF;
>         CONTINUE;
>       END IF;
>       
>       IF (V_IS_ESCAPE) THEN
>         V_IS_ESCAPE := FALSE;
>       END IF;
>       IF NOT(V_IN_QUOTES) AND (V_CHR IN ('[',']')) THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_NO_ARRAYS);
>       END IF;
>       IF (NOT(V_NEED_QUOTES)) THEN
>         IF (INSTR('0123456789', V_CHR) > 0) THEN
>           IF (V_STEP_LEN = 0) THEN
>             V_PATH := V_PATH||V_SQL_QUOT;
>             V_NEED_QUOTES := TRUE;
>           END IF;
>         ELSIF (INSTR(ALPHA_CHARS, V_CHR) = 0) THEN
>           IF (V_STEP_LEN = 0) THEN
>             V_PATH := V_PATH||V_SQL_QUOT;
>           ELSIF (V_STEP_POS = 0) THEN
>             V_PATH := V_SQL_QUOT||V_PATH;
>           ELSE
>             V_PATH := SUBSTR(V_PATH,1,V_STEP_POS-1)||V_SQL_QUOT||
>                       SUBSTR(V_PATH,V_STEP_POS);
>           END IF;
>           V_NEED_QUOTES := TRUE;
>         
>         END IF;
>       END IF;
>       
>       IF (V_CHR = '''') THEN
>         V_PATH := V_PATH||V_CHR||V_CHR;
>       ELSIF (V_CHR = TO_CHAR(U'\0009')) THEN
>         V_PATH := V_PATH||'\t';
>       ELSIF (V_CHR = TO_CHAR(U'\000D')) THEN
>         V_PATH := V_PATH||'\r';
>       ELSIF (V_CHR = TO_CHAR(U'\000A')) THEN
>         V_PATH := V_PATH||'\n';
>       ELSIF (V_CHR = TO_CHAR(U'\0008')) THEN
>         V_PATH := V_PATH||'\b';
>       ELSIF (V_CHR = TO_CHAR(U'\000C')) THEN
>         V_PATH := V_PATH||'\f';
>       
>       ELSIF (V_CHR = TO_CHAR(U'\007F')) THEN
>         V_PATH := V_PATH||'\u007F';
>       ELSIF (V_CHR = V_SQL_QUOT) THEN
>         V_PATH := V_PATH||'\"';
>       ELSIF (V_CHR = '\') THEN
>         V_PATH := V_PATH||'\\';
>       ELSE
>         V_HEXCHR := INSTR(CONTROL_CHARS,V_CHR);
>         IF (V_HEXCHR = 0) THEN
>           V_PATH := V_PATH||V_CHR;
>         ELSE
>           V_HEXCHR := V_HEXCHR - 1;
>           V_PATH := V_PATH||'\u'||
>                     SUBSTR(HEX_VALS, FLOOR(V_HEXCHR/256)*2 + 1, 2)||
>                     SUBSTR(HEX_VALS, MOD(V_HEXCHR,256)*2 + 1, 2);
>         END IF;
>         
>       END IF;
>       IF (V_STEP_LEN = 0) THEN
>         V_STEP_POS := LENGTH(V_PATH);
>       END IF;
>       V_STEP_LEN := V_STEP_LEN + 1;
>     END LOOP;
>     IF (V_IS_ESCAPE) THEN
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_PATH_INCOMPL_ESCSEQ,
>                                             P_PATH);
>     END IF;
>     IF (V_IN_QUOTES) THEN
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_PATH_UNCLOSED_BACKQUOT,
>                                             P_PATH);
>     END IF;
>     IF (V_STEP_LEN = 0) THEN
>       V_PATH := V_PATH||V_SQL_QUOT;
>       V_NEED_QUOTES := TRUE;
>     END IF;
>     IF (V_NEED_QUOTES) THEN
>       V_PATH := V_PATH||V_SQL_QUOT;
>     END IF;
>     RETURN V_PATH;
>   END TRANSLATE_JSON_PATH;
> 
369a611,615
>     V_KEY_PATH                  VARCHAR2(4000):= NULL;
>     V_PARTITION_COLUMN_NAME     VARCHAR2(128) := NULL;
>     V_PARTITION_COLUMN_TYPE     VARCHAR2(4000):= NULL;
>     V_PARTITION_COLUMN_LEN      NUMBER        := NULL;
>     V_PARTITION_PATH            VARCHAR2(4000):= NULL;
384a631
>     V_PRE_PARSED                VARCHAR2(4000):= NULL;
392a640
>     V_QUOT_PARTITION_NAME       VARCHAR2(130) := NULL;
427a676,680
>                JT.KEY_PATH,
>                JT.PARTITION_COLUMN_NAME,
>                JT.PARTITION_COLUMN_TYPE,
>                JT.PARTITION_COLUMN_LEN,
>                JT.PARTITION_PATH,
442a696
>                JT.PRE_PARSED,
456a711,715
>                V_KEY_PATH,
>                V_PARTITION_COLUMN_NAME,
>                V_PARTITION_COLUMN_TYPE,
>                V_PARTITION_COLUMN_LEN,
>                V_PARTITION_PATH,
471a731
>                V_PRE_PARSED,
498a759,768
>          "KEY_PATH"
>            VARCHAR2(4000) PATH '$.keyColumn.path',
>          "PARTITION_COLUMN_NAME"
>            VARCHAR2(128)  PATH '$.partitionColumn.name',
>          "PARTITION_COLUMN_TYPE"
>            VARCHAR2(4000) PATH '$.partitionColumn.sqlType',
>          "PARTITION_COLUMN_LEN"
>            NUMBER         PATH '$.partitionColumn.maxLength',
>          "PARTITION_PATH"
>            VARCHAR2(4000) PATH '$.partitionColumn.path',
528a799,800
>          "PRE_PARSED"
>            VARCHAR2(4000) PATH '$.preParsed',
551a824,836
> 
>     
>     IF (V_PARTITION_COLUMN_NAME IS NOT NULL) THEN
>       
>       IF (V_PARTITION_PATH IS NULL) THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(-40737);
>       END IF;
>     ELSIF ((V_PARTITION_PATH IS NOT NULL) OR
>            (V_PARTITION_COLUMN_TYPE IS NOT NULL) OR
>            (V_PARTITION_COLUMN_LEN IS NOT NULL)) THEN
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(-40738);
>     END IF;
> 
610a896,919
> 
>     IF (V_PARTITION_COLUMN_TYPE IS NULL) THEN
>       V_PARTITION_COLUMN_TYPE := 'VARCHAR2';
>     ELSIF (UPPER(V_PARTITION_COLUMN_TYPE) = 'STRING') THEN
>       V_PARTITION_COLUMN_TYPE := 'VARCHAR2';
>     ELSIF (UPPER(V_PARTITION_COLUMN_TYPE) = 'CHAR') THEN
>       V_PARTITION_COLUMN_TYPE := 'VARCHAR2';
>     ELSIF (UPPER(V_PARTITION_COLUMN_TYPE) = 'VARCHAR') THEN
>       V_PARTITION_COLUMN_TYPE := 'VARCHAR2';
>     ELSIF (UPPER(V_PARTITION_COLUMN_TYPE) = 'VARCHAR2') THEN
>       V_PARTITION_COLUMN_TYPE := 'VARCHAR2';
>     ELSIF (UPPER(V_PARTITION_COLUMN_TYPE) = 'INTEGER') THEN
>       V_PARTITION_COLUMN_TYPE := 'NUMBER';
>     ELSIF (UPPER(V_PARTITION_COLUMN_TYPE) = 'NUMBER') THEN
>       V_PARTITION_COLUMN_TYPE := 'NUMBER';
>     ELSIF (UPPER(V_PARTITION_COLUMN_TYPE) = 'RAW') THEN
>       V_PARTITION_COLUMN_TYPE := 'RAW';
>     ELSIF (UPPER(V_PARTITION_COLUMN_TYPE) = 'DATE') THEN
>       V_PARTITION_COLUMN_TYPE := 'DATE';
>     ELSIF (UPPER(V_PARTITION_COLUMN_TYPE) = 'TIMESTAMP') THEN
>       V_PARTITION_COLUMN_TYPE := 'TIMESTAMP';
>     ELSE
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(-40739, V_PARTITION_COLUMN_TYPE);
>     END IF;
637a947,967
>     
>     
>     
>     
>     
>     
>     
>     
>     
>     IF (V_PRE_PARSED = 'true') THEN
>       IF (NOT(V_CONTENT_COLUMN_TYPE = 'BLOB')) THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(-40740, 'preParsed',
>                                                       V_CONTENT_COLUMN_TYPE);
>       END IF;
>       IF (V_MEDIA_TYPE_COLUMN_NAME IS NOT NULL) THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(-40741, 'preParsed');
>       END IF;
>     ELSIF ((V_PRE_PARSED IS NOT NULL) AND (V_PRE_PARSED <> 'false')) THEN
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(-40742, 'preParsed');
>     END IF;
> 
748a1079,1082
>     ELSIF (UPPER(V_KEY_ASSIGNMENT_METHOD) = 'EXTRACT') THEN
>       V_KEY_ASSIGNMENT_METHOD := 'EXTRACT';
>     ELSIF (UPPER(V_KEY_ASSIGNMENT_METHOD) = 'INSERT') THEN
>       V_KEY_ASSIGNMENT_METHOD := 'INSERT';
804a1139,1158
> 
>     IF ((V_PARTITION_COLUMN_LEN IS NOT NULL) AND
>         (V_PARTITION_COLUMN_LEN < 0)) THEN
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(-40743);
>     END IF;
>     IF (V_PARTITION_COLUMN_TYPE = 'VARCHAR2') THEN
>       IF (NVL(V_PARTITION_COLUMN_LEN, 0) <= 0) THEN
>         V_PARTITION_COLUMN_LEN := DEFAULT_KEY_LENGTH;
>       ELSIF (V_PARTITION_COLUMN_LEN > MAX_KEY_LENGTH) THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(-40744,
>           TO_CHAR(V_PARTITION_COLUMN_LEN),
>           TO_CHAR(MAX_KEY_LENGTH));
>       END IF;
>     ELSIF ((V_PARTITION_COLUMN_LEN IS NOT NULL) AND
>            (V_PARTITION_COLUMN_LEN > 0)) THEN
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(-40745);
>     ELSE
>       V_PARTITION_COLUMN_LEN := 0;
>     END IF;
> 
898a1253,1257
>     IF ((V_KEY_PATH IS NULL) AND
>         (V_KEY_ASSIGNMENT_METHOD IN ('EXTRACT','INSERT'))) THEN
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(-40746, V_KEY_ASSIGNMENT_METHOD);
>     END IF;
>     
928a1288,1293
>     IF (V_KEY_PATH IS NOT NULL) THEN
>       V_KEY_PATH := TRANSLATE_JSON_PATH(V_KEY_PATH);
>     END IF;
>     IF (V_PARTITION_PATH IS NOT NULL) THEN
>       V_PARTITION_PATH := TRANSLATE_JSON_PATH(V_PARTITION_PATH);
>     END IF;
943a1309,1313
>                          V_KEY_PATH,
>                          V_PARTITION_COLUMN_NAME,
>                          V_PARTITION_COLUMN_TYPE,
>                          V_PARTITION_COLUMN_LEN,
>                          V_PARTITION_PATH,
958a1329
>                          V_PRE_PARSED,
966a1338,1339
>     V_QUOT_PARTITION_NAME :=
>       DBMS_ASSERT.ENQUOTE_NAME(V_PARTITION_COLUMN_NAME, FALSE);
1121a1495,1505
>         IF (V_PARTITION_COLUMN_NAME IS NOT NULL) THEN
>           V_SQLTEXT := V_SQLTEXT||V_QUOT_PARTITION_NAME||
>                              ' '||V_PARTITION_COLUMN_TYPE;
>           IF (V_PARTITION_COLUMN_TYPE = 'RAW') THEN
>             V_SQLTEXT := V_SQLTEXT||'(16)';
>           ELSIF (V_PARTITION_COLUMN_LEN > 0) THEN
>             V_SQLTEXT := V_SQLTEXT||'('||TO_CHAR(V_PARTITION_COLUMN_LEN)||')';
>           END IF;
>           V_SQLTEXT := V_SQLTEXT||' not null, ';
>         END IF;
>         
1146a1531,1533
>         IF (V_PRE_PARSED = 'true') THEN
>           V_SQLTEXT := V_SQLTEXT||' format oson';
>         END IF;
1364,1365c1751,1752
<       IF (V_TABLE_NAME IS NOT NULL) THEN
<         SYS.DBMS_SODA_UTIL.CHECKTABLEEXISTS(V_SCHEMA, V_TABLE_NAME, V_EXISTS);
---
>       IF (V_OBJECT_TYPE = 'TABLE') THEN
>         SYS.DBMS_SODA_UTIL.CHECKTABLEEXISTS(V_SCHEMA, V_OBJECT_NAME, V_EXISTS);
1370c1757
<         SYS.DBMS_SODA_UTIL.CHECKCOLUMNS(V_SCHEMA, V_TABLE_NAME, V_NUM_COLUMNS,
---
>         SYS.DBMS_SODA_UTIL.CHECKCOLUMNS(V_SCHEMA, V_OBJECT_NAME, V_NUM_COLUMNS,
1377,1378c1764,1765
<       ELSIF (V_VIEW_NAME IS NOT NULL) THEN
<         SYS.DBMS_SODA_UTIL.CHECKVIEWEXISTS(V_SCHEMA, V_VIEW_NAME, V_EXISTS);
---
>       ELSIF (V_OBJECT_TYPE = 'VIEW') THEN
>         SYS.DBMS_SODA_UTIL.CHECKVIEWEXISTS(V_SCHEMA, V_OBJECT_NAME, V_EXISTS);
1383c1770
<         SYS.DBMS_SODA_UTIL.CHECKCOLUMNS(V_SCHEMA, V_VIEW_NAME, V_NUM_COLUMNS,
---
>         SYS.DBMS_SODA_UTIL.CHECKCOLUMNS(V_SCHEMA, V_OBJECT_NAME, V_NUM_COLUMNS,
1657a2045,2711
> 
> 
> 
>   PROCEDURE GET_METADATA_INFO(P_URI_NAME                 IN OUT NVARCHAR2,
>                               P_DESCRIPTOR               IN   VARCHAR2,
>                               P_SCHEMA_NAME              OUT  VARCHAR2,
>                               P_OBJECT_NAME              OUT  VARCHAR2,
>                               P_CONTENT_COLUMN_NAME      OUT  VARCHAR2,
>                               P_HAS_MEDIA_TYPE           OUT  BOOLEAN)
>   IS
>     V_MEDIA_TYPE_COLUMN_NAME VARCHAR2(128);
>   BEGIN
>     IF (P_DESCRIPTOR IS NOT NULL) THEN
>       BEGIN
>         SELECT JT.TABLE_NAME,
>                JT.SCHEMA_NAME,
>                JT.CONTENT_COLUMN_NAME,
>                JT.MEDIA_TYPE_COLUMN_NAME
>           INTO P_OBJECT_NAME,
>                P_SCHEMA_NAME,
>                P_CONTENT_COLUMN_NAME,
>                V_MEDIA_TYPE_COLUMN_NAME
>           FROM JSON_TABLE(P_DESCRIPTOR, '$' NULL ON ERROR COLUMNS
>                           "TABLE_NAME" 
>                             VARCHAR2(128)  PATH '$.tableName',
>                           "SCHEMA_NAME"
>                             VARCHAR2(128)  PATH '$.schemaName',
>                           "CONTENT_COLUMN_NAME"
>                             VARCHAR2(128)  PATH '$.contentColumn.name',
>                           "MEDIA_TYPE_COLUMN_NAME"
>                             VARCHAR2(128)  PATH '$.mediaTypeColumn.name'
>              )JT;
>         P_HAS_MEDIA_TYPE := V_MEDIA_TYPE_COLUMN_NAME IS NOT NULL;
>       EXCEPTION WHEN NO_DATA_FOUND THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(-40675);
>       END;
>     ELSE
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(-40671);
>     END IF;
>   END GET_METADATA_INFO;
> 
> 
> 
> 
> 
> 
> 
>   PROCEDURE CHECK_TEXT_INDEX_COMPAT(P_DESCRIPTOR  IN  VARCHAR2)
>   IS
>     V_KEY_COLUMN_TYPE      VARCHAR2(12);
>     V_CONTENT_COLUMN_TYPE  VARCHAR2(12);
>     V_CONTENT_LOB_ENCRYPT  VARCHAR2(12);
>   BEGIN
>     IF (P_DESCRIPTOR IS NOT NULL) THEN
>       BEGIN
>         SELECT JT.KEY_COLUMN_TYPE,
>                JT.CONTENT_COLUMN_TYPE,
>                JT.CONTENT_LOB_ENCRYPT
>           INTO V_KEY_COLUMN_TYPE,
>                V_CONTENT_COLUMN_TYPE,
>                V_CONTENT_LOB_ENCRYPT
>           FROM JSON_TABLE(P_DESCRIPTOR, '$' NULL ON ERROR COLUMNS
>                       "KEY_COLUMN_TYPE"
>                                  VARCHAR2(4000) PATH '$.keyColumn.sqlType',
>                       "CONTENT_COLUMN_TYPE"
>                                  VARCHAR2(4000) PATH '$.contentColumn.sqlType',
>                       "CONTENT_LOB_ENCRYPT"
>                                  VARCHAR2(4000) PATH '$.contentColumn.encrypt'
>              )JT;
>         
>       EXCEPTION WHEN NO_DATA_FOUND THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(-40675);
>       END;
>     ELSE
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(-40671);
>     END IF;
>     IF (UPPER(V_KEY_COLUMN_TYPE) = 'NVARCHAR2')
>     THEN
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_TEXT_WRONG_KEY_TYPE);
>     ELSIF (UPPER(V_CONTENT_COLUMN_TYPE) = 'NVARCHAR2' OR
>            UPPER(V_CONTENT_COLUMN_TYPE) = 'NCLOB')
>     THEN
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_TEXT_WRONG_CTNT_TYPE);
>     ELSIF NOT (UPPER(V_CONTENT_LOB_ENCRYPT) = 'NONE')
>     THEN
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_TEXT_WRONG_ENCRYPT);
>     END IF;
>   END CHECK_TEXT_INDEX_COMPAT;
> 
> 
> 
> 
> 
>   PROCEDURE PARSE_INDEX_SPEC(P_SPEC_OBJ            IN   JSON_OBJECT_T,
>                              P_INDEX_NAME          OUT  VARCHAR2,
>                              P_IS_UNIQUE           OUT  BOOLEAN,
>                              P_IS_SCALAR_REQUIRED  OUT  BOOLEAN,
>                              P_IS_LAX              OUT  BOOLEAN,
>                              P_IS_INDEX_NULLS      OUT  BOOLEAN,
>                              P_SEARCH_ON           OUT  VARCHAR2,
>                              P_DATA_GUIDE          OUT  VARCHAR2,
>                              P_SPATIAL             OUT  VARCHAR2,
>                              P_PATHS               OUT  VCNTAB,
>                              P_DATATYPES           OUT  VCNTAB,
>                              P_MAX_LENGTHS         OUT  NUMNTAB,
>                              P_ORDERS              OUT  VCNTAB,
>                              P_NFIELDS             OUT  NUMBER)
>   IS
>     V_KEY           VARCHAR2(128);
>     V_KEYS          JSON_KEY_LIST;
>     V_VALUE         JSON_ELEMENT_T;
>     V_VALUE_TYPE    VARCHAR2(48);
>     V_FIELDS_ARR    JSON_ARRAY_T;
>     V_FIELDS_ELEM   JSON_ELEMENT_T;
>     V_FIELDS_OBJ    JSON_OBJECT_T;
>     V_FIELDS_KEYS   JSON_KEY_LIST;
>     V_FIELDS_KEY    VARCHAR2(128);
>     V_FIELDS_VALUE  JSON_ELEMENT_T;
>     V_FIELDS_TYPE   VARCHAR2(48);
>     V_ORDER         VARCHAR2(128);
>   BEGIN
>     P_NFIELDS := 0;
>     V_KEYS := P_SPEC_OBJ.GET_KEYS;
> 
>     
>     <<INDEX_PROPS_LOOP>>
>     FOR I IN 1 .. V_KEYS.COUNT
>     LOOP
>       V_KEY := V_KEYS(I);
>       V_VALUE := P_SPEC_OBJ.GET(V_KEY);
>       V_VALUE_TYPE := P_SPEC_OBJ.GET_TYPE(V_KEY);
>       
>       IF (UPPER(V_KEY) = 'NAME')
>       THEN
>         IF NOT (V_VALUE.IS_STRING)
>         THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                 'name', 'STRING');
>         END IF;
>         P_INDEX_NAME := P_SPEC_OBJ.GET_STRING(V_KEY);
>       
>       ELSIF (UPPER(V_KEY) = 'UNIQUE')
>       THEN
>         IF NOT (V_VALUE.IS_BOOLEAN)
>         THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                 'unique', 'BOOLEAN');
>         END IF;
>         P_IS_UNIQUE := P_SPEC_OBJ.GET_BOOLEAN(V_KEY);
>       
>       ELSIF (UPPER(V_KEY) = 'SCALARREQUIRED')
>       THEN
>         IF NOT (V_VALUE.IS_BOOLEAN)
>         THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                 'scalarRequired', 'BOOLEAN');
>         END IF;
>         P_IS_SCALAR_REQUIRED := P_SPEC_OBJ.GET_BOOLEAN(V_KEY);
>         IF (P_IS_SCALAR_REQUIRED AND P_IS_LAX)
>         THEN         
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_LAX_SCALAR);
>         END IF;
>       
>       ELSIF (UPPER(V_KEY) = 'LAX')
>       THEN
>         IF NOT (V_VALUE.IS_BOOLEAN)
>         THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                 'lax', 'BOOLEAN');
>         END IF;
>         P_IS_LAX := P_SPEC_OBJ.GET_BOOLEAN(V_KEY);
>         IF (P_IS_SCALAR_REQUIRED AND P_IS_LAX)
>         THEN         
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_LAX_SCALAR);
>         END IF;
>       
>       ELSIF (UPPER(V_KEY) = 'INDEXNULLS')
>       THEN
>         IF NOT (V_VALUE.IS_BOOLEAN)
>         THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                 'indexNulls', 'BOOLEAN');
>         END IF;
>         P_IS_INDEX_NULLS := P_SPEC_OBJ.GET_BOOLEAN(V_KEY);
>       
>       ELSIF (UPPER(V_KEY) = 'DATAGUIDE')
>       THEN
>         IF NOT (V_VALUE.IS_STRING)
>         THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                 'dataguide', 'STRING');
>         END IF;
>         P_DATA_GUIDE := P_SPEC_OBJ.GET_STRING(V_KEY);
>         IF NOT (UPPER(P_DATA_GUIDE) = 'ON'   OR 
>                 UPPER(P_DATA_GUIDE) = 'OFF')
>         THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_DATAGUIDE_VAL);
>         END IF;
>       
>       ELSIF (UPPER(V_KEY) = 'SEARCH_ON')
>       THEN
>         IF NOT (V_VALUE.IS_STRING)
>         THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                 'search_on', 'STRING');
>         END IF;
>         P_SEARCH_ON := P_SPEC_OBJ.GET_STRING(V_KEY);
>         IF NOT (UPPER(P_SEARCH_ON) = 'TEXT'       OR
>                 UPPER(P_SEARCH_ON) = 'TEXT_VALUE' OR
>                 UPPER(P_SEARCH_ON) = 'NONE')
>         THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_SEARCHON_VAL);
>         END IF;
>       
>       ELSIF (UPPER(V_KEY) = 'SPATIAL')
>       THEN
>         IF NOT (V_VALUE.IS_STRING)
>         THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                 'spatial', 'STRING');
>         END IF;
>         P_SPATIAL := P_SPEC_OBJ.GET_STRING(V_KEY);
>         P_SPATIAL := TRANSLATE_JSON_PATH(P_SPATIAL);
>       
>       ELSIF (UPPER(V_KEY) = 'FIELDS')
>       THEN
>         IF NOT (V_VALUE.IS_ARRAY)
>         THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                 'fields', 'ARRAY');
>         END IF;
>         V_FIELDS_ARR := P_SPEC_OBJ.GET_ARRAY(V_KEY);
>         
>         P_NFIELDS := V_FIELDS_ARR.GET_SIZE;
>         P_PATHS := VCNTAB();
>         P_DATATYPES := VCNTAB();
>         P_MAX_LENGTHS := NUMNTAB();
>         P_ORDERS := VCNTAB();
>         <<FIELDS_LOOP>>
>         FOR J IN 1..P_NFIELDS
>         LOOP
>           P_PATHS.EXTEND;
>           P_PATHS(J) := NULL;
>           P_DATATYPES.EXTEND;
>           P_DATATYPES(J) := NULL;
>           P_MAX_LENGTHS.EXTEND;
>           P_MAX_LENGTHS(J) := NULL;
>           P_ORDERS.EXTEND;
>           P_ORDERS(J) := NULL;
>           V_FIELDS_ELEM := V_FIELDS_ARR.GET(J-1);
>           IF NOT (V_FIELDS_ELEM.IS_OBJECT)
>           THEN
>             SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                   'field', 'OBJECT');
>           END IF;
>           V_FIELDS_OBJ := TREAT (V_FIELDS_ELEM AS JSON_OBJECT_T);
>           V_FIELDS_KEYS := V_FIELDS_OBJ.GET_KEYS;
>           
>           <<FIELD_ELEMS_LOOP>>
>           FOR K IN 1 .. V_FIELDS_KEYS.COUNT
>           LOOP
>             V_FIELDS_KEY := V_FIELDS_KEYS(K);
>             V_FIELDS_VALUE := V_FIELDS_OBJ.GET(V_FIELDS_KEY);
>             V_FIELDS_TYPE := V_FIELDS_OBJ.GET_TYPE(V_FIELDS_KEY);
>             
>             IF (UPPER(V_FIELDS_KEY) = 'PATH')
>             THEN
>               IF NOT (V_FIELDS_VALUE.IS_STRING)
>               THEN
>                 SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                       'path', 'STRING');
>               END IF;
>               P_PATHS(J) := V_FIELDS_OBJ.GET_STRING(V_FIELDS_KEY);
>               IF (P_PATHS(J) IS NULL) THEN
>                 P_PATHS(J) := '""';
>               ELSE
>                 P_PATHS(J) := TRANSLATE_JSON_PATH(P_PATHS(J));
>               END IF;
>             
>             ELSIF  (UPPER(V_FIELDS_KEY) = 'DATATYPE')
>             THEN
>               IF NOT (V_FIELDS_VALUE.IS_STRING)
>               THEN
>                 SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                       'dataType', 'STRING');
>               END IF;
>               P_DATATYPES(J) := V_FIELDS_OBJ.GET_STRING(V_FIELDS_KEY);
>               IF (UPPER(P_DATATYPES(J)) = 'STRING' OR
>                   UPPER(P_DATATYPES(J)) = 'VARCHAR')
>               THEN
>                 P_DATATYPES(J) := 'VARCHAR2';
>               END IF;
>             
>             ELSIF (UPPER(V_FIELDS_KEY) = 'MAXLENGTH')
>             THEN
>               IF NOT (V_FIELDS_VALUE.IS_NUMBER)
>               THEN
>                 SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                       'maxLength', 'INTEGER');
>               END IF;
>               IF NOT (REMAINDER(V_FIELDS_OBJ.GET_NUMBER(V_FIELDS_KEY), 1) = 0)
>               THEN
>                 SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                       'maxLength', 'INTEGER');
>               END IF;
>               P_MAX_LENGTHS(J) := V_FIELDS_OBJ.GET_NUMBER(V_FIELDS_KEY);
>             
>             ELSIF  (UPPER(V_FIELDS_KEY) = 'ORDER')
>             THEN
>               IF (V_FIELDS_VALUE.IS_STRING)
>               THEN
>                 V_ORDER := V_FIELDS_OBJ.GET_STRING(V_FIELDS_KEY);
>                 IF NOT (UPPER(V_ORDER) = 'ASC' OR
>                         UPPER(V_ORDER) = 'DESC')
>                 THEN
>                  SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_ORDER_VAL);
>                 END IF;
>                 P_ORDERS(J) := V_ORDER;
>               ELSIF (V_FIELDS_VALUE.IS_NUMBER)
>               THEN
>                 V_ORDER := TO_CHAR(V_FIELDS_OBJ.GET_NUMBER(V_FIELDS_KEY));
>                 IF NOT (V_ORDER = '-1' OR V_ORDER = '1')
>                 THEN
>                  SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_ORDER_VAL);
>                 END IF;
>                 P_ORDERS(J) := V_ORDER;
>               ELSE
>                 SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_PROP_TYPE,
>                                                       'order', 'STRING');
>               END IF;
>             ELSE
>               SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_UNRECOGNIZED_PROP,
>                                                     V_FIELDS_KEY);
>             END IF;
>           END LOOP FIELD_ELEMS_LOOP;
>           IF (P_PATHS(J) IS NULL)
>           THEN
>             SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_MISSING_PROP,
>                                                   'fields.path');
>           END IF;
>           IF NOT (P_DATATYPES(J) IS NULL)
>           THEN
>             IF NOT (UPPER(P_DATATYPES(J)) = 'STRING'   OR
>                     UPPER(P_DATATYPES(J)) = 'VARCHAR'  OR
>                     UPPER(P_DATATYPES(J)) = 'VARCHAR2' OR
>                     UPPER(P_DATATYPES(J)) = 'NUMBER'   OR
>                     UPPER(P_DATATYPES(J)) = 'DATE'     OR
>                     UPPER(P_DATATYPES(J)) = 'TIMESTAMP')
>             THEN
>               SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_WRONG_DATATYPE,
>                                                     P_DATATYPES(J));
>             END IF;
>           END IF;
>           IF NOT (P_MAX_LENGTHS(J) IS NULL)
>           THEN
>             IF NOT (UPPER(P_DATATYPES(J)) = 'STRING'  OR
>                     UPPER(P_DATATYPES(J)) = 'VARCHAR' OR
>                     UPPER(P_DATATYPES(J)) = 'VARCHAR2')
>             THEN
>               SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_MAXLEN_NOT_COMPAT);
>             END IF;
>           END IF;
>         END LOOP FIELDS_LOOP;
>       ELSE
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_UNRECOGNIZED_PROP,
>                                               V_KEY);
>       END IF;
>     END LOOP INDEX_PROPS_LOOP;
>     
>     IF (P_INDEX_NAME IS NULL)
>     THEN
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_MISSING_PROP, 'name');
>     END IF;
>     IF (P_NFIELDS > 0)
>     THEN
>       IF NOT (P_SPATIAL IS NULL)
>       THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_INCOMPAT_PROP,
>                                               'fields', 'spatial');
>       END IF;
>       IF NOT (P_SEARCH_ON IS NULL)
>       THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_INCOMPAT_PROP,
>                                               'fields', 'search_on');
>       END IF;
>       IF NOT (P_DATA_GUIDE IS NULL)
>       THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_INCOMPAT_PROP,
>                                               'fields', 'dataguide');
>       END IF;
>     ELSIF (P_NFIELDS = 0)
>     THEN
>       IF NOT (P_IS_UNIQUE IS NULL)
>       THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_MISSING_FIELDS,
>                                               'unique');
>       END IF;
>       IF NOT (P_IS_INDEX_NULLS IS NULL)
>       THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_MISSING_FIELDS,
>                                               'indexNulls');
>       END IF;
>       IF (P_SPATIAL IS NULL)
>       THEN
>         IF NOT (P_IS_SCALAR_REQUIRED IS NULL)
>         THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_MISSING_FIELDS_SPATIAL,
>                                                 'scalarRequired');
>         ELSIF NOT (P_IS_LAX IS NULL)
>         THEN
>           SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_MISSING_FIELDS_SPATIAL,
>                                                 'lax');
>         END IF;
>       END IF;
>     END IF;
>     IF NOT (P_SPATIAL IS NULL)
>     THEN
>       IF NOT (P_SEARCH_ON IS NULL)
>       THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_INCOMPAT_PROP,
>                                               'spatial', 'search_on');
>       END IF;
>       IF NOT (P_DATA_GUIDE IS NULL)
>       THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_INCOMPAT_PROP,
>                                               'spatial', 'dataguide');
>       END IF;
>     END IF;
>   END PARSE_INDEX_SPEC;
> 
> 
> 
> 
>   PROCEDURE CREATE_INDEX(P_URI_NAME    IN  NVARCHAR2,
>                          P_INDEX_SPEC  IN  VARCHAR2,
>                          P_VERBOSE     IN  BOOLEAN  DEFAULT FALSE)
>   IS
>   PRAGMA AUTONOMOUS_TRANSACTION;
>     V_SPEC_OBJ                  JSON_OBJECT_T;
>     V_SQLTEXT                   VARCHAR2(4000);
>     V_URI_NAME                  NVARCHAR2(255);
>     V_DESCRIPTOR                VARCHAR2(4000);
>     V_SCHEMA_NAME               VARCHAR2(128);
>     V_OBJECT_NAME               VARCHAR2(128);
>     V_CONTENT_COLUMN_NAME       VARCHAR2(128);
>     V_IS_HETEROGENEOUS_COLL     BOOLEAN;
>     V_INDEX_SPEC                VARCHAR2(4000);
>     V_INDEX_NAME                VARCHAR2(128);
>     V_IS_UNIQUE                 BOOLEAN;
>     V_IS_SCALAR_REQUIRED        BOOLEAN;
>     V_IS_LAX                    BOOLEAN;
>     V_IS_INDEX_NULLS            BOOLEAN;
>     V_QUOT_INDEX_NAME           VARCHAR2(130);
>     V_QUOT_SCHEMA_NAME          VARCHAR2(130);
>     V_QUOT_OBJECT_NAME          VARCHAR2(130);
>     V_QUOT_CONTENT_COLUMN_NAME  VARCHAR2(130);
>     V_SEARCH_ON                 VARCHAR2(100);
>     V_DATA_GUIDE                VARCHAR2(100);
>     V_SPATIAL                   VARCHAR2(100);
>     V_PATHS                     VCNTAB;
>     V_DATATYPES                 VCNTAB;
>     V_MAX_LENGTHS               NUMNTAB;
>     V_ORDERS                    VCNTAB;
>     V_NFIELDS                   NUMBER;
>     V_QUOT_PATH                 VARCHAR2(130);
>     V_NUM_CHAR_COLS             NUMBER := 0;
>     V_NUM_CHAR_COLS_LEN         NUMBER := 0;
>     V_DEFAULT_SIZE              NUMBER := 0;
>   BEGIN
> 
>     
>     
>     
>     SYS.DBMS_SODA_UTIL.CHECKCOMPAT();
> 
>     IF (P_INDEX_SPEC IS NULL)
>     THEN
>       SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_NULL_SPEC);
>     END IF;
> 
>     V_URI_NAME := P_URI_NAME;
>     V_SPEC_OBJ := JSON_OBJECT_T.PARSE(P_INDEX_SPEC);
> 
>     PARSE_INDEX_SPEC(V_SPEC_OBJ,
>                      V_INDEX_NAME,
>                      V_IS_UNIQUE,
>                      V_IS_SCALAR_REQUIRED,
>                      V_IS_LAX,
>                      V_IS_INDEX_NULLS,
>                      V_SEARCH_ON,
>                      V_DATA_GUIDE,
>                      V_SPATIAL,
>                      V_PATHS,
>                      V_DATATYPES,
>                      V_MAX_LENGTHS,
>                      V_ORDERS,
>                      V_NFIELDS);
> 
>     DESCRIBE_COLLECTION(V_URI_NAME, V_DESCRIPTOR);
> 
>     GET_METADATA_INFO(V_URI_NAME,
>                       V_DESCRIPTOR,
>                       V_SCHEMA_NAME,
>                       V_OBJECT_NAME,
>                       V_CONTENT_COLUMN_NAME,
>                       V_IS_HETEROGENEOUS_COLL);
> 
>     V_QUOT_SCHEMA_NAME := DBMS_ASSERT.ENQUOTE_NAME(V_SCHEMA_NAME, FALSE);
>     V_QUOT_OBJECT_NAME := DBMS_ASSERT.ENQUOTE_NAME(V_OBJECT_NAME, FALSE);
>     V_QUOT_CONTENT_COLUMN_NAME := DBMS_ASSERT.ENQUOTE_NAME(V_CONTENT_COLUMN_NAME
>                                                          , FALSE);
>     V_QUOT_INDEX_NAME := DBMS_ASSERT.ENQUOTE_NAME(V_INDEX_NAME, FALSE);
> 
>     V_SQLTEXT := 'create ';
> 
>     
>     IF NOT (V_SPATIAL IS NULL)
>     THEN
>       IF (V_IS_HETEROGENEOUS_COLL)
>       THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_GEO_NO_HETERO);
>       END IF;
>       V_SQLTEXT := V_SQLTEXT || 'index ' || V_QUOT_INDEX_NAME || ' ';
>       V_SQLTEXT := V_SQLTEXT || 'on ';
>       V_SQLTEXT := V_SQLTEXT || V_QUOT_SCHEMA_NAME || '.' || V_QUOT_OBJECT_NAME;
>       V_SQLTEXT := V_SQLTEXT || ' (';
>       V_SQLTEXT := V_SQLTEXT || ' json_value(';
>       V_SQLTEXT := V_SQLTEXT || V_QUOT_CONTENT_COLUMN_NAME || ', ''';
>       V_SQLTEXT := V_SQLTEXT || '$.';
>       V_SQLTEXT := V_SQLTEXT || V_SPATIAL || '''';
>       
>       V_SQLTEXT := V_SQLTEXT || ' returning SDO_GEOMETRY';
>       IF (V_IS_LAX IS NULL) OR (V_IS_LAX = FALSE)
>       THEN
>         IF V_IS_SCALAR_REQUIRED
>         THEN
>           V_SQLTEXT := V_SQLTEXT || ' error on error';
>         ELSE
>           V_SQLTEXT := V_SQLTEXT || ' error on error null on empty';
>         END IF;
>       END IF;
>       V_SQLTEXT := V_SQLTEXT || '))';
>       V_SQLTEXT := V_SQLTEXT || ' indextype is MDSYS.SPATIAL_INDEX';
>       V_SQLTEXT := V_SQLTEXT || ' parallel 8';
>     
>     ELSIF (V_NFIELDS = 0)
>     THEN
>       IF (V_IS_HETEROGENEOUS_COLL)
>       THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_TEXT_NO_HETERO);
>       END IF;
>       CHECK_TEXT_INDEX_COMPAT(V_DESCRIPTOR);
> 
>       IF (V_SEARCH_ON IS NULL)
>       THEN
>         V_SEARCH_ON := 'text_value';
>       END IF;
>       IF (V_DATA_GUIDE IS NULL)
>       THEN
>         V_DATA_GUIDE := 'on';
>       END IF;    
>       V_SQLTEXT := V_SQLTEXT || 'search index ' || V_QUOT_INDEX_NAME || ' ';
>       V_SQLTEXT := V_SQLTEXT || 'on ';
>       V_SQLTEXT := V_SQLTEXT || V_QUOT_SCHEMA_NAME || '.' || V_QUOT_OBJECT_NAME;
>       V_SQLTEXT := V_SQLTEXT || ' (' ||  V_QUOT_CONTENT_COLUMN_NAME || ') ';
>       V_SQLTEXT := V_SQLTEXT || 'for json ';
>       V_SQLTEXT := V_SQLTEXT || 'parameters(''';
>       V_SQLTEXT := V_SQLTEXT || 'sync (on commit) ';
>       V_SQLTEXT := V_SQLTEXT || 'search_on ' || LOWER(V_SEARCH_ON) || ' ';
>       V_SQLTEXT := V_SQLTEXT || 'dataguide ' || LOWER(V_DATA_GUIDE);
>       V_SQLTEXT := V_SQLTEXT || ''')';
>     
>     ELSE
>       IF (V_IS_HETEROGENEOUS_COLL)
>       THEN
>         SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_FUNC_NO_HETERO);
>       END IF;
>       IF (V_IS_UNIQUE)
>       THEN
>         V_SQLTEXT := V_SQLTEXT || 'unique ';
>       END IF;
>       V_SQLTEXT := V_SQLTEXT || 'index ' || V_QUOT_INDEX_NAME || ' ';
>       V_SQLTEXT := V_SQLTEXT || 'on ';
>       V_SQLTEXT := V_SQLTEXT || V_QUOT_SCHEMA_NAME || '.' || V_QUOT_OBJECT_NAME;
>       V_SQLTEXT := V_SQLTEXT || ' (';
>       FOR J IN 1..V_NFIELDS
>       LOOP
>         IF (J > 1)
>         THEN
>           V_SQLTEXT := V_SQLTEXT || ', ';
>         END IF;
>         V_SQLTEXT := V_SQLTEXT || 'json_value (';
>         V_SQLTEXT := V_SQLTEXT || V_QUOT_CONTENT_COLUMN_NAME || ', ''';
>         V_SQLTEXT := V_SQLTEXT || '$.';
>         V_SQLTEXT := V_SQLTEXT || V_PATHS(J) || '''';
>         IF NOT (V_DATATYPES(J) IS NULL)
>         THEN
>           V_SQLTEXT := V_SQLTEXT || ' returning ' || V_DATATYPES(J);
>           IF (UPPER(V_DATATYPES(J)) = 'VARCHAR2')
>           THEN
>             IF ((V_NUM_CHAR_COLS + 1) > MAX_INDEX_CHAR_COLS)
>             THEN
>               SYS.DBMS_SODA_UTIL.RAISE_SYSTEM_ERROR(ERR_IDX_CHAR_COLS_EXCEEDED);
>             END IF;
>             IF (V_MAX_LENGTHS(J) > 0)
>             THEN
>               V_SQLTEXT := V_SQLTEXT || '(' || V_MAX_LENGTHS(J) || ')';
>               V_NUM_CHAR_COLS_LEN := V_NUM_CHAR_COLS_LEN + V_MAX_LENGTHS(J);
>             ELSE
>               V_SQLTEXT := V_SQLTEXT || '(' || TO_CHAR(U'\FFFF') || ')';
>               V_NUM_CHAR_COLS := V_NUM_CHAR_COLS + 1;
>             END IF;
>           END IF;
>         END IF;
>         IF (V_IS_LAX IS NULL) OR (V_IS_LAX = FALSE)
>         THEN
>           IF V_IS_SCALAR_REQUIRED
>           THEN
>             V_SQLTEXT := V_SQLTEXT || ' error on error';
>           ELSE
>             V_SQLTEXT := V_SQLTEXT || ' error on error null on empty';
>           END IF;
>         END IF;
>         V_SQLTEXT := V_SQLTEXT || ') ';
>         IF NOT (V_ORDERS(J) IS NULL)
>         THEN
>           V_SQLTEXT := V_SQLTEXT || V_ORDERS(J);
>         END IF;
>       END LOOP;
>       IF (NOT(V_IS_INDEX_NULLS IS NULL) AND V_IS_INDEX_NULLS)
>       THEN
>         V_SQLTEXT := V_SQLTEXT || ',1';  
>       END IF;
>       V_SQLTEXT := V_SQLTEXT || ')';
>       IF (V_NUM_CHAR_COLS > 0)
>       THEN
>         IF (V_NUM_CHAR_COLS_LEN < 2000)
>         THEN
>           V_DEFAULT_SIZE := (2000 - V_NUM_CHAR_COLS_LEN) / V_NUM_CHAR_COLS;
>         END IF;
>         IF (V_DEFAULT_SIZE < 255)
>         THEN
>           V_DEFAULT_SIZE := 255;
>         END IF;
>       END IF;
>       V_SQLTEXT := REPLACE(V_SQLTEXT,
>                            TO_CHAR(U'\FFFF'), TO_CHAR(V_DEFAULT_SIZE));
>     END IF;
>     
>     IF (P_VERBOSE)
>     THEN
>       DBMS_OUTPUT.PUT_LINE(V_SQLTEXT);
>     END IF;
>     
>     BEGIN
>         DO_DDL(V_SQLTEXT);
>         
>     EXCEPTION
>       WHEN OTHERS
>       THEN
>         IF (P_VERBOSE) 
>         THEN
>           DBMS_OUTPUT.PUT_LINE(SQLERRM);
>         END IF;
>         RAISE;
>     END;
>   END CREATE_INDEX;
XDB.DBMS_SODA_DOM - PACKAGE BODY (RU):
10c10,14
<   PROCEDURE APPLY_SPEC(IS_PATCH IN BOOLEAN,
---
>   DO_SELECT CONSTANT NUMBER := 0;
>   DO_PATCH  CONSTANT NUMBER := 1;
>   DO_MERGE  CONSTANT NUMBER := 2;
> 
>   PROCEDURE APPLY_SPEC(SPEC_TYPE IN NUMBER,
15c19
<    IF (IS_PATCH = TRUE) THEN
---
>    IF (SPEC_TYPE = DO_PATCH) THEN
16a21,22
>    ELSIF (SPEC_TYPE = DO_MERGE) THEN
>      DOC.MERGEPATCH(SPEC);
22c28
<       IF (IS_PATCH = TRUE) THEN
---
>       IF ((SPEC_TYPE = DO_PATCH) OR (SPEC_TYPE = DO_MERGE)) THEN
36c42
<     ELSIF ((IS_PATCH <> TRUE) AND 
---
>     ELSIF ((SPEC_TYPE = DO_SELECT) AND
41d46
<        
45c50
<   END APPLY_SPEC; 
---
>   END APPLY_SPEC;
56c61
<       APPLY_SPEC(FALSE, JSELECT, DOC);
---
>       APPLY_SPEC(DO_SELECT, JSELECT, DOC);
83c88
<       APPLY_SPEC(FALSE, JSELECT, DOC);
---
>       APPLY_SPEC(DO_SELECT, JSELECT, DOC);
112c117
<       APPLY_SPEC(FALSE, JSELECT, DOC);
---
>       APPLY_SPEC(DO_SELECT, JSELECT, DOC);
136c141
<       APPLY_SPEC(FALSE, JSELECT, DOC);
---
>       APPLY_SPEC(DO_SELECT, JSELECT, DOC);
162c167
<       APPLY_SPEC(FALSE, JSELECT, DOC);
---
>       APPLY_SPEC(DO_SELECT, JSELECT, DOC);
185c190
<       APPLY_SPEC(FALSE, JSELECT, DOC);
---
>       APPLY_SPEC(DO_SELECT, JSELECT, DOC);
208c213
<       APPLY_SPEC(TRUE, JPATCH, DOC);
---
>       APPLY_SPEC(DO_PATCH, JPATCH, DOC);
231c236
<       APPLY_SPEC(TRUE, JPATCH, DOC);
---
>       APPLY_SPEC(DO_PATCH, JPATCH, DOC);
260c265
<       APPLY_SPEC(TRUE, JPATCH, DOC);
---
>       APPLY_SPEC(DO_PATCH, JPATCH, DOC);
283c288
<       APPLY_SPEC(TRUE, JPATCH, DOC);
---
>       APPLY_SPEC(DO_PATCH, JPATCH, DOC);
308c313
<       APPLY_SPEC(TRUE, JPATCH, DOC);
---
>       APPLY_SPEC(DO_PATCH, JPATCH, DOC);
330c335
<       APPLY_SPEC(TRUE, JPATCH, DOC);
---
>       APPLY_SPEC(DO_PATCH, JPATCH, DOC);
342a348,485
>   FUNCTION JSON_MERGE_PATCH(JVAL IN VARCHAR2,
>                             JPATCH IN VARCHAR2,
>                             EXCEPTIONS IN VARCHAR2 DEFAULT 'ALL')
>     RETURN VARCHAR2
>   IS
>     DOC JSON_ELEMENT_T;
>   BEGIN
>     DOC := JSON_ELEMENT_T.PARSE(JVAL);
>     BEGIN
>       APPLY_SPEC(DO_MERGE, JPATCH, DOC);
>     END;
>     RETURN(DOC.TO_STRING);
>   EXCEPTION WHEN OTHERS THEN
>     IF ((((SQLCODE = XDB.DBMS_SODA_DOM.PATCH_SPEC_JSON_INVALID)) AND
>           (EXCEPTIONS = 'INVALID_PATCH_SPEC')) OR (EXCEPTIONS = 'ALL')) THEN
>       RAISE;
>     ELSE
>       RETURN(NULL);
>     END IF;
>   END JSON_MERGE_PATCH;
>   
>   FUNCTION JSON_MERGE_PATCH_N(JVAL IN NVARCHAR2,
>                               JPATCH IN VARCHAR2,
>                               EXCEPTIONS IN VARCHAR2 DEFAULT 'ALL')
>     
>     RETURN VARCHAR2
>   IS
>     DOC JSON_ELEMENT_T;
>   BEGIN
>     DOC := JSON_ELEMENT_T.PARSE(JVAL);
>     BEGIN
>       APPLY_SPEC(DO_MERGE, JPATCH, DOC);
>     END;
>     RETURN(DOC.TO_STRING);
>   EXCEPTION WHEN OTHERS THEN
>     IF ((((SQLCODE = XDB.DBMS_SODA_DOM.PATCH_SPEC_JSON_INVALID)) AND
>           (EXCEPTIONS = 'INVALID_PATCH_SPEC')) OR (EXCEPTIONS = 'ALL')) THEN
>       RAISE;
>     ELSE
>       RETURN(NULL);
>     END IF;
>   END JSON_MERGE_PATCH_N;
>   
>   
>   
>   
>   
>   
>   FUNCTION JSON_MERGE_PATCH_R(JVAL IN RAW,
>                               JPATCH IN VARCHAR2,
>                               EXCEPTIONS IN VARCHAR2 DEFAULT 'ALL')
>     RETURN RAW
>   IS
>     DOC JSON_ELEMENT_T;
>     TMP VARCHAR2(32767);
>   BEGIN
>     
>     DOC := JSON_ELEMENT_T.PARSE(JVAL);
>     BEGIN
>       APPLY_SPEC(DO_MERGE, JPATCH, DOC);
>     END;
>     TMP := DOC.TO_STRING;
>     RETURN(UTL_RAW.CAST_TO_RAW(TMP));
>   EXCEPTION WHEN OTHERS THEN
>     IF ((((SQLCODE = XDB.DBMS_SODA_DOM.PATCH_SPEC_JSON_INVALID)) AND
>           (EXCEPTIONS = 'INVALID_PATCH_SPEC')) OR (EXCEPTIONS = 'ALL')) THEN
>       RAISE;
>     ELSE
>       RETURN(NULL);
>     END IF;
>   END JSON_MERGE_PATCH_R;
>   
>   FUNCTION JSON_MERGE_PATCH_C(JVAL IN CLOB,
>                               JPATCH IN VARCHAR2,
>                               EXCEPTIONS IN VARCHAR2 DEFAULT 'ALL')
>     RETURN CLOB
>   IS
>     DOC JSON_ELEMENT_T;
>   BEGIN
>     DOC := JSON_ELEMENT_T.PARSE(JVAL);
>     BEGIN
>       APPLY_SPEC(DO_MERGE, JPATCH, DOC);
>     END;
>     RETURN(DOC.TO_CLOB);
>   EXCEPTION WHEN OTHERS THEN
>     IF ((((SQLCODE = XDB.DBMS_SODA_DOM.PATCH_SPEC_JSON_INVALID)) AND
>           (EXCEPTIONS = 'INVALID_PATCH_SPEC')) OR (EXCEPTIONS = 'ALL')) THEN
>       RAISE;
>     ELSE
>       RETURN(NULL);
>     END IF;
>   END JSON_MERGE_PATCH_C;
>   
>   
>   
>   FUNCTION JSON_MERGE_PATCH_NC(JVAL IN NCLOB,
>                                JPATCH IN VARCHAR2,
>                                EXCEPTIONS IN VARCHAR2 DEFAULT 'ALL')
>     
>     RETURN CLOB
>   IS
>     DOC JSON_ELEMENT_T;
>   BEGIN
>     DOC := JSON_ELEMENT_T.PARSE(JVAL);
>     BEGIN
>       APPLY_SPEC(DO_MERGE, JPATCH, DOC);
>     END;
>     RETURN(DOC.TO_CLOB);
>   EXCEPTION WHEN OTHERS THEN
>     IF ((((SQLCODE = XDB.DBMS_SODA_DOM.PATCH_SPEC_JSON_INVALID)) AND
>           (EXCEPTIONS = 'INVALID_PATCH_SPEC')) OR (EXCEPTIONS = 'ALL')) THEN
>       RAISE;
>     ELSE
>       RETURN(NULL);
>     END IF;
>   END JSON_MERGE_PATCH_NC;
>   
>   FUNCTION JSON_MERGE_PATCH_B(JVAL IN BLOB,
>                               JPATCH IN VARCHAR2,
>                               EXCEPTIONS IN VARCHAR2 DEFAULT 'ALL')
>     RETURN BLOB
>   IS
>     DOC JSON_ELEMENT_T;
>   BEGIN
>     DOC := JSON_ELEMENT_T.PARSE(JVAL);
>     BEGIN
>       APPLY_SPEC(DO_MERGE, JPATCH, DOC);
>     END;
>     RETURN(DOC.TO_BLOB);
>   EXCEPTION WHEN OTHERS THEN
>     IF ((((SQLCODE = XDB.DBMS_SODA_DOM.PATCH_SPEC_JSON_INVALID)) AND
>           (EXCEPTIONS = 'INVALID_PATCH_SPEC')) OR (EXCEPTIONS = 'ALL')) THEN
>       RAISE;
>     ELSE
>       RETURN(NULL);
>     END IF;
>   END JSON_MERGE_PATCH_B;
>   
XDB.DBMS_XDB - PACKAGE BODY (RU):
873a874,875
>    NO_HTTP_PORT    EXCEPTION;
>    PRAGMA EXCEPTION_INIT(NO_HTTP_PORT, -30952);
881a884,885
>    HTTP_PORT := 0;
>    HTTP2_PORT := 0;
890a895,900
>    
>    IF (HTTP_PORT = 0 AND HTTP2_PORT = 0) THEN
>       RAISE NO_HTTP_PORT; 
>    END IF;
> 
>    
894,895c904,907
<       DBMS_XDB.SETLISTENERENDPOINT(DBMS_XDB.XDB_ENDPOINT_HTTP, 'localhost', 
<                                    HTTP_PORT, HTTPPRTCL);
---
>        IF (HTTP_PORT > 0) THEN
>           DBMS_XDB.SETLISTENERENDPOINT(DBMS_XDB.XDB_ENDPOINT_HTTP, 'localhost',
>                                        HTTP_PORT, HTTPPRTCL);
>        END IF;
897c909
<        IF (HTTP2_PORT IS NOT NULL) THEN
---
>        IF (HTTP2_PORT > 0) THEN
903,904c915,918
<        DBMS_XDB.SETLISTENERENDPOINT(DBMS_XDB.XDB_ENDPOINT_HTTP, NULL,
<                                     HTTP_PORT, HTTPPRTCL);
---
>        IF (HTTP_PORT > 0) THEN
>           DBMS_XDB.SETLISTENERENDPOINT(DBMS_XDB.XDB_ENDPOINT_HTTP, NULL,
>                                        HTTP_PORT, HTTPPRTCL);
>        END IF;
906c920
<        IF (HTTP2_PORT IS NOT NULL) THEN
---
>        IF (HTTP2_PORT > 0) THEN
XDB.DBMS_XDBZ0 - PACKAGE BODY (RU):
1051,1052c1051,1052
<   DBMS_SQL.DEFINE_COLUMN(CUR, 1, OWNER_VAR, 30);
<   DBMS_SQL.DEFINE_COLUMN(CUR, 2, TABN_VAR, 30);
---
>   DBMS_SQL.DEFINE_COLUMN(CUR, 1, OWNER_VAR, ORA_MAX_NAME_LEN);
>   DBMS_SQL.DEFINE_COLUMN(CUR, 2, TABN_VAR, ORA_MAX_NAME_LEN);
1063,1064c1063,1064
<         OWNER_VAR := '"' || OWNER_VAR || '"';
<         TABN_VAR := '"' || TABN_VAR || '"';
---
>         OWNER_VAR := SYS.DBMS_ASSERT.ENQUOTE_NAME(OWNER_VAR, FALSE);
>         TABN_VAR := SYS.DBMS_ASSERT.ENQUOTE_NAME(TABN_VAR, FALSE);
XDB.DBMS_XDB_CONFIG - PACKAGE BODY (RU):
700a701,702
>    NO_HTTP_PORT    EXCEPTION;
>    PRAGMA EXCEPTION_INIT(NO_HTTP_PORT, -30952);
708a711,713
>    HTTP_PORT := 0;
>    HTTP2_PORT := 0;
> 
713,715c718,726
<    GETLISTENERENDPOINT(DBMS_XDB_CONFIG.XDB_ENDPOINT_HTTP2, HTTP2_HOST, HTTP2_PORT,
<                        HTTP2PRTCL);
<            
---
>    GETLISTENERENDPOINT(DBMS_XDB_CONFIG.XDB_ENDPOINT_HTTP2, HTTP2_HOST,
>                        HTTP2_PORT, HTTP2PRTCL);
> 
>    
>    
>    IF (HTTP_PORT = 0 AND HTTP2_PORT = 0) THEN
>       RAISE NO_HTTP_PORT; 
>    END IF;
> 
720,721c731,734
<       DBMS_XDB_CONFIG.SETLISTENERENDPOINT(DBMS_XDB_CONFIG.XDB_ENDPOINT_HTTP,
<                                           'localhost', HTTP_PORT, HTTPPRTCL);
---
>       IF (HTTP_PORT > 0) THEN
>          DBMS_XDB_CONFIG.SETLISTENERENDPOINT(DBMS_XDB_CONFIG.XDB_ENDPOINT_HTTP,
>                                              'localhost', HTTP_PORT, HTTPPRTCL);
>       END IF;
723,724c736,737
<       IF (HTTP2_PORT IS NOT NULL) THEN
<          DBMS_XDB_CONFIG.SETLISTENERENDPOINT(DBMS_XDB_CONFIG.XDB_ENDPOINT_HTTP2, 
---
>       IF (HTTP2_PORT > 0) THEN
>          DBMS_XDB_CONFIG.SETLISTENERENDPOINT(DBMS_XDB_CONFIG.XDB_ENDPOINT_HTTP2,
730,731c743,746
<       DBMS_XDB_CONFIG.SETLISTENERENDPOINT(DBMS_XDB_CONFIG.XDB_ENDPOINT_HTTP,
<                                           NULL, HTTP_PORT, HTTPPRTCL);
---
>       IF (HTTP_PORT > 0) THEN
>          DBMS_XDB_CONFIG.SETLISTENERENDPOINT(DBMS_XDB_CONFIG.XDB_ENDPOINT_HTTP,
>                                              NULL, HTTP_PORT, HTTPPRTCL);
>       END IF;
733c748
<       IF (HTTP2_PORT IS NOT NULL) THEN
---
>       IF (HTTP2_PORT > 0) THEN
XDB.JSON$COLLECTION_METADATA_V - VIEW (RU):
14a15,19
>        JT.KEY_PATH                   KEY_PATH,
>        JT.PARTITION_COLUMN_NAME      PARTITION_COLUMN_NAME,
>        JT.PARTITION_COLUMN_TYPE      PARTITION_COLUMN_TYPE,
>        JT.PARTITION_COLUMN_LEN       PARTITION_COLUMN_LEN,
>        JT.PARTITION_PATH             PARTITION_PATH,
29c34,35
<        JT.READ_ONLY                  READ_ONLY
---
>        JT.READ_ONLY                  READ_ONLY,
>        JT.PRE_PARSED                 PRE_PARSED
43a50,54
>  "KEY_PATH"                  varchar2(255) path '$.keyColumn.path',
>  "PARTITION_COLUMN_NAME"     varchar2(128) path '$.partitionColumn.name',
>  "PARTITION_COLUMN_TYPE"     varchar2(10)  path '$.partitionColumn.sqlType',
>  "PARTITION_COLUMN_LEN"      number        path '$.partitionColumn.maxLength',
>  "PARTITION_PATH"            varchar2(255) path '$.partitionColumn.path',
58c69,70
<  "READ_ONLY"                 varchar2(10)  path '$.readOnly'
---
>  "READ_ONLY"                 varchar2(10)  path '$.readOnly',
>  "PRE_PARSED"                varchar2(10)  path '$.preParsed'

Useful Links:

 

Have you enjoyed? Please leave a comment or give a 👍!

Leave a Reply

Your email address will not be published.