Bo's Oracle Station

查看: 1804|回复: 0

12cCLOUDCONTROL使用方法和多租户体系结构,课程第66/67次(2017-03-19星期日上下午)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-3-20 10:23:28 | 显示全部楼层 |阅读模式
上完1Z0-063第1章(12cCLOUDCONTROL使用方法)
上完1Z0-063第2章(多租户体系结构)
开始1Z0-063第3章(各种方法创建多租户数据库)
1Z0-052共19章(上完19章),1Z0-053共21章(上完21章),1Z0-063多租户部分共9章(上完2章)
总共上完全部49章中的42章

  1. select  * from dba_rsrc_plan_directives d
  2.   where d.PLAN='PLAN1'  and d.GROUP_OR_SUBPLAN='GROUP1';
  3.   
  4.   ---
  5.   
  6.   SELECT begin_time, consumer_group_name, cpu_consumed_time, cpu_wait_time
  7. FROM v$rsrcmgrmetric_history
  8. ORDER BY begin_time;
  9. ---

  10. begin
  11. dbms_resource_manager.create_pending_area;
  12. dbms_resource_manager.set_consumer_group_mapping('Client_machine','station37.example.com','group2');
  13. dbms_resource_manager.submit_pending_area;
  14. end;

  15. ---

  16. select  * from DBA_RSRC_MANAGER_SYSTEM_PRIVS;

  17. begin
  18.   dbms_resource_manager.clear_pending_area;
  19.   dbms_resource_manager.create_pending_area;
  20.     dbms_resource_manager_privs.grant_system_privilege('HR','ADMINISTER_RESOURCE_MANAGER',false);
  21.   dbms_resource_manager.submit_pending_area;
  22.   end;


  23. BEGIN
  24. dbms_resource_manager.clear_pending_area();
  25. dbms_resource_manager.create_pending_area();
  26. dbms_resource_manager.set_consumer_group_mapping_pri(
  27.     EXPLICIT => 1,  CLIENT_MACHINE => 2,
  28.     SERVICE_MODULE_ACTION => 3,
  29.     SERVICE_MODULE => 4,
  30.     MODULE_NAME_ACTION => 5,
  31.     MODULE_NAME => 6,
  32.     SERVICE_NAME => 7,
  33.     ORACLE_USER => 8,
  34.     CLIENT_PROGRAM => 9,
  35.     CLIENT_OS_USER => 10,
  36.     CLIENT_ID => 11
  37. );
  38. dbms_resource_manager.submit_pending_area();
  39. END;
复制代码

多租户:
  1. select name, cdb, con_id from v$database;


  2. select INSTANCE_NAME, STATUS, CON_ID from v$instance;

  3. select  name , con_id from v$services;


  4. select   name , open_mode , con_id   from v$pdbs;

  5. alter pluggable database pdb1_1 open;

  6. select  sys_context('userenv','con_name') from dual;

  7. select  sys_context('userenv','con_id')  from dual;

  8. select  pdb_id, dbid, guid ,pdb_name , con_id from cdb_pdbs;

  9. ---
  10. select  name ,con_id  from v$datafile
  11.   where con_id=3;
  12.   
  13.   select  name ,con_id  from v$datafile
  14.   where con_id=2;
  15.   
  16.   ---
  17.   
  18.   select  * from v$log;
  19.   
  20.   select  * from v$logfile;
  21.   
  22.   select  * from v$controlfile;
  23.   
  24.   select  file_name, tablespace_name, file_id , con_id
  25.    from cdb_data_files
  26.     order by con_id  , tablespace_name;
  27.        
  28.         select name , con_id from v$datafile
  29.          where con_id=1;
  30.          
  31.          select  * from dba_data_files;
  32.          
  33.          ---
  34.          
  35.          select   d.name, file#, t.name , t.ts#  , t.con_id
  36.            from v$tablespace t, v$datafile d
  37.            where t.ts# = d.ts#
  38.            and t.con_id= d.con_id;
  39.   ---
  40.   select  file_name, tablespace_name , file_id , con_id
  41.     from cdb_temp_files;
  42.        
  43.         select    name, file#  ,con_id  from
  44.           v$tempfile;
  45.           
  46.                     select  username, common, con_id from cdb_users
  47.             where username='SYSTEM';
  48.           
  49.           select  username, common, con_id from cdb_users
  50.             where username='SYS';

  51.           select  username, common, con_id from cdb_users
  52.             where username='HR';
  53.                
  54.                
  55.                 select username, common, con_id from cdb_users
  56.                  where con_id=1
  57.                  order by  username;
  58.                  
  59.                  
  60.                          select username, common, con_id from cdb_users
  61.                  where con_id=3
  62.                  order by  username;
  63.                  
  64.                           select username, common, con_id from cdb_users
  65.                  where con_id=3  and common='NO'
  66.                  order by  username;
  67.                  
  68.                   select username from cdb_users
  69.                  where con_id=3
  70.                  minus         
  71.                          select username  from cdb_users
  72.                  where con_id=1 ;
  73.                  
  74.                  ----
  75.                  select role, common, con_id from cdb_roles
  76.                  where con_id=1
  77.                  order by  role;
  78.                  
  79.                  select role, common, con_id from cdb_roles
  80.                  where con_id=3
  81.                  order by  role;
  82.                  ---
  83.                  
  84.                  select  *
  85.                    from cdb_sys_privs
  86.                     where con_id=1
  87.                 ;
  88.                        
  89.                          select  *
  90.                    from cdb_sys_privs
  91.                     where con_id=3;
  92.                        
  93.                         select s.GRANTEE, s.PRIVILEGE, s.COMMON
  94.                         from cdb_sys_privs s
  95.                         where con_id=3
  96.                         minus
  97.                     select s.GRANTEE, s.PRIVILEGE, s.COMMON
  98.                         from cdb_sys_privs s
  99.                         where con_id=1;
  100.                        
  101.                         ----
  102.                 select  *
  103.                    from cdb_tab_privs
  104.                     where con_id=1  and
  105.                         common='NO'
  106.                 ;
  107.                        
  108.                                 select  count(*)
  109.                    from cdb_tab_privs
  110.                     where con_id=1  and
  111.                         common='YES'
  112.                 ;
  113.                        
  114.                        
  115.                        
  116.                        
  117.                                         select  *
  118.                    from cdb_tab_privs
  119.                     where con_id=3  and
  120.                         common='NO'
  121.                 ;
  122.                        
  123.                                 select  count(*)
  124.                    from cdb_tab_privs
  125.                     where con_id=3  and
  126.                         common='YES'
  127.                 ;                
  128.                
  129.                 ---
  130.                 select  *
  131.                    from cdb_role_privs
  132.                     where con_id=1  and
  133.                         common='YES'
  134.                 ;
  135.                        
  136.                                 select  count(*)
  137.                    from cdb_role_privs
  138.                     where con_id=1  and
  139.                         common='YES'
  140.                 ;
  141.                        
  142.                        
  143.                        
  144.                        
  145.                                         select  *
  146.                    from cdb_role_privs
  147.                     where con_id=3  and
  148.                         common='YES'
  149.                 ;
  150.                        
  151.                                 select  count(*)
  152.                    from cdb_role_privs
  153.                     where con_id=3  and
  154.                         common='YES'
  155.                 ;                
  156.                
  157.                         select  count(*)
  158.                    from cdb_role_privs
  159.                     where con_id=3  and
  160.                         common='NO'
  161.                 ;         
复制代码
  1. select name, cdb, con_id from v$database;


  2. select INSTANCE_NAME, STATUS, CON_ID from v$instance;

  3. select  name , con_id from v$services;


  4. select   name , open_mode , con_id   from v$pdbs;

  5. alter pluggable database pdb1_1 open;

  6. select  sys_context('userenv','con_name') from dual;

  7. select  sys_context('userenv','con_id')  from dual;

  8. select  pdb_id, dbid, guid ,pdb_name , con_id from cdb_pdbs;

  9. ---
  10. select  name ,con_id  from v$datafile
  11.   where con_id=3;
  12.   
  13.   select  name ,con_id  from v$datafile
  14.   where con_id=2;
  15.   
  16.   ---
  17.   
  18.   select  * from v$log;
  19.   
  20.   select  * from v$logfile;
  21.   
  22.   select  * from v$controlfile;
  23.   
  24.   select  file_name, tablespace_name, file_id , con_id
  25.    from cdb_data_files
  26.     order by con_id  , tablespace_name;
  27.        
  28.         select name , con_id from v$datafile
  29.          where con_id=1;
  30.          
  31.          select  * from dba_data_files;
  32.          
  33.          ---
  34.          
  35.          select   d.name, file#, t.name , t.ts#  , t.con_id
  36.            from v$tablespace t, v$datafile d
  37.            where t.ts# = d.ts#
  38.            and t.con_id= d.con_id;
  39.   ---
  40.   select  file_name, tablespace_name , file_id , con_id
  41.     from cdb_temp_files;
  42.        
  43.         select    name, file#  ,con_id  from
  44.           v$tempfile;
  45.           
  46.                     select  username, common, con_id from cdb_users
  47.             where username='SYSTEM';
  48.           
  49.           select  username, common, con_id from cdb_users
  50.             where username='SYS';

  51.           select  username, common, con_id from cdb_users
  52.             where username='HR';
  53.                
  54.                
  55.                 select username, common, con_id from cdb_users
  56.                  where con_id=1
  57.                  order by  username;
  58.                  
  59.                  
  60.                          select username, common, con_id from cdb_users
  61.                  where con_id=3
  62.                  order by  username;
  63.                  
  64.                           select username, common, con_id from cdb_users
  65.                  where con_id=3  and common='NO'
  66.                  order by  username;
  67.                  
  68.                   select username from cdb_users
  69.                  where con_id=3
  70.                  minus         
  71.                          select username  from cdb_users
  72.                  where con_id=1 ;
  73.                  
  74.                  ----
  75.                  select role, common, con_id from cdb_roles
  76.                  where con_id=1
  77.                  order by  role;
  78.                  
  79.                  select role, common, con_id from cdb_roles
  80.                  where con_id=3
  81.                  order by  role;
  82.                  ---
  83.                  
  84.                  select  *
  85.                    from cdb_sys_privs
  86.                     where con_id=1
  87.                 ;
  88.                        
  89.                          select  *
  90.                    from cdb_sys_privs
  91.                     where con_id=3;
  92.                        
  93.                         select s.GRANTEE, s.PRIVILEGE, s.COMMON
  94.                         from cdb_sys_privs s
  95.                         where con_id=3
  96.                         minus
  97.                     select s.GRANTEE, s.PRIVILEGE, s.COMMON
  98.                         from cdb_sys_privs s
  99.                         where con_id=1;
  100.                        
  101.                         ----
  102.                 select  *
  103.                    from cdb_tab_privs
  104.                     where con_id=1  and
  105.                         common='NO'
  106.                 ;
  107.                        
  108.                                 select  count(*)
  109.                    from cdb_tab_privs
  110.                     where con_id=1  and
  111.                         common='YES'
  112.                 ;
  113.                        
  114.                        
  115.                        
  116.                        
  117.                                         select  *
  118.                    from cdb_tab_privs
  119.                     where con_id=3  and
  120.                         common='NO'
  121.                 ;
  122.                        
  123.                                 select  count(*)
  124.                    from cdb_tab_privs
  125.                     where con_id=3  and
  126.                         common='YES'
  127.                 ;                
  128.                
  129.                 ---
  130.                 select  *
  131.                    from cdb_role_privs
  132.                     where con_id=1  and
  133.                         common='YES'
  134.                 ;
  135.                        
  136.                                 select  count(*)
  137.                    from cdb_role_privs
  138.                     where con_id=1  and
  139.                         common='YES'
  140.                 ;
  141.                        
  142.                        
  143.                        
  144.                        
  145.                                         select  *
  146.                    from cdb_role_privs
  147.                     where con_id=3  and
  148.                         common='YES'
  149.                 ;
  150.                        
  151.                                 select  count(*)
  152.                    from cdb_role_privs
  153.                     where con_id=3  and
  154.                         common='YES'
  155.                 ;                
  156.                
  157.                         select  count(*)
  158.                    from cdb_role_privs
  159.                     where con_id=3  and
  160.                         common='NO'
  161.                 ;         
复制代码




回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-3-29 16:48 , Processed in 0.035969 second(s), 24 queries .

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