Home » RDBMS Server » Server Administration » Datafile cannot be open by either non cdb or cdb instance (19.0.0, windows 2016 64 bit)
Datafile cannot be open by either non cdb or cdb instance [message #681113] Tue, 16 June 2020 17:14 Go to next message
juniordbanewbie
Messages: 250
Registered: April 2014
Senior Member
Dear all,

I'm using method similar to https://oracle-base.com/articles/19c/upgrading-to-19c#convert-non-cdb-to-pdb
to upgrade my customer database and perform non cdb to pdb conversion later.


I try to create a pluggable database using xml

but it fails after not enough disk space

SYS@camden-ora06 bicdb>CREATE PLUGGABLE DATABASE &&2 USING '&3'
  2  MOVE
  3  FILE_NAME_CONVERT=('&4','&5'
  4  ,'&6','&7');
old   1: CREATE PLUGGABLE DATABASE &&2 USING '&3'
new   1: CREATE PLUGGABLE DATABASE biorcl USING 'K:\db_upgrade\database\scripts\dbms_pdb\describe\log\camden-ora06_biorcl_describe_20200615_195914.xml'
old   3: FILE_NAME_CONVERT=('&4','&5'
new   3: FILE_NAME_CONVERT=('D:\app\oracle\oradata\biorcl','D:\app\oracle\oradata\bicdb\biorcl'
old   4: ,'&6','&7')
new   4: ,'J:\app\oracle\oradata\biorcl','J:\app\oracle\oradata\bicdb\biorcl')

next I do the following, resolve disk issue and drop the pluggable database (did not drop database files), and move the datafiles files, create the pluggable database again


CREATE PLUGGABLE DATABASE biorcl USING 'K:\db_upgrade\database\scripts\dbms_pdb\describe\log\camden-ora06_biorcl_describe_20200615_195914.xml'
*
ERROR at line 1:
ORA-65139: Mismatch between XML metadata file and data file
D:\APP\ORACLE\ORADATA\biorcl\SYSTEM01.DBF for value of cid (0 in the plug XML
file, 3 in the data file)
it fail again,

so I decide to start the non cdb instance and check whether i can be read or not

it fails
from alert_biorcl.log

ALTER DATABASE OPEN
2020-06-16T02:29:29.462767-04:00
Errors in file E:\APP\ORACLE\diag\rdbms\biorcl\biorcl\trace\biorcl_mz00_11760.trc:
ORA-01110: data file 1: 'D:\APP\ORACLE\ORADATA\biorcl\SYSTEM01.DBF'
ORA-01204: file number is 8 rather than 1 - wrong file
Ping without log force is disabled:
  instance mounted in exclusive mode.
Read of datafile 'D:\APP\ORACLE\ORADATA\biorcl\SYSTEM01.DBF' (fno 1) header failed with ORA-01204
Rereading datafile 1 header failed with ORA-01204
2020-06-16T02:29:29.587830-04:00
Errors in file E:\APP\ORACLE\diag\rdbms\biorcl\biorcl\trace\biorcl_ora_12232.trc:

it quite obvious that the datafile header has its number renamed during the plug in operations.

so how can i make the datafile back to its original number again?

On one note here I should just resolve the disk issues and copy the tempfiles and do non cdb to pdb conversion. who knows it might work.

many thanks in advance.
Re: Datafile cannot be open by either non cdb or cdb instance [message #681117 is a reply to message #681113] Wed, 17 June 2020 01:39 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
I don't understand this:Quote:
drop the pluggable database (did not drop database files), and move the datafiles files,
Are you saying that you copied the failed PDB datafiles over the non-CDB's datafiles? If so, you have destroyed the non-CDB.
Re: Datafile cannot be open by either non cdb or cdb instance [message #681118 is a reply to message #681117] Wed, 17 June 2020 02:45 Go to previous messageGo to next message
juniordbanewbie
Messages: 250
Registered: April 2014
Senior Member
Dear John,

I think I'm a bit misleading,

what I means is after dropping pluggable database (does not include datafiles),

I have copied the original non cdb data files to the non CDB instance. the non CDB instance cannot be opened at all since all the datafiles are moved to the cdb instance. non cdb instance can at most mount.

it's quite clear to me that restore is required, but that might be issues here.

I restore old server 11.2.0.4 rman backup to new server 19.0.0 and open the database with alter database resetlogs upgrade.

I still have the 11.2.0.4 rman backup
I still have the 19.0.0 archivelog in the non cdb instance,

Issue is are they enough to restore the datafiles to the state just before they are being moved to cdb?
Re: Datafile cannot be open by either non cdb or cdb instance [message #681119 is a reply to message #681118] Wed, 17 June 2020 04:09 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
I think you are asking if you can upgrade by applying the archive logfiles generated in your first attempt? I wouldn't think so, but no harm in trying. However, I don't see why it would be quicker than doing the upgrade again.
Re: Datafile cannot be open by either non cdb or cdb instance [message #681120 is a reply to message #681119] Wed, 17 June 2020 04:16 Go to previous message
juniordbanewbie
Messages: 250
Registered: April 2014
Senior Member
Dear John,

I did not think of upgrading by applying the archivelog until you mentioned it, I more concern about restoring up the the point before unplugging the non cdb, but it most likely case, I can only restore up to before the upgrade.

It's probably too optimistic to think that I can recover up to the point of just before the datafiles are being moved.

It brings me to a point, the need to backup the database after the upgrade, otherwise every thing will be lost.

many thanks
Previous Topic: How to determine the size of backup increased in last one month
Next Topic: DBA practice on cloud
Goto Forum:
  


Current Time: Thu Mar 28 11:32:07 CDT 2024