这篇文章给大家分享的是有关Oracle 12c中使用FILE_NAME_CONVERT创建pdb报错ORA-01276怎么办的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
在使用12c多租户模式,创建PDB时遇到如下 ORA-01276 错误:
SQL> select * from v$version;
BANNER CON_ID
-------------------------------------------------------------------------------- ----------
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 0
PL/SQL Release 12.2.0.1.0 - Production 0
CORE 12.2.0.1.0 Production 0
TNS for Linux: Version 12.2.0.1.0 - Production 0
NLSRTL Version 12.2.0.1.0 - Production 0
SQL> create pluggable database yhem from pdb1
2 file_name_convert=('/u01/app/oracle/oradata/ORCL/3F605C8D8A4206B6E0536838A8C04ACF','/u01/app/oracle/oradata/ORCL/enmotech');
create pluggable database yhem from pdb1
*
ERROR at line 1:
ORA-01276: Cannot add file
/u01/app/oracle/oradata/ORCL/enmotech/datafile/o1_mf_system_d0n37tyk_.dbf.
File has an Oracle Managed Files file name.
这个错误是由于使用了OMF管理模式后,不允许显示的指定目录转换的映射关系。
可以通过设置DB_CREATE_FILE_DEST参数指向新的PDB目录,执行PDB Clone创建即可。
SQL> alter system set db_create_file_dest='/u01/app/oracle/oradata/ORCL/enmotech';
System altered.
SQL> create pluggable database yhem from pdb1 ;
Pluggable database created.
SQL> select name from v$datafile where con_id=5;
NAME
------------------------------------------------------------------------------------------------------------
/u01/app/oracle/oradata/ORCL/enmotech/PG1/428AB277A7FC3DE6E0530381250AFAB1/datafile/o1_mf_system_d3ybm4z6_.dbf
/u01/app/oracle/oradata/ORCL/enmotech/PG1/428AB277A7FC3DE6E0530381250AFAB1/datafile/o1_mf_sysaux_d3ybm50s_.dbf
/u01/app/oracle/oradata/ORCL/enmotech/PG1/428AB277A7FC3DE6E0530381250AFAB1/datafile/o1_mf_undotbs1_d3ybm50w_.dbf
/u01/app/oracle/oradata/ORCL/enmotech/PG1/428AB277A7FC3DE6E0530381250AFAB1/datafile/o1_mf_users_d3ybm50y_.dbf
SQL> alter pluggable database yhem open;
Pluggable database altered.
SQL> alter session set container=YHEM;
Session altered.
SQL> alter session set current_schema=EYGLE;
Session altered.
SQL> select count(*) from enmotech;
COUNT(*)
----------
10
感谢各位的阅读!关于“Oracle 12c中使用FILE_NAME_CONVERT创建pdb报错ORA-01276怎么办”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!