The dbms_metadata.get_granted_ddl Does Not Extract all System Privileges

(Doc ID 1163383.1)

Last updated on DECEMBER 07, 2016

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.3 to 11.2.0.1.0 [Release 10.2 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 07-Dec-2016***

Symptoms

During extract of the DDL of all system privileges as granted to a user not all privileges are shown. Privileges granted through specific plsql packages do not show up.

Method used to extract the privileges:

SQL>
connect / as sysdba
set long 1000000
set pagesize 9999

begin
DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'PRETTY',true);
DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SQLTERMINATOR',true);
end;
/

select DBMS_METADATA.GET_GRANTED_DDL('SYSTEM_GRANT',upper('&user')) as Privs from dual;

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms