最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當(dāng)前位置: 首頁 - 科技 - 知識百科 - 正文

或許你不知的ORACLE秘密系列一

來源:懂視網(wǎng) 責(zé)編:小采 時間:2020-11-09 07:44:27
文檔

或許你不知的ORACLE秘密系列一

或許你不知的ORACLE秘密系列一:LIU 9DEC0D889E8E9A6B SQL alter user amit identified by abc; User altered. SQL conn amit/abc Connected. SQL conn sys as sysdba Enter password: Connected. SQL alter user LIU identified by values'9DEC0D889E8E9A6B'; User altered. SQL conn liu/l
推薦度:
導(dǎo)讀或許你不知的ORACLE秘密系列一:LIU 9DEC0D889E8E9A6B SQL alter user amit identified by abc; User altered. SQL conn amit/abc Connected. SQL conn sys as sysdba Enter password: Connected. SQL alter user LIU identified by values'9DEC0D889E8E9A6B'; User altered. SQL conn liu/l

LIU 9DEC0D889E8E9A6B SQL alter user amit identified by abc; User altered. SQL conn amit/abc Connected. SQL conn sys as sysdba Enter password: Connected. SQL alter user LIU identified by values'9DEC0D889E8E9A6B'; User altered. SQL conn liu/l

LIU 9DEC0D889E8E9A6B

SQL> alter user amit identified by abc;

User altered.

SQL> conn amit/abc

Connected.

SQL> conn sys as sysdba

Enter password:

Connected.

SQL> alter user LIU identified by values'9DEC0D889E8E9A6B';

User altered.

SQL> conn liu/liu

Connected.

In 11g if you query password field, itwill return NULL.

SQL> select username,password fromdba_users where username='LIU';

USERNAME PASSWORD

------------------------------------------------------------

LIU

Let’s first see Case-sensitive passwordfeature in 11g and then steps to change/restore passwords

SYS@orcl>create user LIU IDENTIFIED BYLIU;

用戶已創(chuàng)建。

SYS@orcl>GRANT CONNECT TO LIU;

授權(quán)成功。

SYS@orcl>conn liu/liu

ERROR:

ORA-01017: invalid username/password;logon denied

警告:您不再連接到 ORACLE。

@>CONN LIU/LIU

已連接。

LIU@orcl>

This behavior is controlled by“sec_case_sensitive_logon”initialization paramter. If the value is true then it will enforce casesensitive passwords

LIU@orcl>conn / as sysdba

已連接。

SYS@orcl>SHO PARAMETER PFILE

NAME TYPE VALUE

----------------------------------------------- ------------------------------

spfile string \opt\DBHOME_1\DATABASE\SPFILE

ORCL.ORA

SYS@orcl>sho parameter sec_case_sensi

NAME TYPE VALUE

----------------------------------------------- ------------------------------

sec_case_sensitive_logon boolean TRUE

SYS@orcl>alter system setsec_case_sensitive_logon=false;

系統(tǒng)已更改。

SYS@orcl>conn liu/liu

已連接。

LIU@orcl>alter system setsec_case_sensitive_logon=true;

alter system setsec_case_sensitive_logon=true

*

第 1行出現(xiàn)錯誤:

ORA-01031:權(quán)限不足

LIU@orcl>conn / as sysdba

已連接。

SYS@orcl>alter system setsec_case_sensitive_logon=true;

系統(tǒng)已更改。

SYS@orcl>conn liu/LIU;

已連接。

LIU@orcl>conn liu/liu

ERROR:

ORA-01017: invalid username/password; logondenied

警告:您不再連接到 ORACLE。

Now to reset the password in 11g, we needto query spare4 column in user$ table

@>conn / as sysdba

已連接。

SYS@orcl>select spare4 from user$ wherename='LIU';

SPARE4

----------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------

S:813731A84040EA2C4DF1545B869495ECA28C81486A11E5E19344F88BA312

SYS@orcl>ALTER USER LIU IDENTIFIED BYABC;

用戶已更改。

SYS@orcl>CONN LIU/ABC

已連接。

LIU@orcl>CONN / AS SYSDBA

已連接。

SYS@orcl>ALTER USER LIU IDENTIFIEDBY VALUES'S:813731A84040EA2C4DF1545B869495ECA28C81486A11E5E19344F88BA312';

用戶已更改。

SYS@orcl>CONN LIU/ABC

ERROR:

ORA-01017: invalid username/password;logon denied

警告:您不再連接到 ORACLE。

@>CONN / AS SYSDBA

已連接。

SYS@orcl>conn LIU/LIU

已連接。

LIU@orcl>

As per Metalink Note429465.1 , view DBA_USERS has new column PASSWORD_VERSIONS rendered as follows:

decode(length(u.password),16,'10G',NULL)||NVL2(u.spare4, '11G ' ,NULL)

for example:

SYS@orcl>SELECT USERNAME,PASSWORD_VERSIONSFROM DBA_USERS WHERE USERNAME='LIU';

USERNAME PASSWORD

------------------------------ --------

LIU 11G

SYS@orcl>SELECT USERNAME,PASSWORD_VERSIONSFROM DBA_USERS WHERE USERNAME IN ('SYS','DNA','LIU');

USERNAME PASSWORD

------------------------------ --------

SYS 10G 11G

DNA 10G 11G

LIU 11G

In this case it means both old andnew-style hash values are available for the users--SYS,DNA, the new hash valueis stored in the USER$.SPARE4 column, as long as this remains NULL it means thepassword has not been changed since the migration and the user will have theold case insensitive password.

SYS@orcl>CREATE USER LIU2 IDENTIFIED BYLIU2;

用戶已創(chuàng)建。

SYS@orcl>SELECTUSERNAME,PASSWORD_VERSIONS FROM DBA_USERS WHERE USERNAME IN('SYS','DNA','LIU','LIU2');

USERNAME PASSWORD

------------------------------ --------

SYS 10G 11G

LIU 11G

LIU2 10G 11G

DNA 10G 11G

As I had reset passwordusing only spare4 string, password will be case -sensitive irrespective ofsetting for sec_case_sensitive_logon parameter value

Update

When resetting the password, we need toalso query password column from user$ column if we wish to use case-insensitivefeature in future. i.e In my above example I used only spare4 column value toreset the password. Now if I set sec_case_sensitive_logon=false , I will not beable to connect.

SYS@orcl>CONN LIU/Liu

ERROR:

ORA-01017: invalid username/password;logon denied

警告:您不再連接到 ORACLE。

@>conn LIU/LIU

已連接。

LIU@orcl>CONN / AS SYSDBA

已連接。

SYS@orcl>ALTER SYSTEM SETSEC_CASE_SENSITIVE_LOGON=FALSE;

系統(tǒng)已更改。

SYS@orcl>SHO PARAMETER SEC_CASE

NAME TYPE VALUE

----------------------------------------------- ------------------------------

sec_case_sensitive_logon boolean FALSE

SYS@orcl>CONN LIU/LIU

ERROR:

ORA-01017: invalid username/password;logon denied

警告:您不再連接到 ORACLE。

@>CONN LIU/liu

ERROR:

ORA-01017: invalid username/password;logon denied

In case we wish to useboth, we need to setidentified by values ‘S:spare4;password’. As I didnot usepassword field while resetting, I find that password field in user$ is empty.To correct it, I had to change the password again.

SYS@orcl>select password,spare4 fromuser$ where name='LIU';

PASSWORD

------------------------------

SPARE4

------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------

S:813731A84040EA2C4DF1545B869495ECA28C81486A11E5E19344F88BA312

SYS@orcl>alter system setsec_case_sensitive_logon=true;

系統(tǒng)已更改。

SYS@orcl>

SYS@orcl>alter user liu identified byabcabc;

用戶已更改。

SYS@orcl>select password,spare4 fromuser$ where name='LIU';

PASSWORD

------------------------------

SPARE4

------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------

622BF185A48AEFD1

S:FF0C2DBE8CBFCCECF290452C0389A9117101E1025B47504F9CEE356AF0EF

SYS@orcl>alter user liu identified byvalues'S:FF0C2DBE8CBFCCECF290452C0389A9117101E1025B47504F9CEE356AF0EF;622BF185A48

AEFD1';

用戶已更改。

SYS@orcl>selectusername,password_versions from dba_users where username like 'LIU%';

USERNAME PASSWORD

------------------------------ --------

LIU2 10G 11G

LIU 10G 11G

SYS@orcl>sho parameter sec_case

NAME TYPE VALUE

----------------------------------------------- ------------------------------

sec_case_sensitive_logon boolean TRUE

SYS@orcl>conn LIU/abcabc

已連接。

LIU@orcl>conn LIU/ABCABC

ERROR:

ORA-01017: invalid username/password; logondenied

警告:您不再連接到 ORACLE。

@>conn / as sysdba

已連接。

SYS@orcl>alter system setsec_case_sensitive_logon=false;

系統(tǒng)已更改。

SYS@orcl>conn liu/ABCABC

已連接。

LIU@orcl>

聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

或許你不知的ORACLE秘密系列一

或許你不知的ORACLE秘密系列一:LIU 9DEC0D889E8E9A6B SQL alter user amit identified by abc; User altered. SQL conn amit/abc Connected. SQL conn sys as sysdba Enter password: Connected. SQL alter user LIU identified by values'9DEC0D889E8E9A6B'; User altered. SQL conn liu/l
推薦度:
標(biāo)簽: 秘密 不知 系列
  • 熱門焦點(diǎn)

最新推薦

猜你喜歡

熱門推薦

專題
Top