How to recover a skipped tablespace after an incomplete recovery? (Doc ID 1561645.1)
How to recover a skipped tablespace after an incomplete recovery? (Doc ID 1561645.1)
APPLIES TO:
Oracle Database - Enterprise Edition - Version 11.2.0.1 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.
GOAL
How to recover a skipped tablespace after an incomplete recovery.
不完全恢复后如何恢复跳过的表空间
Skipped datafile is reported offline after resetlogs is done from Incomplete recovery.
从不完全恢复中完成 resetlogs 后,跳过的数据文件将报告为 offline 状态
SQL> select * from V$recover_file; FILE# ONLINE ONLINE_ ERROR CHANGE# TIME
---------- ------- ------- ----------------------------------------------------------------- ---------- --------------------
6 OFFLINE OFFLINE UNKNOWN ERROR 2386984 13-JUN-2013 22:52:39
This Document holds good if you have a Valid backup of the skipped tablespace.
如果您具有已跳过表空间的有效备份,则本文档非常有用
SOLUTION
For the purposes of this document, the following fictitious environment is used as an example to describe the procedure:
Database Name: PRODDB
Tablespace Name: PRODDATA
Directory Location: u01/app/oradb1
********
It is possible to restore and recover a skipped tablespace even when the database has been opened with resetlogs.
即使使用 resetlogs 打开了数据库,也可以 restore and recover 跳过的表空间。
As a best practice we always recommend testing the backups, restore and recovery scenario in your environment.
作为最佳实践,我们始终建议您在您的环境中测试备份,还原和恢复方案
In this note we will be skipping the tablespace PRODDATA
在本说明中,我们将跳过表空间PRODDATA
Database Structure and Backup 数据库结构与备份
Assume that we have the following tablespaces and a full backup is taken:
假设我们具有以下表空间,并已进行了完整备份
SQL> select tablespace_name, file_name, status from dba_data_files order by 1; TABLESPACE_NAME FILE_NAME STATUS
-------------------- ---------------------------------------------------------------------- ---------
EXAMPLE /u01/app/oradb1/oradata/PRODDB/datafile/o1_mf_example_8vg997t4_.dbf AVAILABLE
PRODDATA /u01/app/oradb1/oradata/PRODDB/datafile/o1_mf_proddata_8vg9jlk1_.dbf AVAILABLE
SYSAUX /u01/app/oradb1/oradata/PRODDB/datafile/o1_mf_sysaux_8vg997qs_.dbf AVAILABLE
SYSTEM /u01/app/oradb1/oradata/PRODDB/datafile/o1_mf_system_8vg997sd_.dbf AVAILABLE
UNDOTBS1 /u01/app/oradb1/oradata/PRODDB/datafile/o1_mf_undotbs1_8vg997wc_.dbf AVAILABLE
USERS /u01/app/oradb1/oradata/PRODDB/datafile/o1_mf_users_8vg997xp_.dbf AVAILABLE
USERS /u01/app/oradb1/oradata/PRODDB/datafile/o1_mf_users_8vg997vg_.dbf AVAILABLE 7 rows selected. $ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jun 13 22:43:27 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: PRODDB (DBID=552982679) RMAN> backup database plus archivelog;
... piece handle=/u01/app/oradb1/fast_recovery_area/PRODDB/backupset/2013_06_13/o1_mf_nnndf_TAG20130613T224932_8vmhywt8_.bkp tag=TAG20130613T224932 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
Finished backup at 13-JUN-13 Starting Control File and SPFILE Autobackup at 13-JUN-13
piece handle=/u01/app/oradb1/fast_recovery_area/PRODDB/autobackup/2013_06_13/o1_mf_s_818031037_8vmj0y3g_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 13-JUN-13
Incomplete Recovery with a skipped tablespace. 具有跳过的表空间的不完全恢复
Skip a tablespace during restore/recovery get the rest of the database online for use.
在 restore/recovery 期间跳过表空间,以使数据库的其余部分联机使用
$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jun 13 22:54:08 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: PRODDB (DBID=552982679, not open) RMAN> run {
set until sequence 10;
restore database skip tablespace proddata;
recover database skip tablespace proddata;
} executing command: SET until clause Starting restore at 13-JUN-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 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 00001 to /u01/app/oradb1/oradata/PRODDB/datafile/o1_mf_system_8vg997sd_.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oradb1/oradata/PRODDB/datafile/o1_mf_sysaux_8vg997qs_.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oradb1/oradata/PRODDB/datafile/o1_mf_undotbs1_8vg997wc_.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oradb1/oradata/PRODDB/datafile/o1_mf_users_8vg997xp_.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oradb1/oradata/PRODDB/datafile/o1_mf_example_8vg997t4_.dbf
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oradb1/oradata/PRODDB/datafile/o1_mf_users_8vg997vg_.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oradb1/fast_recovery_area/PRODDB/backupset/2013_06_13/o1_mf_nnndf_TAG20130613T222311_8vmgfhjm_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oradb1/fast_recovery_area/PRODDB/backupset/2013_06_13/o1_mf_nnndf_TAG20130613T222311_8vmgfhjm_.bkp tag=TAG20130613T222311
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:57
Finished restore at 13-JUN-13 Starting recover at 13-JUN-13
using channel ORA_DISK_1 Executing: alter database datafile 6 offline --->>> (This is the datafile for PRODDATA)
starting media recovery archived log for thread 1 with sequence 8 is already on disk as file /u01/app/oradb1/fast_recovery_area/PRODDB/archivelog/2013_06_13/o1_mf_1_8_8vmghjn4_.arc
archived log for thread 1 with sequence 9 is already on disk as file /u01/app/oradb1/fast_recovery_area/PRODDB/archivelog/2013_06_13/o1_mf_1_9_8vmhrdnv_.arc
archived log file name=/u01/app/oradb1/fast_recovery_area/PRODDB/archivelog/2013_06_13/o1_mf_1_8_8vmghjn4_.arc thread=1 sequence=8
archived log file name=/u01/app/oradb1/fast_recovery_area/PRODDB/archivelog/2013_06_13/o1_mf_1_9_8vmhrdnv_.arc thread=1 sequence=9
media recovery complete, elapsed time: 00:00:00
Finished recover at 13-JUN-13 SQL> alter database open resetlogs; Database altered. SQL> select file#, status from V$datafile; FILE# STATUS
---------- -------
1 SYSTEM
2 ONLINE
3 ONLINE
4 ONLINE
5 ONLINE
6 OFFLINE
7 ONLINE 7 rows selected. SQL> select * from V$recover_file; FILE# ONLINE ONLINE_ ERROR CHANGE# TIME
---------- ------- ------- ----------------------------------------------------------------- ---------- --------------------
6 OFFLINE OFFLINE UNKNOWN ERROR 2386984 13-JUN-2013 22:52:39
The skipped tablespace 'datafile' is offline and all the other 'datafiles' are online. 跳过的表空间 'datafile' 处于 offline 状态,而所有其他 'datafiles' 均处于online 状态
# V$tablespace shows the Tablespace 'PRODDATA' is still defined in dictionary and available
V$tablespace 显示表空间 'PRODDATA' 仍在字典中定义并且可用
SQL> select * from v$tablespace ;
Performing recovery of the skipped tablespace.执行已跳过表空间的恢复
As the database incarnation increments after resetlogs, to pick up the new/current database incarnation you will need to re-initiate the rman session as below:
随着 resetlogs 后数据库 incarnation 的增加,要获取 new/current 的数据库 incarnation,您将需要重新启动rman会话,如下所示
$ rman target / Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jun 13 23:03:24 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: PRODDB (DBID=552982679) RMAN> run {
restore tablespace proddata;
recover tablespace proddata;
} RMAN>
Starting restore at 13-JUN-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=17 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 00006 to /u01/app/oradb1/oradata/PRODDB/datafile/o1_mf_proddata_8vg9jlk1_.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oradb1/fast_recovery_area/PRODDB/backupset/2013_06_13/o1_mf_nnndf_TAG20130613T222311_8vmgfhjm_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oradb1/fast_recovery_area/PRODDB/backupset/2013_06_13/o1_mf_nnndf_TAG20130613T222311_8vmgfhjm_.bkp tag=TAG20130613T222311
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 13-JUN-13 RMAN>
Starting recover at 13-JUN-13
using channel ORA_DISK_1 starting media recovery archived log for thread 1 with sequence 8 is already on disk as file /u01/app/oradb1/fast_recovery_area/PRODDB/archivelog/2013_06_13/o1_mf_1_8_8vmghjn4_.arc
archived log for thread 1 with sequence 9 is already on disk as file /u01/app/oradb1/fast_recovery_area/PRODDB/archivelog/2013_06_13/o1_mf_1_9_8vmhrdnv_.arc
archived log for thread 1 with sequence 1 is already on disk as file /u01/app/oradb1/fast_recovery_area/PRODDB/archivelog/2013_06_13/o1_mf_1_1_8vmjofl8_.arc
archived log for thread 1 with sequence 2 is already on disk as file /u01/app/oradb1/fast_recovery_area/PRODDB/archivelog/2013_06_13/o1_mf_1_2_8vmjoh19_.arc
archived log file name=/u01/app/oradb1/fast_recovery_area/PRODDB/archivelog/2013_06_13/o1_mf_1_8_8vmghjn4_.arc thread=1 sequence=8
archived log file name=/u01/app/oradb1/fast_recovery_area/PRODDB/archivelog/2013_06_13/o1_mf_1_9_8vmhrdnv_.arc thread=1 sequence=9
media recovery complete, elapsed time: 00:00:00
Finished recover at 13-JUN-13 SQL> select * from V$recover_file; no rows selected SQL> select file#, status from V$datafile; FILE# STATUS
---------- -------
1 SYSTEM
2 ONLINE
3 ONLINE
4 ONLINE
5 ONLINE
6 OFFLINE
7 ONLINE 7 rows selected. SQL> alter tablespace proddata online; Tablespace altered. SQL> select file#, status from V$datafile; FILE# STATUS
---------- -------
1 SYSTEM
2 ONLINE
3 ONLINE
4 ONLINE
5 ONLINE
6 ONLINE
7 ONLINE 7 rows selected.
Incomplete recovery of all datafiles of the skipped tablespace is performed till the earlier specified "set until" and tablespace can be brought online for use.
对跳过的表空间的所有数据文件执行不完全恢复,直到先前指定的 "set until" 和表空间可以联机使用
How to recover a skipped tablespace after an incomplete recovery? (Doc ID 1561645.1)的更多相关文章
- How to recover a skipped tablespace after an incomplete recovery with resetlogs? [ID 1561645.1]
n this Document Goal Solution This document is being delivered to you via Oracle Support's Rapid ...
- RMAN RECOVER TABLE 功能是 Oracle Database 12c 的新增功能 (Doc ID 1521524.1)
RMAN RECOVER TABLE Feature New to Oracle Database 12c (Doc ID 1521524.1) APPLIES TO: Oracle Database ...
- 如何为 Automatic Undo Management 调整 UNDO Tablespace 的大小 (Doc ID 262066.1)
How To Size UNDO Tablespace For Automatic Undo Management (Doc ID 262066.1) APPLIES TO: Oracle Datab ...
- Troubleshooting ORA-30036 - Unable To Extend Undo Tablespace (Doc ID 460481.1)
Troubleshooting ORA-30036 - Unable To Extend Undo Tablespace (Doc ID 460481.1) APPLIES TO: Oracle Da ...
- tspitr(tablespace point in time recovery)实验
===========环境模拟================= -----------模拟数据---------------- SYS@ORCL>create tablespace test ...
- V4 Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 2471245.1)
V4 Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 2471245. ...
- Recover With Until Time fails With RMAN-20207 When Time Is Before Last RESETLOGS (Doc ID 159405.1)
Recover With Until Time fails With RMAN-20207 When Time Is Before Last RESETLOGS (Doc ID 159405.1) A ...
- ODA: After Apply ODA 12.2.1.2.0 Patch, Unable to Create TableSpace Due to [ORA-15001: diskgroup "DATA" does not exist or is not mounted | ORA-15040: diskgroup is incomplete] (Doc ID 2375553.1)
ODA: After Apply ODA 12.2.1.2.0 Patch, Unable to Create TableSpace Due to [ORA-15001: diskgroup &quo ...
- 故障排除指南(TSG)-ORA-01552: Cannot Use System Rollback Segment for Non-System Tablespace (Doc ID 1579215.1)
Troubleshooting Guide (TSG) - ORA-01552: Cannot Use System Rollback Segment for Non-System Tablespac ...
随机推荐
- 如何从Mac删除恶意广告软件,摆脱那些通过弹出广告或工具栏入侵Mac的恶意软件
厌倦了那些利用弹出式广告和工具栏之类入侵Mac的恶意软件?该如何摆脱Mac上的恶意软件呢?今天小编为大家带来两种方法从Mac 删除广告软件,甚至阻止它到达您的Mac,感兴趣的朋友一起来看看吧! 方法一 ...
- android:Program type already present: android.support.v4.app.INotificationSideChannel
背景 这个错误的原因是:androidx和 android.support同时存在. 首先,网上有很多解答说这样处理: 在 gradle.properties 添加: android.useAndro ...
- 【zabbix监控问题】记录zabbix控制面板报错及日志报错的解决方法
问题1: 上图是我已经解决了的截图.在百度查询的资料中,说是把zabbix_agentd.conf文件中server监听的主机127.0.0.1去掉,但是我去掉之后问题仍然没有解决,最后在这篇博客上发 ...
- IDEA 如何自动导入(import)
如果大家正在使用一个未曾导入(import)过的类,或者它的静态方法或者静态字段,IDEA 会给出对应的建议,只要按下 ⌥(option)和回车就可以接受建议. 但我觉得这样做仍然很麻烦,不够智能化. ...
- 数据结构学习--单循环链表(python)
概念 将单链表的终端节点的指针由原来的空指针改为指向头节点, 就是整个单链表形成一个环, 这种首尾相接的单链表称为单循环链表. 实现 class Node: """ 节点 ...
- C# net core程序调试错误集(持续更新)
目录 C#程序调试错误集 1.依赖注入错误System.InvalidOperationException: Unable to resolve service for type 'xxx' whil ...
- spring的事物管理配置
基于注解的事务管理器配置(AOP) 首先要引入AOP和TX的名称控件 <!-- 使用annotation定义事务 --> <tx:annotation-driven transact ...
- SSH框架之Spring第四篇
1.1 JdbcTemplate概述 : 它是spring框架中提供的一个对象,是对原始JdbcAPI对象的简单封装.spring框架为我们提供了很多的操作模板类. ORM持久化技术 模板类 JDBC ...
- 白话 MVC、MVP、MVVP
白话 MVC.MVP.MVVP 注意这里单纯的通过例子来讲解 MVC MVP MVVP 这三种架构模式的起源和作用,不牵扯某种特定的语言.具体到各种语言各种软件系统上体现有所不同,但是原理都是这样的. ...
- InnoDB On-Disk Structures(二)--Indexes (转载)
转载.节选于 https://dev.mysql.com/doc/refman/8.0/en/innodb-indexes.html This section covers topics relate ...