亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

Oracle 密碼文件

系統(tǒng) 2455 0

--==============================

-- Oracle 密碼文件

--==============================

/*

一、密碼文件

??? 作用:主要進(jìn)行 DBA 權(quán)限的身份認(rèn)證

??? DBA 用戶:具有 sysdba sysoper 權(quán)限的用戶被稱為 dba 用戶。默認(rèn)情況下 sysdba 角色中存在 sys 用戶, sysoper 角色中存在 system 用戶

???

二、 Oracle 的兩種認(rèn)證方式;

??? 1. 使用與操作系統(tǒng)集成的身份驗證

??? 2. 使用 Oracle 數(shù)據(jù)庫的密碼文件進(jìn)行身份認(rèn)證

?

三、密碼文件的位置

??? Linux 下的存放位置: $ORACLE_HOME/dbs/orapw$ORACLE_SID

????????????????? 即: ORACLE_HOME/dbs/orapw<sid>

??? Windows 下的存放位置 :$ORACLE_HOME/database/PW%ORACLE_SID%.ora

?

??? 密碼文件查找的順序

??? --->orapw<sid>--->orapw--->Failure

?

??? 兩種認(rèn)證方式:類型與 SQL server 中的 windows 認(rèn)證和 SQL server 認(rèn)證

??? 決定在兩個參數(shù)中

??? 1.remote_login_passwordfile = none | exclusive |shared ? 位于 $ORACLE_HOME/dbs/spfile$ORACLE_SID.ora 參數(shù)文件中

??? ?? none : 不使用密碼文件認(rèn)證

??? ?? exclusive : 要密碼文件認(rèn)證,自己獨(dú)占使用 ( 默認(rèn)值 )

??? ?? shared :要密碼文件認(rèn)證,不同實例 dba 用戶可以共享密碼文件

??? ??

??? 2. $ORACLE_HOME/network/admin/sqlnet.ora ?

??? ?? SQLNET.AUTHENTICATION_SERVICES = none | all | ntf(windows)

??? ?? none : 表示關(guān)閉操作系統(tǒng)認(rèn)證,只能密碼認(rèn)證

??? ?? all : 用于 linux unix 平臺,關(guān)閉本機(jī)密碼文件認(rèn)證,采用操作系統(tǒng)認(rèn)證,但遠(yuǎn)程 < 異機(jī) > 可以使用密碼文件認(rèn)證

??? ?? nts : 用于 windows 平臺

??? ??

??? 不同的組合

??? ? 1 ?????????? 2

??? none ????????? none ????? sys 用戶無論是本機(jī)還是遠(yuǎn)程均不可用

??

??? 判斷當(dāng)前使用的是操作系統(tǒng)認(rèn)證還是密碼認(rèn)證

???

四、演示:

??? 1. sqlnet.ora 中追加 SQLNET.AUTHENTICATION_SERVICES = none ? */

??? [oracle@robinson ~]$ sqlplus / as sysdba /* 登陸失敗 */

?

??? SQL * Plus : Release 10.2.0.1.0 - Production on Fri Apr 9 10 : 41 : 28 2010

?

??? Copyright ( c ) 1982 , 2005 , Oracle . ? All rights reserved .

?

??? ERROR :

??? ORA - 01031 : insufficient privileges

??? Enter user - name :

??? --------------------------------------------------------------------------------

??? [oracle@robinson ~]$ sqlplus sys / redhat as sysdba /* 使用密碼文件認(rèn)證,登陸成功 */

?

??? SQL * Plus : Release 10.2.0.1.0 - Production on Fri Apr 9 10 : 42 : 35 2010

?

??? 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 >

??? --=================================================================================

???

??? 2. SQLNET . AUTHENTICATION_SERVICES 的值改為 all

?

??? [oracle@robinson admin]$ sqlplus / as sysdba /* 采用本機(jī)認(rèn)證可以登陸 */

?

??? SQL * Plus : Release 10.2.0.1.0 - Production on Fri Apr 9 10 : 46 : 55 2010

?

??? 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 >

??? --------------------------------------------------------------------------------------

??? [oracle@robinson admin]$ sqlplus sys / redhat@orcl as sysdba /* 使用密碼文件登陸認(rèn)證失敗 */

?

??? SQL * Plus : Release 10.2.0.1.0 - Production on Fri Apr 9 10 : 48 : 35 2010

?

??? Copyright ( c ) 1982 , 2005 , Oracle . ? All rights reserved .

?

??? ERROR :

??? ORA - 12641 : Authentication service failed to initialize

?

??? Enter user - name :

?

??? -- 注:此時可以使用遠(yuǎn)程登陸。 ?

?

??? -- 使用 # 符號將新增的 SQLNET.AUTHENTICATION_SERVICES 行注釋掉恢復(fù)到缺省值

?

??? /*

五、密碼文件的建立: orapwd ? */

??? [oracle@robinson ~]$ orapwd

??? Usage : orapwd file =< fname > password =< password > entries =< users > force =< y / n >

?

??? ? where

?????? file - name of password file ( mand ), ? /* 密碼文件的名字 orapw<sid>*/

?????? password - password for SYS ( mand ), ?? /*sys 用戶的密碼 */

?????? entries - maximum number of distinct DBA and ? /* 可以有多少個 sysdba,sysoper 權(quán)限用戶放到密碼文件中去,去掉重復(fù)記錄 */

????????????????????????????????????????????? ? /* 注意 entries 中存放的個數(shù)但不是實際個數(shù),這個是二進(jìn)制數(shù)據(jù) */ ??

?????? force - whether to overwrite existing file ( opt ), /*10g 新增的參數(shù),默認(rèn)值為 n ,y 表示允許覆蓋 */

??? OPERs ( opt ),

??? ? There are no spaces around the equal - to (=) character .

??? ?

??? -- 修改密碼:

??? [oracle@robinson ~]$ cd $ORACLE_HOME / dbs

??? [oracle@robinson dbs]$ ll orapworcl

??? - rw - r ----- 1 oracle oinstall 1536 Apr ? 7 15:50 orapworcl

??? [oracle@robinson dbs]$ orapwd file = orapworcl password = oracle force = y

??? [oracle@robinson dbs]$ sqlplus sys / oracle@orcl as sysdba

?

??? SQL * Plus : Release 10.2.0.1.0 - Production on Fri Apr 9 11 : 34 : 09 2010

?

??? 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 > ??

??? -- 將密碼改回原來的密碼

??? [oracle@robinson dbs]$ orapwd file = orapworcl password = redhat

?

??? OPW - 00005 : File with same name exists - please delete or rename

??? [oracle@robinson dbs]$ orapwd file = orapworcl password = redhat force = y

??? [oracle@robinson dbs]$ rm orapworcl ? /* 刪除密碼文件 */

??? [oracle@robinson dbs]$ orapwd file = orapworcl password = redhat /* 重建密碼文件 */

?

??? -- 演示將 entries 改為,然后將多個用戶設(shè)置為 sysdba sysoper

??? [oracle@robinson dbs]$ orapwd file = orapworcl password = redhat entries = 1

??? [oracle@robinson dbs]$ strings orapworcl

??? ]/[Z

??? ORACLE Remote Password file

??? INTERNAL

??? F7AC0C5E9C3C37AB

??? E100B964899CDDDF

?

??? -- 創(chuàng)建 PL/SQL 增加個新用戶

??? SQL > begin

??? ? 2 ? for i in 1..20 loop

??? ? 3 ? execute immediate 'create user u' || i|| ' identified by u' || i|| '' ;

??? ? 4 ? end loop ;

??? ? 5 ? end ;

??? ? 6 ? /

??? -- 將新用戶賦予 sysdba 角色

??? PL / SQL procedure successfully completed .

?

??? SQL > begin

??? ? 2 ? for i in 1..20 loop

??? ? 3 ? execute immediate 'grant sysdba to u' || i|| '' ;

??? ? 4 ? end loop ;

??? ? 5 ? end ;

??? ? 6 ? /

??? begin ? /* 得到和密碼文件相關(guān)的錯誤提示 */

??? *

??? ERROR at line 1 :

??? ORA - 01996 : GRANT failed : password file '' is full

??? ORA - 06512 : at line 3

?

??? -- 再次查看 orapworcl 發(fā)現(xiàn)多出了行,即當(dāng)設(shè)置為的時候多出了個用戶。原因是該密碼文件是二進(jìn)制文件,按矩陣計算可存放多少

??? [oracle@robinson dbs]$ strings orapworcl

??? ]/[Z

??? ORACLE Remote Password file

??? INTERNAL

??? F7AC0C5E9C3C37AB

??? E100B964899CDDDF

??? 3E81B724A296E296

??? 668509DF9DD36B43

??? 9CE6AF1E3F609FFC

??? 7E19965085C9ED47

?

?

??? -- 注意不要輕易刪掉密碼文件,這樣會將其他賬戶的信息也刪除

?

??? /*

六、導(dǎo)致密碼文件內(nèi)容修改的幾種方式:

??? 1. 使用 orapwd 建立,修改密碼文件,不建議使用

??? 2. 使用 alter user sys identified by <>

??? 3. 使用 grant sysdba to <> grant sysoper to <> revoke sysdba |sysoper from <>

?

七、查看密碼文件內(nèi)容 */

?

??? [oracle@robinson dbs]$ strings orapworcl

??? ]/[Z

??? ORACLE Remote Password file

??? INTERNAL

??? F7AC0C5E9C3C37AB

??? E100B964899CDDDF

?

??? -- 當(dāng) sys 密碼不記得可以使用 OS 系統(tǒng)身份認(rèn)證登陸到 sqlplus, 再使用 alter user 修改密碼

??? SQL > alter user sys identified by oracle ;

?

??? User altered

??? -- 再次查看密碼文件與上一次對比,已經(jīng)發(fā)生變化

??? SQL > ho strings orapworcl

??? ]/[Z

??? ORACLE Remote Password file

??? INTERNAL

??? AB27B53EDC5FEF41

??? 8A8F025737A9097A

?

?

??? -- 通過授予權(quán)限來修改密碼,密碼文件中多出了 scott 的信息

??? SQL > grant sysdba to scott ;

?

??? Grant succeeded .

?

??? SQL > ho strings orapworcl

??? ]/[Z

??? ORACLE Remote Password file

??? INTERNAL

??? AB27B53EDC5FEF41

??? 8A8F025737A9097A

??? SCOTT

??? F894844C34402B67

?

?

??? -- 注意此處中登陸后,顯示的賬戶信息還是 sys, 而不是 scott, 但此時的 scott 已經(jīng)具備了 sys 權(quán)限

??? [oracle@robinson dbs]$ sqlplus scott / tiger@orcl as sysdba

?

??? SQL * Plus : Release 10.2.0.1.0 - Production on Fri Apr 9 11 : 56 : 09 2010

?

??? 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 "SYS"

?

??? /*

八、 sysdba sysoper 的區(qū)別 */

??? SQL > select * from system_privilege_map where name like '%SYS%' ;

?

??? ? PRIVILEGE NAME ?????????????????????????????????????? PROPERTY

??? ---------- ---------------------------------------- ----------

?????????? - 3 ALTER SYSTEM ????????????????????????????????????? 0

?????????? - 4 AUDIT SYSTEM ????????????????????????????????????? 0

?????? ?? - 83 SYSDBA ??????????????????????????????????????????? 0

?????? ?? - 84 SYSOPER ?????????????????????????????????????????? 0

?????? ??

??? -- 下面的鏈接是兩者不同的權(quán)限說明 ? ??

??? http :// download . oracle . com / docs / cd / B19306_01 / server .102 / b14231 / dba . htm#sthref137

??? The manner in which you are authorized to use these privileges depends upon the method of authentication that you use .

?

??? When you connect with SYSDBA or SYSOPER privileges , you connect with a default schema ,

??? not with the schema that is generally associated with your username .

??? For SYSDBA this schema is SYS ; for SYSOPER the schema is PUBLIC .

??? -- 兩者的 schema 不同

??? SQL > show user

??? USER is "SYS"

??? SQL > conn / as sysoper

??? Connected .

??? SQL > show user

??? USER is "PUBLIC"

?

??? -- 查看密碼文件視圖,可以得到哪些用戶為 sysdba, 哪些用戶為 sysoper

??? SQL > select * from v$pwfile_users ;

?

??? USERNAME ?????????????????????? SYSDB SYSOP

??? ------------------------------ ----- -----

??? SYS ??????????????????????????? TRUE ? TRUE

??? SCOTT ????????????????????????? TRUE ? FALSE

??? USER1 ????????????????????????? FALSE TRUE

??? -- 下面演示了使用不同的角色來登陸

??? SQL > conn scott / tiger@orcl as sysdba

??? Connected .

??? SQL > conn scott / tiger@orcl as sysoper ? /*scott sysop 列為 false*/

??? ERROR :

??? ORA - 01031 : insufficient privileges

?

?

??? Warning : You are no longer connected to ORACLE .

??? SQL > conn user1 / user1@orcl as sysdba

??? ERROR :

??? ORA - 01031 : insufficient privileges

?

?

??? SQL > conn user1 / user1 as sysoper

??? Connected .

??? /*

九、更多 */

Oracle 數(shù)據(jù)庫實例啟動關(guān)閉過程

?

Oracle 10g SGA 的自動化管理

?

使用 OEM,SQL*Plus,iSQL*Plus 管理 Oracle 實例

?

Oracle 實例和 Oracle 數(shù)據(jù)庫 (Oracle 體系結(jié)構(gòu) )

?

SQL 基礎(chǔ) --> 常用函數(shù)

?

SQL 基礎(chǔ) --> 過濾和排序

?

SQL 基礎(chǔ) -->SELECT 查詢

?

?

Oracle 密碼文件


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 4hu四虎永久免在线视看 | 在线观看免费亚洲 | 成人毛片18女人毛片 | 一级毛片免费播放视频 | 日韩欧美在线综合网高清 | 拍拍拍精品视频在线观看 | 一本大道高清香蕉中文大在线 | 国产麻豆高清视频在线第一页 | 久久视频免费看 | 国产欧美日韩精品a在线观看高清 | 国产美女拍拍拍在线观看 | 丁香色综合 | 欧美成人伊人十综合色 | 精品牛牛影视久久精品 | 久久久久综合中文字幕 | 今天的恋爱未删减在线观看 | 国产高清天干天天视频 | 中文字幕日韩视频 | 国产爱视频 | 久久这里精品青草免费 | 成人免费动作大片黄在线 | 5g天天爽影院| 免费网站日本永久免费观看 | 亚洲成人综合视频 | 国产福利视频奶水在线 | 日日骑夜夜操 | 午夜爱爱网 | 日韩在线第二页 | 日本免费不卡一区 | 欧美精品中文字幕手机免费视频 | 色综合网站国产麻豆 | 激情综合色综合啪啪开心 | 狠狠色噜噜狠狠狠888奇米 | 欧美中文综合在线视频 | 国产在线观看不卡 | 精品在线视频观看 | 精品国产一区二区三区19 | h视频在线观看免费网站 | 亚洲精品欧美精品日韩精品 | 中国大陆一级毛片 免费 | 奇米影视第四色在线 |