溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

設定Oracle用戶名密碼的規(guī)則有哪些

發(fā)布時間:2021-11-05 10:33:07 來源:億速云 閱讀:552 作者:iii 欄目:關系型數(shù)據(jù)庫

這篇文章主要講解了“設定Oracle用戶名密碼的規(guī)則有哪些”,文中的講解內(nèi)容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“設定Oracle用戶名密碼的規(guī)則有哪些”吧!

1. 查詢當前用戶使用profile以及profile規(guī)則

1.1 查詢當前用戶使用profile

$ sqlplus / as sysdba

SQL > select profile,resource_name,resource_type,limit from dba_profiles where profile=(select PROFILE from dba_users where username=upper('&user_name'));

1.2 加載自帶密碼復雜度函數(shù)

$ sqlplus / as sysdba

SQL > @?/rdbms/admin/utlpwdmg.sql

l  最小長度8

l  不能與用戶名相同或相似

l  不能是用戶名倒序。

l  不能與前密碼超過3個字符相同

l  至少包含一個“\”、“數(shù)字”以及“字符”

2. 修改當前profile或創(chuàng)建單獨profile使用密碼驗證函數(shù)

2.1 修改當前用戶使用profile

$ sqlplus / as sysdba

SQL> select 'alter profile ' || profile ||

       ' limit PASSWORD_VERIFY_FUNCTION VERIFY_FUNCTION;'

  from dba_profiles

 group by profile;

'ALTERPROFILE'||PROFILE||'LIMITPASSWORD_VERIFY_FUNCTIONVERIFY_FUNCTION;'

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

alter profile MONITORING_PROFILE limit PASSWORD_VERIFY_FUNCTION VERIFY_FUNCTION;

alter profile DEFAULT limit PASSWORD_VERIFY_FUNCTION VERIFY_FUNCTION;    # 使用需要修改profile相應語句即可

SYS@honor1 > alter profile DEFAULT limit PASSWORD_VERIFY_FUNCTION VERIFY_FUNCTION;

Profile altered.

SYS@honor1 > alter user hr identified by 111111;         # 規(guī)則已經(jīng)生效,簡單密碼已經(jīng)無法使用

alter user hr identified by 111111

*

ERROR at line 1:

ORA-28003: password verification for the specified password failed

ORA-20003: Password should contain at least one \

digit, one character and one punctuation

2.2 創(chuàng)建profile設定規(guī)則

SYS@honor1 > CREATE PROFILE new_profile LIMIT 

SESSIONS_PER_USER UNLIMITED 

CPU_PER_SESSION UNLIMITED 

CPU_PER_CALL UNLIMITED 

CONNECT_TIME UNLIMITED 

IDLE_TIME 600

LOGICAL_READS_PER_SESSION UNLIMITED 

LOGICAL_READS_PER_CALL UNLIMITED 

COMPOSITE_LIMIT UNLIMITED 

PRIVATE_SGA UNLIMITED 

FAILED_LOGIN_ATTEMPTS UNLIMITED

PASSWORD_LIFE_TIME UNLIMITED

PASSWORD_REUSE_TIME UNLIMITED 

PASSWORD_REUSE_MAX UNLIMITED 

PASSWORD_LOCK_TIME 1

PASSWORD_GRACE_TIME 10

PASSWORD_VERIFY_FUNCTION verify_function;

Profile created.

SYS@honor1 > alter user hr profile new_profile;

User altered.

SYS@honor1 > alter user hr identified by 111111;

alter user hr identified by 111111

*

ERROR at line 1:

ORA-28003: password verification for the specified password failed   # 新規(guī)則已經(jīng)生效

ORA-20003: Password should contain at least one \

digit, one character and one punctuation

3. 回退

3.1 修改profile屬性回退

SYS@honor1 > alter profile DEFAULT limit PASSWORD_VERIFY_FUNCTION null;

Profile altered.

SYS@honor1 > alter user hr identified by 111111;     # 可以看到密碼規(guī)則已經(jīng)失效

User altered.

3.2 新建profile回退

SYS@honor1 > alter user hr profile default;         #如果原來使用了自定義profile則輸入原來名稱

User altered.

SYS@honor1 > alter user hr identified by 111111;  # 可以看到密碼規(guī)則已經(jīng)失效

User altered.

4. 密碼有效期

SYS@honor1 > alter profile DEFAULT limit PASSWORD_LIFE_TIME 90;      # 修改為90天

Profile altered.

SYS@honor1 > select profile,resource_name,resource_type,limit from dba_profiles where profile='DEFAULT';

Caution:

設定較短有效期,一定要注意密碼有效期,及時在有效期前修改密碼,防止密碼過期導致應用連接數(shù)據(jù)庫失敗。

5. 同一密碼再次使用間隔

SYS@honor1 > alter profile default limit PASSWORD_REUSE_TIME 365;

Profile altered.

SYS@honor1 > select profile,resource_name,resource_type,limit from dba_profiles where profile='DEFAULT';

6. 同一密碼可被使用次數(shù)

SYS@honor1 > alter profile default limit PASSWORD_REUSE_MAX 5;

Profile altered.

SYS@honor1 > select profile,resource_name,resource_type,limit from dba_profiles where profile='DEFAULT';

7. 回退上述設置

SYS@honor1 > alter profile DEFAULT limit PASSWORD_LIFE_TIME 180;

SYS@honor1 > alter profile default limit PASSWORD_REUSE_TIME UNLIMITED;

SYS@honor1 > alter profile default limit PASSWORD_REUSE_MAX UNLIMITED;

感謝各位的閱讀,以上就是“設定Oracle用戶名密碼的規(guī)則有哪些”的內(nèi)容了,經(jīng)過本文的學習后,相信大家對設定Oracle用戶名密碼的規(guī)則有哪些這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。

AI