How to create a new user in Oracle

Source: Internet
Author: User
Tags oracle database

The permission system of Oracle database is divided into system permissions and object permissions. System permissions (Database system privilege) allows users to perform a specific set of commands. For example, the CREATE TABLE permission allows a user to create a table, and grant any privilege permission allows the user to grant any system permissions. Object permissions (Database object privilege) allow users to perform certain operations on individual objects. For example, delete permission allows a user to delete a row of a table or view, and the SELECT permission allows the user to query information from a table, view, sequence (sequences), or snapshot (snapshots) through a select.

Each Oracle user has a name and password and has some tables, views, and other resources created by it. An Oracle role is a set of permissions (privilege) (or the type of access each user needs depending on their status and conditions). The user can grant or give the role the specified permissions, and then assign the role to the appropriate user. A user can also authorize other users directly.

First, create users

There are two built users within Oracle: System and sys. Users can log on to the system user directly to create other users, because system has the right to create another user. When Oracle is installed, the user or system administrator can first establish a user for themselves. e.g.

SQL code

Create user User01 identified by u01;

This command can also be used to set additional permissions, as detailed in the self-study material. To change a password, you can use the ALTER USER command:

Now User01 's password has been changed from "U01" to "Usr01".

In addition to the alter USER command, users can also use the password command. If you use the password command, the new password entered by the user will not appear on the screen. A user with DBA authority can change the password of any other user through the password command, and other users can only change their password.

When the user enters the password command, the user is prompted for the old password and the new password, as follows:

Password

changing password for User01

Old Password:

New Password:

Retype new Password:

When a password is successfully modified, the user receives the following feedback:

Password changed

Second, delete users

To delete a user, you can use the drop user command as follows:

Drop user User01;

If the user owns the object, it cannot be deleted directly, or an error value is returned. Specifies the keyword cascade, which deletes all the user's objects and then deletes the user. The following examples are used to delete users and their objects:

Drop user User01 cascade;

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

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.