eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« Oracle 12c多租户新特性:Common用户和Local用户的管理 | Blog首页 | Oracle 12c 新特性: 多租户 PDB 的克隆与维护 »

Oracle 12c:多租户数据库克隆 ORA-01276 错误处理一例
modb.pro

在使用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

在引入了多租户特性之后,数据库的维护发生了很多改变。记录一下。



历史上的今天...
    >> 2019-12-06文章:
    >> 2010-12-06文章:
    >> 2007-12-06文章:
           DBA警世录:bootstrap$的禁忌
    >> 2006-12-06文章:
    >> 2005-12-06文章:

By eygle on 2016-12-06 12:12 | Comments (0) | Oracle12c/11g | 3220 |


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com