19c pdb 热插拔测试

举报
snowofsummer 发表于 2021/05/21 16:20:53 2021/05/21
【摘要】 拔掉PDB:SQL> show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONL...

拔掉PDB:

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         4 PDB01                          MOUNTED
SQL> alter pluggable database PDB01 unplug into '/home/oracle/pdb01.xml';

Pluggable database altered.

SQL> exit

数据迁移到新的主机目录,包含xml,和所有的dbf数据文件。

[oracle@db01 pdb02]$ pwd
/data/pdb02
[oracle@db01 pdb02]$ ls
pdb01.xml  sysaux01.dbf  system01.dbf  temp01.dbf  undotbs01.dbf  users01.dbf

插入数据库:

#需要删除tmep文件

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB                            MOUNTED
SQL> create pluggable database pdb01  as clone using '/data/pdb02/pdb01.xml' nocopy source_file_directory='/data/pdb02';
create pluggable database pdb01  as clone using '/data/pdb02/pdb01.xml' nocopy source_file_directory='/data/pdb02'
*
ERROR at line 1:
ORA-27038: created file already exists
ORA-01119: error in creating database file '/data/pdb02/temp01.dbf'


SQL>  create pluggable database pdb01  as clone using '/data/pdb02/pdb01.xml' nocopy source_file_directory='/data/pdb02';

Pluggable database created.

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB                            MOUNTED
         5 PDB01                          MOUNTED
SQL> alter pluggable database all open;

Pluggable database altered.

SQL> col  pdb_name format a20;
col guid format a30;
set linesize 200;
select pdb_id,pdb_name,dbid,guid from dba_pdbs;SQL> SQL> SQL>

    PDB_ID PDB_NAME                   DBID GUID
---------- -------------------- ---------- ------------------------------
         3 PDB                  1201118169 C2BFDD43DA1888DEE053E603A8C096
                                           21

         2 PDB$SEED             1297793510 C2BFB82E06A766DAE053E603A8C006
                                           B2

         5 PDB01                3441547112 C2D9C59ED604D724E053E603A8C01A
                                           82

热插拔日志:

2021-05-21T23:51:50.837155+08:00
create pluggable database pdb01  as clone using '/data/pdb02/pdb01.xml' nocopy source_file_directory='/data/pdb02'
2021-05-21T23:51:50.864766+08:00
Scanning plugin datafile directory - /data/pdb02 for file originally          created  as /u01/app/oracle/oradata/ORCL/pdb01/system01.dbf with afn -13
Using file-/data/pdb02/system01.dbf for original file-/u01/app/oracle/oradata/ORCL/pdb01/system01.dbf with afn-13
Scanning plugin datafile directory - /data/pdb02 for file originally          created  as /u01/app/oracle/oradata/ORCL/pdb01/sysaux01.dbf with afn -14
Using file-/data/pdb02/sysaux01.dbf for original file-/u01/app/oracle/oradata/ORCL/pdb01/sysaux01.dbf with afn-14
Scanning plugin datafile directory - /data/pdb02 for file originally          created  as /u01/app/oracle/oradata/ORCL/pdb01/undotbs01.dbf with afn -15
Using file-/data/pdb02/undotbs01.dbf for original file-/u01/app/oracle/oradata/ORCL/pdb01/undotbs01.dbf with afn-15
Creating new file-/data/pdb02/temp01.dbf for original file-/u01/app/oracle/oradata/ORCL/pdb01/temp01.dbf
**************************************************************
Undo Create of Pluggable Database PDB01 with pdb id - 4.
**************************************************************
ORA-27038 signalled during: create pluggable database pdb01  as clone using '/data/pdb02/pdb01.xml' nocopy source_file_directory='/data/pdb02'...
2021-05-21T23:52:27.900827+08:00
 create pluggable database pdb01  as clone using '/data/pdb02/pdb01.xml' nocopy source_file_directory='/data/pdb02'
2021-05-21T23:52:27.909602+08:00
Scanning plugin datafile directory - /data/pdb02 for file originally          created  as /u01/app/oracle/oradata/ORCL/pdb01/system01.dbf with afn -13
Using file-/data/pdb02/system01.dbf for original file-/u01/app/oracle/oradata/ORCL/pdb01/system01.dbf with afn-13
Scanning plugin datafile directory - /data/pdb02 for file originally          created  as /u01/app/oracle/oradata/ORCL/pdb01/sysaux01.dbf with afn -14
Using file-/data/pdb02/sysaux01.dbf for original file-/u01/app/oracle/oradata/ORCL/pdb01/sysaux01.dbf with afn-14
Scanning plugin datafile directory - /data/pdb02 for file originally          created  as /u01/app/oracle/oradata/ORCL/pdb01/undotbs01.dbf with afn -15
Using file-/data/pdb02/undotbs01.dbf for original file-/u01/app/oracle/oradata/ORCL/pdb01/undotbs01.dbf with afn-15
Creating new file-/data/pdb02/temp01.dbf for original file-/u01/app/oracle/oradata/ORCL/pdb01/temp01.dbf
Scanning plugin datafile directory - /data/pdb02 for file originally          created  as /u01/app/oracle/oradata/ORCL/pdb01/users01.dbf with afn -16
Using file-/data/pdb02/users01.dbf for original file-/u01/app/oracle/oradata/ORCL/pdb01/users01.dbf with afn-16
PDB01(5):Endian type of dictionary set to little
****************************************************************
Pluggable Database PDB01 with pdb id - 5 is created as UNUSABLE.
If any errors are encountered before the pdb is marked as NEW,
then the pdb must be dropped
local undo-1, localundoscn-0x0000000000000118
****************************************************************
PDB01(5):Pluggable database PDB01 pseudo opening
PDB01(5):SUPLOG: Initialize PDB SUPLOG SGA, old value 0x0, new value 0x18
PDB01(5):Autotune of undo retention is turned on.
PDB01(5):Undo initialization recovery: Parallel FPTR complete: start:115756612 end:115756613 diff:1 ms (0.0 seconds)
PDB01(5):Undo initialization recovery: err:0 start: 115756612 end: 115756613 diff: 1 ms (0.0 seconds)
PDB01(5):[55076] Successfully onlined Undo Tablespace 2.
PDB01(5):Undo initialization online undo segments: err:0 start: 115756613 end: 115756637 diff: 24 ms (0.0 seconds)
PDB01(5):Undo initialization finished serial:0 start:115756612 end:115756638 diff:26 ms (0.0 seconds)
PDB01(5):Database Characterset for PDB01 is AL32UTF8
PDB01(5):Pluggable database PDB01 pseudo closing
PDB01(5):JIT: pid 55076 requesting stop
PDB01(5):Closing sequence subsystem (115756681286).
PDB01(5):Buffer Cache flush started: 5
PDB01(5):Buffer Cache flush finished: 5
Completed:  create pluggable database pdb01  as clone using '/data/pdb02/pdb01.xml' nocopy source_file_directory='/data/pdb02'
2021-05-21T23:52:42.223690+08:00


【声明】本内容来自华为云开发者社区博主,不代表华为云及华为云开发者社区的观点和立场。转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息,否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。