Oracle All about profile(三)
定义在profile中的默认值,默认情况下,所有的参数在profile中都被设置为unlimited,如果没有改变profile默认值,数据库对该值总是默认为unlimited。
4.如果两个参数都设置为unlimited,则数据库忽略他们。
Password_lock_time:指定登陆尝试失败次数到达后帐户的缩定时间,以天为单位。
Password_grace_time:指定宽限天数,数据库发出警告到登陆失效前的天数。如果数据库密码在这中间没有被修改,则过期会失效。
Password_verify_function:该字段允许将复杂的PL/SQL密码验证脚本做为参数传递到create profile语句。Oracle数据库提供了一个默认的脚本,但是自己可以创建自己的验证规则或使用第三方软件验证。 对Function名称,指定的是密码验证规则的名称,指定为Null则意味着不使用密码验证功能。如果为密码参数指定表达式,则该表达式可以是任意格式,除了数据库标量子查询。
五、举例:
1.创建一个profile:
create profile new_profile limit
password_reuse_max 10
password_reuse_time 30;
2.设置profile资源限制:
create profile app_user limit
sessions_per_user unlimited
cpu_per_session unlimited
cpu_per_call 3000
connect_time 45
logical_reads_per_session default
logical_reads_per_call 1000
private_sga 15k
composite_limit 5000000;
总的resource cost不超过五百万service units。计算总的resource cost的公式由alter resource cost语句来指定。
3.设置密码限制profile:
create profile app_users2 limit
failed_login_attempts 5
password_life_time 60
password_reuse_time 60
password_reuse_max 5
password_verify_function verify_function
password_lock_time 1/24
password_grace_time 10;
4.将配置文件分配给用户:
SQL> alter user dinya profile app_user;
用户已更改。
SQL> alter user dinya profile default;
用户已更改。
错误信息及解决方法
ORA-02390 exceeded COMPOSITE_LIMIT, you are being logged off
Cause: The COMPOSITE_LIMIT for the profile is exceeded. That is, the weighted sum of the connection time, logical reads per session, CPU usage per session, and private SGA space used during the session exceeded the limit set by the COMPOSITE_LIMIT clause set in the user profile.
Action: If this happens often, ask the database administrator to raise the COMPOSITE_LIMIT of the user profile, or determine which resource is used the most and raise the limit on that resource.
ORA-02391 exceeded simultaneous SESSIONS_PER_USER limit
Cause: An attempt was made to exceed the maximum number of concurrent sessions allowed by the SESSIONS_PER_USER clause of the user profile.
Action: End one or more concurrent sessions or ask the database administrator to increase the SESSIONS_PER_USER limit of the user profile. For more information about SESSIONS_PER_USER and the database administrator's specific tasks of adjusting concurrent sessions, see the Oracle9i SQL Reference and the Oracle9i Database Administrator's Guide.
ORA-02392 exceeded session limit on CPU usage, you are being logged off
Cause: An attempt was made to exceed the maximum CPU usage allowed by the CPU_PER_SESSION clause of the user profile.
Action: If this happens often, ask the database administrator to increase the CPU_PER_SESSION limit of the user profile.
ORA-02393 exceeded call limit on CPU usage
Cause: An attempt was made to exceed the maximum CPU time for a call, a parse, execute, or fetch, allowed by the CPU_PER_CALL clause of the user profile.
Action: If this happens often, ask the database administrator to increase the CPU_PER_CALL limit of the user profile.
ORA-02394 exceeded session limit on IO usage, you are being logged off
Cause: An attempt was made to exceed the maximum I/O allowed by the LOGICAL_READS_PER_SESSION clause of the user profile.
Action: If this happens often, ask the database administrator to increa