Oracle DBMS_XDBUTIL_INT
Version 21c

General Information
Library Note Morgan's Library Page Header
Which has the higher priority in your organization: Deploying a new database or securing the ones you already have? Looking for a website, and resources, dedicated solely to securing Oracle databases? Check out DBSecWorx.
Purpose Internal XDB Utilities
AUTHID CURRENT_USER
Dependencies
ALL_SEQUENCES DBMS_ASSERT IS_VPD_ENABLED
ALL_TRIGGERS DBMS_CSX_ADMIN KU$_EXP_XMLSCHEMA_VIEW
ALL_USERS DBMS_DATAPUMP KU$_JOBDESC
ALL_XML_SCHEMAS DBMS_LOB KU$_STATUS
ALL_XML_SCHEMA_ATTRIBUTES DBMS_OUTPUT KU$_XMLSCHEMA_VIEW
ALL_XML_SCHEMA_COMPLEX_TYPES DBMS_SQL KU$_TTS_TYPES_VIEW
ALL_XML_SCHEMA_ELEMENTS DBMS_STANDARD KU$_XMLSCHEMA_TYPES_VIEW
ALL_XML_SCHEMA_NAMESPACES DBMS_XDB KU$_XMLSCHEMA_VIEW
ALL_XML_SCHEMA_SIMPLE_TYPES DBMS_XDBUTIL_INT KUPW$WORKER
ALL_XML_SCHEMA_SUBSTGRP_HEAD DBMS_XDBZ PLITBLM
ALL_XML_SCHEMA_SUBSTGRP_MBRS DBMS_XDBZ0 USER_XML_SCHEMAS
CHECK_UPGRADE DBMS_XDB_ADMIN XDB$PATCHUPSCHEMA
DBA_XMLSCHEMA_LEVEL_VIEW DBMS_XDB_LIB XDB$SCHEMA
DBA_XMLSCHEMA_LEVEL_VIEW_DUP DBMS_XMLDOM XDB$STRING_LIST_T
DBA_XML_SCHEMAS DBMS_XSLPROCESSOR XMLSCHEMA_LIB
DBA_XML_SCHEMA_DEPENDENCY DUAL XMLTYPE
DBA_XML_SCHEMA_IMPORTS GETXMLSCHEMADEPENDENCYLIST XMLTYPEEXTRA
DBA_XML_SCHEMA_INCLUDES GET_TABLE_NAME XMLTYPEPI
Documented No
First Available Not known
Security Model Owned by XDB with EXECUTE granted to PUBLIC
Source {ORACLE_HOME}/rdbms/admin/prvtxdb0.plb
Subprograms
 
CLEANSGAFORUPGRADE
Undocumented dbms_xdbutil_int.cleanSGAForUpgrade;
exec dbms_xdbutil_int.cleansgaforupgrade;

PL/SQL procedure successfully completed.
 
CLEANUP_EXPIRED_NFSCLIENTS
Undocumented dbms_xdbutil_int.cleanup_expired_nfsClients;
exec dbms_xdbutil_int.cleanup_expired_nfsclients;

PL/SQL procedure successfully completed.
 
CREATEACL
Create Access Control List dbms_xdbutil_int.createACL(
acl_path IN VARCHAR2,
objid    IN RAW,
data     IN XMLTYPE)
RETURN BOOLEAN;
TBD
 
CREATECROSSCONFOLDER
Undocumented dbms_xdbutil_int.createCrossConFolder(
abspath IN VARCHAR2,
vwname  IN VARCHAR2)
RETURN BOOLEAN;
TBD
 
CREATESYSTEMVIRTUALFOLDER
Undocumented dbms_xdbutil_int.createSystemVirtualFolder(abspath IN VARCHAR2)
RETURN BOOLEAN;
-- from $ORACLE_HOME/rdbms/admin/catxdbst.sql and xdbu9202.sql

Rem Create OID virtual folder
Rem This step is repeatable.
DECLARE
 ret BOOLEAN;
BEGIN
  ret := dbms_xdbutil_int.createSystemVirtualFolder('/sys/oid');
  IF ret THEN
    dbms_xdb.setacl('/sys/oid', '/sys/acls/bootstrap_acl.xml');
  END IF;
EXCEPTION
  WHEN OTHERS THEN
    ret := FALSE;
END;
/

COMMIT;

Rem Create ASM virtual folder
Rem This step is repeatable.
DECLARE
 ret BOOLEAN;
BEGIN
  ret := dbms_xdbutil_int.createSystemVirtualFolder('/sys/asm');
  IF ret THEN
    dbms_xdb.setacl('/sys/asm', '/sys/acls/all_owner_acl.xml');
END IF;
EXCEPTION
  WHEN OTHERS THEN
    ret := FALSE;
END;
/

COMMIT;
 
FIXACL
Undocumented dbms_xdbutil_int.fixACL(oldacl IN XMLTYPE) RETURN XMLTYPE;
TBD
 
FIXACL_DOWNGRADE
Undocumented dbms_xdbutil_int.fixACL_downGrade(oldacl IN XMLTYPE) RETURN XMLTYPE;
TBD
 
FLUSHSESSION
Flush the current session from memory dbms_xdbutil_int.flushSession;
exec dbms_xdbutil_int.flushSession;
XDB FlushSession at Sun 16-May-2021 15:19:11

PL/SQL procedure successfully completed.
 
GETCOMPILEDSCHEMA
Returns the schema XML based on the schema URL dbms_xdbutil_int.getCompiledSchema(schemaURL IN VARCHAR2) RETURN XMLTYPE;
SELECT dbms_xdbutil_int.getCompiledSchema('http://xmlns.oracle.com/xdb/acl.xsd')
FROM dual;

DBMS_XDBUTIL_INT.GETCOMPILEDSCHEMA('HTTP://XMLNS.ORACLE.COM/XDB/ACL.XSD')
--------------------------------------------------------------------------
<?xml version="1.0" encoding="US-ASCII"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xdbacl="http://xmlns.oracle.com/xdb/acl.xsd" targetNamespace="http://xmlns.oracle.com/ xdb/acl.xsd" version="1.0" elementFormDefault="qualified" xdb:flags="1075863861" xdb:schemaURL="http://xmlns.oracle.com/xdb/acl.xsd" xdb:schemaOwner="XDB" xdb:numProps="46" xmlns:cs x="http://xmlns.oracle.com/2004/CSX">
  <annotation>
    <documentation>
      This XML schema describes the structure of XDB ACL documents.
...
  <element name="write-config" type="xdbacl:privilegeNameType"
    substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""
    xmlns:csx="http://xmlns.oracle.com/2004/CSX" csx:property
    ID="2037" xdb:global="true" xdb:memType="258" xdb:defaultTableSchema="XDB"/>
</schema>
 
GETCOMPILEDSCHEMABYID
Returns the schema XML based on the schema object identifier dbms_xdbutil_int.getcompiledSchemaByID(schemaOID IN RAW) RETURN XMLTYPE;
TBD
 
GETCSXSCHEMA
Returns the schema XML based on the CSX schema dbms_xdbutil_int.getCSXSchema(schemaDoc IN XMLTYPE) RETURN XMLTYPE;
TBD
 
GETNAMESPACE
Get the resolved namespace for an attribute in the list (by position) dbms_xdbutil_int.getNameSpace(
schemadoc IN XMLTYPE,
inde      IN BINARY_INTEGER)
RETURN VARCHAR2;
conn xdb/xdb

set long 1000000

SELECT XMLTYPE(s.getclobval())
FROM xdb$schema s;

SELECT dbms_xdbutil_int.getNamespace(XMLTYPE(s.getclobval()), 1)
FROM xdb$schemas;
 
GETNEWOID
Returns an object identifier dbms_xdbutil_int.getNewOID RETURN RAW;
SELECT dbms_xdbutil_int.getNewOID
FROM dual;

GETNEWOID
--------------------------------
C275128F141C4273E0531000000AFD2B
 
GET_TABLESPACE_TAB
Undocumented dbms_xdbutil_int.get_tablespace_tab(
object_owner   IN VARCHAR2,
object_name    IN VARCHAR2,
object_subname IN VARCHAR2,
object_type    IN VARCHAR2)
RETURN VARCHAR2;
TBD
IMPORTSEQUENCE
Undocumented dbms_xdbutil_int.importSequence(
schema   IN VARCHAR2,
sequence IN VARCHAR2,
value    IN NUMBER);
TBD
 
INSTANCE_CALLOUT_IMP
Undocumented dbms_xdbutil_int.instance_callout_imp(
obj_name   IN  VARCHAR2
obj_schema IN  VARCHAR2
obj_type   IN  NUMBER
prepost    IN  BINARY_INTEGER
action     OUT VARCHAR2
alt_name   OUT VARCHAR2);
TBD
 
INSTANCE_EXPORT_ACTION
Undocumented dbms_xdbutil_int.instance_export_action(
obj_name   IN  VARCHAR2
obj_schema IN  VARCHAR2
obj_type   IN  NUMBER
prepost    IN  BINARY_INTEGER
action     OUT VARCHAR2
alt_name   OUT VARCHAR2
TBD
 
ISOBJECTGENERATED
Undocumented: Presumably returns 1 for a generated object, otherwise 0 dbms_xdbutil_int.isObjectGenerated(
objname IN VARCHAR2,
schname IN VARCHAR2)
RETURN NUMBER;
SELECT dbms_xdbutil_int.isobjectgenerated('XDB', 'SYS_LOB0000042280C00022$$')
FROM dual;

DBMS_XDBUTIL_INT.ISOBJECTGENERATED('XDB','SYS_LOB0000042280C00022$$')
---------------------------------------------------------------------
                                                                    0
 
ISTABLEOUTOFLINE
Undocumented: Presumably returns 1 for an out of line table, otherwise 0 dbms_xdbutil_int.isTableOutOfLine(
tablename IN VARCHAR2,
owner     IN VARCHAR2)
RETURN NUMBER;
SELECT dbms_xdbutil_int.isTableOutOfLine('XDB$PATH_INDEX_PARAMS', 'XDB')
FROM dual;

DBMS_XDBUTIL_INT.ISTABLEOUTOFLINE('XDB$PATH_INDEX_PARAMS','XDB')
----------------------------------------------------------------
                                                               0
 
ISXMLNESTEDTABLE
Undocumented: Presumably returns 1 if a nested table, otherwise 0 dbms_xdbutil_int.isXMLNestedTable(
tablename IN VARCHAR2,
schname   IN VARCHAR2)
RETURN NUMBER;
SELECT dbms_xdbutil_int.isXMLNestedTable('XDB$SCHEMA', 'XDB')
FROM dual;

DBMS_XDBUTIL_INT.ISXMLNESTEDTABLE('XDB$SCHEMA','XDB')
-----------------------------------------------------
                                                    0
 
LOOKUPSCHEMAOID
Undocumented dbms_xdbutil_int.lookupSchemaOID(schemaoid IN RAW) RETURN VARCHAR2;
TBD
 
LOOKUPSCHEMAURL
Undocumented dbms_xdbutil_int.lookupSchemaURL(schemaurl IN VARCHAR2) RETURN RAW;
TBD
 
MIGRATEALLXMLFROM9201
Undocumented dbms_xdbutil_int.migrateAllXMLFrom9201;
exec dbms_xdbutil_int.migrateAllXMLFrom9201;
 
NUMTOHEX
Converts a number to hex dbms_xdbutil_int.numToHex(n IN NUMBER) RETURN RAW;
SELECT dbms_xdbutil_int.numToHex(42)
FROM dual;

DBMS_XDBUTIL_INT.NUMTOHEX(42)
-----------------------------
2A


SELECT dbms_xdbutil_int.numToHex(43)
FROM dual;

DBMS_XDBUTIL_INT.NUMTOHEX(43)
-----------------------------
2B


SELECT dbms_xdbutil_int.numToHex(47)
FROM dual;

DBMS_XDBUTIL_INT.NUMTOHEX(47)
-----------------------------
2F


SELECT dbms_xdbutil_int.numToHex(420128)
FROM dual;

DBMS_XDBUTIL_INT.NUMTOHEX(420128)
---------------------------------
066920
 
NUMTOHEX2
Converts a number to hex

Specifically what is different from this function, when compared to the above function, is not apparent.
dbms_xdbutil_int.numToHex2(n IN NUMBER) RETURN RAW;
SELECT dbms_xdbutil_int.numToHex(420128)
FROM dual;

DBMS_XDBUTIL_INT.NUMTOHEX(420128)
---------------------------------
066920
 
PATCHREPOSITORYRESCONFIGLIST
Undocumented dbms_xdbutil_int.patchRepositoryResConfigList;
dbms_xdbutil_int.patchRepositoryResConfigList;
BEGIN dbms_xdbutil_int.patchRepositoryResConfigList; END;
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "XDB.DBMS_XDBUTIL_INT", line 1051
ORA-06512: at line 1
 
RAWTONUM
Converts RAW to NUMBER dbms_xdbutil_int.rawToNum(prefix_code IN RAW) RETURN NUMBER;
SELECT utl_raw.cast_to_raw('ABC')
FROM dual;

UTL_RAW.CAST_TO_RAW('ABC')
--------------------------
414243


SELECT dbms_xdbutil_int.rawToNum(utl_raw.cast_to_raw('ABC'))
FROM dual;

DBMS_XDBUTIL_INT.RAWTONUM(UTL_RAW.CAST_TO_RAW('ABC'))
-----------------------------------------------------
                                              4276803

SELECT dbms_xdbutil_int.rawToNum('414243')
FROM dual;

DBMS_XDBUTIL_INT.RAWTONUM('414243')
-----------------------------------
                            4276803
 
RAWTONUM2
Converts RAW to NUMBER dbms_xdbutil_int.rawToNum2(prefix_code IN RAW) RETURN NUMBER;
SELECT dbms_xdbutil_int.rawToNum2(utl_raw.cast_to_raw('ABC'))
FROM dual;

DBMS_XDBUTIL_INT.RAWTONUM2(UTL_RAW.CAST_TO_RAW('ABC'))
------------------------------------------------------
                                               4276803
 
SETLINKPARENTS
Undocumented dbms_xdbutil_int.setLinkParents;
exec dbms_xdbutil_int.setLinkParents;
 
SETLINKPARENTSNEW
Undocumented dbms_xdbutil_int.setLinkParentsNew;
exec dbms_xdbutil_int.setLinkParentsNew;

PL/SQL procedure successfully completed.
 
SYSTEM_INFO_EXP
Undocumented dbms_xdbutil_int.system_info_exp(
prePost       IN  BINARY_INTEGER,
connectString OUT VARCHAR2,
version       IN  VARCHAR2,
new_block     OUT BINARY_INTEGER);
RETURN VARCHAR2;
TBD
 
USESETLINKPARENTSNEW
Undocumented dbms_xdbutil_int.useSetLinkParentsNew RETURN BOOLEAN;
BEGIN
  IF dbms_xdbutil_int.useSetLinkParentsNew THEN
    dbms_output.put_line('Using ParentsNew');
  ELSE
    dbms_output.put_line('Not Using ParentsNew');
  END IF;
END;
/
Not Using ParentsNew

PL/SQL procedure successfully completed.
 
XMLSCHEMADEPENDENCYLEVEL
Undocumented dbms_xdbutil_int.xmlSchemaDependencyLevel(
schoid IN RAW,
owner  IN VARCHAR2)
RETURN BINARY_INTEGER;
TBD
 
XMLSCHEMAGETDEPENDENCYLIST
Undocumented dbms_xdbutil_int.XMLSchemaGetDependencyList(
schoid  IN RAW,
owner   IN VARCHAR2,
depclob IN CLOB)
RETURN BINARY_INTEGER;
TBD
 
XMLSCHEMASTRIPUSERNAME
Undocumented dbms_xdbutil_int.XMLSchemaStripUsername(
schemadoc IN XMLTYPE,
username  IN VARCHAR2)
RETURN CLOB;
conn xdb/xdb

set long 1000000
set pagesize 0
set linesize 131
col xml_out format a130
col xml_len format 999999

SELECT XMLTYPE(s.getclobval()) as xml_out
FROM xdb$schema s
WHERE rownum = 1;

SELECT MIN(rowid) FROM xdb$schema;

SELECT XMLTYPE(s.getclobval()) as xml_out
FROM xdb$schema s
WHERE rowid = 'AAANXLAACAAADecAAA';

SELECT LENGTH(XMLTYPE(s.getclobval())) as xml_len
FROM xdb$schema s
WHERE rowid = 'AAANXLAACAAADecAAA';

SELECT xdb.dbms_xdbutil_int.XMLSchemaStripUsername(XMLTYPE(s.getClobVal()), 'XDB') xml_out
FROM xdb$schema s
WHERE rowid = 'AAANXLAACAAADecAAA';

col xml_out format 999999

SELECT LENGTH(xdb.dbms_xdbutil_int.XMLSchemaStripUsername(XMLTYPE(s.getClobVal()), 'XDB')) xml_len
FROM xdb$schema s
WHERE rowid = 'AAANXLAACAAADecAAA';

Related Topics
Built-in Functions
Built-in Packages
DBMS_NETWORK_ACL_ADMIN
What's New In 19c
What's New In 20c-21c

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2019 Daniel A. Morgan All Rights Reserved
  DBSecWorx