Answers

Question and Answer:

  Home  Oracle Database

⟩ How To Assign a Tablespace to a Users in Oracle?

When you create a new user, Oracle will assign the SYSTEM tablespace to the user by default. If you want to change this, you can assign a different table space to a user using the ALTER USER command. The following tutorial exercise changes user dev's default tablespace, and assigns 4MB of space to dev:

>.insqlplus /nolog

SQL> CONNECT DEV/developer

SQL> ALTER USER dev DEFAULT TABLESPACE USERS;

User altered.

SQL> ALTER USER dev QUOTA 4M ON USERS;

User altered.

SQL> disconnect

SQL> CONNECT DEV/developer

SQL> CREATE TABLE ggl (id NUMBER);

Table created.

SQL> DROP TABLE ggl;

Table dropped.

SQL> CREATE TABLE ggl (id NUMBER);

Table created.

As you can see, "dev" can create and drop tables now. You can also let "dev" to create tables in any tablespace without any restriction by granting him the UNLIMITED TABLESPACE system privilege.

 132 views

More Questions for you: