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. Oracle Golden Gate - 概念和机制 (ogg)

    Golden Gate(简称OGG)提供异构环境下交易数据的实时捕捉.变换.投递. OGG支持的异构环境有: OGG的特性: 对生产系统影响小:实时读取交易日志,以低资源占用实现大交易量数据实时复制 ...

  2. wamp安装

    下载之后双击文件进行安装选择:I accept the agreement ,点击Next. 一直单击NEXT 安装完成后运行wamp,在桌面右下角即会出现wamp的图标,图标最初是红色的,然后变为橙 ...

  3. iOS开发面试题整理(二)

    8 类别的作用?继承和类别在实现中有何区别? 答案:category 可以在不获悉,不改变原来代码的情况下往里面添加新的方法,只能添加,不能删除修改. 并且如果类别和原来类中的方法产生名称冲突,则类别 ...

  4. RTP InitializeComponent() 报错

    注意xaml中x:Class 是不是相应改了,下面2处标红的部分是否一致. namespace RTP.ToolKits{ /// <summary> /// Interaction lo ...

  5. Java中的static关键字

    写在前面: 在Java中并不存在全局变量的概念,但是我们可以通过static来实现一个“伪全局”的概念,在Java中static表示“全局”或“静态”的意思,用来修饰成员变量和成员方法,当然也可以修饰 ...

  6. go JSON

    package utils import ( "encoding/json" "errors" ) func JsonToMap(text []byte) (m ...

  7. outlook 2007 IMAP设置和配置

    以Outlook2007为例(Outlook2003操作基本类似).  1.依次点击“工具”>“帐户设置”. 2.在“帐户设置”页中点击“新建”> 不需要做任何选择,点击下一步. 3.填写 ...

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

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

  9. python爬图

    闲的无事,看着知乎里种种python优点,按捺不住,装起python3.4. 网上找了点爬行图片的代码,修改至兼容3.4,成功爬行指定url所有jpg图片,代码段如下: import os impor ...

  10. Ubuntu系统下创建python数据挖掘虚拟环境

    虚拟环境:   虚拟环境是用于创建独立的python环境,允许我们使用不同的python模块和版本,而不混淆.   让我们了解一下产品研发过程中虚拟环境的必要性,在python项目中,显然经常要使用不 ...