Oracle19c多租户+Linux7.9环境两个pdb,分别是pdb1和pdb2

有RMAN全库备份。
问题:以多租户pdb2为例:
1.pdb2的文件被rm了
2.pdb2被drop了
以上两种情况该如何恢复?请思考后再继续。。。。。。
以下为详细测试记录参考:
备份
[oracle@oracle ~]$ date
Tue Aug 19 08:48:29 CST 2025
[oracle@oracle ~]$
[oracle@oracle ~]$ rman target /
Recovery Manager: Release 19.0.0.0.0 - Production on Tue Aug 19 08:48:35 2025
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2507622857)
RMAN> backup database;
Starting backup at 19-AUG-25
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1944 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/data/u01/app/oracle/oradata/TEST/system01.dbf
input datafile file number=00003 name=/data/u01/app/oracle/oradata/TEST/sysaux01.dbf
input datafile file number=00004 name=/data/u01/app/oracle/oradata/TEST/undotbs01.dbf
input datafile file number=00007 name=/data/u01/app/oracle/oradata/TEST/users01.dbf
channel ORA_DISK_1: starting piece 1 at 19-AUG-25
channel ORA_DISK_1: finished piece 1 at 19-AUG-25
piece handle=/data/u01/app/oracle/flash_recovery_area/TEST/backupset/2025_08_19/o1_mf_nnndf_TAG20250819T084844_nb7lhdo7_.bkp tag=TAG20250819T084844 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00014 name=/data/u01/app/oracle/oradata/TEST/pdb1/data_D-TEST_I-2507622857_TS-SYSAUX_FNO-10_5941ek5b
input datafile file number=00013 name=/data/u01/app/oracle/oradata/TEST/pdb1/data_D-TEST_I-2507622857_TS-SYSTEM_FNO-9_ke41ek5b
input datafile file number=00015 name=/data/u01/app/oracle/oradata/TEST/pdb1/data_D-TEST_I-2507622857_TS-UNDOTBS1_FNO-11_u741ek5b
input datafile file number=00016 name=/data/u01/app/oracle/oradata/TEST/pdb1/data_D-TEST_I-2507622857_TS-USERS_FNO-12_3d41ek5b
channel ORA_DISK_1: starting piece 1 at 19-AUG-25
channel ORA_DISK_1: finished piece 1 at 19-AUG-25
piece handle=/data/u01/app/oracle/flash_recovery_area/TEST/3C9E646212A8515CE06310CFA8C02A72/backupset/2025_08_19/o1_mf_nnndf_TAG20250819T084844_nb7lhmvo_.bkp tag=TAG20250819T084844 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00018 name=/data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-SYSAUX_FNO-10_5941ek5b
input datafile file number=00017 name=/data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-SYSTEM_FNO-9_ke41ek5b
input datafile file number=00019 name=/data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-UNDOTBS1_FNO-11_u741ek5b
input datafile file number=00020 name=/data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-USERS_FNO-12_3d41ek5b
channel ORA_DISK_1: starting piece 1 at 19-AUG-25
channel ORA_DISK_1: finished piece 1 at 19-AUG-25
piece handle=/data/u01/app/oracle/flash_recovery_area/TEST/3CAE2E51F4134CBFE06310CFA8C05FE6/backupset/2025_08_19/o1_mf_nnndf_TAG20250819T084844_nb7lhq39_.bkp tag=TAG20250819T084844 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/data/u01/app/oracle/oradata/TEST/pdbseed/sysaux01.dbf
input datafile file number=00005 name=/data/u01/app/oracle/oradata/TEST/pdbseed/system01.dbf
input datafile file number=00008 name=/data/u01/app/oracle/oradata/TEST/pdbseed/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 19-AUG-25
channel ORA_DISK_1: finished piece 1 at 19-AUG-25
piece handle=/data/u01/app/oracle/flash_recovery_area/TEST/3C9E3B9465A44852E06310CFA8C0E771/backupset/2025_08_19/o1_mf_nnndf_TAG20250819T084844_nb7lht93_.bkp tag=TAG20250819T084844 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 19-AUG-25
Starting Control File and SPFILE Autobackup at 19-AUG-25
piece handle=/data/u01/app/oracle/flash_recovery_area/TEST/autobackup/2025_08_19/o1_mf_s_1209545341_nb7lhxg8_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 19-AUG-25
RMAN> exit
Recovery Manager complete.
pdb2的所有文件被rm了
[oracle@oracle ~]$
[oracle@oracle ~]$
[oracle@oracle ~]$ export ORACLE_SID=test
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 19 09:04:32 2025
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
4 PDB2 READ WRITE NO
SQL> alter session set container=pdb2;
Session altered.
SQL> select * from jyc.test;
ID
----------
1
SQL> alter session set container=pdb1;
Session altered.
SQL> select * from jyc.test;
ID
----------
1
3
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
date
[oracle@oracle ~]$ date
Tue Aug 19 09:05:14 CST 2025
[oracle@oracle ~]$
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 19 09:05:19 2025
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> set time on
09:05:49 SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/data/u01/app/oracle/oradata/TEST/system01.dbf
/data/u01/app/oracle/oradata/TEST/sysaux01.dbf
/data/u01/app/oracle/oradata/TEST/undotbs01.dbf
/data/u01/app/oracle/oradata/TEST/pdbseed/system01.dbf
/data/u01/app/oracle/oradata/TEST/pdbseed/sysaux01.dbf
/data/u01/app/oracle/oradata/TEST/users01.dbf
/data/u01/app/oracle/oradata/TEST/pdbseed/undotbs01.dbf
/data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-SYSTEM_FNO-9_
ke41ek5b
/data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-SYSAUX_FNO-10
NAME
--------------------------------------------------------------------------------
_5941ek5b
/data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-UNDOTBS1_FNO-
11_u741ek5b
/data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-USERS_FNO-12_
3d41ek5b
/data/u01/app/oracle/oradata/TEST/pdb1/data_D-TEST_I-2507622857_TS-SYSTEM_FNO-9_
ke41ek5b
NAME
--------------------------------------------------------------------------------
/data/u01/app/oracle/oradata/TEST/pdb1/data_D-TEST_I-2507622857_TS-SYSAUX_FNO-10
_5941ek5b
/data/u01/app/oracle/oradata/TEST/pdb1/data_D-TEST_I-2507622857_TS-UNDOTBS1_FNO-
11_u741ek5b
/data/u01/app/oracle/oradata/TEST/pdb1/data_D-TEST_I-2507622857_TS-USERS_FNO-12_
3d41ek5b
15 rows selected.
09:06:24 SQL> !rm /data/u01/app/oracle/oradata/TEST/pdb2/*
09:06:56 SQL> !ls /data/u01/app/oracle/oradata/TEST/pdb2/*
ls: cannot access /data/u01/app/oracle/oradata/TEST/pdb2/*: No such file or directory
09:07:06 SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
4 PDB2 READ WRITE NO
09:07:15 SQL> alter session container=pdb2;
alter session container=pdb2
*
ERROR at line 1:
ORA-00922: missing or invalid option
09:07:28 SQL> alter session set container=pdb2;
Session altered.
09:07:37 SQL> select * from jyc.test;
ID
----------
1
09:07:59 SQL> insert into jyc.test values(2);
insert into jyc.test values(2)
*
ERROR at line 1:
ORA-01116: error in opening database file 20
ORA-01110: data file 20:
'/data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-USERS_FNO-12
_3d41ek5b'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
09:08:26 SQL> alter pluggable database close immediate;
Pluggable database altered.
09:08:39 SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
4 PDB2 MOUNTED
09:08:42 SQL> alter pluggable database open;
alter pluggable database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 20 - see DBWR trace file
ORA-01110: data file 20:
'/data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-USERS_FNO-12
_3d41ek5b'
09:08:58 SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
4 PDB2 MOUNTED
09:09:05 SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
恢复被rm的pdb2
[oracle@oracle ~]$ rman target /
Recovery Manager: Release 19.0.0.0.0 - Production on Tue Aug 19 09:09:12 2025
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2507622857)
RMAN> restore pluggable database pdb2;
Starting restore at 19-AUG-25
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1703 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00017 to /data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-SYSTEM_FNO-9_ke41ek5b
channel ORA_DISK_1: restoring datafile 00018 to /data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-SYSAUX_FNO-10_5941ek5b
channel ORA_DISK_1: restoring datafile 00019 to /data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-UNDOTBS1_FNO-11_u741ek5b
channel ORA_DISK_1: restoring datafile 00020 to /data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-USERS_FNO-12_3d41ek5b
channel ORA_DISK_1: reading from backup piece /data/u01/app/oracle/flash_recovery_area/TEST/3CAE2E51F4134CBFE06310CFA8C05FE6/backupset/2025_08_19/o1_mf_nnndf_TAG20250819T084844_nb7lhq39_.bkp
channel ORA_DISK_1: piece handle=/data/u01/app/oracle/flash_recovery_area/TEST/3CAE2E51F4134CBFE06310CFA8C05FE6/backupset/2025_08_19/o1_mf_nnndf_TAG20250819T084844_nb7lhq39_.bkp tag=TAG20250819T084844
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 19-AUG-25
RMAN> recover pluggable database pdb2;
Starting recover at 19-AUG-25
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 19-AUG-25
RMAN> exit
Recovery Manager complete.
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 19 09:09:49 2025
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
4 PDB2 MOUNTED
SQL> alter pluggable database pdb2 open;
Pluggable database altered.
SQL> select * from jyc.test;
select * from jyc.test
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> alter session set container=pdb2;
Session altered.
SQL> select * from jyc.test;
ID
----------
1
SQL> insert into jyc.test values(2);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from jyc.test;
ID
----------
2
1
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
pdb2被drop了
[oracle@oracle ~]$
[oracle@oracle ~]$ date
Tue Aug 19 09:10:46 CST 2025
[oracle@oracle ~]$
[oracle@oracle ~]$
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 19 09:10:51 2025
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> drop pluggable database pdb2 including datafiles;
drop pluggable database pdb2 including datafiles
*
ERROR at line 1:
ORA-65025: Pluggable database PDB2 is not closed on all instances.
SQL> alter pluggable database pdb2 close immediate;
Pluggable database altered.
SQL> drop pluggable database pdb2 including datafiles;
Pluggable database dropped.
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
恢复被drop的pdb2
[oracle@oracle ~]$
[oracle@oracle ~]$ rman target /
Recovery Manager: Release 19.0.0.0.0 - Production on Tue Aug 19 09:12:05 2025
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2507622857)
RMAN> restore pluggable database pdb2;
Starting restore at 19-AUG-25
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1944 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 08/19/2025 09:12:17
RMAN-06813: could not translate pluggable database PDB2
RMAN>
----注意此处restore是失败报错的:RMAN-06813: could not translate pluggable database PDB2
RMAN>
RMAN>
RMAN>
RMAN>
RMAN>
----正确的恢复方式如下:
RMAN> recover pluggable database pdb2 until time "to_date('2025-08-19 09:10:51','YYYY-MM-DD HH24:MI:SS')" auxiliary destination '/home/oracle/aux/';
Starting recover at 19-AUG-25
current log archived
using channel ORA_DISK_1
RMAN-05026: warning: presuming following set of tablespaces applies to specified point-in-time
List of tablespaces expected to have UNDO segments
Tablespace SYSTEM
Tablespace UNDOTBS1
Creating automatic instance, with SID='Fmnp'
initialization parameters used for automatic instance:
db_name=TEST
db_unique_name=Fmnp_pitr_pdb2_TEST
compatible=19.0.0
db_block_size=8192
db_files=200
diagnostic_dest=/data/u01/app/oracle
_system_trig_enabled=FALSE
sga_target=6560M
processes=200
db_create_file_dest=/home/oracle/aux/
log_archive_dest_1='location=/home/oracle/aux/'
enable_pluggable_database=true
_clone_one_pdb_recovery=true
#No auxiliary parameter file used
starting up automatic instance TEST
Oracle instance started
Total System Global Area 6878658336 bytes
Fixed Size 9150240 bytes
Variable Size 1207959552 bytes
Database Buffers 5653921792 bytes
Redo Buffers 7626752 bytes
Automatic instance created
contents of Memory Script:
{
# set requested point in time
set until time "to_date('2025-08-19 09:10:51','YYYY-MM-DD HH24:MI:SS')";
# restore the controlfile
restore clone controlfile;
# mount the controlfile
sql clone 'alter database mount clone database';
}
executing Memory Script
executing command: SET until clause
Starting restore at 19-AUG-25
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=198 device type=DISK
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /data/u01/app/oracle/flash_recovery_area/TEST/autobackup/2025_08_19/o1_mf_s_1209546147_nb7m93yh_.bkp
channel ORA_AUX_DISK_1: piece handle=/data/u01/app/oracle/flash_recovery_area/TEST/autobackup/2025_08_19/o1_mf_s_1209546147_nb7m93yh_.bkp tag=TAG20250819T090227
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/home/oracle/aux/TEST/controlfile/o1_mf_nb7mxbnh_.ctl
Finished restore at 19-AUG-25
sql statement: alter database mount clone database
contents of Memory Script:
{
# set requested point in time
set until time "to_date('2025-08-19 09:10:51','YYYY-MM-DD HH24:MI:SS')";
# set destinations for recovery set and auxiliary set datafiles
set newname for clone datafile 1 to new;
set newname for clone datafile 4 to new;
set newname for clone datafile 3 to new;
set newname for clone datafile 7 to new;
set newname for datafile 17 to
"/data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-SYSTEM_FNO-9_ke41ek5b";
set newname for datafile 18 to
"/data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-SYSAUX_FNO-10_5941ek5b";
set newname for datafile 19 to
"/data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-UNDOTBS1_FNO-11_u741ek5b";
set newname for datafile 20 to
"/data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-USERS_FNO-12_3d41ek5b";
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile 1, 4, 3, 7, 17, 18, 19, 20;
switch clone datafile all;
}
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
executing command: SET NEWNAME
Starting restore at 19-AUG-25
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 /home/oracle/aux/TEST/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /home/oracle/aux/TEST/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /home/oracle/aux/TEST/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00007 to /home/oracle/aux/TEST/datafile/o1_mf_users_%u_.dbf
channel ORA_AUX_DISK_1: reading from backup piece /data/u01/app/oracle/flash_recovery_area/TEST/backupset/2025_08_19/o1_mf_nnndf_TAG20250819T084844_nb7lhdo7_.bkp
channel ORA_AUX_DISK_1: piece handle=/data/u01/app/oracle/flash_recovery_area/TEST/backupset/2025_08_19/o1_mf_nnndf_TAG20250819T084844_nb7lhdo7_.bkp tag=TAG20250819T084844
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 00017 to /data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-SYSTEM_FNO-9_ke41ek5b
channel ORA_AUX_DISK_1: restoring datafile 00018 to /data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-SYSAUX_FNO-10_5941ek5b
channel ORA_AUX_DISK_1: restoring datafile 00019 to /data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-UNDOTBS1_FNO-11_u741ek5b
channel ORA_AUX_DISK_1: restoring datafile 00020 to /data/u01/app/oracle/oradata/TEST/pdb2/data_D-TEST_I-2507622857_TS-USERS_FNO-12_3d41ek5b
channel ORA_AUX_DISK_1: reading from backup piece /data/u01/app/oracle/flash_recovery_area/TEST/3CAE2E51F4134CBFE06310CFA8C05FE6/backupset/2025_08_19/o1_mf_nnndf_TAG20250819T084844_nb7lhq39_.bkp
channel ORA_AUX_DISK_1: piece handle=/data/u01/app/oracle/flash_recovery_area/TEST/3CAE2E51F4134CBFE06310CFA8C05FE6/backupset/2025_08_19/o1_mf_nnndf_TAG20250819T084844_nb7lhq39_.bkp tag=TAG20250819T084844
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 19-AUG-25
datafile 1 switched to datafile copy
input datafile copy RECID=8 STAMP=1209546811 file name=/home/oracle/aux/TEST/datafile/o1_mf_system_nb7mxjqs_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=9 STAMP=1209546811 file name=/home/oracle/aux/TEST/datafile/o1_mf_undotbs1_nb7mxjqx_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=1209546811 file name=/home/oracle/aux/TEST/datafile/o1_mf_sysaux_nb7mxjqv_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=11 STAMP=1209546811 file name=/home/oracle/aux/TEST/datafile/o1_mf_users_nb7mxjqz_.dbf
contents of Memory Script:
{
# set requested point in time
set until time "to_date('2025-08-19 09:10:51','YYYY-MM-DD HH24:MI:SS')";
# online the datafiles restored or switched
sql clone "alter database datafile 1 online";
sql clone "alter database datafile 4 online";
sql clone "alter database datafile 3 online";
sql clone "alter database datafile 7 online";
sql clone 'PDB2' "alter database datafile
17 online";
sql clone 'PDB2' "alter database datafile
18 online";
sql clone 'PDB2' "alter database datafile
19 online";
sql clone 'PDB2' "alter database datafile
20 online";
#recover pdb
recover clone database tablespace "SYSTEM", "UNDOTBS1", "SYSAUX", "USERS" pluggable database
'PDB2' delete archivelog;
#open in read write mode
sql clone 'alter database open resetlogs';
#unplug dropped pdb into temp file
sql clone "alter pluggable database PDB2 unplug into ''
/data/u01/app/oracle/product/19c/dbhome_1/dbs/_rm_pdb_pitr_2_Fmnp.xml''";
#create pdb using temp file of recovered pdb
sql "create pluggable database PDB2 using ''
/data/u01/app/oracle/product/19c/dbhome_1/dbs/_rm_pdb_pitr_2_Fmnp.xml'' nocopy tempfile reuse";
alter pluggable database PDB2 open;
}
executing Memory Script
executing command: SET until clause
sql statement: alter database datafile 1 online
sql statement: alter database datafile 4 online
sql statement: alter database datafile 3 online
sql statement: alter database datafile 7 online
sql statement: alter database datafile 17 online
sql statement: alter database datafile 18 online
sql statement: alter database datafile 19 online
sql statement: alter database datafile 20 online
Starting recover at 19-AUG-25
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 9 is already on disk as file /data/u01/app/oracle/flash_recovery_area/TEST/archivelog/2025_08_19/o1_mf_1_9_nb7lo6xk_.arc
archived log for thread 1 with sequence 10 is already on disk as file /data/u01/app/oracle/flash_recovery_area/TEST/archivelog/2025_08_19/o1_mf_1_10_nb7mwwqd_.arc
archived log file name=/data/u01/app/oracle/flash_recovery_area/TEST/archivelog/2025_08_19/o1_mf_1_9_nb7lo6xk_.arc thread=1 sequence=9
archived log file name=/data/u01/app/oracle/flash_recovery_area/TEST/archivelog/2025_08_19/o1_mf_1_10_nb7mwwqd_.arc thread=1 sequence=10
media recovery complete, elapsed time: 00:00:01
Finished recover at 19-AUG-25
sql statement: alter database open resetlogs
sql statement: alter pluggable database PDB2 unplug into ''/data/u01/app/oracle/product/19c/dbhome_1/dbs/_rm_pdb_pitr_2_Fmnp.xml''
sql statement: create pluggable database PDB2 using ''/data/u01/app/oracle/product/19c/dbhome_1/dbs/_rm_pdb_pitr_2_Fmnp.xml'' nocopy tempfile reuse
Statement processed
Removing automatic instance
shutting down automatic instance
Oracle instance shut down
Automatic instance removed
auxiliary instance file /data/u01/app/oracle/product/19c/dbhome_1/dbs/_rm_pdb_pitr_2_Fmnp.xml deleted
auxiliary instance file /home/oracle/aux/TEST/datafile/o1_mf_sysaux_nb7mxjqv_.dbf deleted
auxiliary instance file /home/oracle/aux/TEST/controlfile/o1_mf_nb7mxbnh_.ctl deleted
Finished recover at 19-AUG-25
RMAN> exit
Recovery Manager complete.
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 19 09:13:55 2025
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
5 PDB2 READ WRITE NO
SQL> alter session set container=pdb2;
Session altered.
SQL> select * from jyc.test;
ID
----------
2
1
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
d[oracle@oracle ~]$ date
Tue Aug 19 09:14:16 CST 2025
[oracle@oracle ~]$
结论:
1.pdb2的文件被rm了
处理办法:restore+recover
2.pdb2被drop掉了
处理办法:直接recover until time auxiliary destination
参考:
How to Recover - Dropped Pluggable database (PDB) (Doc ID 2983210.1)

继续思考:
如果没有全库备份,仅仅只有租户pdb2的备份,上述两种情况都还能恢复吗???
最后修改时间:2025-08-26 14:59:12
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




