Create Oracle User with Default Tablespace
To create a new user and assign a default table space, you can follow these steps:
- Log in to the Oracle database with administrator privileges.
- Create a new tablespace, for example:
CREATE TABLESPACE example_ts
DATAFILE '/path/to/example_ts.dbf' SIZE 100M
AUTOEXTEND ON NEXT 10M;
- 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;
- Grant appropriate permissions to new users, for example:
GRANT CONNECT, RESOURCE TO new_user;
- Finally, save the changes and exit the session.
COMMIT;
EXIT;
Now, the new user has been created and assigned their default tablespace.