Home > Database > SQL > body text

ORACLE user rights management

little bottle
Release: 2019-05-24 15:16:00
forward
5442 people have browsed it

Today, let’s take a look at ORACLE’s user rights management. Creating new users can only be done by Oracle's DBA administrator.

语句:Create user TestUser identified by testPass;

       其中TestUser是用户名,testPass则是密码了
Copy after login

Change the password (the DBA manager or the user can use the Alter statement)

语句:Alter user TestUser identified by newtestPass;

          只需要把Create 换成Alter,那个用户名,后面跟新的密码
Copy after login

If the user is created and cannot log in, the plsql application will report an error, and here is an important point The next step is to assign permissions

ORACLE user rights management

The above picture means: the test user does not need to grant connection permissions (Create Session keyword) and grant permissions (Grant)

语句:Grant Create Session to test;
Copy after login

Beginners only need to have the following permissions:

Permissions Meaning
Create table Give permission to create a table
Create view Give permission to create a view
Create procedure Give permission to create a procedure
Create sequence Give permission to create a sequence

There is also an object permission: (that is, the permissions you have can be assigned to the specified users to use which permissions


  1. •Different objects Have different object permissions
  2. •The owner of the object has all permissions
  3. •The owner of the object can assign permissions to outside

Allocation table oll Query, update, add, etc...Permissions

~~~~~
      语句1:Grant Select、Update on oll to test;

      语句2:Grant Select、Update on oll to test with grant option;

      语句3:Grant Select、Update on oll to public;
      
~~~~~
Copy after login

Statement 1: Only the Select and Update permissions of the oll table are given to the test user.

The keywords are~ ~(with grant option)

The difference between statement 2 and statement 1 is that the keyword with grant option is added, which means that the test user also has the permission to assign the Select and Update of the oll table to others User

Keywords are (public)

Statement 3 Keyword (public) means public. As long as the user uses the Select and Update permissions of the oll table public
That is, all users can use the data of the oll table.

If you can grant permissions to an object, you can revoke the object permissions, keyword (revoke)

If the revoke statement is used, even the permissions assigned by using the with grant option clause will be revoked
This means that the permissions equivalent to the oll table are assigned to test, and the test user has assigned permissions to other users, and The revoke statement
revokes the permissions of the test user, which is equivalent to revoking the permissions assigned to test to other people.

语句:Revoke Select、Update on oll from  test;
Copy after login

User lock and unlock and password invalidation

  命令行:ALTER test USER ACCOUNT LOCK/UNLOCK;
  
          Lock是锁上的意思UnLock是没有锁的
Copy after login

Delete user (drop)

语句:drop user test ;
Copy after login

Related course recommendations:

SQL video tutorial
MySQL video tutorial

oracle basic video tutorial

The above is the detailed content of ORACLE user rights management. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!