RMAN can perform recovery by fetching an incremental backup, over the network, from a primary database and then applying this incremental backup to the physical standby database. RMAN is connected as TARGET
to the physical standby database. The recovery process is optimized by restoring only the used data blocks in a data file. Use the FROM SERVICE
clause to specify the service name of the primary database from which the incremental backup must be fetched.
To use multisection backup sets during the recovery process, specify the SECTION SIZE
clause in the RECOVER
command. To transfer the required files from the primary database as encrypted backup sets, use the SET ENCRYPTION
command before the RESTORE
command to specify the encryption algorithm used to create the backup sets.
To compress backup sets that are used to recover files over the network, use the USING COMPRESSED BACKUPSET
. RMAN compresses backup sets when it creates them on the primary database and then transfers these backup sets to the target
可以通過(guò)restore .. from service指定的對(duì)象類(lèi)型:
當(dāng)在主庫(kù)Primary丟失/或損壞FILE#=6的user01.dbf數(shù)據(jù)文件時(shí),可以直接使用restore datafile from service來(lái)從standby(其實(shí)并不要求一定是DataGuard,只需要是合適的備用庫(kù)即可)上獲得數(shù)據(jù)文件,例如:
select * from v$version; BANNER CON_ID ------------------------------------------------------------------------------------------ ---------- Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production 0 PL/SQL Release 12.1.0.2.0 - Production 0 CORE 12.1.0.2.0 Production 0 TNS for Linux: Version 12.1.0.2.0 - Production 0 NLSRTL Version 12.1.0.2.0 - Production askmaclean.com RMAN> select name from v$datafile where file#=6; NAME -------------------------------------------------------------------------------- /s01/oradata/PDPROD/datafile/o1_mf_users_b2wgb20l_.dbf RMAN> alter database datafile 6 offline; Statement processed RMAN> restore datafile 6 from service pdstby; Starting restore at 04-OCT-14 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=51 device type=DISK channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: using network backup set from service pdstby channel ORA_DISK_1: specifying datafile(s) to restore from backup set channel ORA_DISK_1: restoring datafile 00006 to /s01/oradata/PDPROD/datafile/o1_mf_users_b2wgb20l_.dbf channel ORA_DISK_1: restore complete, elapsed time: 00:00:01 Finished restore at 04-OCT-14 RMAN> recover datafile 6 from service pdstby; Starting recover at 04-OCT-14 using channel ORA_DISK_1 channel ORA_DISK_1: starting incremental datafile backup set restore channel ORA_DISK_1: using network backup set from service pdstby destination for restore of datafile 00006: /s01/oradata/PDPROD/datafile/o1_mf_users_b2wgb20l_.dbf RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of recover command at 10/04/2014 02:57:09 ORA-19845: error in backupDatafile while communicating with remote database server ORA-17628: Oracle error 19648 returned by remote Oracle server ORA-19648: datafile : incremental-start SCN equals checkpoint SCN ORA-19660: some files in the backup set could not be verified ORA-19661: datafile 6 could not be verified ORA-19845: error in backupDatafile while communicating with remote database server ORA-17628: Oracle error 19648 returned by remote Oracle server ORA-19648: datafile : incremental-start SCN equals checkpoint SCN 之后recover 并online datafile 6即可
具體的幾種用法:
通過(guò)recover .. from service命令可以通過(guò)網(wǎng)絡(luò)將service指定的數(shù)據(jù)庫(kù)的增量備份拉過(guò)來(lái)在本地做recover從而讓本地?cái)?shù)據(jù)庫(kù)跟上遠(yuǎn)程數(shù)據(jù)庫(kù)的SCN。
CONNECT TARGET “sys/
此外上述增量備份還可以是基于壓縮備份的:
SET COMPRESSION ALGORITHM ‘BASIC';
SET COMPRESSION ALGORITHM ‘LOW';
SET COMPRESSION ALGORITHM ‘MEDIUM';
SET COMPRESSION ALGORITHM ‘HIGH';
CONNECT TARGET “sys/
SET COMPRESSION ALGORITHM ‘BASIC';
RECOVER DATABASE FROM SERVICE primary
USING COMPRESSED BACKUPSET;
Related posts:
原文地址:12c RMAN新特性restore/recover from service遠(yuǎn)程恢復(fù), 感謝原作者分享。
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com