环境:
OS:Windows 2003
DB:10.2.0.1
今天在O文档中看到有关OS认证用户的章节,按自己的理解做了如下验证.
1.查看OS验证用户的前缀
SQL> show parameter os_authent_prefix;
NAME TYPE VALUE
--------------------------- ----------- --------
os_authent_prefix string ops$
2.创建OS验证用户并授予相应的权限
SQL> create user ops$administrator identified externally;
User created.
SQL> grant connect, resource to ops$oracle;
Grant succeeded.
注意这里的administrator是OS的账号名,若你以其他用户登录OS的,如zhangsan,则创建的账号是ops$zhangsan.
3.将remote_os_authent参数设置为true
SQL>alter system set remote_os_authent=true scope=spfile;
SQL>shutdown immedate
SQL>startup
4.OS账号登录,这里不用输入用户名和密码
C:\Documents and Settings\Administrator>sqlplus
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Oct 18 21:56:21 2012
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> create table tb_tt(id number);
Table created.
SQL> show user;
USER is "OPS$ADMINISTRATOR"
SQL>
这里的ORACL是连接到服务器的连接串,要使OS验证用户登录的前提还必须使sqlnet.ora文件中的#SQLNET.AUTHENTICATION_SERVICES = (NTS)注释掉,或是设置成SQLNET.AUTHENTICATION_SERVICES = (none)
-- The End --
阅读(4500) | 评论(1) | 转发(0) |