oracle12c pdb不完全恢复报错,求大神指导

weixin_38142467 2019-02-11 10:44:24
在数据中建了一张表
然后备份
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 834666496 bytes
Fixed Size 8798264 bytes
Variable Size 595595208 bytes
Database Buffers 222298112 bytes
Redo Buffers 7974912 bytes
Database mounted.
SQL>

RMAN> backup database plus archivelog;

Starting backup at 11-FEB-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=260 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=5 RECID=2 STAMP=999933228
channel ORA_DISK_1: starting piece 1 at 11-FEB-19
channel ORA_DISK_1: finished piece 1 at 11-FEB-19
piece handle=/usr/local/oracle/fast_recovery_area/orcl/ORCL/backupset/2019_02_11/o1_mf_annnn_TAG20190211T100734_g61p76yt_.bkp tag=TAG20190211T100734 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 11-FEB-19

Starting backup at 11-FEB-19
using channel ORA_DISK_1
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=/usr/local/oracle/oradata/orcl/system01.dbf
input datafile file number=00003 name=/usr/local/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00004 name=/usr/local/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00007 name=/usr/local/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 11-FEB-19
channel ORA_DISK_1: finished piece 1 at 11-FEB-19
piece handle=/usr/local/oracle/fast_recovery_area/orcl/ORCL/backupset/2019_02_11/o1_mf_nnndf_TAG20190211T100738_g61p7bgo_.bkp tag=TAG20190211T100738 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00010 name=/usr/local/oracle/oradata/orcl/pdb_ser1/sysaux01.dbf
input datafile file number=00009 name=/usr/local/oracle/oradata/orcl/pdb_ser1/system01.dbf
input datafile file number=00011 name=/usr/local/oracle/oradata/orcl/pdb_ser1/undotbs01.dbf
input datafile file number=00012 name=/usr/local/oracle/oradata/orcl/pdb_ser1/users01.dbf
channel ORA_DISK_1: starting piece 1 at 11-FEB-19
channel ORA_DISK_1: finished piece 1 at 11-FEB-19
piece handle=/usr/local/oracle/fast_recovery_area/orcl/ORCL/810094A6C9B91D01E053701FA8C0878B/backupset/2019_02_11/o1_mf_nnndf_TAG20190211T100738_g61p8qwk_.bkp tag=TAG20190211T100738 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
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=/usr/local/oracle/oradata/orcl/pdbseed/sysaux01.dbf
input datafile file number=00005 name=/usr/local/oracle/oradata/orcl/pdbseed/system01.dbf
input datafile file number=00008 name=/usr/local/oracle/oradata/orcl/pdbseed/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 11-FEB-19
channel ORA_DISK_1: finished piece 1 at 11-FEB-19
piece handle=/usr/local/oracle/fast_recovery_area/orcl/ORCL/810067A29850141DE053701FA8C0DC18/backupset/2019_02_11/o1_mf_nnndf_TAG20190211T100738_g61p9kmj_.bkp tag=TAG20190211T100738 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 11-FEB-19

Starting backup at 11-FEB-19
using channel ORA_DISK_1
specification does not match any archived log in the repository
backup cancelled because there are no files to backup
Finished backup at 11-FEB-19

Starting Control File and SPFILE Autobackup at 11-FEB-19
piece handle=/usr/local/oracle/fast_recovery_area/orcl/ORCL/autobackup/2019_02_11/o1_mf_s_999943586_g61pbg8p_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 11-FEB-19

RMAN>

查询pdb数据库的SCN
SQL> alter session set container=pdb_ser1;
Session altered.

SQL> select dbms_flashback.get_system_change_number from dual;

GET_SYSTEM_CHANGE_NUMBER
------------------------
1888739

删除表
drop table user_test;

开始恢复
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 834666496 bytes
Fixed Size 8798264 bytes
Variable Size 595595208 bytes
Database Buffers 222298112 bytes
Redo Buffers 7974912 bytes
Database mounted.
SQL>

RMAN> run
2> {
3> set until SCN=1888739;
4> restore pluggable database pdb_ser1;
5> recover pluggable database pdb_ser1 auxiliary destination '/tmp';
6> alter database open resetlogs;
7> }

executing command: SET until clause

Starting restore at 11-FEB-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 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 00009 to /usr/local/oracle/oradata/orcl/pdb_ser1/system01.dbf
channel ORA_DISK_1: restoring datafile 00010 to /usr/local/oracle/oradata/orcl/pdb_ser1/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00011 to /usr/local/oracle/oradata/orcl/pdb_ser1/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00012 to /usr/local/oracle/oradata/orcl/pdb_ser1/users01.dbf
channel ORA_DISK_1: reading from backup piece /usr/local/oracle/fast_recovery_area/orcl/ORCL/810094A6C9B91D01E053701FA8C0878B/backupset/2019_02_11/o1_mf_nnndf_TAG20190211T100738_g61p8qwk_.bkp
channel ORA_DISK_1: piece handle=/usr/local/oracle/fast_recovery_area/orcl/ORCL/810094A6C9B91D01E053701FA8C0878B/backupset/2019_02_11/o1_mf_nnndf_TAG20190211T100738_g61p8qwk_.bkp tag=TAG20190211T100738
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 11-FEB-19

Starting recover at 11-FEB-19
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/11/2019 10:28:11
RMAN-06457: UNTIL SCN (1888739) is ahead of last SCN in archived logs (1867876)

RMAN>

操作哪里有问题啊,试了好多次都报错,还有报
Starting recover at 11-FEB-19
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/11/2019 08:08:24
RMAN-05141: target database must be opened for flashback PDB or PDB point-in-time recovery

这个百度了一圈都没有找到,数据库的FLASHBACK已经打开了
SQL> select log_mode,FLASHBACK_ON from v$database;

LOG_MODE FLASHBACK_ON
------------ ------------------
ARCHIVELOG YES

SQL>
...全文
371 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
从 SCN (1888739) is ahead of last SCN in archived logs (1867876) 这个报错看是 你第一个归档的scn号大于你的要恢复的scn。 不知道我的理解对不对

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧