備份與恢復:用rman方式基於日誌序列的不完全恢復
RMAN> run{
2> allocate channel c1 type disk;
3> backup full tag 'dbfull' format 'd:\backup\full%u_%s_%p' database
4> include current controlfile;
5> sql 'alter system archive log current';
6> release channel c1;
7> }
sql> insert into test values (16);
commit;
sql>alter system switch logfile;
sql> insert into test values (17);
commit;
sql>alter system switch logfile;
SQL> select * from test;
A
----------
1
2
3
4
5
6
7
8
9
10
11
A
----------
12
13
14 --這之前資料是14號日誌前產生的
16
17 --這之後資料是14號日誌後產生的
16 rows selected.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination D:\oracle\ora92\RDBMS
Oldest online log sequence 14
Next log sequence to archive 16
Current log sequence 16
SQL> alter system switch logfile;
System altered.
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIME
------------- -------------------
1 1 16 104857600 1 YES ACTIVE
84134 2008-04-10 11:39:19
2 1 17 104857600 1 NO CURRENT
84150 2008-04-10 11:40:00
3 1 15 104857600 1 YES ACTIVE
84128 2008-04-10 11:39:10
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
RMAN> shutdown immediate;
using target database controlfile instead of recovery catalog
database closed
database dismounted
Oracle instance shut down
RMAN> startup nomount;
connected to target database (not started)
Oracle instance started
Total System Global Area 101785252 bytes
Fixed Size 454308 bytes
Variable Size 75497472 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
RMAN> alter database mount;
database mounted
RMAN> run{
2> allocate channel c1 type disk;
3> set until logseq 14 thread 1; --基於日誌序列號的不完全恢復
4> restore database;
5> recover database;
6> sql 'alter database open resetlogs';
7> }
allocated channel: c1
channel c1: sid=11 devtype=DISK
executing command: SET until clause
Starting restore at 2008-04-10 11:50:05
datafile 4 not processed because file is read-only
channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to D:\ORACLE\ORADATA\PUBTEST\SYSTEM01.DBF
restoring datafile 00002 to D:\ORACLE\ORADATA\PUBTEST\UNDOTBS01.DBF
restoring datafile 00003 to D:\ORACLE\ORADATA\PUBTEST\INDX01.DBF
restoring datafile 00005 to D:\ORACLE\ORADATA\PUBTEST\USERS01.DBF
channel c1: restored backup piece 1
piece handle=D:\ORACLE\ORA92\DATABASE\04JDFCP3_1_1 tag=TAG20080410T113100 params
=NULL
channel c1: restore complete
Finished restore at 2008-04-10 11:50:42
Starting recover at 2008-04-10 11:50:42
datafile 4 not processed because file is read-only
starting media recovery
archive log thread 1 sequence 9 is already on disk as file D:\ORACLE\ORA92\RDBMS
\ARC00009.001
archive log thread 1 sequence 10 is already on disk as file D:\ORACLE\ORA92\RDBM
S\ARC00010.001
archive log thread 1 sequence 11 is already on disk as file D:\ORACLE\ORA92\RDBM
S\ARC00011.001
archive log thread 1 sequence 12 is already on disk as file D:\ORACLE\ORA92\RDBM
S\ARC00012.001
archive log thread 1 sequence 13 is already on disk as file D:\ORACLE\ORA92\RDBM
S\ARC00013.001
archive log filename=D:\ORACLE\ORA92\RDBMS\ARC00009.001 thread=1 sequence=9
archive log filename=D:\ORACLE\ORA92\RDBMS\ARC00010.001 thread=1 sequence=10
archive log filename=D:\ORACLE\ORA92\RDBMS\ARC00011.001 thread=1 sequence=11
archive log filename=D:\ORACLE\ORA92\RDBMS\ARC00012.001 thread=1 sequence=12
archive log filename=D:\ORACLE\ORA92\RDBMS\ARC00013.001 thread=1 sequence=13
media recovery complete
Finished recover at 2008-04-10 11:50:43
sql statement: alter database open resetlogs
released channel: c1
RMAN> exit
Recovery Manager complete.
C:\Documents and Settings\Paul Yi>sqlplus "/as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Thu Apr 10 11:52:12 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
SQL> select * from test;
A
----------
1
2
3
4
5
6
7
8
9
10
11
A
----------
12
13
14
14 rows selected.
SQL>
看結果只恢復到14號日誌前的資料
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-232350/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 備份與恢復:用user模式基於日誌序列的不完全恢復模式
- 使用RMAN的不完全恢復-基於時間/SCN/日誌序列
- 【備份與恢復】控制檔案的恢復(不完全恢復)
- 恢復到特定點(時間點、scn、日誌序列號),rman不完全恢復
- MySQL備份與恢復——基於Xtrabackup物理備份恢復MySql
- 備份與恢復--從備份的歸檔日誌中恢復資料
- 【備份與恢復】使用Flashback Database(不完全恢復)Database
- MySQL 日誌管理、備份與恢復MySql
- 【備份恢復】 恢復重做日誌組成員
- 【備份與恢復】恢復受損的複用聯機重做日誌檔案
- RMAN備份及恢復歸檔日誌的語法
- MySQL備份與恢復——基於MyDumper/MyLoader 邏輯備份恢復MySql
- RMAN備份與恢復之加密備份加密
- Oracle RMAN 不完全恢復(只有資料檔案備份,丟失歸檔日誌備份)Oracle
- MySQL備份與恢復——基於OUTFILE /LOAD DATA 邏輯備份恢復MySql
- 【備份恢復】恢復inactive狀態的日誌檔案
- RMAN備份恢復原理
- 【管理篇備份恢復】備份恢復基礎
- MySQL日誌管理,備份和恢復MySql
- 冷備份+歸檔日誌的恢復
- rman恢復--丟失聯機重做日誌的恢復
- 循序漸進oracle第7章:備份與恢復之RMAN映象拷貝不完全恢復Oracle
- rman備份恢復-rman入門
- RMAN 備份與恢復深入解析(二)
- RMAN 備份與恢復深入解析(一)
- 【轉】 RMAN備份與恢復實踐
- RMAN基於備份控制檔案恢復失敗
- RMAN備份恢復之控制檔案的恢復(三)
- RMAN備份恢復之控制檔案的恢復(二)
- RMAN備份恢復之控制檔案的恢復(一)
- rman備份恢復-rman恢復資料檔案測試
- Oracle 基於 RMAN 的不完全恢復(incomplete recovery by RMAN)Oracle
- 用冷備份+歸檔日誌執行不完全恢復一例
- 【rman 備份與恢復】恢復丟失所有的控制檔案
- RMAN備份恢復之歸檔日誌對BLOCKRECOVER的影響BloC
- 備份與恢復--利用備份的控制檔案恢復
- oracle rman備份恢復的例子Oracle
- 循序漸進oracle第7章:備份與恢復之RMAN的簡單備份與恢復Oracle