Chinaunix首页 | 论坛 | 博客
  • 博客访问: 530034
  • 博文数量: 134
  • 博客积分: 7990
  • 博客等级: 少将
  • 技术积分: 1290
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-29 11:43
文章分类

全部博文(134)

文章存档

2009年(7)

2008年(80)

2007年(47)

我的朋友

分类: Oracle

2007-12-16 20:44:54

 外部认证是指直接连到操作系统,在创建用户时候可以指定用户不通过口令。在linux下实现很容易,让我们来做个实验:
 
 

[oracle@hundsun ~]$ id
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
[oracle@hundsun ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Dec 16 15:45:18 2007

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

sys@NIUGE> 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 FALSE
remote_os_roles boolean FALSE
timed_os_statistics integer 0
sys@NIUGE> alter system set os_authent_prefix='' scope=spfile;

System altered.

sys@NIUGE> alter system set remote_os_authent=true scope=spfile;

System altered.

sys@NIUGE> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@NIUGE> startup
ORACLE instance started.

Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 79694068 bytes
Database Buffers 83886080 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
sys@NIUGE> create user oracle identified externally;

User created.

sys@NIUGE> grant connect to oracle;

Grant succeeded.

sys@NIUGE> select username,password from dbauser=upper('oracle');
select username,password from dbauser=upper('oracle')
                                     *
ERROR at line 1:
ORA-00933: SQL command not properly ended


sys@NIUGE> select username ,password from dba_users where username=upper('oracle');

USERNAME PASSWORD
------------------------------ ------------------------------

ORACLE EXTERNAL

sys@NIUGE> show user;
USER is "SYS"
sys@NIUGE> connect /
Connected.
oracle@NIUGE> show user;
USER is "ORACLE"
> select sysdate from dual;

SYSDATE
---------
16-DEC-07

>

 

 

就这么简单!!

阅读(1011) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~