Bo's Oracle Station

查看: 2896|回复: 0

第38次活动:2017-12-04(星期一晚上7:00-9:30)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-12-4 19:41:40 | 显示全部楼层 |阅读模式
  1. CREATE PROFILE "PROFILE1" LIMIT CPU_PER_SESSION 500;

  2. select  * from dba_profiles p where p.profile='PROFILE1';

  3. alter user hr profile profile1;

  4. select  u.profile  from dba_users u where u.username='HR';
复制代码


  1. [oracle@station90 ~]$ sqlplus /nolog

  2. SQL*Plus: Release 11.2.0.3.0 Production on Mon Dec 4 19:38:19 2017

  3. Copyright (c) 1982, 2011, Oracle.  All rights reserved.

  4. SQL> conn / as sysdba
  5. Connected.
  6. SQL> show parameter resource

  7. NAME                                     TYPE         VALUE
  8. ------------------------------------ ----------- ------------------------------
  9. resource_limit                             boolean         FALSE
  10. resource_manager_cpu_allocation      integer         4
  11. resource_manager_plan                     string
  12. SQL> alter system set resource_limit=true;

  13. System altered.

  14. SQL> conn hr/oracle_4U
  15. Connected.
  16. SQL> select count(*)  from employees;

  17.   COUNT(*)
  18. ----------
  19.        107

  20. SQL> select count(*)  from employees a , employees b ;

  21.   COUNT(*)
  22. ----------
  23.      11449

  24. SQL> select count(*)  from employees a , employees b , employees c ;

  25.   COUNT(*)
  26. ----------
  27.    1225043

  28. SQL> select count(*)  from employees a , employees b , employees c , employees d ;
  29. select count(*)  from employees a , employees b , employees c , employees d
  30.                       *
  31. ERROR at line 1:
  32. ORA-02392: exceeded session limit on CPU usage, you are being logged off


  33. SQL>

复制代码
  1. SQL> conn hr/oracle_4U
  2. Connected.
  3. SQL> select  * from employees;
  4. select        * from employees
  5.                *
  6. ERROR at line 1:
  7. ORA-00604: error occurred at recursive SQL level 1
  8. ORA-02399: exceeded maximum connect time, you are being logged off


  9. SQL>
复制代码
  1. select  * from resource_cost;

  2. alter resource cost  CPU_PER_SESSION 100;
复制代码
  1.         ALTER PROFILE "PROFILE1" LIMIT PASSWORD_LOCK_TIME 0.000694444
  2. FAILED_LOGIN_ATTEMPTS 1
复制代码
  1. ALTER PROFILE "PROFILE1" LIMIT PASSWORD_LIFE_TIME 0.000694444
  2. PASSWORD_GRACE_TIME 0.000694444
复制代码

  1. select u.account_status,u.lock_date , u.expiry_date
  2. from dba_users u where u.username='HR';

  3. select  * from dba_profiles p where p.profile='PROFILE1'  
  4. and p.resource_type='PASSWORD';



  5. alter profile profile1 limit PASSWORD_REUSE_TIME 0.013888889
  6.            PASSWORD_REUSE_MAX 1;
复制代码
  1. select   * from dba_objects o
  2. where o.object_name  like 'VERIFY_FUNCTION%';
复制代码




回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-3-29 03:07 , Processed in 0.034278 second(s), 24 queries .

快速回复 返回顶部 返回列表