CODE
Oracle Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
PSOUG Home Code Snippets Oracle Reference Oracle Functions PSOUG Forum Oracle Blogs Bookmark and Share
 
 Search the Reference Library pages:  

Free
Oracle Magazine
Subscriptions
and Oracle White Papers

Oracle DBMS_XDBUTIL_INT

Version 11.1
 
General Information
Source {ORACLE_HOME}/rdbms/admin/prvtxdb0.plb
Dependencies
ALL_TRIGGERS DBMS_XDBZ IS_VPD_ENABLED
ALL_USERS DBMS_XDBZ0 KU$_XMLSCHEMA_VIEW
DBMS_ASSERT DBMS_XDB_LIB XDB$PATCHUPSCHEMA
DBMS_CSX_ADMIN GET_TABLE_NAME XMLTYPE
DBMS_CSX_INT    
Security Model Execute is granted to PUBLIC
 
CLEANUP_EXPIRED_NFSCLIENTS (new in 11g)
Undocumented dbms_xdbutil_int.cleanup_expired_nfsclients;
exec dbms_xdbutil_int.cleanup_expired_nfsclients;
 
CREATESYSTEMVIRTUALFOLDER

Undocumented
dbms_xdbutil_int.createsystemvirtualfolder(abspath 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 (new in 11g)
Undocumented dbms_xdbutil_int.fixacl(oldacl IN XMLTYPE) RETURN XMLTYPE;
TBD
 
FIXACL_DOWNGRADE (new in 11g)
Undocumented dbms_xdbutil_int.fixacl_downgrade(oldacl IN XMLTYPE) RETURN XMLTYPE;
TBD
 
FLUSH_SESSION (new in 11g)
Undocumented dbms_xdbutil_int.flushsession;
exec dbms_xdbutil_int.flushsession;
 
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$schema s;
 
GETNEWOID (new in 11g)
Returns an object identifier dbms_xdbutil_int.getnewoid RETURN RAW;
SELECT dbms_xdbutil_int.getnewoid
FROM dual;
 
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;
 
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;
 
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;
 
NUMTOHEX

Converts a number to hex
dbms_xdbutil_int.numtohex(n IN NUMBER) RETURN RAW
SELECT dbms_xdbutil_int.numtohex(42)
FROM dual;

SELECT dbms_xdbutil_int.numtohex(43)
FROM dual;

SELECT dbms_xdbutil_int.numtohex(47)
FROM dual;

SELECT dbms_xdbutil_int.numtohex(420128)
FROM dual;
 
NUMTOHEX2 (new in 11g)
Converts a number to hex dbms_xdbutil_int.numtohex2(n IN NUMBER) RETURN RAW
SELECT dbms_xdbutil_int.numtohex(420128)
FROM dual;
 
RAWTONUM
Converts RAW to NUMBER dbms_xdbutil_int.rawtonum(prefix_code IN RAW) RETURN NUMBER
SELECT utl_raw.cast_to_raw('ABC')
FROM dual;

SELECT dbms_xdbutil_int.rawtonum(utl_raw.cast_to_raw('ABC'))
FROM dual;
 
RAWTONUM2 (new in 11g)
Converts RAW to NUMBER dbms_xdbutil_int.rawtonum2(
SELECT dbms_xdbutil_int.rawtonum2(utl_raw.cast_to_raw('ABC'))
FROM dual;
 
SETLINKPARENTS (new in 11g)
Undocumented dbms_xdbutil_int.setlinkparents;
exec dbms_xdbutil_int.setlinkparents;
 
SETPRINTMODE (dropped from 11g)
Undocumented dbms_xdbutil_int.setprintmode(modeval BINARY_INTEGER)
public static String SET_PRINT_MODE="begin
dbms_xdbutil_int.setPrintMode(:1); end;";
 
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
DBMS_NETWORK_ACL_ADMIN
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us [211 users online]    © 2010 psoug.org