oracle sysdba級用户的認證方式

經過系統化的實訓,讓這部分人羣能夠迅速掌握Oracle最新的核心技術,並能勝任企業大型數據庫管理、維護、開發工作。下面是小編整理的關於oracle sysdba級用户的認證方式,歡迎大家參考!

oracle sysdba級用户的認證方式

Oracle對於普通賬户和超級管理員(指sysdba和sysoper)的認證機制不一樣,前者是通過數據字典,後者主要是通過操作系統驗證和密碼文件驗證。因此一般提到操作系統認證或密碼文件認證,針對的都是超級管理員的認證。

操作系統認證

對於操作系統認證,其實蠻簡單的,只需要將該用户添加到dba(針對sysdba權限)或oper(針對sysoper權限)組中,就可以使用 "sqlplus / as sysdba"方式登陸

在Linux環境下,可通過以下命令添加屬組:usermod -g dba test -->>test是用户名

能否使用操作系統身份認證,取決於$ORACLE_HOME/network/admin/中ENTICATION_SERVICES的取值。

ENTICATION_SERVICES = none | all | ntf(windows)

none : 表示關閉操作系統認證,只能密碼認證。

all : 操作系統認證和密碼認證均可。

nts : 用於windows平台。

當 ENTICATION_SERVICES = none時,會報以下錯誤:

[oracle@node1 admin]$ sqlplus / as sysdba

SQL*Plus: Release Production on Fri Jan 9 23:14:18 2015

Copyright (c) 1982, 2013, Oracle. All rights reserved.

ERROR:

ORA-01017: invalid username/password; logon denied

若用密碼登陸則沒有問題

[oracle@node1 admin]$ sqlplus sys/oracle as sysdba

SQL*Plus: Release Production on Fri Jan 9 23:17:31 2015

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release - Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

SQL>

密碼文件認證

這種方式在實際環境中較為普遍,利用的是orapwd工具創建密碼文件。

在密碼文件認證中,有一個參數十分重要:remote_login_passwordfile,該參數有三個值,默認為exclusive

none----不使用密碼文件認證

exclusive---需要密碼文件認證 自己獨佔使用

shared ---需要密碼文件認證 不同實例dba用户可以共享密碼文件

密碼文件的默認位置為:$ORACLE_HOME/dbs

密碼文件的查找順序:orapw --> orapw --> Failure

所以在創建密碼文件時filename只能為orapw或者orapw

外部認證(External Authentication)

若對用户採用外部認證,則只有用户的賬號由Oracle管理,密碼和用户登錄的認證則通過外部服務來管理。外部認證常見的有操作系統認證和網絡認證。

外部認證之操作系統身份驗證

此技術使用與操作系統用户同樣的名稱創建Oracle用户,但前面加上了os_authent_prefix參數指定的.字符串,默認為ops$,下面我們來看看官檔對該參數的説明:

OS_AUTHENT_PREFIX specifies a prefix that Oracle uses to authenticate users attempting to connect to the server. Oracle concatenates the value of this parameter to the beginning of the user's operating system account name. When a connection request is attempted, Oracle compares the prefixed username with Oracle usernames in the database.