Managing Roles   «Prev  Next»

Investigating DBA_SYS_PRIVS and Tablespace Quotas - Exercise

Objective: Determine whether a user can allocate space through the UNLIMITED TABLESPACE system privilege or an explicit tablespace quota, and identify the objects consuming the space.

Exercise Scoring

This exercise is worth 15 points:

  • 5 points for checking the user's direct system privileges.
  • 5 points for checking the user's current usage and quota on the USERS tablespace.
  • 5 points for identifying the user's segments or checking the overall capacity of the tablespace.

Background and Overview

A developer reports that an operation cannot allocate additional space in the USERS tablespace. Your initial investigation shows that the tablespace is nearly full and that the schema JEFF owns several large segments there.

You expected JEFF to have a restricted quota. Determine whether JEFF currently holds the UNLIMITED TABLESPACE system privilege, has a large or unlimited quota on USERS, and which segments account for the allocated space.

Run the investigation in the pluggable database that contains JEFF. Use an administrative account authorized to query the required data dictionary views. Assume that JEFF is an ordinary, nonquoted username and is therefore stored in uppercase.

Instructions

Write SQL queries and a short explanation that address the following questions:

  1. Does DBA_SYS_PRIVS show a direct grant of UNLIMITED TABLESPACE to JEFF?
  2. What do BYTES and MAX_BYTES in DBA_TS_QUOTAS show for JEFF in USERS?
  3. Which of JEFF's segments use the most allocated space in USERS?
  4. Optionally, how full is the tablespace when its current size, autoextend limits, and available underlying storage are considered?

Explain how you would interpret a returned privilege row, a quota value of -1, and the absence of a quota row.

Submitting Your Exercise

Enter your SQL queries and explanation below. When you are finished, select Submit to compare your response with the suggested solution.