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. [Uva247][Tarjan求强连通分量][Calling Circles]

    题目大意: 例如:A跟B打电话,B跟C打电话,C跟A打电话..D跟E打电话,E跟D不打电话.则A,B,C属于同一个电话圈,D,E分别属于一个电话圈,问有多少个电话圈. 分析 就是裸的求强连通分量,直接 ...

  2. mysql5.7 二进制包安装

    1. 下载包 wget   http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz 2. 解 ...

  3. javax inect

    Spring 3 and JSR-330 @Inject and @Named example By mkyong | September 16, 2012 | Viewed : 86,399 tim ...

  4. bootstrap插件小记

    1.模态框 除了通过data-toggle和data-target来控制模态弹出窗之外,Bootstrap框架针对模态弹出框还提供了其他自定义data-属性,来控制模态弹出窗.比如说:是否有灰色背景m ...

  5. nodejs 计算内存使用率

    //计算内存使用率 function calcMem(){ let mem_total = os.totalmem(), mem_free = os.freemem(), mem_used = mem ...

  6. 第二章实例:ArrayAdapter结合ListView列表视图

    package mydefault.packge; import com.example.codeview.R; import android.app.Activity; import android ...

  7. AspnetPager放在UpdatePanel中,回到顶部。

    最近在做一个项目时,使用了AspNetPager分页控件进行分页,为了防止点击下一页时搜索条件消失掉,使用了UpdatePanel来进行局部刷新. 由此引发了一个问题,即点击某一页时,页面没有返回到顶 ...

  8. iOS之短信认证

    短信验证 现在很多的短信验证平台,我们比较常用的有移动开发者服务平台 根据短信验证文档来集成 1. 找到iOS短信验证的集成开发文档 2. 下载SDK和Demo目录结构  3. 运行Demo 4. 写 ...

  9. C#的一个异常

    1.catch捕获得到的异常如图 2.解决办法(找到app.config文件,修改图中的值将原来的8192扩大了10倍)

  10. 英特尔发布全新英特尔® INDE 2015工具套件

    2014年10月15日,英特尔发布了全新的英特尔® Integrated Native Developer Experience 2015工具套件(简称英特尔® INDE).该产品提供了一系列最佳工具 ...