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则是密码了
Change the password (the DBA manager or the user can use the Alter statement)
语句:Alter user TestUser identified by newtestPass; 只需要把Create 换成Alter,那个用户名,后面跟新的密码
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
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;
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
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; ~~~~~
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;
User lock and unlock and password invalidation
命令行:ALTER test USER ACCOUNT LOCK/UNLOCK; Lock是锁上的意思UnLock是没有锁的
Delete user (drop)
语句:drop user test ;
Related course recommendations:
SQL video tutorial
MySQL 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!