关于ORACLE操作系统认证和ORAPWD密码文件认证SYSDBA权限

简介: 首先注意如下文档说明:    Operating system authentication takes precedence over password file authentication.

首先注意如下文档说明:
   Operating system authentication takes precedence over password file authentication. If you meet the requirements for operating system authentication, then even if you use a
password file, you will be authenticated by operating system authentication.
   On most operating systems, authentication for database administrators involves placing the operating system username of the
database administrator in a special group, generically referred to as OSDBA. Users in that group are granted SYSDBA privileges. A similar group, OSOPER, is used to
grant SYSOPERprivileges to users.
   Operating system authentication takes precedence over password file authentication. Specifically, if you are a member of the OSDBA or OSOPER group for the operating system, and you connect as SYSDBA or SYSOPER,you will be connected with associated administrative privileges regardless of the username/passwordthat you specify.If you are not in the OSDBA or OSOPER groups, and you are not in the password file, then attempting to connect as SYSDBA or as  SYSOPER fails
  其中有一个重要的文件ORAPWD文件,文档说明如果用户属于OSDBA,典型我们建立ORACLE用户的时候一般
  都会将其设置为DBA组,这个时候即使没有ORAPWD文件,实际上ORACLE用户也能够登陆到数据库,因为默认
  的OSDBA就赋予了SYSDBA权限,而如果一个用户不属于OSDBA(DBA组)的话那么可以使用我们的密码文件
  ORAPWD文件进行验证,典型比如远程认证,或者一个不属于DBA组的用户。测试如下:
  首先确定你的LISTENER有静态认证。
  Service "test" has 1 instance(s).
  Instance "ora11g", status UNKNOWN, has 1 handler(s) for this service...
  The command completed successfully
  然后关闭数据库srvctl stop database -d ora11g,或者直接SHUTDOWN IMMEDIATE。
  这个时候我们通过远程使用ORAPWD认证
  SQL>  connect sys/gelc123@ora11g as sysdba
  Connected to an idle instance.
  如果我们删除ORAOWD文件如何?
  [oracle@tasm dbs]$ mv orapwora11g orapwora11gbak
  再次连接
  SQL>  connect sys/gelc123@ora11g as sysdba
ERROR:
ORA-01031: insufficient privileges


Warning: You are no longer connected to ORACLE.

  同理我们建立一个非DBA组用户
  useradd lll
  su - lll
  连接
  [lll@tasm ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 15 09:07:44 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

ERROR:
ORA-01031: insufficient privileges


Enter user-name:
显然此用户不属于DBA组不能使用操作系统认证,如果我们尝试使用ORAPWD文件认证如何?
[lll@tasm ~]$ sqlplus sys/gelc123 as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 15 09:10:43 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

ERROR:
ORA-01031: insufficient privileges


Enter user-name:

同样不行,因为我们刚刚MV了ORAPWD文件,如果我们恢复如何?
[root@tasm ~]# su - lll
[lll@tasm ~]$ sqlplus sys/gelc123 as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 15 09:10:07 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> exit  
可见可以连接,这个用户虽然不属于DBA组但是ORAPWD是可以认证的。
最后如果建立一个DBA用户当然是可以连接的,因为他属于DBA组自然就有SYSDBA权限。
[kkk@tasm ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 15 09:13:11 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL>
所以总结一下:
1、操作系统认证通过操作系统组的方式实现。
2、如果没有属于DBA组,可以使用ORAPWD文件进行认证。
3、如果一个用户在ORAPWD文件中和DBA组,那么操作系统认证优先。
4、注意remote_login_passwordfile的设置 见http://blog.itpub.net/7728585/viewspace-1262106/。
5、任何以AS SYSDBA权限登陆的用户均为SYSDBA权限用户
6、如果用户不在DBA组和ORAPWD文件中AS SYSDBA登陆将会报错。

相关文章
|
Python
文件元数据获取方法对比:`os.path` 与 `os.stat`
本文对比了Python中两种获取文件元数据的方法:`os.path`和`os.stat`。通过示例代码展示了如何获取文件大小和修改时间,并从性能、功能性和代码可读性三方面进行了详细对比。最终给出了根据具体需求选择合适方法的最佳实践建议。
390 2
|
Oracle 安全 关系型数据库
|
存储 Java iOS开发
MacOS环境-手写操作系统-43-dir命令的实现 和 文件写入
MacOS环境-手写操作系统-43-dir命令的实现 和 文件写入
268 0
|
缓存 Linux Windows
初识Linux操作系统(根目录下的重要文件)(命令提示符的含义)
Linux系统基于"一切皆文件"的理念,重要文件分布在如/root(root用户目录)、/home(普通用户目录)、/etc(应用配置)、/dev(设备文件)、/boot(内核及启动文件)、/proc(动态系统信息)、/lib64(库文件)、/opt(软件存放)、/tmp(临时文件)。"[root@localhost ~]#"代表管理员在root目录,"$"代表普通用户。创建新用户用`useradd`命令。调节终端字体大小:Ctrl+Shift++增大,Ctrl+减号缩小。绝对路径从根目录开始,相对路径从当前目录开始。
|
Unix 关系型数据库 API
Python OS 文件/目录方法
Python OS 文件/目录方法
|
Java 开发工具 Android开发
详细解读Android开发DNK开发将.c文件打包成os
详细解读Android开发DNK开发将.c文件打包成os
285 0
|
消息中间件 Java Kafka
实时计算 Flink版操作报错合集之RocksDB在尝试打开更多文件时达到了操作系统允许的最大打开文件数限制,该怎么办
在使用实时计算Flink版过程中,可能会遇到各种错误,了解这些错误的原因及解决方法对于高效排错至关重要。针对具体问题,查看Flink的日志是关键,它们通常会提供更详细的错误信息和堆栈跟踪,有助于定位问题。此外,Flink社区文档和官方论坛也是寻求帮助的好去处。以下是一些常见的操作报错及其可能的原因与解决策略。
406 0
|
Python
Python OS 文件/目录方法
Python OS 文件/目录方法
425 0
|
安全 Linux 数据安全/隐私保护
Vanilla OS:下一代安全 Linux 发行版
【10月更文挑战第30天】
1578 0
Vanilla OS:下一代安全 Linux 发行版
|
11月前
|
Ubuntu Unix Linux
操作系统的最强入门科普(Unix/Linux篇)
下期文章,小枣君会重点聊聊Windows和macOS那条线。敬请关注! 如果大家觉得文章不错,还请帮忙多多转发!谢谢!

推荐镜像

更多