You are on page 1of 4

(in case of another datafile that is not belong to system and undo tablespace):-

RMAN> run{
2> sql 'alter database datafile 4 offline';
3> restore datafile 4;
4> recover datafile 4;
5> sql 'alter database datafile 4 online';
6> }
sql statement: alter database datafile 4 offline
Starting restore at 22-MAR-11
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to /oracle/app/oradata/orcl/users01.dbf
channel ORA_DISK_1: reading from backup piece /oracle/app/flash_recovery_area/OR
CL/backupset/2011_03_22/o1_mf_nnndf_TAG20110322T090553_6rj69779_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/oracle/app/flash_recovery_area/ORCL/backupset/2011_03_22/o1_mf_nnn
df_TAG20110322T090553_6rj69779_.bkp tag=TAG20110322T090553
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 22-MAR-11
Starting recover at 22-MAR-11
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 22-MAR-11
sql statement: alter database datafile 4 online
2.
SQL> shu abort;
ORACLE instance shut down.
SQL>
SQL> startup mount
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 75499112 bytes
Database Buffers 201326592 bytes
Redo Buffers 7168000 bytes
Database mounted.
SQL>
SQL>
SQL> !rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Mar 22 09:14:48 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1273652340, not open)
RMAN> run{
2> sql'alter database datafile 1 offline';
3> restore datafile 1;
4> recover datafile 1;
5> sql 'alter database datafile 1 online';
6> alter database open;
7> }
using target database control file instead of recovery catalog
sql statement: alter database datafile 1 offline
Starting restore at 22-MAR-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: sid=154 devtype=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: sid=153 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oracle/app/oradata/orcl/system01.dbf
channel ORA_DISK_1: reading from backup piece /oracle/app/flash_recovery_area/OR
CL/backupset/2011_03_22/o1_mf_nnndf_TAG20110322T090553_6rj68t20_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/oracle/app/flash_recovery_area/ORCL/backupset/2011_03_22/o1_mf_nnn
df_TAG20110322T090553_6rj68t20_.bkp tag=TAG20110322T090553
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 22-MAR-11
Starting recover at 22-MAR-11
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
starting media recovery
media recovery complete, elapsed time: 00:00:03
Finished recover at 22-MAR-11
sql statement: alter database datafile 1 online
database opened
3.incomplete recovery
SQL> set time on;
09:18:00 SQL>
09:18:03 SQL>
09:18:11 SQL>
09:18:11 SQL>
09:18:11 SQL> drop table scott.emp purge;
Table dropped.
09:18:22 SQL> select * from scott.emp;
select * from scott.emp
*
ERROR at line 1:
ORA-00942: table or view does not exist
09:18:31 SQL> !rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Mar 22 09:18:48 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1273652340)
RMAN> shutdown immediate;
using target database control file instead of recovery catalog
database closed
database dismounted
Oracle instance shut down
RMAN>
RMAN> startup mount
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 75499112 bytes
Database Buffers 201326592 bytes
Redo Buffers 7168000 bytes
RMAN> sql "alter session set nls_date_format=''dd-mon-yyyy hh24:mi:ss''";
sql statement: alter session set nls_date_format=''dd-mon-yyyy hh24:mi:ss''
RMAN>
RMAN> run{
2> restore database;
3> recover database until time '22-mar-2011 09:18:00';
4> alter database open resetlogs;
5> }
Starting restore at 22-MAR-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=157 devtype=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: sid=155 devtype=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: sid=154 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00003 to /oracle/app/oradata/orcl/sysaux01.dbf
restoring datafile 00004 to /oracle/app/oradata/orcl/users01.dbf
channel ORA_DISK_1: reading from backup piece /oracle/app/flash_recovery_area/OR
CL/backupset/2011_03_22/o1_mf_nnndf_TAG20110322T090553_6rj69779_.bkp
channel ORA_DISK_2: starting datafile backupset restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oracle/app/oradata/orcl/system01.dbf
restoring datafile 00002 to /oracle/app/oradata/orcl/undotbs01.dbf
channel ORA_DISK_2: reading from backup piece /oracle/app/flash_recovery_area/OR
CL/backupset/2011_03_22/o1_mf_nnndf_TAG20110322T090553_6rj68t20_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/oracle/app/flash_recovery_area/ORCL/backupset/2011_03_22/o1_mf_nnn
df_TAG20110322T090553_6rj69779_.bkp tag=TAG20110322T090553
channel ORA_DISK_1: restore complete, elapsed time: 00:00:56
channel ORA_DISK_2: restored backup piece 1
piece handle=/oracle/app/flash_recovery_area/ORCL/backupset/2011_03_22/o1_mf_nnn
df_TAG20110322T090553_6rj68t20_.bkp tag=TAG20110322T090553
channel ORA_DISK_2: restore complete, elapsed time: 00:01:00
Finished restore at 22-MAR-11
Starting recover at 22-MAR-11
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
starting media recovery
media recovery complete, elapsed time: 00:00:03
Finished recover at 22-MAR-11
database opened
RMAN> exit
Recovery Manager complete.
09:24:08 SQL> select count(*) from scott.emp;
select count(*) from scott.emp
*
ERROR at line 1:
ORA-03135: connection lost contact
09:24:22 SQL> conn scott/tiger
Connected.
09:24:30 SQL>
09:24:31 SQL> select count(*) from emp;
COUNT(*)
----------
13
09:24:36 SQL> set time off;
SQL>

You might also like