Oracle用户验证之外部验证

转载:http://blog.itpub.net/25264937/viewspace-689344

1、概述

Oracle外部验证又称操作系统验证。用户可以在不输入用户名、密码的情况下,连接到数据库。使用外部验证时,依赖于操作系统或者网络验证服务来限制用户对数据库的访问。
启用外部验证,需要在参数文件中,设置OS_AUTHENT_PREFIX参数。OS_AUTHENT_PREFIX定义了一个前缀,默认为ops$。Oracle数据库会在每个操作系统用户名前,添加此前缀。
如:操作系统用户为user1,则Oracle数据库添加前缀后的用户名为ops$user1。
当操作系统用户user1尝试与数据库建立连接时,Oracle数据库会检查数据中是否存在一个对应的数据库用户ops$user1。如果存在,则允许建立连接。
2、实例
OS:redhat AS 4.8
DB:Oracle 10g 

SQL> show parameters os_authent
NAME TYPE VALUE
-------------------------------- ----------- -------------------
os_authent_prefix string ops$
remote_os_authent boolean FALSE
前缀为ops$,因此,在Oracle数据库中建立系统用户Oracle对应的数据库用户,并通过identified externally子句指定使用外部验证。
SQL> create user ops$oracle identified externally;
User created.
SQL> grant connect to ops$oracle;
Grant succeeded.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release  10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

当前用户为oracle。
[oracle@oraserver ~]$ id
uid=1001(oracle) gid=1002(oinstall) groups=1001(dba),1002(oinstall)

使用oracle用户登陆(外部验证)
[oracle@oraserver ~]$  sqlplus  /
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Mar 14 10:17:33 2011
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

查看当前用户
SQL>  show user;
USER is "OPS$ORACLE"
SQL>

猜你喜欢

转载自blog.csdn.net/ytfy12/article/details/54730391