PL/SQL (MOSC)

MOSC Banner

Specific Priv to allow "Alter view ... compile> in a PL/SQL procedure

in PL/SQL (MOSC) 4 commentsAnswered

11.2.0,4 (Yes I know :-) )

What specific grant do I need?

Already has CREATE any VIEW

DROP any VIEW

CREATE any TABLE

DROP any TABLE

Procedure Code needs to be able to alter view compile IN ANOTHER SCHEMA

E.g. Simple example Below.

create or replace PROCEDURE PROC_CRM_DEPENDENCY_RECOMPILE

AS

Begin

 DBMS_OUTPUT.PUT_LINE('1');

 execute immediate('ALTER VIEW ODS_CRM.V_PAH_TEST COMPILE');

 DBMS_OUTPUT.PUT_LINE('2');

 execute immediate('ALTER VIEW ODS_CRM.V_O_CLARIFY_TABLE_ACT_VIEW COMPILE');

 DBMS_OUTPUT.PUT_LINE('3');

end;

/


SQL> exec PROC_CRM_DEPENDENCY_RECOMPILE;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

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

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center