oracle User Rights Management

  • 2021-11-30 01:52:58
  • OfStack

1. Default users for the system

1) The sys user is a super user with the highest authority, has the role of sysdba, has the authority of create database, and the default password of this user is sys.
Login statement: SQL > conn sys/sys as sysdba;

2) The system user is an administrative operator and has great permissions. It has the role of sysoper, does not have the permissions of create and database, and the default password is manager.
Login statement: SQL > conn system/manager;

3) The biggest difference between sys and system is whether there are create database permissions.

4) The scott user is an ordinary user, and the password defaults to tiger, which is not unlocked by default
Unlock statement: SQL > alter user scott account unlock; Login statement: SQL > conn scott/tiger;

2. Manage users

1) Create user wanghao: SQL under administrator account (sys or system) > create user wanghao identified by wh516;

2) Change user password: SQL > alter user wanghao identified by whigw;

3. Granting Permissions

1) The default ordinary user scott is not unlocked by default, and the newly created user does not have any permissions, which must be granted by the administrator.


SQL> grant create session to wanghao; Grant wanghao User created session That is, login permission. 
SQL> alter user wanghao quota unlimited on USERS; Grant wanghao The user's permission to use the tablespace. 
SQL> grant create table to wanghao; Grant permission to create a table. 
SQL> grant drop any table to wanghao; Grant permission to delete any table 
SQL> grant insert any table to wanghao; Grant permission to insert rows into any table 
SQL> grant update any table to wanghao; Permissions to modify rows in any table 

2) oralce is strict in authority management, and ordinary users cannot access each other by default, so they need to authorize each other.


SQL> grant select on tableName(emp) to wanghao; Grant wanghao Permissions for the user to view the specified table 
SQL> conn wanghao/whigw;
SQL> select * from scott.emp; Users wanghao You can view users scott Table in emp;


Related articles: