|
|
|
Re: Dbms_Metadata issue [message #519033 is a reply to message #519028] |
Tue, 09 August 2011 01:32 |
|
ramoradba
Messages: 2457 Registered: January 2009 Location: AndhraPradesh,Hyderabad,I...
|
Senior Member |
|
|
SQL> SELECT
2 DBMS_METADATA.GET_DEPENDENT_DDL('OBJECT_GRANT',
3 'EMPLOYEES','HR') FROM DUAL;
DBMS_METADATA.GET_DEPENDENT_DDL('OBJECT_GRANT','EMPLOYEES','HR')
--------------------------------------------------------------------------------
GRANT SELECT ON "HR"."EMPLOYEES" TO "OE"
GRANT REFERENCES ON "HR"."EMPLOYEES" TO "OE"
SQL> sho user
USER is "SYSTEM"
SQL> grant SELECT ON HR.EMPLOYEES TO scott;
Grant succeeded.
SQL> SELECT
2 DBMS_METADATA.GET_DEPENDENT_DDL('OBJECT_GRANT',
3 'EMPLOYEES','HR') FROM DUAL;
DBMS_METADATA.GET_DEPENDENT_DDL('OBJECT_GRANT','EMPLOYEES','HR')
--------------------------------------------------------------------------------
GRANT SELECT ON "HR"."EMPLOYEES" TO "SCOTT"
GRANT SELECT ON "HR"."EMPLOYEES" TO "OE"
GRANT REFERENCES ON "HR"."EMPLOYEES" TO "OE"
SQL>
|
|
|
Re: Dbms_Metadata issue [message #519036 is a reply to message #519028] |
Tue, 09 August 2011 01:38 |
|
Michel Cadot
Messages: 68732 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
SQL> grant select , update on t to scott;
Grant succeeded.
SQL> EXEC DBMS_METADATA.SET_TRANSFORM_PARAM (DBMS_METADATA.SESSION_TRANSFORM, 'SQLTERMINATOR', TRUE);
PL/SQL procedure successfully completed.
SQL> select DBMS_METADATA.GET_DEPENDENT_DDL('OBJECT_GRANT','T','MICHEL') from dual;
DBMS_METADATA.GET_DEPENDENT_DDL('OBJECT_GRANT','T','MICHEL')
------------------------------------------------------------------------------------------------------
GRANT SELECT ON "MICHEL"."T" TO "SCOTT";
GRANT UPDATE ON "MICHEL"."T" TO "SCOTT";
1 row selected.
Regards
Michel
|
|
|
|
|
Re: Dbms_Metadata issue [message #519317 is a reply to message #519309] |
Thu, 11 August 2011 01:23 |
|
Michel Cadot
Messages: 68732 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
I do not use it, just OP asked to do it with dbms_metadata.
Say it is another to do it, it does not hurt to have several ways.
Regards
Michel
|
|
|