Create Oracle User with Default Tablespace

To create a new user and assign a default table space, you can follow these steps:

  1. Log in to the Oracle database with administrator privileges.
  2. Create a new tablespace, for example:
CREATE TABLESPACE example_ts
DATAFILE '/path/to/example_ts.dbf' SIZE 100M
AUTOEXTEND ON NEXT 10M;
  1. Create a new user and set their default tablespace to the one we created above, for example:
CREATE USER new_user IDENTIFIED BY password
DEFAULT TABLESPACE example_ts
TEMPORARY TABLESPACE temp_ts;
  1. Grant appropriate permissions to new users, for example:
GRANT CONNECT, RESOURCE TO new_user;
  1. Finally, save the changes and exit the session.
COMMIT;
EXIT;

Now, the new user has been created and assigned their default tablespace.

bannerAds