I have installed an Oracle 12c database on my system. I had an application which need to access the database.
Previously in Oracle 11g, I used the following commands to create an user.
create user name identified by name;
grant connect,create session,resource,create view to name;
Can anyone tell me how to create a user in Oracle 12c with my above requirements? I used the following statements but my installation is showing a fatal error saying
FATAL ERROR - java.sql.SQLException: ORA-01950: no privileges on tablespace 'USERS'
Following were the statements used.
create user c##test1 identified by test1 container = ALL;
grant connect,create session,resource,create view to test1;
Best Practice is to create a tablespace and assign that to the User.
Just to make it easier to understand use same name for username and tablespace
CREATE BIGFILE TABLESPACE C##1
DATAFILE '/path/to/datafile/C##1.dbf'
SIZE 10M AUTOEXTEND ON NEXT 5M MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO
NOLOGGING;
CREATE USER C##1
IDENTIFIED BY password
DEFAULT TABLESPACE C##1
QUOTA UNLIMITED ON C##1;
You should also give the user a quota on his default tablespace:
CREATE USER name
IDENTIFIED BY name
DEFAULT TABLESPACE users
TEMPORARY TABLESPACE temp
QUOTA 50M /* or any other number that makes sense */ ON users
GRANT CONNECT, CREATE SESSION, RESOURCE, CREATE VIEW TO name;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With