12c RMAN新特性之通过网络远程恢复数据库(RESTORE Recover from Service)

0    171    1

Tags:

👉 本文共约6299个字,系统预计阅读时间或需24分钟。

通过网络远程恢复数据库(Restore/Recover from Service)

在Oracle 12c中,可以在主数据库和备用数据库之间用一个服务名重新获得或恢复数据文件、控制文件、参数文件(SPFILE)、表空间或整个数据库。这对于同步主数据库和备用数据库极为有用。

当主数据库和备用数据库之间存在相当大的差异时,不再需要复杂的前滚流程来填补它们之间的差异。RMAN能够通过网络执行备用恢复以进行增量备份,并且可以将它们应用到物理备用数据库。可以用服务名直接将所需数据文件从备用点拷贝至主站,这是为了防止主数据库上数据文件、表空间的丢失,或是没有真正从备份集恢复数据文件。

具体的几种用法:

以下命令演示了如何用此新功能执行一个前滚来对备用数据库和主数据库进行同步。在物理备用数据库上:

以上案例使用备用数据库上定义的primary_db_tns连接字符串连接到主数据库,然后执行了一个增量备份,再将这些增量备份传输至备用目的地,接着将应用这些文件到备用数据库来进行同步。然而,需要确保已经对primary_db_tns进行了配置,即在备份数据库端将其指向主数据库。

在以下命令中,演示了通过从备用数据库获取数据文件来恢复主数据库上丢失的数据文件。在主数据库上:

& 说明:

有关RECOVER TABLE的更多内容可以参考我的BLOG:http://blog.itpub.net/26736162/viewspace-2152712/

有关RECOVER TABLE的更多内容可以参考我的BLOG:http://blog.itpub.net/26736162/viewspace-2152715/

有关RECOVER TABLE的更多内容可以参考我的BLOG:http://blog.itpub.net/26736162/viewspace-2152717/

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

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 RESTOREcommand. 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 BACKUPSET clause in the RESTOREcommand. 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

12c RMAN新特性之通过网络远程恢复数据库(RESTORE Recover from Service)

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

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

12c RMAN新特性之通过网络远程恢复数据库(RESTORE Recover from Service)

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

具体的几种用法:

  • 数据库级别: 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;

12c RMAN新特性之通过网络远程恢复数据库(RESTORE Recover from Service)

本人提供Oracle(OCP、OCM)、MySQL(OCP)、PostgreSQL(PGCA、PGCE、PGCM)等数据库的培训和考证业务,私聊QQ646634621或微信db_bao,谢谢!
12c RMAN新特性之通过网络远程恢复数据库(RESTORE Recover from Service)后续精彩内容已被小麦苗无情隐藏,请输入验证码解锁本站所有文章!
验证码:
请先关注本站微信公众号,然后回复“验证码”,获取验证码。在微信里搜索“DB宝”或者“www_xmmup_com”或者微信扫描右侧二维码都可以关注本站微信公众号。

标签:

Avatar photo

小麦苗

学习或考证,均可联系麦老师,请加微信db_bao或QQ646634621

您可能还喜欢...

发表回复

嘿,我是小麦,需要帮助随时找我哦。
  • 18509239930
  • 个人微信

  • DB宝
  • 个人邮箱
  • 点击加入QQ群
  • 个人微店

  • 回到顶部