The difference between Oracle sys and system users, sysdba and sysopr authentication and dba role permissions

1 Conclusion

1. sys 和 system 都是 Oracle '内置用户'
   且 sys ('超级用户') 的权限远大于 system ('一般管理员')
   
2. sysdba 和 sysopr 是 'sys' 用户登录时 '用户身份验证' 的方式
   
3. dba 是 Oracle 的 '角色权限'

2 Detailed

2.1 The difference between sys and system users

结论:sys 和 system 都是 Oracle '内置用户'
     且 sys ('超级用户') 的权限远大于 system ('一般管理员')

1. 可通过下面语句进行查询验证:
   select * from dba_users t where t.username in ('SYSTEM', 'SYS');
       
2.  sys   :Oracle '超级用户',拥有最高权限。
            存储 Oracle 的数据字典的基表和视图,这些基表和视图对 Oracle 的运行是至关重要的,
            由数据库自己维护,任何用户都不能手动更改。
               
    system:Oracle '一般 dba 用户',和其它用户授予 dba 角色权限后差不多
            存储次一级的内部数据,如:Oracle 的一些特性或工具的管理信息。

3. 权限比较:sys 远大于 system
   select t.grantee, count(1)
     from dba_sys_privs t
    where t.grantee in ('SYS', 'SYSTEM')
    group by t.grantee;

The number of system permissions owned by sys and system:
Insert picture description here

2.2 The difference between sysdba and sysopr authentication

结论:sysdba 和 sysopr 是 'sys' 用户登录时 '用户身份验证' 的方式

"sys"   : 只能以 'sysdba''sysopr' 身份登录
"system": 只能以 'normal' 身份登录,或者提升为 'sysdba'

说明    : (1) 若以 'sysdba' 方式认证,登录用户为 'SYS',为 Oracle '最高权限用户'
          (2) 若以 'sysopr' 方式认证,登录用户为 'PUBLIC',仅有 'PUBLIC 对象权限'

Pl/sql login screenshots with different permissions:
Insert picture description here

Code Demo: Promote system to sys user

Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 
Connected as system@orcl

SQL> conn system/system@orcl as sysdba -- 以 sysdba 身份登录
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 
Connected as system@orcl AS SYSDBA

SQL> show user
User is "SYS"

SQL>

2.3 dba role permissions

结论:dba 是 Oracle 的 '角色权限'

1. 下面语句进行查询验证:
   select * from dba_roles t where t.role = 'DBA';
       
2. 查询拥有 dba 权限的用户
   select * from dba_role_privs t where t.granted_role = 'DBA';

Users with dba permissions:
Insert picture description here

3 expansion

Guess you like

Origin blog.csdn.net/qq_34745941/article/details/105790916