QuestionQ181

VerifiedControlling User Access

User HR has the CREATE SESSION, CREATE ANY TABLE, and UNLIMITED TABLESPACE privileges.

User SCOTT has the CREATE SESSION, CREATE TABLE, and UNLIMITED TABLESPACE privileges.

HR successfully runs the following statement:

Question Image

HR attempts to execute:

  1. INSERT INTO scott.products VALUES (1, 'LAPTOP');

SCOTT attempts to execute:

  1. SELECT * FROM products;
  2. INSERT INTO scott.products VALUES (2, 'HDD');
  3. CREATE SYNONYM prod FOR products;

Which statements execute successfully?

Explanation

CREATE ANY TABLE authorizes creating a table in another schema, but it does not grant permission to insert rows into that table; inserting into tables in other schemas requires an object-level INSERT privilege or the INSERT ANY TABLE system privilege. Because SCOTT.PRODUCTS is in SCOTT's schema, SCOTT owns it and can select from and insert into it. Creating the private synonym PROD requires the CREATE SYNONYM system privilege, which SCOTT does not have.

Learn more

Community Discussion

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