本文共 1551 字,大约阅读时间需要 5 分钟。
一:显示基本信息
SQL> show parameter os
NAME TYPE VALUE
------------------------------------ -----------
------------------------------
optimizer_index_cost_adj integer 100
os_authent_prefix string OPS$
os_roles boolean FALSE
remote_os_authent boolean TRUE
remote_os_roles boolean FALSE
timed_os_statistics integer 0
检查os_authent_prefix为ops$ (可以修改)
alter system set os_authent_prefix=xxx
scope=spfile;
二:在windows中添加一个用户名,如:用户名:oracle,密码:oracle,属于administarator组(本例开了两个远程,为了能让oracle远程连接,估加入到了administrator组)
三:以sysdata登录
SQL> host hostname
svctag-6f5483x
查询该服务器的名称
四:创建外部用户在oracle中
SQL> create user "OPS$SVCTAG-6F5483X\ORACLE" identified externally;
用户已创建。
(注:一定要大写,ops$为os_authent_prefix的值,SVCTAG-6F5483X为机器名,ORACLE为创建的用户)
五:授权
SQL> grant connect to
"OPS$SVCTAG-6F5483X\ORACLE";
授权成功。
六:用oracle用户登录服务器
C:\Documents and Settings\oracle>sqlplus /
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 11月 20 15:09:39
2013
Copyright (c) 1982, 2005, Oracle. All rights
reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 -
Production
With the Partitioning, OLAP and Data Mining options
SQL> show user;
USER 为 "OPS$SVCTAG-6F5483X\ORACLE"
-------------------到此连接成功-------------------------
在做remote_os_authent设置时,没有成功
个人从测试中发现
1.如果在服务器S上建立一个账户如A,并同时在oracle中也建立该账户(外部用户ops$s\a)
2.在客户端B,同样也建立一个账户如A,建好后,switch用户后。
3.用A账户登录,cmd后,输入sqlplus
/@192.168.1.100/orcl,连接成功.(不需要输入用户名和密码)
4.show user命令后,显示的用户是:ops$s\a
问题1,如果删除服务器上的A账户,在客户端连接将失败。提示要输入用户名和密码才能登录。
问题2,如果在服务器上创建一个ops$b\a外部用户。连接还是失败。提示要输入用户名和密码才能登录。
remote_os_authent这个为true和false好像没有多大变化。
以后再研究研究。
转载地址:http://htqll.baihongyu.com/