• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

12c RMAN新特性restore/recover from service远程恢复

mysql 搞代码 4年前 (2022-01-09) 17次浏览 已收录 0个评论

12c中提供了基于网络的RMAN Restore和recover功能: About Restoring Files Over the Network RMAN restores database files, over the network, from a physical standby database by using the FROM SERVICE clause of the RESTORE command. The FROM SERV

12c中提供了基于网络的RMAN Restore和recover功能:

About Restoring Files Over the Network

RMAN restores database files, over the network, from a physical standby database by using the FROM SERVICE clause of the RESTORE command. The FROM SERVICE clause provides the service name of the physical standby database from which the files must be restored. During the restore operation, RMAN creates backup sets, on the physical standby database, of the files that need to be restored and then transfers these backup sets to the target database over the network.

Use the SECTION SIZE clause of the RESTORE command to perform a multisection restore operation. To encrypt the backup sets created on the physical standby database, use the SET ENCRYPTION command before the RESTORE command to specify the encryption algorithm used.

To transfer files from the physical standby database as compressed backup sets, use the USING COMPRESSED BACKU本文来源gaodai#ma#com搞*!代#%^码网5PSET clause in the RESTORE command. By default, RMAN compresses backup sets using the algorithm that is set in the RMAN configuration. You can override the default and set a different algorithm by using the SET COMPRESSION ALGORITHM command before the RESTORE statement.

About Recovering Files Over the Network

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

可以通过restore .. from service指定的对象类型:

  • database
  • datafile
  • tablespace
  • 控制文件
  • SPFILE

当在主库Primary丢失/或损坏FILE#=6的user01.dbf数据文件时,可以直接使用restore datafile from service来从standby(其实并不要求一定是DataGuard,只需要是合适的备用库即可)上获得数据文件,例如:

select * from v$version;BANNER                                                                                         CON_ID------------------------------------------------------------------------------------------ ----------Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production                        0PL/SQL Release 12.1.0.2.0 - Production                                                              0CORE    12.1.0.2.0      Production                                                                          0TNS for Linux: Version 12.1.0.2.0 - Production                                                      0NLSRTL Version 12.1.0.2.0 - Production                                                           askmaclean.comRMAN> select name from v$datafile where file#=6;NAME                                                                            --------------------------------------------------------------------------------/s01/oradata/PDPROD/datafile/o1_mf_users_b2wgb20l_.dbfRMAN> alter database datafile 6 offline;Statement processedRMAN> restore datafile 6 from service pdstby;Starting restore at 04-OCT-14allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=51 device type=DISKchannel ORA_DISK_1: starting datafile backup set restorechannel ORA_DISK_1: using network backup set from service pdstbychannel ORA_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_DISK_1: restoring datafile 00006 to /s01/oradata/PDPROD/datafile/o1_mf_users_b2wgb20l_.dbfchannel ORA_DISK_1: restore complete, elapsed time: 00:00:01Finished restore at 04-OCT-14RMAN> recover datafile 6 from service pdstby;Starting recover at 04-OCT-14using channel ORA_DISK_1channel ORA_DISK_1: starting incremental datafile backup set restorechannel ORA_DISK_1: using network backup set from service pdstbydestination for restore of datafile 00006: /s01/oradata/PDPROD/datafile/o1_mf_users_b2wgb20l_.dbfRMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of recover command at 10/04/2014 02:57:09ORA-19845: error in backupDatafile while communicating with remote database serverORA-17628: Oracle error 19648 returned by remote Oracle serverORA-19648: datafile : incremental-start SCN equals checkpoint SCNORA-19660: some files in the backup set could not be verifiedORA-19661: datafile 6 could not be verifiedORA-19845: error in backupDatafile while communicating with remote database serverORA-17628: Oracle error 19648 returned by remote Oracle serverORA-19648: datafile : incremental-start SCN equals checkpoint SCN之后recover 并online datafile 6即可

具体的几种用法:

  • 数据库级别: restore database from service
  • 表空间: restore tablespace from service
  • 控制文件: restore controlfile to ‘指定的位置’ from service
  • SPFILE: restore spfile from service

通过recover .. from service命令可以通过网络将service指定的数据库的增量备份拉过来在本地做recover从而让本地数据库跟上远程数据库的SCN。

CONNECT TARGET “sys/@standby as sysdba”?RECOVER DATABASE?FROM SERVICE primary;

此外上述增量备份还可以是基于压缩备份的:

SET COMPRESSION ALGORITHM ‘BASIC’;

SET COMPRESSION ALGORITHM ‘LOW’;

SET COMPRESSION ALGORITHM ‘MEDIUM’;

SET COMPRESSION ALGORITHM ‘HIGH’;

CONNECT TARGET “sys/@standby as sysdba”

SET COMPRESSION ALGORITHM ‘BASIC’;

RECOVER DATABASE FROM SERVICE primary

USING COMPRESSED BACKUPSET;

Related posts:

  1. fast incremental backup failed on standby database
  2. 【故障诊断】RMAN-06026与ABSOLUTE_FUZZY_CHANGE#
  3. Exadata offload incremental backup
  4. Rolling a Standby Forward using an RMAN Incremental Backup
  5. Exadata X2-2 1/4 RACK并行备份测试
  6. 11g新特性recover corruption list
  7. 12c新特性:Recover Table
  8. Duplicate standby database from active database
  9. OMF下Restore Oracle Datafile的优先级问题
  10. 【Oracle备份】RMAN备份如何备份完不删除归档并不重复备份归档日志

搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:12c RMAN新特性restore/recover from service远程恢复

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址