QuestionQ83

VerifiedControlling User Access

The HR.EMPLOYEES table contains a row whose EMPLOYEE_ID is 109.

User ALICE has no privileges to access HR.EMPLOYEES.

User ALICE begins a session.

User HR begins a session and successfully runs these statements:

GRANT DELETE ON employees TO alice;  
  
UPDATE employees SET salary = 24000 WHERE employee_id = 109;  

In her already existing session, ALICE then runs:

DELETE FROM hr.employees WHERE employee_id = 109;  

What is the result?

Explanation

The DELETE object privilege authorizes deleting rows from the table. An uncommitted UPDATE holds a row-level lock, so another transaction that tries to update or delete that same row waits until the locking transaction commits or rolls back. Changing only SALARY does not affect the EMPLOYEE_ID = 109 predicate, so the waiting delete proceeds once HR’s transaction ends.

Learn more

Community Discussion

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