n this Document

 

Goal

 

Solution


This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.3 and later
Information in this document applies to any platform.

Goal

How to recover a skipped tablespace after an incomplete recovery with resetlogs?

Solution

It is possible to restore and recover the database and skip a tablespace and open the database for use and than perform the restore and recovery for the skipped tablespace.
As a best practice we always recommend testing the backups, restore and recovery scenario in your environment.

Database Structure and Backup

21:33:13 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.

[oradb1@ls6n1 trace]$ 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.

You may want to skip a tablespace during restore/recovery to save time and get the rest of the database online for use at the earliest.

[oradb1@ls6n1 trace]$ 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;
}2> 3> 4> 5>

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;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> alter database open resetlogs;

Database altered.

23:00:31 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.

---------------
23:00:53 SQL> select * from V$recover_file;

FILE# ONLINE  ONLINE_ ERROR                                                                CHANGE# TIME
---------- ------- ------- ----------------------------------------------------------------- ---------- --------------------
         6 OFFLINE OFFLINE UNKNOWN ERROR                                                        2386984 13-JUN-2013 22:52:39

23:01:03 SQL> alter system switch logfile;

System altered.

23:01:33 SQL> /

System altered.

-->>> Other than the skipped tablespace all the other tablespaces are online for user.

RMAN> run {
restore tablespace proddata;
recover tablespace proddata;
}

RMAN>
Starting restore at 13-JUN-13
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/13/2013 23:02:23
RMAN-20021: database not set
RMAN-06019: could not translate tablespace name "proddata"

-->>  As the database incarnation increments after resetlogs, to pick up the new/current database incarnation you can either re-initiate the rman session or use the below:

RMAN> list incarnation;

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       PRODDB   552982679        PARENT  1          17-SEP-11
2       2       PRODDB   552982679        PARENT  995548     16-APR-13
3       3       PRODDB   552982679        PARENT  1138135    17-APR-13
4       4       PRODDB   552982679        PARENT  2269710    12-JUN-13
5       5       PRODDB   552982679        CURRENT 2384123    13-JUN-13

RMAN> reset database to incarnation 5;

[oradb1@ls6n1 trace]$ 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

23:01:34 SQL>  select * from V$recover_file;

no rows selected

23:04:53 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.

23:05:01 SQL> alter tablespace proddata online;

Tablespace altered.

23:05:23 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 will be performed till the earlier specified "set until" and tablespace can be brought online for use.

---------------------

RECOVER DATABASE SKIP FOREVER TABLESPACE list_skipped_TS UNTIL TIME ...

see SKIP option in ora doc:

SKIP [FOREVER] TABLESPACE Specifies tablespaces that should not be recovered, which is useful for avoiding recovery of tablespaces containing only temporary data or for postponing recovery of some tablespaces. The SKIP clause takes the datafiles in the specified tablespaces offline before starting media recovery. These files are left offline after the media recovery is complete.

If you perform incomplete recovery, then SKIP is not allowed. Instead, use SKIP FOREVER, with the intention of dropping the skipped tablespaces after opening the database with the RESETLOGS option. The SKIP FOREVER clause causes RMAN to take the datafiles offline with the DROP option. Only use SKIP FOREVER when the specified tablespaces will be dropped after opening the database.

How to recover a skipped tablespace after an incomplete recovery with resetlogs? [ID 1561645.1]的更多相关文章

  1. 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: Ora ...

  2. tspitr(tablespace point in time recovery)实验

    ===========环境模拟================= -----------模拟数据---------------- SYS@ORCL>create tablespace test ...

  3. [转载]——Full UNDO Tablespace In 10gR2 and above (文档 ID 413732.1)

    最近遇到了这个案例,官方文档已有详尽的分析.介绍,特转载在此,方便以后查看! Full UNDO Tablespace In 10gR2 and above (SQL> select count ...

  4. RMAN Restore, Recovery

    Complete recovery: rman target / nocatalog startup mount; restore database; recover database; alter ...

  5. [Oracle][PDB]PDB restore/recover 过程记录

    友人给的PDB restore / recover 的过程. 实际上会创建一个辅助Instance,然后抽取出PDB,进行恢复. (10:31:59) frank.yan: [Administrato ...

  6. 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 ...

  7. 一看就会一做就废系列:说说 RECOVER UNTIL CANCEL

    这里是:一看就会,一做就废系列 数据库演示版本为 19.3 (12.2.0.3) 该系列涉及恢复过程中使用的 5 个语句: 1. recover database 2. recover databas ...

  8. 故障排除指南(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 ...

  9. ORA 各种oraclesql错误

    ORA-00001: 违反唯一约束条件 (.) ORA-00017: 请求会话以设置跟踪事件 ORA-00018: 超出最大会话数 ORA-00019: 超出最大会话许可数 ORA-00020: 超出 ...

随机推荐

  1. a:hover span 隐藏/显示 问题

    :hover是我们在CSS设计中最常运用的伪类之一,许多绚丽效果的实现离不开伪类:hover,比如我们常见的纯CSS菜单.相册效果等等. 或许用了这么久的伪类:hover,还有部分朋友还不完全了解ho ...

  2. C#自定义控件在添加引用后不显示在工具箱的解决方法

    先说一些背景: 在开发C#项目时,发现很多控件存在复用的情况,控件的属性都是要设置成一样的,我就想,能不能设置一个类来存放这个控件,这样我每次用的时候直接加一些特殊的操作就可以了,不需要再次设置控件属 ...

  3. 高效的SQL分页存储过程

    CREATE PROCEDURE SP_CommonPageList @Fields VARCHAR(500), @From VARCHAR(1000), @Condition VARCHAR(100 ...

  4. Struts2 工作流程

    Struts2使用了WebWork的设计核心(XWork),在内部使用拦截器处理用户请求,从而允许用户业务逻辑控制器和ServletAPI分离.Struts2内部是一个MVC架构,Struts2 的核 ...

  5. USACO OPEN 12 BOOKSELF(转)

    原文出处:http://txhwind.blog.163.com/blog/static/2035241792012112285146817/(版权为原作者所有,本博文无营利目的,不构成侵权) 题目大 ...

  6. VS2010 配置 DirectX 开发环境

    1.首先下载 DXSDK 并安装 http://download.microsoft.com/download/A/E/7/AE743F1F-632B-4809-87A9-AA1BB3458E31/D ...

  7. zz[C++]合理的设计和使用消息队列

    http://www.cnblogs.com/egmkang/archive/2012/11/17/2763295.html 生产者消费者问题,是永远的经典. 单纯让多个线程去竞争,占有资源然后处理, ...

  8. java+mysql中文乱码问题

    乱码问题原因有多种,其中有一种是由于MySQL默认使用 ISO-8859-1 ( 即Latin1 ) 字符集,而JAVA内部使用Unicode编码,因此在JAVA中向MYSQL数据库插入数据时,或者读 ...

  9. SlimDX的DirectSound模块

    网上SlimDX的资源很少,搜到了http://www.xukailun.me/article/238/这篇关于<SlimDX的DirectSound模块应用实战>的文章,备份下来以备不时 ...

  10. select语句返回结果的顺序问题 .

    今天看到论坛上一个朋友的回帖内容,突然意识到自己好像从来没对SELECT语句做过任何思考,即便SELECT是平时使用最多的语句.自己建了两个测试表,内容如下: SQL> conn scott/t ...