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>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章