1. First we can log in to Oracle as SYSDBA as a Scott user.
Conn Scott/tiger as sysdba
2. Then I'll be able to create the user.
Create user Zzg identified by zzg123;
3. Create a good user we can then modify the user's password.
Alter user ZZG identified by Unis;
4. By default, the user is assigned a table space (users) by default when created.
We can use the following SQL statement to look at the tablespace where all the users are located.
Select Username,default_tablespace from dba_users;
5. Generally in the development situation, we certainly do not use the user's default table space, so we need to create a table space.
Create tablespace ts_zzg datafile ' f:\ts_zzg\zzg_data.dbf ' size 200M;
Note: The datafile is followed by the physical storage path of the tablespace, and the suffix of the file name can be arbitrarily.
6. Create a table space, and you need to assign the tablespace to the user.
Alter user ZZG default tablespace ts_zzg;
7. We can query the table space where the user is located through step 4来.
8. The user is assigned a tablespace, the user is not logged in (no login permission), so you also need to assign permissions to the user
Grant Create session,create table,create view,create sequence,unlimited tablespace to Zzg;
9. After assigning permissions to the user, we can log in with the ZZG user.
Conn Zzg/unis;
10. We can also check the user's privileges after login
SELECT * fromsession_privs;
11. Finally, we can also delete users and their related objects
Drop user ZZG cascade;
Oracle creates users, creates table spaces, authorizes, builds tables