oracle rman恢复单表,RMAN恢复单个表空间或被DROP/DELETE/TRUNCATE的表

这篇博客详细介绍了如何使用Oracle RMAN进行数据库恢复,包括初始化数据、备份数据库、将数据库恢复到nomount状态、还原特定表空间和数据文件,以及重建控制文件的步骤。通过实例展示了如何恢复被DROP、DELETE或TRUNCATE的单个表。
摘要由CSDN通过智能技术生成

1、初始化数据

JZH@jzh>create table t as select * from dba_objects;

Table created.

JZH@jzh>select count(*) from t;

COUNT(*)

----------

74756

JZH@jzh>select bytes/1024/1024 from dba_segments where segment_name='T';

BYTES/1024/1024

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

9

2、备份数据库

[oracle@jzh5 oradata]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Dec 5 08:25:42 2016

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: JZH (DBID=249975939)

RMAN> run{

2> allocate channel d1 type disk;

3> allocate channel d2 type disk;

4> crosscheck archivelog all;

5> delete noprompt expired archivelog all;

6> backup as compressed backupset database format '/home/oracle/backup20161205/full_%d_%T_%s.bak';

7> sql 'alter system archive log current';

8> backup as compressed backupset filesperset 2 format '//home/oracle/backup20161205/arch_%d_%T_%s.bak' archivelog all;

9> backup current controlfile format '/home/oracle/backup20161205/ctl_%d_%T_%s.bak';

10> release channel d1;

11> release channel d2;

12> }

3、数据库启到nomount状态

SYS@jzh>shu immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SYS@jzh>startup nomount

ORACLE instance started.

Total System Global Area  835104768 bytes

Fixed Size                  2232960 bytes

Variable Size             482348416 bytes

Database Buffers          348127232 bytes

Redo Buffers                2396160 bytes

RMAN> restore controlfile from '/home/oracle/backup20161205/ctl_JZH_20161205_20.bak'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值