Oracle基于RMAN的不完全恢复(二)

2014-11-24 09:05:56 · 作者: · 浏览: 3
t Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> insert into t_rec values(6,'fff');
1 row created.
SQL> commit;
Commit complete.
SQL> conn / as sysdba
Connected.
SQL> alter system switch logfile;
System altered.
SQL> select * from zhongwc.t_rec;
ID NAME
---------- ----------
1 aaa
2 bbb
3 ccc
4 ddd
5 eee
6 fff
6 rows selected.
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
3404460
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
3404461
SQL> conn zhongwc/zhongwc
Connected.
SQL> drop table t_rec purge;
Table dropped.
SQL> show recyclebin;
SQL> conn / as sysdba
Connected.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exir
SP2-0042: unknown command "exir" - rest of line ignored.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@zwc ~]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Tue Feb 5 10:52:53 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)
RMAN> startup mount;
Oracle instance started
database mounted
Total System Global Area 1653518336 bytes
Fixed Size 2228904 bytes
Variable Size 1140854104 bytes
Database Buffers 503316480 bytes
Redo Buffers 7118848 bytes
RMAN> run{
2> allocate channel c1 device type disk;
3> restore database;
4> recover database until scn 3404460;
5> sql 'alter database open resetlogs';
6> release channel c1;
7> }
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=18 device type=DISK
Starting restore at 05-FEB-2013 10:55:50
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00001 to /u01/app/oracle/oradata/ZWC/system01.dbf
channel c1: restoring datafile 00002 to /u01/app/oracle/oradata/ZWC/sysaux01.dbf
channel c1: restoring datafile 00003 to /u01/app/oracle/oradata/ZWC/undotbs01.dbf
channel c1: restoring datafile 00004 to /u01/app/oracle/oradata/ZWC/users01.dbf
channel c1: restoring datafile 00005 to /u01/app/oracle/oradata/ZWC/example01.dbf
channel c1: reading from backup piece /u01/backup/db_full_01o16uap_1_1
channel c1: piece handle=/u01/backup/db_full_01o16uap_1_1 tag=FULLBAK
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:55
Finished restore at 05-FEB-2013 10:56:45
Starting recover at 05-FEB-2013 10:56:46
starting media recovery
media recovery complete, elapsed time: 00:00:02
Finished recover at 05-FEB-2013 10:56:48
sql statement: alter database open resetlogs
released channel: c1
RMAN> exit