幾種RMAN恢復場景

前期準備:
做一次全庫備份:
[oracle@localhost ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Sep 8 11:15:52 2016

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

connected to target database: ORCL (DBID=1448371606)

RMAN> backup database;

Starting backup at 08-SEP-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=30 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/orcl/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/user01.dbf
channel ORA_DISK_1: starting piece 1 at 08-SEP-16
channel ORA_DISK_1: finished piece 1 at 08-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_08/o1_mf_nnndf_TAG20160908T111600_cx1ozkdb_.bkp tag=TAG20160908T111600 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 08-SEP-16
channel ORA_DISK_1: finished piece 1 at 08-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_08/o1_mf_ncsnf_TAG20160908T111600_cx1p208k_.bkp tag=TAG20160908T111600 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 08-SEP-16

RMAN> list backupset;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
14      Full    1.11G      DISK        00:01:07     08-SEP-16      
        BP Key: 14   Status: AVAILABLE  Compressed: NO  Tag: TAG20160908T111600
        Piece Name: /u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_08/o1_mf_nnndf_TAG20160908T111600_cx1ozkdb_.bkp
  List of Datafiles in backup set 14
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 1070506    08-SEP-16 /u01/app/oracle/oradata/orcl/system01.dbf
  2       Full 1070506    08-SEP-16 /u01/app/oracle/oradata/orcl/sysaux01.dbf
  3       Full 1070506    08-SEP-16 /u01/app/oracle/oradata/orcl/undotbs01.dbf
  4       Full 1070506    08-SEP-16 /u01/app/oracle/oradata/orcl/user01.dbf
  5       Full 1070506    08-SEP-16 /u01/app/oracle/oradata/orcl/example01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
15      Full    9.36M      DISK        00:00:04     08-SEP-16      
        BP Key: 15   Status: AVAILABLE  Compressed: NO  Tag: TAG20160908T111600
        Piece Name: /u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_08/o1_mf_ncsnf_TAG20160908T111600_cx1p208k_.bkp
  SPFILE Included: Modification time: 08-SEP-16
  SPFILE db_unique_name: ORCL
  Control File Included: Ckp SCN: 1070546      Ckp time: 08-SEP-16

丟失spfile的恢復

刪除spfile。
[oracle@localhost ~]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/dbs/
[oracle@localhost dbs]$ ls
hc_orcl.dat  init.ora  lkORCL  orapworcl  snapcf_orcl.f  spfileorcl.ora
[oracle@localhost dbs]$ rm spfileorcl.ora 
[oracle@localhost dbs]$ 
開始恢復
RMAN> restore spfile from autobackup;

Starting restore at 08-SEP-16
using channel ORA_DISK_1

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/08/2016 11:20:48
RMAN-06564: must use the TO clause when the instance is started with SPFILE
--其實這個時候如果實例還在啓動,可以不用關庫恢復,從memory中恢復。
RMAN> shutdown immediate

database closed
database dismounted
Oracle instance shut down
RMAN> startup nomount
connected to target database (not started)
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initorcl.ora'

starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2260088 bytes
Variable Size                281019272 bytes
Database Buffers             780140544 bytes
Redo Buffers                   5517312 bytes

RMAN> restore spfile from autobackup;

Starting restore at 08-SEP-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK

channel ORA_DISK_1: looking for AUTOBACKUP on day: 20160908
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20160907
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20160906
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20160905
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20160904
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20160903
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20160902
channel ORA_DISK_1: no AUTOBACKUP in 7 days found
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/08/2016 11:21:42
RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece

RMAN> restore spfile from '/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_08/o1_mf_ncsnf_TAG20160908T111600_cx1p208k_.bkp';

Starting restore at 08-SEP-16
using channel ORA_DISK_1

channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_08/o1_mf_ncsnf_TAG20160908T111600_cx1p208k_.bkp
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 08-SEP-16

RMAN> shutdown immediate

Oracle instance shut down

RMAN> startup open

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "open": expecting one of: "dba, force, mount, newline, nomount, pfile, ;"
RMAN-01007: at line 1 column 9 file: standard input

RMAN> startup

connected to target database (not started)
Oracle instance started
database mounted
database opened

Total System Global Area     768294912 bytes

Fixed Size                     2257192 bytes
Variable Size                486543064 bytes
Database Buffers             276824064 bytes
Redo Buffers                   2670592 bytes
演示從memory恢復。
[oracle@localhost 2016_09_08]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/dbs/
[oracle@localhost dbs]$ ls
hc_orcl.dat  init.ora  lkORCL  orapworcl  snapcf_orcl.f  spfileorcl.ora
[oracle@localhost dbs]$ rm spfileorcl.ora
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 8 11:26:24 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create spfile from memory;
create spfile from memory
*
ERROR at line 1:
ORA-32002: cannot create SPFILE already being used by the instance


SQL> alter system set db_files = 2000 scope = spfile;
alter system set db_files = 2000 scope = spfile
*
ERROR at line 1:
ORA-01565: error in identifying file
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileorcl.ora'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3


SQL> create spfile from memory;
create spfile from memory
*
ERROR at line 1:
ORA-32002: cannot create SPFILE already being used by the instance


SQL> create spfile = '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileorcl.ora' from memory;
create spfile = '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileorcl.ora' from memory
*
ERROR at line 1:
ORA-32002: cannot create SPFILE already being used by the instance


SQL> create spfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileORCL.ora' from memory;

File created.

SQL> alter system set db_files = 2000 scope = spfile;
alter system set db_files = 2000 scope = spfile
*
ERROR at line 1:
ORA-01565: error in identifying file
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileorcl.ora'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
這個時候我把之前的創建的新的spfileORCL.ora改名字
[oracle@localhost dbs]$ pwd
/u01/app/oracle/product/11.2.0/dbhome_1/dbs
[oracle@localhost dbs]$ mv spfileORCL.ora spfileorcl.ora
重新執行下面命令
SQL> alter system set db_files = 2000 scope = spfile;

System altered.

spfile和pfile都是在數據庫實例啓動的時候纔會用到,同時也是在數據庫做一些修改的時候纔會用到,所以,可以在中途移動這些文件。

丟失控制文件的恢復

[oracle@localhost dbs]$ cd /u01/app/oracle/oradata/orcl/
[oracle@localhost orcl]$ ls
control01.ctl  redo01.log  redo03.log    system01.dbf  undotbs01.dbf
example01.dbf  redo02.log  sysaux01.dbf  temp01.dbf    user01.dbf
[oracle@localhost orcl]$ rm control01.ctl 
[oracle@localhost orcl]$ cd /u01/app/oracle/fast_recovery_area/orcl/
[oracle@localhost orcl]$ rm control02.ctl
這裏面如果在linux環境下,可以不用備份恢復。
首先看看數據庫狀態。
[oracle@localhost fd]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 8 14:28:02 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE
這個時候我們刪除控制文件。
[oracle@localhost ~]$ rm /u01/app/oracle/oradata/orcl/control01.ctl 
[oracle@localhost ~]$ rm /u01/app/oracle/fast_recovery_area/orcl/control02.ctl 
[oracle@localhost ~]$ 
其實我們能發現,linux中數據庫依然能做操作。,並沒有宕機。windows則會宕機。
windows
C:\Users\Csong>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on 星期四 9月 8 14:35:05 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


連接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select open_mode from v$datbase;
select open_mode from v$datbase
*
第 1 行出現錯誤:
ORA-03113: 通信通道的文件結尾
進程 ID: 8960
會話 ID: 203 序列號: 3
linux
這個時候看看控制文件的進程號
[oracle@localhost ~]$ ps -ef | grep gen
oracle   12990     1  0 14:25 ?        00:00:00 ora_gen0_orcl
oracle   13907 13701  0 14:40 pts/1    00:00:00 grep --color=auto gen
[oracle@localhost ~]$ cd /proc/12990/fd/
[oracle@localhost fd]$ ll
total 0
lr-x------. 1 oracle oinstall 64 Sep  8 14:41 0 -> /dev/null
l-wx------. 1 oracle oinstall 64 Sep  8 14:41 1 -> /dev/null
l-wx------. 1 oracle oinstall 64 Sep  8 14:41 10 -> /u01/app/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl.log
lr-x------. 1 oracle oinstall 64 Sep  8 14:41 11 -> /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/mesg/oraus.msb
l-wx------. 1 oracle oinstall 64 Sep  8 14:41 2 -> /dev/null
lrwx------. 1 oracle oinstall 64 Sep  8 14:41 256 -> /u01/app/oracle/oradata/orcl/control01.ctl (deleted)
lrwx------. 1 oracle oinstall 64 Sep  8 14:41 257 -> /u01/app/oracle/fast_recovery_area/orcl/control02.ctl (deleted)
lr-x------. 1 oracle oinstall 64 Sep  8 14:41 3 -> /dev/null
lr-x------. 1 oracle oinstall 64 Sep  8 14:41 4 -> /dev/null
lr-x------. 1 oracle oinstall 64 Sep  8 14:41 5 -> /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/mesg/oraus.msb
lr-x------. 1 oracle oinstall 64 Sep  8 14:41 6 -> /proc/12990/fd
lr-x------. 1 oracle oinstall 64 Sep  8 14:41 7 -> /dev/zero
lrwx------. 1 oracle oinstall 64 Sep  8 14:41 8 -> /u01/app/oracle/product/11.2.0/dbhome_1/dbs/hc_orcl.dat
lrwx------. 1 oracle oinstall 64 Sep  8 14:41 9 -> /u01/app/oracle/product/11.2.0/dbhome_1/dbs/lkORCL
我們發現有兩個連接,狀態是deleted。
我們可以cp恢復。
[oracle@localhost fd]$ cp 256 /u01/app/oracle/oradata/orcl/control01.ctl
[oracle@localhost fd]$ cp 257 /u01/app/oracle/fast_recovery_area/orcl/control02.ctl.
這裏操作數據庫是可以的,但是關閉實例還是會報錯。
SQL> shutdown immediate
Database closed.
ORA-03113: end-of-file on communication channel
Process ID: 14010
Session ID: 1 Serial number: 3

SQL> startup open;
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn't exist
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@localhost fd]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 8 14:58:53 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup open
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area  768294912 bytes
Fixed Size		    2257192 bytes
Variable Size		  490737368 bytes
Database Buffers	  272629760 bytes
Redo Buffers		    2670592 bytes
Database mounted.
Database opened.
用RMAN恢復。
[oracle@localhost fd]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Sep 8 15:06:18 2016

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

connected to target database: ORCL (DBID=1448371606)

RMAN> backup database;

Starting backup at 08-SEP-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=38 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/orcl/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/user01.dbf
channel ORA_DISK_1: starting piece 1 at 08-SEP-16
channel ORA_DISK_1: finished piece 1 at 08-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_08/o1_mf_nnndf_TAG20160908T150623_cx23hhqc_.bkp tag=TAG20160908T150623 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 08-SEP-16
channel ORA_DISK_1: finished piece 1 at 08-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_08/o1_mf_ncsnf_TAG20160908T150623_cx23klbk_.bkp tag=TAG20160908T150623 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 08-SEP-16
這個時候刪除controlfile
RMAN> shutdown abort

Oracle instance shut down

RMAN> startup nomount

connected to target database (not started)
Oracle instance started

Total System Global Area     768294912 bytes

Fixed Size                     2257192 bytes
Variable Size                490737368 bytes
Database Buffers             272629760 bytes
Redo Buffers                   2670592 bytes

RMAN> restore controlfile from '/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_08/o1_mf_ncsnf_TAG20160908T150623_cx23klbk_.bkp';

Starting restore at 08-SEP-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/orcl/control01.ctl
output file name=/u01/app/oracle/fast_recovery_area/orcl/control02.ctl
Finished restore at 08-SEP-16

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN> recover database;

Starting recover at 08-SEP-16
Starting implicit crosscheck backup at 08-SEP-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 08-SEP-16

Starting implicit crosscheck copy at 08-SEP-16
using channel ORA_DISK_1
Crosschecked 9 objects
Finished implicit crosscheck copy at 08-SEP-16

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_08/o1_mf_ncsnf_TAG20160908T150623_cx23klbk_.bkp

using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 5 is already on disk as file /u01/app/oracle/oradata/orcl/redo02.log
archived log file name=/u01/app/oracle/oradata/orcl/redo02.log thread=1 sequence=5
media recovery complete, elapsed time: 00:00:00
Finished recover at 08-SEP-16

RMAN> alter database open resetlogs;

database opened

數據文件損壞

[oracle@localhost orcl]$ rm user01.dbf 
RMAN> sql 'alter database datafile 4 offline';

sql statement: alter database datafile 4 offline

RMAN> restore datafile 4;

Starting restore at 08-SEP-16
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/orcl/user01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_08/o1_mf_nnndf_TAG20160908T150623_cx23hhqc_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_08/o1_mf_nnndf_TAG20160908T150623_cx23hhqc_.bkp tag=TAG20160908T150623
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 08-SEP-16

RMAN> recover datafile 4;

Starting recover at 08-SEP-16
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 5 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_08/o1_mf_1_5_cx23rpnb_.arc
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_08/o1_mf_1_5_cx23rpnb_.arc thread=1 sequence=5
media recovery complete, elapsed time: 00:00:00
Finished recover at 08-SEP-16

RMAN> sql 'alter database datafile 4 online';

sql statement: alter database datafile 4 online

表空間損壞

只是文件損壞。
RMAN> sql 'alter tablespace users offline';

sql statement: alter tablespace users offline
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 09/08/2016 15:19:27
RMAN-11003: failure during parse/execution of SQL statement: alter tablespace users offline
ORA-01116: error in opening database file 4
ORA-01110: data file 4: '/u01/app/oracle/oradata/orcl/user01.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

RMAN> sql 'alter tablespace users offline immediate';

sql statement: alter tablespace users offline immediate

RMAN> restore tablespace users;

Starting restore at 08-SEP-16
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/orcl/user01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_08/o1_mf_nnndf_TAG20160908T150623_cx23hhqc_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_08/o1_mf_nnndf_TAG20160908T150623_cx23hhqc_.bkp tag=TAG20160908T150623
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 08-SEP-16

RMAN> recover tablespace users;

Starting recover at 08-SEP-16
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 5 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_08/o1_mf_1_5_cx23rpnb_.arc
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_08/o1_mf_1_5_cx23rpnb_.arc thread=1 sequence=5
media recovery complete, elapsed time: 00:00:00
Finished recover at 08-SEP-16

RMAN> sql 'alter tablespace users online';

sql statement: alter tablespace users online
表空間刪除
我這裏創建了一個表空間後,又做了一次全庫備份。
如果需要刪除表空間後的其他數據庫數據,則使用TSPITR,或者異機恢復後導回原庫。
如果後面的數據無所謂,則可以全庫基於時間點的恢復。
使用RMAN TSPITR恢復drop的表空間。
創建表空間
<pre name="code" class="sql">SQL> create tablespace Csong datafile '/u01/app/oracle/oradata/orcl/Csong.dbf' size 200m;
Tablespace created.

做全備
RMAN> backup database;

Starting backup at 09-SEP-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/orcl/example01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/Csong.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/orcl/liyuanyuan.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 09-SEP-16
channel ORA_DISK_1: finished piece 1 at 09-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_09/o1_mf_nnndf_TAG20160909T161517_cx4vwqcz_.bkp tag=TAG20160909T161517 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 09-SEP-16
channel ORA_DISK_1: finished piece 1 at 09-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_09/o1_mf_ncsnf_TAG20160909T161517_cx4vyrbr_.bkp tag=TAG20160909T161517 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 09-SEP-16
創建一個新的表空間liyuanyuan,創建tablespace 爲liyuanyuan的表Csong
<pre name="code" class="sql">SQL> create tablespace liyuanyuan datafile '/u01/app/oracle/oradata/orcl/liyuanyuan.dbf' size 200m;

Tablespace created.

SQL> create table Csong(id number(10)) tablespace liyuanyuan;
Table created.
SQL> insert into Csong select level from dual connect by level <= 200000;

200000 rows created.

刪掉表空間Csong
SQL> drop tablespace Csong including contents and datafiles;

Tablespace dropped。
RMAN TSPITR恢復
RMAN> recover tablespace Csong until time "to_date('2016-09-09 16:17:00','yyyy-mm-dd hh24:mi:ss')" auxiliary destination '/u01/app/oracle';

Starting recover at 09-SEP-16
using channel ORA_DISK_1
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='kchD'

initialization parameters used for automatic instance:
db_name=ORCL
db_unique_name=kchD_tspitr_ORCL
compatible=11.2.0.4.0
db_block_size=8192
db_files=200
sga_target=1G
processes=80
db_create_file_dest=/u01/app/oracle
log_archive_dest_1='location=/u01/app/oracle'
#No auxiliary parameter file used


starting up automatic instance ORCL

Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2260088 bytes
Variable Size                281019272 bytes
Database Buffers             780140544 bytes
Redo Buffers                   5517312 bytes
Automatic instance created


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

contents of Memory Script:
{
# set requested point in time
set until  time "to_date('2016-09-09 16:17:00','yyyy-mm-dd hh24:mi:ss')";
# 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 09-SEP-16
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=18 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 /u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_09/o1_mf_ncsnf_TAG20160909T161517_cx4vyrbr_.bkp
channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_09/o1_mf_ncsnf_TAG20160909T161517_cx4vyrbr_.bkp tag=TAG20160909T161517
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/ORCL/controlfile/o1_mf_cx4w30db_.ctl
Finished restore at 09-SEP-16

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  time "to_date('2016-09-09 16:17:00','yyyy-mm-dd hh24:mi:ss')";
# 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  6 to 
 "/u01/app/oracle/oradata/orcl/Csong.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, 6;
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 /u01/app/oracle/ORCL/datafile/o1_mf_temp_%u_.tmp in control file

Starting restore at 09-SEP-16
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 /u01/app/oracle/ORCL/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/ORCL/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /u01/app/oracle/ORCL/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/orcl/Csong.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_09/o1_mf_nnndf_TAG20160909T161517_cx4vwqcz_.bkp
channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_09/o1_mf_nnndf_TAG20160909T161517_cx4vwqcz_.bkp tag=TAG20160909T161517
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:15
Finished restore at 09-SEP-16

datafile 1 switched to datafile copy
input datafile copy RECID=5 STAMP=922119602 file name=/u01/app/oracle/ORCL/datafile/o1_mf_system_cx4w37no_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=6 STAMP=922119602 file name=/u01/app/oracle/ORCL/datafile/o1_mf_undotbs1_cx4w37sj_.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=7 STAMP=922119602 file name=/u01/app/oracle/ORCL/datafile/o1_mf_sysaux_cx4w37qw_.dbf

contents of Memory Script:
{
# set requested point in time
set until  time "to_date('2016-09-09 16:17:00','yyyy-mm-dd hh24:mi:ss')";
# 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  6 online";
# recover and open resetlogs
recover clone database tablespace  "CSONG", "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  6 online

Starting recover at 09-SEP-16
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 2 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_09/o1_mf_1_2_cx4w365j_.arc
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_09/o1_mf_1_2_cx4w365j_.arc thread=1 sequence=2
media recovery complete, elapsed time: 00:00:00
Finished recover at 09-SEP-16

database opened

contents of Memory Script:
{
# online the tablespaces that will be exported
sql clone 'alter tablespace  CSONG online';
# make read only the tablespace that will be exported
sql clone 'alter tablespace  CSONG read only';
# create directory for datapump import
sql "create or replace directory TSPITR_DIROBJ_DPDIR as ''
/u01/app/oracle''";
# create directory for datapump export
sql clone "create or replace directory TSPITR_DIROBJ_DPDIR as ''
/u01/app/oracle''";
}
executing Memory Script

sql statement: alter tablespace  CSONG online

sql statement: alter tablespace  CSONG read only

sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/app/oracle''

sql statement: create or replace directory TSPITR_DIROBJ_DPDIR as ''/u01/app/oracle''

Performing export of metadata...
   EXPDP> Starting "SYS"."TSPITR_EXP_kchD":  
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
   EXPDP> Master table "SYS"."TSPITR_EXP_kchD" successfully loaded/unloaded
   EXPDP> ******************************************************************************
   EXPDP> Dump file set for SYS.TSPITR_EXP_kchD is:
   EXPDP>   /u01/app/oracle/tspitr_kchD_33345.dmp
   EXPDP> ******************************************************************************
   EXPDP> Datafiles required for transportable tablespace CSONG:
   EXPDP>   /u01/app/oracle/oradata/orcl/Csong.dbf
   EXPDP> Job "SYS"."TSPITR_EXP_kchD" successfully completed at Fri Sep 9 16:21:34 2016 elapsed 0 00:00:59
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_kchD" successfully loaded/unloaded
   IMPDP> Starting "SYS"."TSPITR_IMP_kchD":  
   IMPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
   IMPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
   IMPDP> Job "SYS"."TSPITR_IMP_kchD" successfully completed at Fri Sep 9 16:22:08 2016 elapsed 0 00:00:04
Import completed


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

sql statement: alter tablespace  CSONG read write

sql statement: alter tablespace  CSONG offline

sql statement: begin dbms_backup_restore.AutoBackupFlag(TRUE); end;

Removing automatic instance
Automatic instance removed
auxiliary instance file /u01/app/oracle/ORCL/datafile/o1_mf_temp_cx4w5sxh_.tmp deleted
auxiliary instance file /u01/app/oracle/ORCL/onlinelog/o1_mf_3_cx4w5qxn_.log deleted
auxiliary instance file /u01/app/oracle/ORCL/onlinelog/o1_mf_2_cx4w5q1g_.log deleted
auxiliary instance file /u01/app/oracle/ORCL/onlinelog/o1_mf_1_cx4w5o9c_.log deleted
auxiliary instance file /u01/app/oracle/ORCL/datafile/o1_mf_sysaux_cx4w37qw_.dbf deleted
auxiliary instance file /u01/app/oracle/ORCL/datafile/o1_mf_undotbs1_cx4w37sj_.dbf deleted
auxiliary instance file /u01/app/oracle/ORCL/datafile/o1_mf_system_cx4w37no_.dbf deleted
auxiliary instance file /u01/app/oracle/ORCL/controlfile/o1_mf_cx4w30db_.ctl deleted
Finished recover at 09-SEP-16
校驗
SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
EXAMPLE
CSONG
LIYUANYUAN

8 rows selected.

SQL> select count(1) from Csong;

  COUNT(1)
----------
    200000
其實通過恢復的信息能看到,數據庫自動創建了一個auxiliary實例(實例名未指定的話則隨機),然後在新的實例上全庫基於時間點恢復了之前的備份,然後EXPDP導出了還原的tablespace,然後IMPDP回target庫。

基於時間點的不完全恢復

RMAN> backup database;

Starting backup at 10-SEP-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/orcl/example01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/Csong.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/orcl/liyuanyuan.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 10-SEP-16
channel ORA_DISK_1: finished piece 1 at 10-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_10/o1_mf_nnndf_TAG20160910T165650_cx7lpm3c_.bkp tag=TAG20160910T165650 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 10-SEP-16
channel ORA_DISK_1: finished piece 1 at 10-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_10/o1_mf_ncsnf_TAG20160910T165650_cx7lrq70_.bkp tag=TAG20160910T165650 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 10-SEP-16

RMAN> shutdown immediate

database dismounted
Oracle instance shut down

RMAN> startup mount

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area     768294912 bytes

Fixed Size                     2257192 bytes
Variable Size                503320280 bytes
Database Buffers             260046848 bytes
Redo Buffers                   2670592 bytes

RMAN> run{
2> set until time "to_date('2016-09-10 17:30:00','yyyy-mm-dd hh24:mi:ss')";
3> restore database;
4> recover database;
5> alter database open resetlogs;
6> }

executing command: SET until clause

Starting restore at 10-SEP-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK

datafile 6 not processed because file is offline
skipping datafile 1; already restored to file /u01/app/oracle/oradata/orcl/system01.dbf
skipping datafile 2; already restored to file /u01/app/oracle/oradata/orcl/sysaux01.dbf
skipping datafile 3; already restored to file /u01/app/oracle/oradata/orcl/undotbs01.dbf
skipping datafile 4; already restored to file /u01/app/oracle/oradata/orcl/users01.dbf
skipping datafile 5; already restored to file /u01/app/oracle/oradata/orcl/example01.dbf
skipping datafile 7; already restored to file /u01/app/oracle/oradata/orcl/liyuanyuan.dbf
restore not done; all files read only, offline, or already restored
Finished restore at 10-SEP-16

Starting recover at 10-SEP-16
using channel ORA_DISK_1
datafile 6 not processed because file is offline

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 10-SEP-16

database opened

基於日誌序列的不完全恢復

先做一次全庫備份
RMAN> backup database;

Starting backup at 10-SEP-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/orcl/example01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/orcl/Csong.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/orcl/liyuanyuan.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 10-SEP-16
channel ORA_DISK_1: finished piece 1 at 10-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_10/o1_mf_nnndf_TAG20160910T181024_cx7q0k03_.bkp tag=TAG20160910T181024 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 10-SEP-16
channel ORA_DISK_1: finished piece 1 at 10-SEP-16
piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_10/o1_mf_ncsnf_TAG20160910T181024_cx7q397p_.bkp tag=TAG20160910T181024 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 10-SEP-16
切換日誌
SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> archive log list;
Database log mode	       Archive Mode
Automatic archival	       Enabled
Archive destination	       USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     14
Next log sequence to archive   16
Current log sequence	       16
現在做恢復。恢復到10
RMAN> restore database until sequence 10 thread 1;

Starting restore at 10-SEP-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK

datafile 6 not processed because file is offline
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/orcl/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/orcl/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/orcl/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/orcl/example01.dbf
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/orcl/liyuanyuan.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_10/o1_mf_nnndf_TAG20160910T181024_cx7q0k03_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/ORCL/backupset/2016_09_10/o1_mf_nnndf_TAG20160910T181024_cx7q0k03_.bkp tag=TAG20160910T181024
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:25
Finished restore at 10-SEP-16

RMAN> recover database until sequence 10 thread 1;

Starting recover at 10-SEP-16
using channel ORA_DISK_1
datafile 6 not processed because file is offline

starting media recovery

archived log for thread 1 with sequence 5 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_10/o1_mf_1_5_cx7q44y7_.arc
archived log for thread 1 with sequence 6 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_10/o1_mf_1_6_cx7q49l0_.arc
archived log for thread 1 with sequence 7 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_10/o1_mf_1_7_cx7q4d4g_.arc
archived log for thread 1 with sequence 8 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_10/o1_mf_1_8_cx7q4dt5_.arc
archived log for thread 1 with sequence 9 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_10/o1_mf_1_9_cx7q4fjf_.arc
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_10/o1_mf_1_5_cx7q44y7_.arc thread=1 sequence=5
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_10/o1_mf_1_6_cx7q49l0_.arc thread=1 sequence=6
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_10/o1_mf_1_7_cx7q4d4g_.arc thread=1 sequence=7
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_10/o1_mf_1_8_cx7q4dt5_.arc thread=1 sequence=8
archived log file name=/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2016_09_10/o1_mf_1_9_cx7q4fjf_.arc thread=1 sequence=9
media recovery complete, elapsed time: 00:00:02
Finished recover at 10-SEP-16

RMAN> alter database open resetlogs;

database opened


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章