QuestionQ174

VerifiedManage Security

In a multitenant container database (CDB) containing pluggable databases (PDBs), the hr user runs the following commands to create a procedure and grant privileges on it:

CREATEORREPLACEPROCEDUREcreate_test_v(v_emp_idNUMBER,v_enameVARCHAR2, v_SALARYNUMBER,v_dept_idNUMBER)  
  
BEGIN -  
INSERT INTO hr.test VALUES (v_emp_id, v_ename, v salary, v_dept_id);  
END;  
/  
GRANT EXECUTE ON CREATE_TEST TO John, jim, smith, king;  

How can you stop users who have the EXECUTE privilege on the create_test_v procedure from inserting values into tables on which they have no privileges?

Explanation

An invoker’s-rights procedure executes with the privileges of the user who invokes it. Consequently, an executing user must have the necessary privilege on a target table; the procedure does not allow that user to rely on the procedure owner’s table privileges.

Community Discussion

No comments yet. Be the first to start the discussion!