克隆pdb创建新的pdb的时候遇到了以下的错误,具体过程如下文。
数据库版本:12.2.0.1

 

查看已有pdb的tempfile文件

SQL> select name from v$tempfile;

NAME
--------------------------------------------------------------------------------
+DATA/O12C/25FC2D397AF41D70E0524A0F0A0AAEDA/TEMPFILE/temp.276.947842435

 

查看已有pdb的datafile文件

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+DATA/O12C/25FC2D397AF41D70E0524A0F0A0AAEDA/DATAFILE/system.274.947842433
+DATA/O12C/25FC2D397AF41D70E0524A0F0A0AAEDA/DATAFILE/sysaux.275.947842433
+DATA/O12C/25FC2D397AF41D70E0524A0F0A0AAEDA/DATAFILE/undotbs1.273.947842433
+DATA/O12C/25FC2D397AF41D70E0524A0F0A0AAEDA/DATAFILE/users.278.947842449
+DATA/O12C/25FC2D397AF41D70E0524A0F0A0AAEDA/DATAFILE/undotbs2.277.947878603

  

创建新的pdb

SQL> create pluggable database abce from o12c1pdb file_name_convert=(
  2  '+data/o12c/25fc2d397af41d70e0524a0f0a0aaeda/datafile/system.274.947842433','+data/o12c/abce/datafile/system01.dbf',
  3  '+data/o12c/25fc2d397af41d70e0524a0f0a0aaeda/datafile/sysaux.275.947842433','+data/o12c/abce/datafile/sysaux01.dbf',
  4  '+data/o12c/25fc2d397af41d70e0524a0f0a0aaeda/datafile/undotbs1.273.947842433','+data/o12c/abce/datafile/undotbs101.dbf',
  5  '+data/o12c/25fc2d397af41d70e0524a0f0a0aaeda/datafile/undotbs2.277.947878603','+data/o12c/abce/datafile/undotbs201.dbf',
  6  '+data/o12c/25fc2d397af41d70e0524a0f0a0aaeda/datafile/users.278.947842449','+data/o12c/abce/datafile/users01.dbf',
  7  '+data/o12c/25fc2d397af41d70e0524a0f0a0aaeda/tempfile/temp.276.947842435','+data/o12c/abce/tempfile/temp01.dbf');
create pluggable database abce from o12c1pdb file_name_convert=(
*
ERROR at line 1:
ORA-65005: missing or invalid file name pattern for file -
+DATA/O12C/25FC2D397AF41D70E0524A0F0A0AAEDA/DATAFILE/system.274.947842433


SQL>

 

创建失败,报错。查了一下MOS,没有发现类似的问题。

当然,也有人是因为没有加上temp文件导致的,但是与本人遇到的问题还是不符合。

最终怀疑是不是大小写的问题,于是把上面从v$tempfile、v$datafile中查看到的name结果直接拷贝在create语句中(保持大小写格式不变),同时要创建的pdb的文件路径也以类似的方式(路径以大写的格式),再次执行。居然创建成功了!!!

SQL> create pluggable database abce from o12c1pdb file_name_convert=(
  2      '+DATA/O12C/25FC2D397AF41D70E0524A0F0A0AAEDA/DATAFILE/system.274.947842433','+DATA/O12C/ABCE/DATAFILE/system01.dbf',
  3      '+DATA/O12C/25FC2D397AF41D70E0524A0F0A0AAEDA/DATAFILE/sysaux.275.947842433','+DATA/O12C/ABCE/DATAFILE/sysaux01.dbf',
  4      '+DATA/O12C/25FC2D397AF41D70E0524A0F0A0AAEDA/DATAFILE/undotbs1.273.947842433','+DATA/O12C/ABCE/DATAFILE/undotbs101.dbf',
  5      '+DATA/O12C/25FC2D397AF41D70E0524A0F0A0AAEDA/DATAFILE/undotbs2.277.947878603','+DATA/O12C/ABCE/DATAFILE/undotbs201.dbf',
  6      '+DATA/O12C/25FC2D397AF41D70E0524A0F0A0AAEDA/DATAFILE/users.278.947842449','+DATA/O12C/ABCE/DATAFILE/users01.dbf',
  7      '+DATA/O12C/25FC2D397AF41D70E0524A0F0A0AAEDA/TEMPFILE/temp.276.947842435','+DATA/O12C/ABCE/TEMPFILE/temp01.dbf');

Pluggable database created.

SQL>