Bo's Oracle Station

查看: 2655|回复: 0

课程第53次(2017-11-14星期二)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-11-14 20:19:25 | 显示全部楼层 |阅读模式
1Z0-052第8章
1Z0-05219章(上完15章),1Z0-05321章(上完16章)和1Z0-063多租户部分共9章(上完0章)
总共上完全部49章中的31
  1. select * from dba_roles order by role;

  2. select  * from role_sys_privs p where p.ROLE='ROLE2';

  3. select  * from role_tab_privs t where t.ROLE='ROLE2';

  4. select * from role_role_privs r where r.ROLE='ROLE2';


  5. select  * from dba_role_privs p where p.GRANTED_ROLE='ROLE1';

  6. create role role2 ;

  7. grant role1 to role2;

  8. select  * from dba_sys_privs sp  where sp.GRANTEE='USER1';

  9. select  * from dba_tab_privs tp where tp.GRANTEE='USER1';

  10. select  * from dba_col_privs cp where cp.GRANTEE='USER1';

  11. grant update (email)  on hr.employees to user1;
  12. grant insert(a) on  hr.t05208_a to user1;

  13. alter user user1 account unlock;

  14. select * from dba_role_privs rp where rp.GRANTEE='USER1';

  15. grant role2 to user1;

  16. revoke  role1 from role2;
  17. grant select  on hr.employees to role2;
  18. revoke select  on hr.employees from role2;

  19. grant role1 to role2;

  20. -------------------------------------
  21. select * from dba_role_privs rp where rp.GRANTEE='USER1';

  22. alter user user1 default role connect;

  23. revoke role2 from user1;

  24. drop role role2;

  25. create role role2 identified by oracle_4U;

  26. grant role2 to user1;

  27. select * from dba_role_privs rp where rp.GRANTEE='USER1';
  28. ----------------------------------
  29. grant select  on hr.employees to role2;
  30. --------------------



  31. select  u.USERNAME,
  32.            u.ACCOUNT_STATUS,
  33.                    u.AUTHENTICATION_TYPE,
  34.                    u.EXPIRY_DATE,
  35.                    u.LOCK_DATE                  
  36.                       from dba_users u
  37. where u.USERNAME='USER3';


  38. select   to_date('2018-05-08:19:51:31','YYYY-MM-DD:HH24:MI:SS')-  sysdate
  39. from dual;
复制代码
登录图形界面需要的角色是:
grant select_catalog_role to hr;

  1. CREATE PROFILE "PROFILE1" LIMIT CPU_PER_SESSION 500
  2. CPU_PER_CALL DEFAULT
  3. CONNECT_TIME DEFAULT
  4. IDLE_TIME DEFAULT
  5. SESSIONS_PER_USER DEFAULT
  6. LOGICAL_READS_PER_SESSION DEFAULT
  7. LOGICAL_READS_PER_CALL DEFAULT
  8. PRIVATE_SGA DEFAULT
  9. COMPOSITE_LIMIT DEFAULT
  10. PASSWORD_LIFE_TIME DEFAULT
  11. PASSWORD_GRACE_TIME DEFAULT
  12. PASSWORD_REUSE_MAX DEFAULT
  13. PASSWORD_REUSE_TIME DEFAULT
  14. PASSWORD_LOCK_TIME DEFAULT
  15. FAILED_LOGIN_ATTEMPTS DEFAULT
  16. PASSWORD_VERIFY_FUNCTION DEFAULT

  17.                         
复制代码
  1. SQL> select  count(*)  from t_big a  , departments b , departments  c  ;

  2.   COUNT(*)
  3. ----------
  4. 237906963

  5. SQL> /

  6.   COUNT(*)
  7. ----------
  8. 237906963

  9. SQL> exit
  10. Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
  11. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
  12. [oracle@station26 ~]$ sqlplus /nolog

  13. SQL*Plus: Release 12.1.0.2.0 Production on Tue Nov 14 20:47:56 2017

  14. Copyright (c) 1982, 2014, Oracle.  All rights reserved.

  15. SQL> conn hr/oracle_4U
  16. Connected.
  17. SQL> select  count(*)  from t_big a  , departments b , departments  c  ;
  18. select        count(*)  from t_big a        , departments b , departments  c
  19. *
  20. ERROR at line 1:
  21. ORA-02392: exceeded session limit on CPU usage, you are being logged off
复制代码
  1. ALTER PROFILE "PROFILE1" LIMIT CPU_PER_SESSION DEFAULT
  2. CONNECT_TIME 1
复制代码
  1. SQL> conn hr/oracle_4U
  2. Connected.
  3. SQL> select  salary from employees;
  4. select        salary from employees
  5.                     *
  6. ERROR at line 1:
  7. ORA-02399: exceeded maximum connect time, you are being logged off


  8. SQL>
复制代码
  1. SQL> select  * from employees;
  2. select        * from employees
  3. *
  4. ERROR at line 1:
  5. ORA-02396: exceeded maximum idle time, please connect again
复制代码

Screenshot.png

组成成分越大,说明复合值越小。

  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
复制代码
Screenshot-1.png

  1. ALTER PROFILE "PROFILE1" LIMIT password_reuse_max 1
  2. password_reuse_time 20 ;
复制代码
  1. select  * from dba_profiles p

  2. where p.PROFILE='PROFILE1' and p.RESOURCE_TYPE='PASSWORD';
复制代码
Screenshot.png

  1.     select  * from dba_profiles p
  2.     where p.PROFILE='PROFILE1' and p.RESOURCE_TYPE='PASSWORD';
  3.         
  4.         select  u.USERNAME,
  5.            u.ACCOUNT_STATUS,
  6.                    u.AUTHENTICATION_TYPE,
  7.                    u.EXPIRY_DATE,
  8.                    u.LOCK_DATE                  
  9.                       from dba_users u
  10. where u.USERNAME='HR';

  11. select  * from dba_objects o
  12. where o.OBJECT_NAME like '%VERIFY_FUNCTION%'
  13.   and o.OBJECT_TYPE='FUNCTION';
  14.   
  15.       select  * from dba_profiles p
  16.     where p.PROFILE='DEFAULT' and p.RESOURCE_TYPE='PASSWORD';
  17.         
  18.         
  19.         alter profile profile1 limit
  20.         password_verify_function  verify_function;
  21.   
  22.       select  * from dba_profiles p
  23.     where p.PROFILE='PROFILE1' and p.RESOURCE_TYPE='PASSWORD';
  24.         
  25.         alter profile profile1 limit
  26.         password_verify_function  verify_function_11g;
  27.         
  28.         select  * from role_sys_privs sp
  29.          where sp.ROLE='RESOURCE';
  30.          
  31.          create user user4 identified by oracle_4U ;
  32.          
  33.          grant create session, resource  to user4;
  34.          
  35.          grant unlimited tablespace to user4;
复制代码
11g里头 要注意的unlimited tablespace:
Screenshot-1.png

回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-25 09:16 , Processed in 0.032014 second(s), 27 queries .

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