Skip to Main Content

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Mohamed.

Asked: May 15, 2020 - 1:34 pm UTC

Last updated: May 19, 2020 - 9:27 am UTC

Version: Oracle 19c

Viewed 1000+ times

You Asked

Hello Tom

I am upgrading a non CDB DB to CDB on oracle 19c.
But, my DB uses oracle managed files (OMF).
And I got

Create a PDB using description of the non-CDB

nohup ./CreatePDB.sh &

ERROR at line 1:
ORA-01276: Cannot add file
/opt/mycom/data/oracle/cdbnims/CDBNIMS1/pdb1/u04/NIMS/datafile/o1_mf_undotbs1_h3
op3vp0_.dbf. File has an Oracle Managed Files file name.


Below the 2 scripts I used:
1. to describe the new pdb.
2. to move datafiles.

1. more CreatePDBXML.sh

#!/bin/sh
sqlplus / as sysdba <<EOF

SHUTDOWN IMMEDIATE;
STARTUP OPEN READ ONLY;

BEGIN
  DBMS_PDB.DESCRIBE(
    pdb_descr_file => '/opt/mycom/3rd_party/oracle/app/oracle/products/19.0.0/NIMS.xml');
END;
/

SHUTDOWN IMMEDIATE;

exit;
EOF


2. more CreatePDB.sh

!/bin/sh
export ORACLE_SID=CDBNIMS1
mkdir -p /opt/mycom/data/oracle/cdbnims/CDBNIMS1/pdb1

sqlplus / as sysdba <<EOF

CREATE PLUGGABLE DATABASE pdb1 USING '/opt/mycom/3rd_party/oracle/app/oracle/products/19.0.0/NIMS.xml'
  MOVE
  FILE_NAME_CONVERT = ('/opt/mycom/data/oracle/nims/', ' /opt/mycom/data/oracle/cdbnims/CDBNIMS1/pdb1/');

ALTER SESSION SET CONTAINER=pdb1;

@$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql

ALTER PLUGGABLE DATABASE OPEN;
ALTER PLUGGABLE DATABASE SAVE STATE;

exit;
EOF


The second script exit with above error.
Indeed,some my data tables have been repartitioned (using rdbms redefiniton) and used OMF as datafiles.

Thanks a lot.
Moh



and Chris said...

The FILE_NAME_CONVERT clause doesn't work with Oracle Managed Files!

So either omit this clause or set

FILE_NAME_CONVERT = NONE


You can set the DB_CREATE_FILE_DEST to control the file locations.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Moh, May 18, 2020 - 5:33 pm UTC

Hello Chris
Thanks for your reply.
But I cannot see how to set FILE_NAME_CONVERT = NONE
Could you give me an example ?

I have tried the NOCOPY option as below:

export ORACLE_SID=CDBNIMS1
 sqlplus / as sysdba
 CREATE PLUGGABLE DATABASE pdb1 USING '/opt/mycom/3rd_party/oracle/app/oracle/products/19.0.0/NIMS.xml'
  NOCOPY;



But got below error:
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 1164
Session ID: 21 Serial number: 60363



Also, I have to convert some big non-CDB to PDB (5TB) DB, could you tell me what is the better option to do this convertion ?

Thanks
Chris Saxon
May 19, 2020 - 9:27 am UTC

So what happens when you do:

CREATE PLUGGABLE DATABASE pdb1 USING '/opt/mycom/3rd_party/oracle/app/oracle/products/19.0.0/NIMS.xml'
  MOVE
  FILE_NAME_CONVERT = NONE;


If this continues to give you ORA-03113 or similar errors, contact support.

Mike Dietrich discusses options for going non-CDB -> PDB at:

https://mikedietrichde.com/2019/08/13/database-migration-from-non-cdb-to-pdb-the-minimal-downtime-challenge/

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database