I am trying to remove a PDB in Oracle 19.3 that is no longer needed. I get the following error:
SQL> alter pluggable database DEV_PDB close immediate instances=all;
Pluggable database altered.
SQL> alter pluggable database DEV_PDB unplug into '/tmp/DEV_PDB.xml';
alter pluggable database DEV_PDB unplug into '/tmp/DEV_PDB.xml' *
ERROR at line 1: ORA-17500: ODM err:Invalid argument
ORA-01114: IO error writing block to file 5590 (block # 1)
ORA-17500: ODM err:Invalid argument
ORA-01114: IO error writing block to file 5589 (block # 1)
ORA-17500: ODM err:Invalid argument
ORA-01114: IO error writing block to file 5588 (block # 1)
ORA-17500: ODM err:Invalid argument
ORA-01114: IO error writing block to file 5587 (block # 1)
ORA-17500: ODM err:Invalid argument
ORA-01114: IO error writing block to file 5586 (block # 1)
ORA-17500: ODM err:Invalid argument
ORA-01114: IO error writing block to file 5585 (block # 1)
ORA-17500: ODM err:Invalid argument
ORA-01114: IO error writing block to file 5584 (block # 1)
ORA-17500: ODM err:Invalid argument
ORA-01114: IO error writing block to file 5583 (block # 1)
ORA-17500: ODM err:Invalid argument ORA-01114: IO error writing block to file 5582 (block # 1)
ORA-17500: ODM err:Invalid argument
ORA-01114: IO error writing block to file 5581 (block # 1)
ORA-17500: ODM err:Invalid argument
ORA-01114: IO error writing block to file 5580 (block # 1)
ORA-17500: ODM err:Invalid argument
ORA-01114: IO error writing block to file 5579 (block # 1)
ORA-17500: ODM err:Invalid argument
ORA-01114: IO error writing block to file 5578 (block # 1)
ORA-17500: ODM err:Invalid argument
ORA-01114: IO error writing block to file 5577 (block # 1)
ORA-17500: ODM err:Invalid argument
ORA-01114: IO error writing block to file 5576 (block # 1)
ORA-17500: ODM err:Invalid argument
ORA-17528: A read-only file or a file opened read-only cannot be written to:
/u01/app/oracle/oradata/DEV_PDB/data04/users01.dbf.
Hmm…interesting. I did not have this problem when I did the same process in Oracle 12.1.0.2 (I skipped 12.2 and 18).
Thanks to MOS Note 2419236.1 and some of my own work (the Note doesn’t exactly match my problem), I was able to resolve the issue. The problem is that this PDB was once the basis for cloned PDB’s in my environment. We create a PDB in our Multitenant environment and the clone it to create multiple dev and test databases for our IT staff. I learned that in Oracle 12.2 and higher, Oracle will change the file permissions at the OS level for any clone source PDB. The file permissions are set to read only. When I try to unplug the PDB, it needs to write info to the datafile headers and we get the above errors.
The workaround is to simply change the file permissions of the datafiles to 640 and try the unplug operation again. The workaround in Note 2419236.1 requires downtime but my workaround does not.