Bo's Oracle Station

查看: 1634|回复: 0

从种子创建插件数据库、克隆本容器插件数据库和插入一个普通数据库,课程第68次(2017-03-22星期三)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-3-22 23:06:43 | 显示全部楼层 |阅读模式
  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. select  sys_context('userenv','con_name') from dual;

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

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

  8. select  name ,con_id  from v$datafile ;

  9. select  * from v$tempfile;

  10.   select  * from v$log;
  11.   
  12.     select  * from v$logfile;
  13.        
  14.   select  * from v$controlfile;       
  15.   
  16.     select  file_name, tablespace_name, file_id , con_id
  17.    from cdb_data_files
  18.     order by con_id  , tablespace_name;
  19.        
  20. select  * from dba_data_files;

  21.    select   d.name, file#, t.name , t.ts#  , t.con_id
  22.            from v$tablespace t, v$datafile d
  23.            where t.ts# = d.ts#
  24.            and t.con_id= d.con_id;
  25.                   
  26.         select  file_name, tablespace_name , file_id , con_id
  27.     from cdb_temp_files;       
  28.        
  29.        
  30.                   
  31.          select    name, file#  ,con_id  from
  32.           v$tempfile;          
  33.                 ----
  34.                    select  username, common, con_id from cdb_users
  35.             where username='SYSTEM';
  36.                        
  37.                           select  username, common, con_id from cdb_users
  38.             where username='SYS';
  39.                        
  40.                          select  username, common, con_id from cdb_users
  41.             where username='HR';
  42.                        
  43.                                   select username, common, con_id from cdb_users
  44.                
  45.                  order by  username;
  46.                                 select distinct username, CON_ID from cdb_users
  47. where common ='NO';

  48. select distinct status, con_id from v_$bh order by 2 ;
  49.                         ---
  50.                         create pluggable database pdb2_1  
  51.                          admin user pdb2_1_admin  
  52.                          identified by oracle_4U roles=(connect)
  53.                          file_name_convert=('/u01/app/oracle/oradata/cdb2/pdbseed',
  54.                          '/u01/app/oracle/oradata/cdb2/pdb2_1');
  55.                
  56.                                  
  57.                        
  58. select  name ,  open_mode , con_id from v$pdbs;
  59.          
  60.          alter pluggable database pdb2_1 open;
  61.                   
  62.                   
  63.                   ---
  64. alter pluggable database pdb2_1 close immediate;

  65. drop pluggable database pdb2_1 including datafiles;

  66. ---

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

  68. alter pluggable database pdb2_1  close;
  69. select  name , open_mode , con_id from v$pdbs;

  70. alter pluggable database pdb2_1 open read  only;


  71. create pluggable database pdb2_2 from pdb2_1;

  72. alter pluggable database pdb2_1 close;

  73. alter pluggable database pdb2_1 open;

  74. alter pluggable database pdb2_2 open;
  75. select  name , open_mode , con_id from v$pdbs;

  76. create pluggable database pdb_orcl2 using '/home/oracle/orcl2.xml' nocopy;


  77.         select  file_name, tablespace_name , file_id , con_id
  78.     from cdb_temp_files;       
  79.        
  80.         select  name, open_mode , con_id  from v$pdbs;
  81.        
  82.         select  pdb_name ,status , con_id from cdb_pdbs;

  83.                
  84.        
复制代码


回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-3-28 18:05 , Processed in 0.034707 second(s), 24 queries .

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