oracle新建一个用户命令,oracle 外部用户创建(windows xp)

一:显示基本信息

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好像没有多大变化。

以后再研究研究。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值