User Management - Quiz Explanation

  Explanation of answers
The answers you selected are indicated below, along with text that explains the correct answers.
1. You want to remove a user from your database and you are certain that the user owns no data. Which command should you use?
Please select the best answer.
  A. DROP USER username CASCADE
  B. DELETE username FROM DATABASE
  C. DROP USER username
  D. DELETE USER username
  The correct answer is C. The correct answer is C because you should always use DROP USER username, unless you are purposely trying to delete data at the same time. If you use the CASCADE option first, you might later discover that the user owns data and that you deleted it.

2. One of your fellow employees is taking a 3-month leave of absence. What is the best way to secure his account while he is gone?
Please select the best answer.
  A. Change his password to something only you know
  B. Lock his account
  C. Revoke his CREATE SESSION privilege
  D. Drop the user from the database
 

The correct answer is B.

If you lock the account, you only have to unlock it when he returns. The password remains the same and data are unchanged. All of the other methods would work, but they are more complicated and not as fail-safe. Dropping the user from the database would require that you create a new user when he comes back. That's a lot of work, and it would be easy to forget something. Revoking the CREATE SESSION privilege seems easy enough, but another DBA might see that as just an oversite and grant it back again. Changing the password carries with it the same potential problem. Most DBAs willingly reset passwords when asked. By locking the account, you are making your intent very explicit.

3. Which of the following commands will change Harold's password to WINDY_CITY?
Please select the best answer.
  A. ALTER USER HAROLD PASSWORD WINDY_CITY
  B. ALTER USER HAROLD IDENTIFIED BY WINDY_CITY
  C. ALTER USER HAROLD IDENTIFIED BY VALUES 'WINDY_CITY'
  D. ALTER USER HAROLD IDENTIFIED BY PASSWORD 'WINDY_CITY'
  The correct answer is B. The correct answer is B because the IDENTIFIED BY clause is used to set a user's password.

4. You want to reset a user's password, but you do not want to know it yourself. What is the best way to handle this situation?
Please select the best answer.
  A. Give the user the SYSTEM password, so he or she can reset the personal password without you looking
  B. Log the user into your terminal as SYSTEM, and walk away so he or she can change the password
  C. Change the user's password yourself, but pre-expire it so the user is forced to change it again
  D. Type in a random series of characters without looking , so that even you won't know the result
  The correct answer is C. You should use the PASSWORD EXPIRE clause of the alter user command to pre-expire the user's password. Next time the user logs in, he or she will be forced to change his password again.