Bo's Oracle Station

查看: 3326|回复: 0

课程第61次(2017-07-27星期四)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-7-28 10:34:31 | 显示全部楼层 |阅读模式
上完1Z0-063多租户部分(不讲1Z0-063备份恢复部分)第1/2章
1Z0-052
19章(上完19章),1Z0-05321章(上完21章)1Z0-063多租户部分共9章(上完2章)
总共上完全部49章中的42
Screenshot.png

Screenshot-1.png

  1. --. oraenv
  2. --cdb1
  3. --conn / as sysdba
  4. select   d.CON_ID,d.NAME,d.OPEN_MODE,d.CDB
  5. from v$database d;

  6. select i.INSTANCE_MODE, i.INSTANCE_NAME,i.CON_ID
  7.   from v$instance i;
  8.   
  9.   select s.CON_ID,s.NAME,s.PDB
  10.    from v$services s;
  11.   
  12. select  p.CON_ID,p.NAME,p.OPEN_MODE
  13.   from v$pdbs p;
  14.   
  15.   alter pluggable database pdb1_1 open;
  16.   
  17.   select  sys_context('userenv','con_id') from dual;
  18.   
  19.   select  sys_context('userenv','con_name') from dual;
  20.   
  21.   select  c.CON_ID,c.DBID,c.PDB_ID, c.GUID  , c.PDB_NAME,c.STATUS
  22.    from cdb_pdbs c;
  23.    
  24. select  * from v$logfile;

  25. select * from v$controlfile;

  26. select  c.CON_ID,c.FILE_NAME,c.STATUS from
  27.   cdb_data_files c;
  28.   
  29.   select  d.CON_ID,d.NAME,d.STATUS
  30.   from v$datafile d;
  31.   
  32.   select t.NAME,t.STATUS,t.CON_ID
  33.    from v$tempfile t;
  34.    
  35. select * from dba_data_files;

  36. select t.CON_ID,t.NAME,d.NAME,d.STATUS
  37.   from v$tablespace t, v$datafile d
  38.   where t.TS#=d.TS#  and t.CON_ID=d.CON_ID
  39.   order by 1,2;
  40.   
  41.   select  c.CON_ID,c.FILE_NAME,c.TABLESPACE_NAME,c.STATUS
  42.    from cdb_temp_files c;
  43.    
  44.    select t.CON_ID,t.NAME,d.NAME,d.STATUS
  45.   from v$tablespace t, v$tempfile d
  46.   where t.TS#=d.TS#  and t.CON_ID=d.CON_ID
  47.   order by 1,2;
  48.    
  49.    
  50.     select c.COMMON,c.CON_ID,c.DEFAULT_TABLESPACE,
  51.   c.TEMPORARY_TABLESPACE,c.INITIAL_RSRC_CONSUMER_GROUP,c.USERNAME
  52.    from cdb_users c
  53.    where c.USERNAME='SYSTEM';

  54.   select c.COMMON,c.CON_ID,c.DEFAULT_TABLESPACE,
  55.   c.TEMPORARY_TABLESPACE,c.INITIAL_RSRC_CONSUMER_GROUP,c.USERNAME
  56.    from cdb_users c
  57.    where c.COMMON='NO';

  58. select u.USERNAME
  59. from dba_users u
  60. where u.COMMON='NO';
  61.   
  62. select r.ROLE
  63.   from dba_roles r
  64.   where r.COMMON='NO';
  65.   
  66. select u.USERNAME ,u.CON_ID
  67. from cdb_users u
  68. where u.COMMON='NO';  

  69.   select r.ROLE,r.CON_ID
  70.   from cdb_roles r
  71.   where r.COMMON='NO';
  72.    
  73. select  *
  74.   from cdb_roles r
  75.   order by r.CON_ID,    r.ROLE;


  76. desc sys.system_privilege_map;

  77.   
  78. select  count(*)  from system_privilege_map;

  79. select  * from system_privilege_map;

  80. select  distinct p.name  from system_privilege_map p;


  81. desc sys.table_privilege_map;

  82. select  count(*) from table_privilege_map;

  83. select  * from table_privilege_map;

  84. select  distinct tp.NAME       from table_privilege_map tp;

  85. select  * from cdb_sys_privs  sp
  86. where sp.CON_ID=1 and sp.COMMON='YES';
  87.   
  88. select  * from cdb_sys_privs  sp
  89. where sp.CON_ID=1 and sp.COMMON='NO';

  90.   select tp.GRANTEE,tp.GRANTOR,tp.CON_ID,tp.TABLE_NAME
  91. from cdb_tab_privs tp
  92. where tp.CON_ID=1 and    tp.COMMON='YES';

  93.    
  94. select tp.GRANTEE,tp.GRANTOR,tp.CON_ID,tp.TABLE_NAME
  95. from cdb_tab_privs tp
  96. where tp.CON_ID=1  and  tp.COMMON='NO';

  97. select  rp.GRANTEE, rp.GRANTED_ROLE, rp.COMMON,rp.CON_ID
  98. from cdb_role_privs rp
  99. where rp.CON_ID=1  and  rp.COMMON='YES';

  100.   select  rp.GRANTEE, rp.GRANTED_ROLE, rp.COMMON,rp.CON_ID
  101. from cdb_role_privs rp
  102. where rp.CON_ID=1  and  rp.COMMON='NO';


  103. select  * from cdb_sys_privs  sp
  104. where sp.CON_ID=3 and sp.COMMON='YES';
  105.   
  106. select  * from cdb_sys_privs  sp
  107. where sp.CON_ID=3 and sp.COMMON='NO';

  108.   select tp.GRANTEE,tp.GRANTOR,tp.CON_ID,tp.TABLE_NAME
  109. from cdb_tab_privs tp
  110. where tp.CON_ID=3 and    tp.COMMON='YES';

  111.    
  112. select tp.GRANTEE,tp.GRANTOR,tp.CON_ID,tp.TABLE_NAME
  113. from cdb_tab_privs tp
  114. where tp.CON_ID=3  and  tp.COMMON='NO';

  115.   select  rp.GRANTEE, rp.GRANTED_ROLE, rp.COMMON,rp.CON_ID
  116. from cdb_role_privs rp
  117. where rp.CON_ID=3  and  rp.COMMON='YES';

  118.   select  rp.GRANTEE, rp.GRANTED_ROLE, rp.COMMON,rp.CON_ID
  119. from cdb_role_privs rp
  120. where rp.CON_ID=3  and  rp.COMMON='NO';
复制代码



回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-24 08:21 , Processed in 0.045311 second(s), 28 queries .

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