DEVFYI - Developer Resource - FYI

How does one create and drop database users?

ORACLE Interview Questions and Answers (Part 4)


(Continued from previous question...)

606. How does one create and drop database users?

Look at these examples:
CREATE USER scott
IDENTIFIED BY tiger -- Assign password
DEFAULT TABLESACE tools -- Assign space for table and index segments
TEMPORARY TABLESPACE temp; -- Assign sort space
DROP USER scott CASCADE; -- Remove user
After creating a new user, assign the required privileges:
GRANT CONNECT, RESOURCE TO scott;
GRANT DBA TO scott; -- Make user a DB Administrator
Remember to give the user some space quota on its tablespaces:
ALTER USER scott QUOTA UNLIMITED ON tools;

(Continued on next question...)

Other Interview Questions