Thursday 15 March 2012

To find the DDL of schema's in Oracle Database

Command to find the DDL of Schema's:

select dbms_metadata.get_ddl( 'USER','username' ) from dual
     UNION ALL
     select dbms_metadata.get_granted_ddl('SYSTEM_GRANT','username') from dual
          UNION ALL
          select dbms_metadata.get_granted_ddl('OBJECT_GRANT','username') from dual
               UNION ALL
               select dbms_metadata.get_granted_ddl('ROLE_GRANT','username') from dual;

No comments:

Post a Comment