How to write the SQL statement to create a user in Oracle?

In Oracle, you can create a user using the following SQL statement:

CREATE USER username IDENTIFIED BY password;

In this case, the username is the desired user name to be created, and the password is the user’s password.

Furthermore, additional attributes can be specified for users, such as table space, temporary table space, default table space, etc. Here is an example:

CREATE USER username
IDENTIFIED BY password
DEFAULT TABLESPACE users
TEMPORARY TABLESPACE temp
QUOTA UNLIMITED ON users;

In this example, the DEFAULT TABLESPACE is used to specify the default tablespace for the user, TEMPORARY TABLESPACE is used to specify the user’s temporary tablespace, and QUOTA UNLIMITED ON is used to specify the user’s quota on the tablespace.

It is important to note that creating a user typically requires appropriate privileges, such as the CREATE USER permission or the DBA role.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds