Oracle DBMS_METADATA_HACK
Version 19.3

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 The following comment is in the creation file script:
Register XML schemas for SXML docs. When XDK is created by catproc.sql, this code can go into dbms_metadata_util. For now we keep it here.
Note This package, built with unwrapped source code is undocumented and is not built during the default installation. Here's what it looks like when it is built.

SQL> @?/rdbms/admin/catxdbh.sql

SP2-0808: Package created with compilation warnings

Errors for PACKAGE DBMS_METADATA_HACK:

LINE/COL ERROR
-------- ------------------------------------------------------------------------------
    7/26 PLW-06010: keyword "NAME" used as a defined name
Type created.
SP2-0810: Package Body created with compilation warnings
    66/3 PLW-06006: uncalled procedure "GET_SCHEMA_DIR" is removed.
  152/26 PLW-06010: keyword "NAME" used as a defined name
  156/18 PLW-06009: procedure "DELETESCHEMA" OTHERS handler does not end in RAISE or RAISE_APPLICATION_ERROR
   174/3 PLW-06006: uncalled procedure "GET_XML_DIR" is removed.
AUTHID DEFINER
Dependencies
DBMS_ASSERT DBMS_XMLSCHEMA V$DATABASE
DBMS_SYSTEM DIRNAMESMH  
Documented No
First Available 10.2.0.1
Security Model Owned by SYS with no privileges granted
Source {ORACLE_HOME}/rdbms/admin/catxdbh.sql
Subprograms
 
CRE_DIR
Undocumented
Assumes directory is rdbms/xml/schema
dbms_metadata_hack.cre_dir;
exec dbms_metadata_hack.cre_dir;
 
CRE_XML_DIR
Undocumented
needed for rdbms/xml access
dbms_metadata_hack.procedure cre_xml_dir;
exec dbms_metadata_hack.procedure cre_xml_dir;
 
DELETESCHEMA
Undocumented
Assumes directory is rdbms/xml/schema
dbms_metadata_hack.deleteSchema(name IN VARCHAR2);
TBD
 
DROP_DIR
Undocumented
Assumes directory is rdbms/xml/schema
dbms_metadata_hack.drop_dir;
exec dbms_metadata_hack.drop_dir;
 
DROP_XML_DIR
Undocumented
Needed for rdbms/xml access
dbms_metadata_hack.drop_dir;
exec dbms_metadata_hack.drop_xml_dir;
 
GET_BFILE
Undocumented
Assumes directory is rdbms/xml/schema
dbms_metadata_hack.get_bfile(filename IN VARCHAR2)
RETURN BFILE;
TBD
 
GET_XML_BFILE
Returns the full BFILE based on its target file name dbms_metadata_hack.get_xml_bfile(filename IN VARCHAR2)
RETURN BFILE;
conn sys@pdbdev as sysdba

SQL> GRANT read, write ON DIRECTORY ctemp TO uwclass;

Grant succeeded.

conn uwclass/uwclass@pdbdev

SQL> CREATE TABLE uw_files (
  2  file_id NUMBER,
  3* file_name BFILE);

Table created.

SQL> INSERT INTO uw_files
2 (file_id, file_name)
3 VALUES
4 (1, BFILENAME('CTEMP', 'testfile.xml'));

1 row created.

SQL> COMMIT;

Commit complete.

conn sys@pdbdev as sysdba

SQL> SELECT dbms_metadata_hack.get_xml_bfile('testfile.xml')
  2  FROM dual;

DBMS_METADATA_HACK.GET_XML_BFILE('TESTFILE.XML')
-------------------------------------------------
bfilename('XMLDIR', 'testfile.xml')
 
GET_XML_DIRNAME
Undocumented
Assumes directory is rdbms/xml/schema
dbms_metadata_hack.get_xml_dirname RETURN VARCHAR2;
SQL> SELECT dbms_metadata_hack.get_xml_dirname
  2  FROM dual;

GET_XML_DIRNAME
----------------
XMLDIR
 
LOAD_XSD
Undocumented
Assumes directory is rdbms/xml/schema
dbms_metadata_hack.load_xsd(
filename  IN VARCHAR2,
gentypes1 IN BOOLEAN := FALSE);
TBD

Related Topics
Built-in Functions
Built-in Packages
DBMS_METADATA
DBMS_METADATA_BUILD
DBMS_METADATA_DIFF
DBMS_METADATA_DPBUILD
DBMS_METADATA_INT
DBMS_METADATA_UTIL
What's New In 18c
What's New In 19c

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