Oracle Profile 配置文件


 

  Profile是用戶的配置文件,它是密碼限制,資源限制的命名集合。利用profile 可以對數據庫用戶進行基本的資源管理,密碼管理。

 

  1 創建profile 的語法

create profile profile_test1 limit
failed_login_attempts 3
password_lock_time 1
password_life_time 90
password_reuse_time 90
sessions_per_user unlimited
cpu_per_session unlimited
cpu_per_call 1000
connect_time 30
logical_reads_per_session default
logical_reads_per_call 1000
composite_limit 6
private_sga 128k;

 

(1) 對數據庫資源做限制
sessions_per_user  每個用戶名所允許的並行會話數
cpu_per_session    一個會話一共可以使用的cpu時間,單位是百分之一秒
ccpu_per_call     一次sql調用(解析、執行和獲取)允許使用的cpu時間
connect_time     限制會話連接時間,單位是分鍾
idle_time         允許空閑會話的時間,單位是分鍾
logical_reads_per_session  限制會話對數據塊的讀取,單位是塊
logical_reads_per_call    限制sql調用對數據塊的讀取,單位是塊
composite_limit         指定一個會話的總的資源消耗,以service units單位表示
private_sga          限制會話在sga中shared pool中私有空間的分配

(2) 對密碼做限制
failed_login_attempts    帳戶被鎖定之前可以錯誤嘗試的次數
password_life_time      密碼可以被使用的天數,單位是天,默認值180天
password_reuse_time      密碼可重用的間隔時間(結合password_reuse_max)
password_reuse_max     密碼的最大改變次數(結合password_reuse_time)
password_lock_time       超過錯誤嘗試次數后,用戶被鎖定的天數,默認1天
password_grace_time     當密碼過期之后還有多少天可以使用原密碼
password_verify_function   該字段允許將復雜的PL/SQL密碼驗證腳本做為參數傳遞到create

 

2  創建用戶指定profile

create user test2 identified by 123456
default tablespace default_tablespace
temporary tablespace temp
profile profile_test1;

查詢創建的profile 對於資源與密碼使用策略

select *
from dba_profiles
where profile='PROFILE_TEST1';


grant create session to test2;

 

此時用戶對於密碼與資源使用限制會遵循profile_test1,我們可以測試一下,連着輸錯3次密碼,用戶被鎖

 

3 修改用戶對應的profile

alter user test1 profile profile_test1;

 

4 修改profile

alter profile profile_test1 limit
cpu_per_session 10000
sessions_per_user 10
failed_login_attempts 5
password_grace_time 5
password_lock_time 3;

 

5 刪除profile

drop profile profile_test1 cascade;

刪除profile文件之后,使用這個profile的用戶將自動重新指定default profile配置文件。

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM