Oracle 9i用RMAN恢复删除掉的表(一)

2014-11-24 08:49:01 · 作者: · 浏览: 2
在实际工作过程中开发人员往往不小心删除掉了一个重要的表,这时候他们会找管理员找回删除掉的表,具体场景如下:
1、开发人员:
SQL> conn usr1/usr1
Connected.
SQL> create table t( id int,name varchar2(10));
Table created.
SQL> insert into t values(0,yejun0);
1 row created.
SQL> insert into t values(1,yejun1);
1 row created.
SQL> commit;
Commit complete.
SQL>
.........................
过了一段时间
.........................
2、系统备份
SQL> select to_char(sysdate,YYYY-MM-DD:HH24:MI:SS) from dual;
TO_CHAR(SYSDATE,YY
-------------------
2011-06-16:07:50:58
[oracle@oracle9idemo cold]$ rman targetsys/oracle@oracle9ivmnocatalog
Recovery Manager: Release 9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: DENVER (DBID=4041114247)
using target database controlfile instead of recovery catalog
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Full 556M DISK 00:02:09 16-JUN-11
BP Key: 3 Status: AVAILABLE Tag: TAG20110616T070233
Piece Name: /u01/ubackup/rman_i_04mf0p09_1_1
SPFILE Included: Modification time: 14-JUN-11
List of Datafiles in backup set 3
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 1073814281 16-JUN-11 /u01/oradata/denver/system01.dbf
2 Full 1073814281 16-JUN-11 /u01/oradata/denver/undotbs01.dbf
3 Full 1073814281 16-JUN-11 /u01/oradata/denver/cwmlite01.dbf
4 Full 1073814281 16-JUN-11 /u01/oradata/denver/drsys01.dbf
5 Full 1073814281 16-JUN-11 /u01/oradata/denver/example01.dbf
6 Full 1073814281 16-JUN-11 /u01/oradata/denver/indx01.dbf
7 Full 1073814281 16-JUN-11 /u01/oradata/denver/odm01.dbf
8 Full 1073814281 16-JUN-11 /u01/oradata/denver/tools01.dbf
9 Full 1073814281 16-JUN-11 /u01/oradata/denver/users01.dbf
10 Full 1073814281 16-JUN-11 /u01/oradata/denver/xdb01.dbf
11 Full 1073814281 16-JUN-11 /u01/oradata/denver/app1_01.dbf
12 Full 1073814281 16-JUN-11 /u01/oradata/denver/app2_01.dbf
RMAN> delete backup;
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=17 devtype=DISK
List of Backup Pieces
BP Key BS Key P c# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
3 3 1 1 AVAILABLE DISK /u01/ubackup/rman_i_04mf0p09_1_1
Do you really want to delete the above objects (enter YES or NO) yes;
"yes;" is an invalid response - please re-enter.
Do you really want to delete the above objects (enter YES or NO) yes
deleted backup piece
backup piece handle=/u01/ubackup/rman_i_04mf0p09_1_1 recid=3 stamp=753951756
Deleted 1 objects
RMAN> list backup;
RMAN> backup database format /u01/ubackup/rman_i_%U
2> ;
Starting backup at 16-JUN-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current SPFILE in backupset
including current controlfile in backupset
input datafile fno=00001 name=/u01/oradata/denver/system01.dbf
input datafile fno=00002 name=/u01/oradata/denver/undotbs01.dbf
input datafile fno=00005 name=/u01/oradata/denver/example01.dbf
input dat