Steps To Recover A Dropped Tablespace Using TSPITR

In this Document
Purpose
Scope
Details
References
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.1 to 11.2.0.2 [Release 11.2]
Information in this document applies to any platform.
PURPOSE

Recover a dropped tablespace using TSPITR.

SCOPE

RMAN automatic Tablespace Point-In-Time Recovery ( TSPITR) enables you to quickly recover one or more tablespaces in an Oracle database to an earlier time, without affecting the state of the rest of the tablespaces and other objects in the database. 

Prior to 11.2 version the TSPITR had a restriction of not being able to recover the dropped tablespace. 
From 11.2 this limitation no longer exists. We can recover the dropped tablespace using TSPITR.

The below example is an attempt to show the steps and functioning of TSPITR to recover a dropped tablespace.

DETAILS

Example:

1) Create a tablespace.

SQL> create tablespace users datafile 'D:\DATABASES\ORA11G\users01.dbf' size 10m reuse;

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS

2) Create a user and create a table in the new tablespace.

SQL> create user tiger identified by tiger;
SQL> grant dba to tiger;
SQL> conn tiger/tiger
SQL> create table objects tablespace users as select * from dba_objects ;
SQL> select count(*) from objects;

COUNT(*)
----------
17299

3) Make a note of the current log sequence number.

SQL > select sequence# from v$log where status='CURRENT';

SEQUENCE#
----------
21  

4) Take a backup of the database and the archivelogs.

% rman target /
RMAN> backup database plus archivelog;

5) Now login to the database and just perform a few log switches and then drop the tablespace.

SQL> alter system switch logfile;
SQL> alter system switch logfile;
SQL> drop tablespace users including contents and datafiles;

6) Now note down the current log sequence number in the database.

SQL> select SEQUENCE# from v$log where status='CURRENT';

SEQUENCE#
----------
25

7) The log sequence number in the database when the tablespace was dropped is 25. So if we recover upto sequence 24 then we will be able to get the tablespace back. To recover upto sequence 24 we have use 24+1=25 in the set until clause of the TSPITR statement.

% rman target /
RMAN> recover tablespace users until logseq 25 auxiliary destination 'd:\';

Starting recover at 03-JAN-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=15 device type=DISK
RMAN-05026: WARNING: presuming following set of tablespaces applies to specified point-in-time

List of tablespaces expected to have UNDO segments
Tablespace SYSTEM
Tablespace UNDOTBS1

Creating automatic instance, with SID='nyxF'
initialization parameters used for automatic instance:
db_name=ORA11G
db_unique_name=nyxF_tspitr_ORA11G
compatible=11.2.0.0.0
db_block_size=8192
db_files=200
sga_target=280M
processes=50
db_create_file_dest=d:\
log_archive_dest_1='location=d:\'
#No auxiliary parameter file used

starting up automatic instance ORA11G

Oracle instance started
Total System Global Area 292933632 bytes
Fixed Size 1374164 bytes
Variable Size 100665388 bytes
Database Buffers 184549376 bytes
Redo Buffers 6344704 bytes
Automatic instance created

List of tablespaces that have been dropped from the target database:
Tablespace users

contents of Memory Script:
{
# set requested point in time
set until logseq 25 thread 1;
# restore the controlfile
restore clone controlfile;
# mount the controlfile
sql clone 'alter database mount clone database';
# archive current online log 
sql 'alter system archive log current';
# avoid unnecessary autobackups for structural changes during TSPITR
sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;';
}
executing Memory Script
executing command: SET until clause

Starting restore at 03-JAN-11
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=59 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece D:\DATABASES\ORA11G\FRA\ORA11G\BACKUPSET\2011_01_03\O1_MF_NCSNF_TAG20110103T092723_6L2LB86C_.BKP
channel ORA_AUX_DISK_1: piece handle=D:\DATABASES\ORA11G\FRA\ORA11G\BACKUPSET\2011_01_03\O1_MF_NCSNF_TAG20110103T092723_6L2LB86C_.BKP tag=TAG20110103T092723
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=D:\ORA11G\CONTROLFILE\O1_MF_6L2M39N0_.CTL
Finished restore at 03-JAN-11

sql statement: alter database mount clone database
sql statement: alter system archive log current
sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end;

contents of Memory Script:
{
# set requested point in time
set until logseq 25 thread 1;
# set destinations for recovery set and auxiliary set datafiles
set newname for clone datafile 1 to new;
set newname for clone datafile 3 to new;
set newname for clone datafile 2 to new;
set newname for clone tempfile 1 to new;
set newname for datafile 4 to 
"D:\DATABASES\ORA11G\USERS01.DBF";
# switch all tempfiles
switch clone tempfile all;
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile 1, 3, 2, 4;
switch clone datafile all;
}
executing Memory Script
executing command: SET until clause
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
renamed tempfile 1 to D:\ORA11G\DATAFILE\O1_MF_TEMP_%U_.TMP in control file

Starting restore at 03-JAN-11
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to D:\ORA11G\DATAFILE\O1_MF_SYSTEM_%U_.DBF
channel ORA_AUX_DISK_1: restoring datafile 00003 to D:\ORA11G\DATAFILE\O1_MF_UNDOTBS1_%U_.DBF
channel ORA_AUX_DISK_1: restoring datafile 00002 to D:\ORA11G\DATAFILE\O1_MF_SYSAUX_%U_.DBF
channel ORA_AUX_DISK_1: restoring datafile 00004 to D:\DATABASES\ORA11G\USERS01.DBF
channel ORA_AUX_DISK_1: reading from backup piece D:\DATABASES\ORA11G\FRA\ORA11G\BACKUPSET\2011_01_03\O1_MF_NNNDF_TAG20110103T092723_6L2L941Y_.BKP
channel ORA_AUX_DISK_1: piece handle=D:\DATABASES\ORA11G\FRA\ORA11G\BACKUPSET\2011_01_03\O1_MF_NNNDF_TAG20110103T092723_6L2L941Y_.BKP tag=TAG20110103T092723
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 03-JAN-11

datafile 1 switched to datafile copy
input datafile copy RECID=12 STAMP=739446137 file name=D:\ORA11G\DATAFILE\O1_MF_SYSTEM_6L2M3MRW_.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=13 STAMP=739446137 file name=D:\ORA11G\DATAFILE\O1_MF_UNDOTBS1_6L2M3N8S_.DBF
datafile 2 switched to datafile copy
input datafile copy RECID=14 STAMP=739446137 file name=D:\ORA11G\DATAFILE\O1_MF_SYSAUX_6L2M3N1G_.DBF

contents of Memory Script:
{
# set requested point in time
set until logseq 25 thread 1;
# online the datafiles restored or switched
sql clone "alter database datafile 1 online";
sql clone "alter database datafile 3 online";
sql clone "alter database datafile 2 online";
sql clone "alter database datafile 4 online";
# recover and open resetlogs
recover clone database tablespace "USERS", "SYSTEM", "UNDOTBS1", "SYSAUX" delete archivelog;
alter clone database open resetlogs;
}
executing Memory Script

executing command: SET until clause
sql statement: alter database datafile 1 online
sql statement: alter database datafile 3 online
sql statement: alter database datafile 2 online
sql statement: alter database datafile 4 online

Starting recover at 03-JAN-11
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 22 is already on disk as file D:\DATABASES\ORA11G\FRA\ORA11G\ARCHIVELOG\2011_01_03\O1_MF_1_22_6L2LB9M1_.ARC
archived log for thread 1 with sequence 23 is already on disk as file D:\DATABASES\ORA11G\FRA\ORA11G\ARCHIVELOG\2011_01_03\O1_MF_1_23_6L2LPHCQ_.ARC
archived log for thread 1 with sequence 24 is already on disk as file D:\DATABASES\ORA11G\FRA\ORA11G\ARCHIVELOG\2011_01_03\O1_MF_1_24_6L2LPQ2G_.ARC
archived log file name=D:\DATABASES\ORA11G\FRA\ORA11G\ARCHIVELOG\2011_01_03\O1_MF_1_22_6L2LB9M1_.ARC thread=1 sequence=22
archived log file name=D:\DATABASES\ORA11G\FRA\ORA11G\ARCHIVELOG\2011_01_03\O1_MF_1_23_6L2LPHCQ_.ARC thread=1 sequence=23
archived log file name=D:\DATABASES\ORA11G\FRA\ORA11G\ARCHIVELOG\2011_01_03\O1_MF_1_24_6L2LPQ2G_.ARC thread=1 sequence=24
media recovery complete, elapsed time: 00:00:04
Finished recover at 03-JAN-11

database opened

contents of Memory Script:
{
# make read only the tablespace that will be exported
sql clone 'alter tablespace USERS read only';
# create directory for datapump import
sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''
d:\''";
# create directory for datapump export
sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as ''
d:\''";
}
executing Memory Script

sql statement: alter tablespace USERS read only
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''d:\''
sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''d:\''

Performing export of metadata...
EXPDP> Starting "SYS"."TSPITR_EXP_nyxF": 
EXPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
EXPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
EXPDP> Master table "SYS"."TSPITR_EXP_nyxF" successfully loaded/unloaded
EXPDP> ******************************************************************************
EXPDP> Dump file set for SYS.TSPITR_EXP_nyxF is:
EXPDP> D:\TSPITR_NYXF_54517.DMP
EXPDP> ******************************************************************************
EXPDP> Datafiles required for transportable tablespace USERS:
EXPDP> D:\DATABASES\ORA11G\USERS01.DBF
EXPDP> Job "SYS"."TSPITR_EXP_nyxF" successfully completed at 09:43:07
Export completed

contents of Memory Script:
{
# shutdown clone before import
shutdown clone immediate
}
executing Memory Script

database closed
database dismounted
Oracle instance shut down

Performing import of metadata...
IMPDP> Master table "SYS"."TSPITR_IMP_nyxF" successfully loaded/unloaded
IMPDP> Starting "SYS"."TSPITR_IMP_nyxF": 
IMPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
IMPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
IMPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
IMPDP> Job "SYS"."TSPITR_IMP_nyxF" successfully completed at 09:43:29
Import completed

contents of Memory Script:
{
# make read write and offline the imported tablespaces
sql 'alter tablespace USERS read write';
sql 'alter tablespace USERS offline';
# enable autobackups after TSPITR is finished
sql 'begin dbms_backup_restore.AutoBackupFlag(TRUE); end;';
}
executing Memory Script

sql statement: alter tablespace USERS read write
sql statement: alter tablespace USERS offline
sql statement: begin dbms_backup_restore.AutoBackupFlag(TRUE); end;

Removing automatic instance
Automatic instance removed
auxiliary instance file D:\ORA11G\DATAFILE\O1_MF_TEMP_6L2M5G8S_.TMP deleted
auxiliary instance file D:\ORA11G\ONLINELOG\O1_MF_3_6L2M5CJM_.LOG deleted
auxiliary instance file D:\ORA11G\ONLINELOG\O1_MF_2_6L2M5BNZ_.LOG deleted
auxiliary instance file D:\ORA11G\ONLINELOG\O1_MF_1_6L2M59N0_.LOG deleted
auxiliary instance file D:\ORA11G\DATAFILE\O1_MF_SYSAUX_6L2M3N1G_.DBF deleted
auxiliary instance file D:\ORA11G\DATAFILE\O1_MF_UNDOTBS1_6L2M3N8S_.DBF deleted
auxiliary instance file D:\ORA11G\DATAFILE\O1_MF_SYSTEM_6L2M3MRW_.DBF deleted
auxiliary instance file D:\ORA11G\CONTROLFILE\O1_MF_6L2M39N0_.CTL deleted
Finished recover at 03-JAN-11

8) Here rman uses transportable tablespace mechanism to plug the dropped tablespace back in to the database.

SQL> select tablespace_name,status,plugged_in from dba_tablespaces;

TABLESPACE_NAME     STATUS   PLU
----------------    -------  ---
SYSTEM              ONLINE   NO
SYSAUX              ONLINE   NO
UNDOTBS1            ONLINE   NO
TEMP                ONLINE   NO
USERS               OFFLINE  YES  ===> Plugged_in is YES.

9) Online the tablespace.

SQL > alter tablespace users online;

10) Check for the data.

SQL> conn tiger/tiger
SQL> select count(*) from objects;

COUNT(*)
----------
17299
<think> 嗯,用户这次遇到了英伟达显卡的OpenGL驱动内核恢复失败问题,这是典型的图形驱动故障。结合用户提供的引用线索(关于Premier崩溃和Quadro驱动问题)以及历史对话中的LaTeX格式要求,需要先排除三个核心方向:驱动兼容性、硬件稳定性、软件冲突。 用户提到的错误信息"unable to recover from a kernel"通常意味着GPU在遭遇严重错误后驱动重置失败。根据NVIDIA开发者论坛的讨论[^1],Quadro新版驱动确实存在OpenGL兼容性问题,这点特别值得关注。不过用户没说明显卡型号,需要覆盖通用解决方案。 首先考虑驱动层面的处理:安全模式下DDU卸载能彻底清除驱动残留,比普通卸载可靠得多。版本选择上建议分支策略:创作者用Studio驱动(针对Adobe优化),游戏玩家用Game Ready驱动,企业级Quadro则需核对NV认证列表[^1]。回退版本要优先排除已知有问题的456.71等版本。 硬件方面容易忽略内存因素——显存错误会引发OpenGL崩溃,Win自带的内存诊断工具不够彻底,建议用memtest86+深度检测。超频用户必须重置默认频率,AMD平台的fTPM问题也可能间接导致异常。 软件冲突场景中,浏览器硬件加速是高频诱因,Chromium系浏览器尤为明显。专业软件如Premier Pro需关闭GPU加速解码测试,但要注意这会牺牲渲染性能。系统文件完整性扫描(sfc /scannow)能修复被篡改的OpenGL组件。 最后给的应急方案是有价值的:调低OpenGL核心频率这种偏门操作,其实源自NV控制面板的隐藏功能,对老旧显卡特别有效。电源管理设置成"最高性能"则是预防驱动重置的经典方案。 用户可能还想知道:为什么Linux系统很少出现此类问题?(驱动架构差异)是否需要调整BIOS设置?(通常不需要)这些可以作为衍生问题预留。 </think> 英伟达显卡提示 **"OpenGL driver unable to recover from a kernel"** 通常由驱动冲突、硬件不稳定或系统兼容性问题引发。以下是系统化的解决方案: --- ### 一、核心解决步骤 1. **彻底卸载驱动** - 下载 [DDU(Display Driver Uninstaller)](https://www.wagnardsoft.com/) - **安全模式**下运行 → 选择 "NVIDIA GPU" → 点击 "Clean and restart" - **关键点**:避免残留驱动冲突[^1] 2. **安装稳定版驱动** - **创作者用户**:下载 [NVIDIA Studio Driver](https://www.nvidia.cn/studio/drivers/) - **游戏用户**:选择 [Game Ready 驱动](https://www.nvidia.cn/geforce/drivers/) 的 **WHQL认证版本**(如 511.23/516.94) - **企业用户**:使用 [Quadro 认证驱动](https://www.nvidia.cn/drivers/quadro-rtx-enterprise-driver/) 3. **禁用驱动自动更新** ```bat bcdedit /set {current} disabledynamictick yes ``` (管理员权限运行CMD) --- ### 二、深度优化方案 | 方向 | 操作 | |-------------|----------------------------------------------------------------------| | **硬件检测** | 运行 `Win+R` → `mdsched.exe` 内存诊断<br>使用 [OCCT](https://www.ocbase.com/) 压力测试GPU稳定性 | | **OpenGL 优化** | NVIDIA控制面板 → 管理3D设置 → 添加程序 → 设置 **"首选图形处理器"为高性能** | | **电源管理** | 控制面板 → 电源选项 → 创建高性能计划 → PCI Express 设置 **"链接状态电源管理"关闭** | --- ### 三、特殊场景处理 - **Adobe 软件崩溃**: 在 Premiere Pro 设置中禁用 **"GPU加速"** → 改用 **"软件渲染"**[^1] - **多显示器问题**: 降低主屏刷新率至 **60Hz** 测试,或断开副屏 - **超频导致**: 重置显卡频率(MSI Afterburner → Reset) --- ### 四、终极解决方案 若上述无效: 1. **重置BIOS**:拔主板电池30秒 2. **更换硬件**: - 测试显卡在其他主板的表现 - 检查电源功率是否达标(建议≥650W) 3. **系统降级**:回退到 Win10 21H2 或安装 Linux 驱动测试(Nouveau开源驱动) ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值