botang 发表于 2017-12-4 19:41:40

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

CREATE PROFILE "PROFILE1" LIMIT CPU_PER_SESSION 500;

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

alter user hr profile profile1;

selectu.profilefrom dba_users u where u.username='HR';


$ sqlplus /nolog

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

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

SQL> conn / as sysdba
Connected.
SQL> show parameter resource

NAME                                     TYPE         VALUE
------------------------------------ ----------- ------------------------------
resource_limit                           boolean         FALSE
resource_manager_cpu_allocation      integer         4
resource_manager_plan                     string
SQL> alter system set resource_limit=true;

System altered.

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

COUNT(*)
----------
       107

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

COUNT(*)
----------
   11449

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

COUNT(*)
----------
   1225043

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


SQL>


SQL> conn hr/oracle_4U
Connected.
SQL> select* from employees;
select      * from employees
               *
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-02399: exceeded maximum connect time, you are being logged off


SQL>

select* from resource_cost;

alter resource costCPU_PER_SESSION 100;
      ALTER PROFILE "PROFILE1" LIMIT PASSWORD_LOCK_TIME 0.000694444
FAILED_LOGIN_ATTEMPTS 1
ALTER PROFILE "PROFILE1" LIMIT PASSWORD_LIFE_TIME 0.000694444
PASSWORD_GRACE_TIME 0.000694444


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

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



alter profile profile1 limit PASSWORD_REUSE_TIME 0.013888889
         PASSWORD_REUSE_MAX 1;
select   * from dba_objects o
where o.object_namelike 'VERIFY_FUNCTION%';



页: [1]
查看完整版本: 第38次活动:2017-12-04(星期一晚上7:00-9:30)