DBMS_METADATA Package

Oracle supplied packages -DBMS_METADATA Package

Example of DBMS_METADATA Package use

DBMS_METADATA.GET_GRANTED_XML (
object_type          IN VARCHAR2,
grantee              IN VARCHAR2 DEFAULT NULL,
version              IN VARCHAR2 DEFAULT ‘COMPATIBLE’,
model                IN VARCHAR2 DEFAULT ‘ORACLE’,
transform            IN VARCHAR2 DEFAULT NULL,
object_count         IN NUMBER   DEFAULT 10000)
RETURN CLOB;

DBMS_METADATA.GET_GRANTED_DDL (
object_type          IN VARCHAR2,
grantee              IN VARCHAR2 DEFAULT NULL,
version              IN VARCHAR2 DEFAULT ‘COMPATIBLE’,
model                IN VARCHAR2 DEFAULT ‘ORACLE’,
transform            IN VARCHAR2 DEFAULT DDL,
object_count         IN NUMBER   DEFAULT 10000)
RETURN CLOB;

SELECT DBMS_METADATA.GET_GRANTED_DDL(‘SYSTEM_GRANT’,’SCOTT’)
from dual;

SELECT DBMS_METADATA.GET_GRANTED_XML(‘SYSTEM_GRANT’,’SCOTT’)
from dual;

SELECT DBMS_METADATA.GET_DDL
(
‘TABLE’,’EMP’,’SCOTT’)
FROM DUAL
/

SELECT DBMS_METADATA.GET_XML
(
‘TABLE’,’EMP’,’SCOTT’)
FROM DUAL
/

Posted in Uncategorized