Error ORA-14404: partitioned table contains partitions in a different tablespace During Duplicate Database With Tablespace Parameter

Last week I got an issue trying to duplicate a database with only READ WRITE tablespaces for a specific table that had many partitions, some of them READ ONLY and others, those I wanted, READ WRITE. The goal for this operation is save time in a disaster event.

Unfortunately, using SKIP READONLY command parameter was not working as expected, so, I tried to use TABLESPACE parameter and put tablespace by tablespace, but, in the same way, I received the issue.

Let’s simulated this and explain what Oracle expect for this. First, the environment I am using for testing:

  • Oracle Linux 8.10 ARM
  • Oracle Database 19.19 ARM
  • Local filesystem without ASM
  • VMWare Fusion 26H1

I will skip the environment installations and focus only how to simulate the issue.

Let’s create on database, the tablespaces to store the partitions:

CREATE TABLESPACE ts_2024 DATAFILE '/oracle/oradata/ORCL19C/ts_2024_01.dbf' size 1M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED;
CREATE TABLESPACE ts_2025 DATAFILE '/oracle/oradata/ORCL19C/ts_2025_01.dbf' size 1M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED;
CREATE TABLESPACE ts_2026 DATAFILE '/oracle/oradata/ORCL19C/ts_2026_01.dbf' size 1M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED;
CREATE TABLESPACE ts_2027 DATAFILE '/oracle/oradata/ORCL19C/ts_2027_01.dbf' size 1M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED;

Now, create an oracle user for test and give the quotas and necessaries grants:

CREATE USER TESTE IDENTIFIED BY TESTE;
ALTER USER TESTE QUOTA UNLIMITED ON ts_2024;
ALTER USER TESTE QUOTA UNLIMITED ON ts_2025;
ALTER USER TESTE QUOTA UNLIMITED ON ts_2026;
ALTER USER TESTE QUOTA UNLIMITED ON ts_2027;
GRANT connect, resource to TESTE;

Let’s create the table, partitioning the table by date. After that, create a local index for partition:

CREATE TABLE TESTE.orders_range (
    order_id NUMBER,
    order_date DATE,
    customer_id NUMBER,
    total_amount NUMBER(10,2)
)
PARTITION BY RANGE (order_date) (
    PARTITION p_2024 VALUES LESS THAN (TO_DATE('2024-01-01', 'YYYY-MM-DD')) TABLESPACE ts_2024,
    PARTITION p_2025 VALUES LESS THAN (TO_DATE('2025-01-01', 'YYYY-MM-DD')) TABLESPACE ts_2025,
    PARTITION p_2026 VALUES LESS THAN (TO_DATE('2026-01-01', 'YYYY-MM-DD')) TABLESPACE ts_2026,
    PARTITION p_future VALUES LESS THAN (MAXVALUE) TABLESPACE ts_2027
);

CREATE INDEX TESTE.idx_orders_range_date ON TESTE.orders_range(order_date) LOCAL;

Now, we need insert some register in each partition:

INSERT INTO TESTE.orders_range VALUES (1,TO_DATE('2023-03-01', 'YYYY-MM-DD'),1001,10);
INSERT INTO TESTE.orders_range VALUES (2,TO_DATE('2024-04-01', 'YYYY-MM-DD'),1002,20);
INSERT INTO TESTE.orders_range VALUES (3,TO_DATE('2025-05-01', 'YYYY-MM-DD'),1003,30);
INSERT INTO TESTE.orders_range VALUES (4,TO_DATE('2026-06-01', 'YYYY-MM-DD'),1004,40);
COMMIT;

Verify the registers:

SQL> SELECT * FROM TESTE.orders_range;

  ORDER_ID ORDER_DAT CUSTOMER_ID TOTAL_AMOUNT
---------- --------- ----------- ------------
	 1 01-MAR-23	    1001	   10
	 2 01-APR-24	    1002	   20
	 3 01-MAY-25	    1003	   30
	 4 01-JUN-26	    1004	   40

SQL> 

Change tablespaces ts_2024 and ts_2025 to READ ONLY:

ALTER TABLESPACE ts_2024 READ ONLY;
ALTER TABLESPACE ts_2025 READ ONLY;

Now, let’s take a backup of this database, via RMAN. Make sure that CONFIGURE BACKUP OPTIMIZATION RMAN parameter is OFF. RMAN ignore READ ONLY tablespaces if this parameter its ON.

RMAN> backup incremental level 0 cumulative filesperset=1 section size 64G database plus archivelog filesperset=32;

Starting backup at 07-JUL-26
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=271 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=1 STAMP=1237979183
channel ORA_DISK_1: starting piece 1 at 07-JUL-26
channel ORA_DISK_1: finished piece 1 at 07-JUL-26
piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_annnn_TAG20260707T110623_o4t1yzfo_.bkp tag=TAG20260707T110623 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 07-JUL-26

Starting backup at 07-JUL-26
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oracle/oradata/ORCL19C/system01.dbf
channel ORA_DISK_1: starting piece 1 at 07-JUL-26
channel ORA_DISK_1: finished piece 1 at 07-JUL-26
piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t1z0kp_.bkp tag=TAG20260707T110624 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00003 name=/oracle/oradata/ORCL19C/sysaux01.dbf
channel ORA_DISK_1: starting piece 1 at 07-JUL-26
channel ORA_DISK_1: finished piece 1 at 07-JUL-26
piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t1zsn7_.bkp tag=TAG20260707T110624 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/oracle/oradata/ORCL19C/ts_2025_01.dbf
channel ORA_DISK_1: starting piece 1 at 07-JUL-26
channel ORA_DISK_1: finished piece 1 at 07-JUL-26
piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t208ps_.bkp tag=TAG20260707T110624 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=/oracle/oradata/ORCL19C/ts_2024_01.dbf
channel ORA_DISK_1: starting piece 1 at 07-JUL-26
channel ORA_DISK_1: finished piece 1 at 07-JUL-26
piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t209s1_.bkp tag=TAG20260707T110624 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00008 name=/oracle/oradata/ORCL19C/ts_2026_01.dbf
channel ORA_DISK_1: starting piece 1 at 07-JUL-26
channel ORA_DISK_1: finished piece 1 at 07-JUL-26
piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20bvo_.bkp tag=TAG20260707T110624 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/oracle/oradata/ORCL19C/ts_2027_01.dbf
channel ORA_DISK_1: starting piece 1 at 07-JUL-26
channel ORA_DISK_1: finished piece 1 at 07-JUL-26
piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20cxs_.bkp tag=TAG20260707T110624 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/oracle/oradata/ORCL19C/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 07-JUL-26
channel ORA_DISK_1: finished piece 1 at 07-JUL-26
piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20f14_.bkp tag=TAG20260707T110624 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=/oracle/oradata/ORCL19C/users01.dbf
channel ORA_DISK_1: starting piece 1 at 07-JUL-26
channel ORA_DISK_1: finished piece 1 at 07-JUL-26
piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20g3j_.bkp tag=TAG20260707T110624 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 07-JUL-26

Starting backup at 07-JUL-26
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=2 RECID=2 STAMP=1237979231
channel ORA_DISK_1: starting piece 1 at 07-JUL-26
channel ORA_DISK_1: finished piece 1 at 07-JUL-26
piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_annnn_TAG20260707T110711_o4t20h6s_.bkp tag=TAG20260707T110711 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 07-JUL-26

Starting Control File and SPFILE Autobackup at 07-JUL-26
piece handle=/oracle/fast_recovery_area/ORCL19C/autobackup/2026_07_07/o1_mf_s_1237979232_o4t20j9o_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 07-JUL-26

RMAN> 

Now, we need duplicate to a new database. As I said, I will not focus in create the environment, so, to create init parameter file, directories and whatever necessaries things, see my article “Duplicate Database Using Local Backup”.

First, lets try to duplicate, only the READ WRITE tablespaces:

RMAN> run {
    duplicate database to orcl19c2
    backup location '/oracle/fast_recovery_area/ORCL19C/' 
    tablespace ts_2026,ts_2027
    nofilenamecheck;
}2> 3> 4> 5> 6> 

Starting Duplicate Db at 07-JUL-26
searching for database ID
found backup of database ID 1716358874

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''ORCL19C'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name = 
 ''ORCL19C2'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  '/oracle/fast_recovery_area/ORCL19C/autobackup/2026_07_07/o1_mf_s_1237979232_o4t20j9o_.bkp';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''ORCL19C'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''ORCL19C2'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area    1778381816 bytes

Fixed Size                     8926200 bytes
Variable Size                419430400 bytes
Database Buffers            1342177280 bytes
Redo Buffers                   7847936 bytes

Starting restore at 07-JUL-26
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=2 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/oracle/oradata/ORCL19C2/controlfile/control01.ctl
output file name=/oracle/fast_recovery_area/ORCL19C2/controlfile/control02.ctl
Finished restore at 07-JUL-26

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=2 device type=DISK
Automatically adding tablespace SYSTEM
Automatically adding tablespace SYSAUX
Automatically adding tablespace UNDOTBS1
Not connected to TARGET or TARGET not open, cannot verify that subset of tablespaces is self-contained
Skipping tablespace USERS
Skipping tablespace TS_2025
Skipping tablespace TS_2024
Not connected to TARGET, cannot verify that set of tablespaces being duplicated does not have SYS objects

contents of Memory Script:
{
   set until scn  1165430;
   set newname for datafile  1 to 
 "/oracle/oradata/ORCL19C2/system01.dbf";
   set newname for datafile  3 to 
 "/oracle/oradata/ORCL19C2/sysaux01.dbf";
   set newname for datafile  4 to 
 "/oracle/oradata/ORCL19C2/undotbs01.dbf";
   set newname for datafile  8 to 
 "/oracle/oradata/ORCL19C2/ts_2026_01.dbf";
   set newname for datafile  9 to 
 "/oracle/oradata/ORCL19C2/ts_2027_01.dbf";
   restore
   clone database
   skip forever tablespace  "USERS",
 "TS_2025",
 "TS_2024"   ;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 07-JUL-26
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /oracle/oradata/ORCL19C2/system01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t1z0kp_.bkp
channel ORA_AUX_DISK_1: piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t1z0kp_.bkp tag=TAG20260707T110624
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /oracle/oradata/ORCL19C2/sysaux01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t1zsn7_.bkp
channel ORA_AUX_DISK_1: piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t1zsn7_.bkp tag=TAG20260707T110624
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /oracle/oradata/ORCL19C2/undotbs01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20f14_.bkp
channel ORA_AUX_DISK_1: piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20f14_.bkp tag=TAG20260707T110624
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00008 to /oracle/oradata/ORCL19C2/ts_2026_01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20bvo_.bkp
channel ORA_AUX_DISK_1: piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20bvo_.bkp tag=TAG20260707T110624
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00009 to /oracle/oradata/ORCL19C2/ts_2027_01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20cxs_.bkp
channel ORA_AUX_DISK_1: piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20cxs_.bkp tag=TAG20260707T110624
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 07-JUL-26

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=6 STAMP=1237980203 file name=/oracle/oradata/ORCL19C2/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=7 STAMP=1237980203 file name=/oracle/oradata/ORCL19C2/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=8 STAMP=1237980203 file name=/oracle/oradata/ORCL19C2/undotbs01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=9 STAMP=1237980203 file name=/oracle/oradata/ORCL19C2/ts_2026_01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=10 STAMP=1237980203 file name=/oracle/oradata/ORCL19C2/ts_2027_01.dbf

contents of Memory Script:
{
   set until scn  1165430;
   recover
   clone database
   skip forever tablespace  "USERS",
 "TS_2025",
 "TS_2024"    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 07-JUL-26
using channel ORA_AUX_DISK_1

Executing: alter database datafile 2, 5, 7 offline drop
starting media recovery

archived log for thread 1 with sequence 2 is already on disk as file /oracle/fast_recovery_area/ORCL19C/archivelog/2026_07_07/o1_mf_1_2_o4t20h4t_.arc
archived log file name=/oracle/fast_recovery_area/ORCL19C/archivelog/2026_07_07/o1_mf_1_2_o4t20h4t_.arc thread=1 sequence=2
media recovery complete, elapsed time: 00:00:00
Finished recover at 07-JUL-26
Oracle instance started

Total System Global Area    1778381816 bytes

Fixed Size                     8926200 bytes
Variable Size                419430400 bytes
Database Buffers            1342177280 bytes
Redo Buffers                   7847936 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''ORCL19C2'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
}
executing Memory Script

sql statement: alter system set  db_name =  ''ORCL19C2'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile
Oracle instance started

Total System Global Area    1778381816 bytes

Fixed Size                     8926200 bytes
Variable Size                419430400 bytes
Database Buffers            1342177280 bytes
Redo Buffers                   7847936 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORCL19C2" RESETLOGS ARCHIVELOG 
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP     1 ( '/oracle/oradata/ORCL19C2/redo01.log' ) SIZE 200 M  REUSE,
  GROUP     2 ( '/oracle/oradata/ORCL19C2/redo02.log' ) SIZE 200 M  REUSE,
  GROUP     3 ( '/oracle/oradata/ORCL19C2/redo03.log' ) SIZE 200 M  REUSE
 DATAFILE
  '/oracle/oradata/ORCL19C2/system01.dbf'
 CHARACTER SET AL32UTF8


contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/oracle/oradata/ORCL19C2/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/oracle/oradata/ORCL19C2/sysaux01.dbf", 
 "/oracle/oradata/ORCL19C2/undotbs01.dbf", 
 "/oracle/oradata/ORCL19C2/ts_2026_01.dbf", 
 "/oracle/oradata/ORCL19C2/ts_2027_01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /oracle/oradata/ORCL19C2/temp01.dbf in control file

cataloged datafile copy
datafile copy file name=/oracle/oradata/ORCL19C2/sysaux01.dbf RECID=1 STAMP=1237980231
cataloged datafile copy
datafile copy file name=/oracle/oradata/ORCL19C2/undotbs01.dbf RECID=2 STAMP=1237980231
cataloged datafile copy
datafile copy file name=/oracle/oradata/ORCL19C2/ts_2026_01.dbf RECID=3 STAMP=1237980231
cataloged datafile copy
datafile copy file name=/oracle/oradata/ORCL19C2/ts_2027_01.dbf RECID=4 STAMP=1237980231

datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=1237980231 file name=/oracle/oradata/ORCL19C2/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=1237980231 file name=/oracle/oradata/ORCL19C2/undotbs01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=3 STAMP=1237980231 file name=/oracle/oradata/ORCL19C2/ts_2026_01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=4 STAMP=1237980231 file name=/oracle/oradata/ORCL19C2/ts_2027_01.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Dropping offline and skipped tablespaces
Executing: alter database default tablespace system
Executing: drop tablespace "USERS" including contents cascade constraints
Executing: drop tablespace "TS_2025" including contents cascade constraints
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 07/07/2026 11:24:03
RMAN-05501: aborting duplication of target database
RMAN-06136: Oracle error from auxiliary database: ORA-14404: partitioned table contains partitions in a different tablespace

Why does this happen? Oracle doesn’t receive all the necessary tablespaces to create the object. If any tablespace is missing, the table’s metadata and data will be broken.

So, to fix it, we need to put all tablespaces belonging the table as we can see below:

RMAN> run {
    duplicate database to orcl19c2
    backup location '/oracle/fast_recovery_area/ORCL19C/' 
    tablespace ts_2024,ts_2025,ts_2026,ts_2027
    nofilenamecheck;
}2> 3> 4> 5> 6> 

Starting Duplicate Db at 07-JUL-26
searching for database ID
found backup of database ID 1716358874

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''ORCL19C'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name = 
 ''ORCL19C2'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  '/oracle/fast_recovery_area/ORCL19C/autobackup/2026_07_07/o1_mf_s_1237979232_o4t20j9o_.bkp';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''ORCL19C'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''ORCL19C2'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area    1778381816 bytes

Fixed Size                     8926200 bytes
Variable Size                419430400 bytes
Database Buffers            1342177280 bytes
Redo Buffers                   7847936 bytes

Starting restore at 07-JUL-26
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=2 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/oracle/oradata/ORCL19C2/controlfile/control01.ctl
output file name=/oracle/fast_recovery_area/ORCL19C2/controlfile/control02.ctl
Finished restore at 07-JUL-26

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=2 device type=DISK
Automatically adding tablespace SYSTEM
Automatically adding tablespace SYSAUX
Automatically adding tablespace UNDOTBS1
Not connected to TARGET or TARGET not open, cannot verify that subset of tablespaces is self-contained
Skipping tablespace USERS
Not connected to TARGET, cannot verify that set of tablespaces being duplicated does not have SYS objects

contents of Memory Script:
{
   set until scn  1165430;
   set newname for datafile  1 to 
 "/oracle/oradata/ORCL19C2/system01.dbf";
   set newname for datafile  2 to 
 "/oracle/oradata/ORCL19C2/ts_2025_01.dbf";
   set newname for datafile  3 to 
 "/oracle/oradata/ORCL19C2/sysaux01.dbf";
   set newname for datafile  4 to 
 "/oracle/oradata/ORCL19C2/undotbs01.dbf";
   set newname for datafile  5 to 
 "/oracle/oradata/ORCL19C2/ts_2024_01.dbf";
   set newname for datafile  8 to 
 "/oracle/oradata/ORCL19C2/ts_2026_01.dbf";
   set newname for datafile  9 to 
 "/oracle/oradata/ORCL19C2/ts_2027_01.dbf";
   restore
   clone database
   skip forever tablespace  "USERS"   ;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 07-JUL-26
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /oracle/oradata/ORCL19C2/system01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t1z0kp_.bkp
channel ORA_AUX_DISK_1: piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t1z0kp_.bkp tag=TAG20260707T110624
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00002 to /oracle/oradata/ORCL19C2/ts_2025_01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t208ps_.bkp
channel ORA_AUX_DISK_1: piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t208ps_.bkp tag=TAG20260707T110624
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /oracle/oradata/ORCL19C2/sysaux01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t1zsn7_.bkp
channel ORA_AUX_DISK_1: piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t1zsn7_.bkp tag=TAG20260707T110624
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /oracle/oradata/ORCL19C2/undotbs01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20f14_.bkp
channel ORA_AUX_DISK_1: piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20f14_.bkp tag=TAG20260707T110624
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /oracle/oradata/ORCL19C2/ts_2024_01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t209s1_.bkp
channel ORA_AUX_DISK_1: piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t209s1_.bkp tag=TAG20260707T110624
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00008 to /oracle/oradata/ORCL19C2/ts_2026_01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20bvo_.bkp
channel ORA_AUX_DISK_1: piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20bvo_.bkp tag=TAG20260707T110624
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00009 to /oracle/oradata/ORCL19C2/ts_2027_01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20cxs_.bkp
channel ORA_AUX_DISK_1: piece handle=/oracle/fast_recovery_area/ORCL19C/backupset/2026_07_07/o1_mf_nnnd0_TAG20260707T110624_o4t20cxs_.bkp tag=TAG20260707T110624
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 07-JUL-26

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=8 STAMP=1237980440 file name=/oracle/oradata/ORCL19C2/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=9 STAMP=1237980440 file name=/oracle/oradata/ORCL19C2/ts_2025_01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=1237980440 file name=/oracle/oradata/ORCL19C2/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=11 STAMP=1237980440 file name=/oracle/oradata/ORCL19C2/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=12 STAMP=1237980440 file name=/oracle/oradata/ORCL19C2/ts_2024_01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=13 STAMP=1237980440 file name=/oracle/oradata/ORCL19C2/ts_2026_01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=14 STAMP=1237980440 file name=/oracle/oradata/ORCL19C2/ts_2027_01.dbf

contents of Memory Script:
{
   set until scn  1165430;
   recover
   clone database
   skip forever tablespace  "USERS"    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 07-JUL-26
using channel ORA_AUX_DISK_1
datafile 2 not processed because file is read-only
datafile 5 not processed because file is read-only

Executing: alter database datafile 7 offline drop
starting media recovery

archived log for thread 1 with sequence 2 is already on disk as file /oracle/fast_recovery_area/ORCL19C/archivelog/2026_07_07/o1_mf_1_2_o4t20h4t_.arc
archived log file name=/oracle/fast_recovery_area/ORCL19C/archivelog/2026_07_07/o1_mf_1_2_o4t20h4t_.arc thread=1 sequence=2
media recovery complete, elapsed time: 00:00:00
Finished recover at 07-JUL-26
Oracle instance started

Total System Global Area    1778381816 bytes

Fixed Size                     8926200 bytes
Variable Size                419430400 bytes
Database Buffers            1342177280 bytes
Redo Buffers                   7847936 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''ORCL19C2'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
}
executing Memory Script

sql statement: alter system set  db_name =  ''ORCL19C2'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile
Oracle instance started

Total System Global Area    1778381816 bytes

Fixed Size                     8926200 bytes
Variable Size                419430400 bytes
Database Buffers            1342177280 bytes
Redo Buffers                   7847936 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORCL19C2" RESETLOGS ARCHIVELOG 
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP     1 ( '/oracle/oradata/ORCL19C2/redo01.log' ) SIZE 200 M  REUSE,
  GROUP     2 ( '/oracle/oradata/ORCL19C2/redo02.log' ) SIZE 200 M  REUSE,
  GROUP     3 ( '/oracle/oradata/ORCL19C2/redo03.log' ) SIZE 200 M  REUSE
 DATAFILE
  '/oracle/oradata/ORCL19C2/system01.dbf'
 CHARACTER SET AL32UTF8


contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/oracle/oradata/ORCL19C2/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/oracle/oradata/ORCL19C2/sysaux01.dbf", 
 "/oracle/oradata/ORCL19C2/undotbs01.dbf", 
 "/oracle/oradata/ORCL19C2/ts_2026_01.dbf", 
 "/oracle/oradata/ORCL19C2/ts_2027_01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /oracle/oradata/ORCL19C2/temp01.dbf in control file

cataloged datafile copy
datafile copy file name=/oracle/oradata/ORCL19C2/sysaux01.dbf RECID=1 STAMP=1237980468
cataloged datafile copy
datafile copy file name=/oracle/oradata/ORCL19C2/undotbs01.dbf RECID=2 STAMP=1237980468
cataloged datafile copy
datafile copy file name=/oracle/oradata/ORCL19C2/ts_2026_01.dbf RECID=3 STAMP=1237980468
cataloged datafile copy
datafile copy file name=/oracle/oradata/ORCL19C2/ts_2027_01.dbf RECID=4 STAMP=1237980468

datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=1237980468 file name=/oracle/oradata/ORCL19C2/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=1237980468 file name=/oracle/oradata/ORCL19C2/undotbs01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=3 STAMP=1237980468 file name=/oracle/oradata/ORCL19C2/ts_2026_01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=4 STAMP=1237980468 file name=/oracle/oradata/ORCL19C2/ts_2027_01.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened

contents of Memory Script:
{
   catalog clone datafilecopy  "/oracle/oradata/ORCL19C2/ts_2025_01.dbf", 
 "/oracle/oradata/ORCL19C2/ts_2024_01.dbf";
   switch clone datafile  2 to datafilecopy 
 "/oracle/oradata/ORCL19C2/ts_2025_01.dbf";
   switch clone datafile  5 to datafilecopy 
 "/oracle/oradata/ORCL19C2/ts_2024_01.dbf";
   #online the readonly tablespace
   sql clone "alter tablespace  TS_2025 online";
   #online the readonly tablespace
   sql clone "alter tablespace  TS_2024 online";
}
executing Memory Script

cataloged datafile copy
datafile copy file name=/oracle/oradata/ORCL19C2/ts_2025_01.dbf RECID=5 STAMP=1237980474
cataloged datafile copy
datafile copy file name=/oracle/oradata/ORCL19C2/ts_2024_01.dbf RECID=6 STAMP=1237980474

datafile 2 switched to datafile copy
input datafile copy RECID=5 STAMP=1237980474 file name=/oracle/oradata/ORCL19C2/ts_2025_01.dbf

datafile 5 switched to datafile copy
input datafile copy RECID=6 STAMP=1237980474 file name=/oracle/oradata/ORCL19C2/ts_2024_01.dbf

sql statement: alter tablespace  TS_2025 online

sql statement: alter tablespace  TS_2024 online
Dropping offline and skipped tablespaces
Executing: alter database default tablespace system
Executing: drop tablespace "USERS" including contents cascade constraints
Finished Duplicate Db at 07-JUL-26

RMAN>

Deixe um comentário