Oracle creates users, creates table spaces, authorizes, builds tables

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.