How to specify a tablespace when creating a user in Oracle?

To create a user in Oracle and specify a tablespace, you can use the following syntax:

CREATE USER username
IDENTIFIED BY password
DEFAULT TABLESPACE tablespace_name
TEMPORARY TABLESPACE temp_tablespace_name;

其中,username指的是要创建的用户的名字,password是用户的密码,tablespace_name是要指定的表空间的名称,temp_tablespace_name是要指定的临时表空间的名称。

For example, to create a user named user1 and set their default tablespace to users and temporary tablespace to temp, you can use the following statement:

CREATE USER user1
IDENTIFIED BY password123
DEFAULT TABLESPACE users
TEMPORARY TABLESPACE temp;

Please note that you need to have sufficient permissions to create users and specify table spaces before performing the above operations.

bannerAds