After oracle is installed, three users are generated by default, which are:
SysUser: Super Administrator with the highest permissions. Its role isDBAThe password is:Change_on_install
SystemUser: it is a system administrator and has high permissions. Its role isDbaoperThe password isManager
ScottUser: common user, password isTiger
1. Create a user
Create a new user in OracleCreate userCommand, and you must have the DBA (Database Administrator) permission to use.
Example:
Create user Lida identified by m123;
Note: Lida is the username to be created. The password of the user to be created is followed by the identified by statement.
Note: The password must start with a letter and cannot start with a number.
2. Change the password for the user
1. If you change your password, you can directly usePassword UsernameThis command, for example:
Password Lida;// Change the password of Lida.
2. If you change the password for someone else, you must have the DBA (System Administrator) permission orAlert userSystem permissions
Alter user Lida identified by Lida;
3. delete a user
Generally, a user is deleted as a DBA. If another user is used to delete a user, the user must have the permission to drop the user. The command to delete the user is:
Drop User Username [cascade]
Note: If you have already created a table, you need to include the [cascade] parameter when deleting the table. when a user is deleted, the table created by the user is also deleted in cascade mode.
Iv. permission authorization
Grant connect to Lida;// Grant the database connection permission to the Lida user
Grant select on EMP to Lida;// Grant the permission to query the EMP table to Lida.
Grant all on EMP to Lida;// Grant all permissions on the EMP table to Lida
5. revoke permissions
Revoke select on EMP from lida;// Revoke Lida's permission to query the EMP table
Vi. Permission Maintenance
If you want Lida users to query the content of the EMP table, And you want lida to grant the permission to query the EMP table to other users
For object permissions, addWith grant optionSuch:
Grant select on EMP to Lida with grant option;
If it is a system permission, then:
Grant connect to Lida with Grant admin option;
Note: If the Scott User grants the Lida permission to query the EMP table and grants permissions to other users, the Scott user suddenly revokes the Lida query for the EMP table one day, other permissions granted by lida to query the EMP table are also revoked.