|
|
我现在模拟表空间损坏进行了恢复取得了成功,但是rman采用的是最近一次备份进行恢复,我现在有多个rman备份文件,请问我在rman中如何指定备份文件进行恢复,如我有以下rman备份,test_1_545581077.bak是我最近的一次备份,我现在想用test_1_545580979.bak恢复,我的恢复语句该怎么写?此外我想问一下数据库处于startup状态,能够对表空间进行恢复吗?
我的备份文件如下:
[root@test rman]# ll -th
总用量 8.4G
-rw-r----- 1 oracle oinstall 775K 12月 22 14:20 14g89q52_1_1_36.bak
-rw-r----- 1 oracle oinstall 1.5G 12月 22 14:19 test_1_545581077.bak[/COLOR]
-rw-r----- 1 oracle oinstall 623M 12月 22 14:17 test_1_545580979.bak[/COLOR]
-rw-r----- 1 oracle oinstall 1.3M 12月 22 14:07 0ug89pd3_1_1_30.bak
-rw-r----- 1 oracle oinstall 1.5G 12月 22 14:06 test_1_545580240.bak
-rw-r----- 1 oracle oinstall 623M 12月 22 14:01 test_1_545580042.bak
-rw-r----- 1 oracle oinstall 623M 12月 22 13:59 test_1_545579886.bak
-rw-r----- 1 oracle oinstall 1.5G 12月 22 13:57 test_1_545579683.bak
-rw-r----- 1 oracle oinstall 1.5G 12月 22 13:54 test_1_545579496.bak
-rw-r----- 1 oracle oinstall 623M 12月 22 13:48 test_1_545579276
我的模拟表空间丢失恢复过程如下
[oracle@test test]$ sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 - Production on Wed Dec 22 15:25:56 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn / as sysdba
Connected to an idle instance.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
[oracle@test test]$ pwd
/oracle/oradata/test
[oracle@test test]$ mv GAME.dbf /opt/
[oracle@test test]$ sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 - Production on Wed Dec 22 15:25:56 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
[oracle@test bin]$ ./rman
Recovery Manager: Release 9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
RMAN> connect target /
connected to target database: test (DBID=3541278024)
RMAN> run{
2> allocate channel c1 type disk;
3> restore tablespace game;
4> recover tablespace game;
5> }
using target database controlfile instead of recovery catalog
allocated channel: c1
channel c1: sid=13 devtype=DISK
Starting restore at 22-DEC-04
channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00011 to /oracle/oradata/test/GAME.dbf
channel c1: restored backup piece 1
piece handle=/opt/rman/test_1_545581077.bak[/COLOR]tag=TAG20041222T141757 params=NULL
channel c1: restore complete
Finished restore at 22-DEC-04
Starting recover at 22-DEC-04
starting media recovery
media recovery complete
Finished recover at 22-DEC-04
released channel: c1
SQL> alter database open;
Database altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> |
|