Oracle體系結構之密碼檔案管理

2021-09-06 19:45:55 字數 1982 閱讀 7891

oracle密碼檔案主要用來控制sysdba和sysoper使用者用於遠端登入。通常,oracle使用者登入database有兩種方式,一種是通過本地作業系統驗證登入,一種是通過密碼檔案驗證登入。

作業系統驗證方式:#sqlplus / as sysdba

#sqlplus "/as sysdba"

密碼檔案驗證方式:#sqlplus user/password as sysdba

#sqlplus user/password@as sysdba

#sqlplus user/password@as sysdba

oracle密碼檔案位置通常在:$oracle_home/dbs/orapw

oracle用於登入database方式決定於2個引數:

1. 位於$oracle_home/dbs/spfile$oracle_sid.ora引數檔案中

remote_login_passwordfile = none | exclusive |shared 

none : 不使用密碼檔案認證

exclusive :要密碼檔案認證,自己獨佔使用(預設值)

shared :要密碼檔案認證,不同例項dba使用者可以共享密碼檔案

2. $oracle_home/network/admin/sqlnet.ora下新增如下引數:

sqlnet.authentication_services = none | all | ntf(windows)

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

all : 用於linux或unix平台,關閉本機密碼檔案認證,採用作業系統認證,但遠端《異機》可以使用密碼檔案認證

nts : 用於windows平台

以上兩個引數的不同組合即可組成oracle資料庫使用者登入的不同驗證方式。

密碼檔案損壞或者丟失,需要重建密碼檔案,重建密碼檔案語句如下:

sql>orapwd file=> password=entries=force=;

密碼檔案查詢的順序

--->orapw--->orapw--->failure

導致密碼檔案內容修改的幾種方式:

1.使用orapwd建立,修改密碼檔案,不建議使用

2.使用alter user sys identified by ;

3.使用grant sysdba to 或grant sysoper to 或revoke sysdba |sysoper from

檢視密碼檔案內容:

1、#strings orapworcl

2、sql>ho strings orapworcl

sysdba與sysoper的區別*/

sql> select* from system_privilege_mapwhere name like '%sys%';

privilege name                                      property

-3 alter system                                     0

-4 audit system                                     0

-83 sysdba                                            0

-84 sysoper                                           0

檢視密碼檔案檢視,可以得到哪些使用者為sysdba,哪些使用者為sysoper

sql> select* from v$pwfile_users;

username                       sysdb sysop

sys                            true  true

scott                          true  false

user1                          false true

Oracle之體系結構

oracle資料庫是資料的物理儲存。包括 資料庫檔案ora或者dbf 控制檔案 聯機日誌 引數檔案 其實oracle資料庫的概念和其他資料庫不一樣,這裡的資料庫是乙個作業系統只有乙個庫。可以看作oracle就只有乙個大資料庫。乙個oracle例項 oracle instance 有一系列的後台程序 ...

oracle密碼檔案

很多時候需要對oracle密碼檔案進行重建,oracle對密碼檔案有著較為嚴格的要求,比如檔名,檔名大小寫等等,有一次因oracle sid的大小寫折騰了很久,現記錄如下 linux平台 orapwd file oracle home dbs orapw oracle sid password en...

oracle密碼檔案

很多時候需要對oracle密碼檔案進行重建,oracle對密碼檔案有著較為嚴格的要求,比如檔名,檔名大小寫等等,有一次因oracle sid的大小寫折騰了很久,現記錄如下 linux平台 orapwd file oracle home dbs orapw oracle sid password en...