copy archived log from ASM 异地恢复归档

这篇具有很好参考价值的文章主要介绍了copy archived log from ASM 异地恢复归档。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

NOTE:  In 11g, you can use RMAN to copy the files across the network. See Note 1909235.1 Copy database file directly across network using RMAN in 11g including Primary and Standby

Please use the rman scripts below to backup missing archive log files from the primary site and restore to the standby site.

RMAN> run {
allocate channel c1 type disk;
backup archivelog from sequence x1 until sequence x2 thread 1 format '/<path on Primary>/arch_%U';
}

Then use the same script to backup for thread 2. For example,

RMAN> run {
allocate channel c1 type disk;
backup archivelog from sequence x1 until sequence x2 thread 2 format '/<path on Primary>/arch_%U';
}

Note: Please make sure the directory path /<path on Primary>/ exists on the primary site or use any other existing path.

Copy the backup pieces from the primary site to the standby site. Then restore them by

RMAN> run
{
catalog start with '/<Directory path on standby where backuppiece was copied>/';
allocate channel c1 type disk ;
restore archivelog from sequence x1 until sequence x2 thread 1;
}

Use the same script to restore for thread 2 archive log files.

RMAN> run
{
catalog start with '/<Directory path on standby where backuppiece was copied>/';
allocate channel c1 type disk ;
restore archivelog from sequence x1 until sequence x2 thread 2;
}

Note: Please make sure the path /oraback/arch/ exists on the standby site.

11g

Oracle 11g Release 1 and Release 2 allows you to copy files across the network with the RMAN Active File Copy feature.   This feature is controlled with the 'AUXILIARY FORMAT' option to the backup command. 

For example, you can copy an archivelog like:
 

connect target SYS/...@<Connect string> # source system
connect auxiliary SYS/...@<Connect string of destination> # destination system
backup as copy reuse
archivelog like "/u01/oracle/archivelog/arc_des/arch%.arc"
auxiliary format "+AUX" ;


Or copy a datafile like:
 

connect target SYS/...@<Connect string> # source system
connect auxiliary SYS/...@<Connect string of destination> # destination system
backup as copy reuse datafile "/u01/oracle/datafiles/system01.dbf"
auxiliary format "+DATA" ;

19c

There are three potential solutions:

1) Use the RMAN copy command

RMAN> copy archivelog '+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_60.267.606732487' to '/tmp/archive_seq_60.arc';

If there are only a few archivelogs required then the copy command can be repeated for each log. However if there are multiple archive logs below solutions may be preferable.

2) Try to use the FORCE clause in the restore command to restore the archivelog to an alternate location even when the archvie already exists on disk:

RMAN> run {
2> set archivelog destination to '/tmp';
3> restore FORCE archivelog from logseq=60 until logseq=65;
4> }

3)  Use the RMAN uncatalog command.

RMAN> change archivelog from logseq=60 until logseq=65 uncatalog;

uncataloged archive log
archive log filename=+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_60.267.606732487 recid=64 stamp=606732490
uncataloged archive log
archive log filename=+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_61.263.606732499 recid=65 stamp=606732500
uncataloged archive log
archive log filename=+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_62.265.606732505 recid=66 stamp=606732507
uncataloged archive log
archive log filename=+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_63.278.606732509 recid=67 stamp=606732508
uncataloged archive log
archive log filename=+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_64.277.606732509 recid=68 stamp=606732511
uncataloged archive log
archive log filename=+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_65.276.606732521 recid=69 stamp=606732523
Uncataloged 6 objects

Once the archivelogs have been successfully uncataloged you are able to successfully restore the archive logs to new location.


RMAN> run {
2> set archivelog destination to '/tmp';
3> restore archivelog from logseq=60 until logseq=65;
4> }

executing command: SET ARCHIVELOG DESTINATION

Starting restore at 2006/11/17 08:57:06
using channel ORA_DISK_1

channel ORA_DISK_1: starting archive log restore to user-specified destination
archive log destination=/tmp
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=60
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=61
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=62
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=63
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=64
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=65
channel ORA_DISK_1: restored backup piece 1
piece handle=+DGROUP2/rman/backupset/2006_11_17/DB_tag20061117t084948_0.275.606732589 tag=TAG20061117T084948
channel ORA_DISK_1: restore complete
Finished restore at 2006/11/17 08:57:08

 Following the successul restore of the archivelogs you can then continue to re-catalog the archivelogs back into the ASM diskgroup. Below is an example of cataloging one archivelog.

RMAN> catalog archivelog '+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_60.267.606732487';

cataloged archive log
archive log filename=+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_60.267.606732487 recid=76 stamp=606733388

OPTION -I : Copy archivelog

OPTION II : Take backup of archivelog

OPTION -I:

1. Check for the GAP,

On standby,

 

SQL>SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;


2. On primary Check the location where the missing logfiles exist.

SELECT NAME FROM V$ARCHIVED_LOG WHERE THREAD#=<n> AND DEST_ID=<n> AND SEQUENCE# BETWEEN <LOW_SEQUENCE#> AND <HIGH_SEQUENCE#>;


For example,

 

SQL> SELECT * FROM V$ARCHIVE_GAP;

THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#
----------- ------------- --------------
1 1113 1115


SQL> SELECT NAME FROM V$ARCHIVED_LOG WHERE THREAD#=1 AND DEST_ID=1 AND SEQUENCE# BETWEEN 1113 AND 1115;

NAME
--------------------------------------------------------------------------------
+DGROUP2/PRIM/datafile/ARC00001113_0732997804.001
+DGROUP2/PRIM/datafile/ARC00001114_0732997804.001
+DGROUP2/PRIM/datafile/ARC00001115_0732997804.001


3. Use RMAN to copy to someother local filesystem.
 

RMAN>copy archivelog '+DGROUP2/PROD/datafile/ARC00001113_0732997804.001' to '/u01/app/oracle/ARC00001113_0732997804.001';


Do the same for all the logs.

4. SCP to standby.

scp /u01/app/oracle/ARC00001113_0732997804.001  remoteusername@destination_host_ofstandby:/u01/app/oracle/

5. Register manually by mentioning the copied file location.

On standby,

 

SQL>alter database register logfile '/u01/app/oracle/ARC00001113_0732997804.001';

NOTE : Alternatively we can copy this archive log to standby ASM location and then do a register.


On standby,

$rman target /

RMAN>copy archivelog '/u01/app/oracle/ARC00001113_0732997804.001' to '+DGROUP2/STDBY/datafile/ARC00001113_0732997804.001';

Now register,

SQL>alter database register logfile '+DGROUP2/STDBY/datafile/ARC00001113_0732997804.001';

OPTION - II

Please use the rman scripts below to backup missing archive log files from the primary site and restore to the standby site.

RMAN> run {
allocate channel c1 type disk;
backup archivelog from sequence x1 until sequence x2 thread 1 format '/oraback/arch/arch_%U';
}

Then use the same script to backup for thread 2. For example,

RMAN> run {
allocate channel c1 type disk;
backup archivelog from sequence x1 until sequence x2 thread 2 format '/oraback/arch/arch_%U';
}

Note: Please make sure the path /oraback/arch/ exists on the primary site or use any other existing path.

Copy the backup pieces from the primary site to the standby site. Then restore them by

RMAN> run
{
catalog start with '/oraback/arch/';
allocate channel c1 type disk ;
restore archivelog from sequence x1 until sequence x2 thread 1;
}

Use the same script to restore for thread 2 archive log files.

RMAN> run
{
catalog start with '/oraback/arch/';
allocate channel c1 type disk ;
restore archivelog from sequence x1 until sequence x2 thread 2;
}

Note: Please make sure the path /oraback/arch/ exists on the standby site.文章来源地址https://www.toymoban.com/news/detail-698174.html

到了这里,关于copy archived log from ASM 异地恢复归档的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • HDFS小文件解决方案---archive归档文件命令

    hdfs并不擅长存储小文件,因为每个文件最少一个block,每个block的元数据都会在namenode占用内存,如果存在大量的小文件,它们会吃掉namenode大量内存。如下所示,模拟小文件场景: hadoop archive可以有效地处理以上的问题,它可以把多个文件归档成为一个文件,归档成一个文件

    2024年02月14日
    浏览(36)
  • 利用 pt-archiver 实现数据库归档功能

    一个完整的项目,除了开发阶段,还有运维移交阶段,运维移交往往需要考虑数据库后续的归档机制,比如:将1年前的数据归档到另外一台服务器的归档库。有些业务表数据量比较大,为了更快的查询速度更好的用户体验,可能会对某张特定的表做归档处理,只保留最近1个

    2024年02月19日
    浏览(41)
  • MySQL数据库归档工具之【pt-archiver】

    前言 当MySQL数据库积累了大量历史数据时,有效地管理这些数据变得至关重要。为了避免影响数据库性能,并确保其顺畅运行,我们可以利用 pt-archiver 工具来对历史数据进行归档。 什么是pt-archiver? pt-archiver是Percona Toolkit的一部分,是一个强大的MySQL数据归档工具。它能够帮

    2024年04月14日
    浏览(38)
  • PG14归档失败解决办法archiver failed on wal_lsn

    昨晚Repmgr+PG14主备主库因wal日志撑爆磁盘,删除主库过期wal文件重做备库后上午进行主备状态巡查,主库向备库发送wal文件正常,但是查主库状态时发现显示有1条归档失败的记录。 postgres: archiver failed on 000000010000006F00000086 主库: walsender repmgr 172.28.32.23(36122) streaming 72/1BAC3A10

    2024年02月06日
    浏览(43)
  • oracle 清理归档日志

    1. 相关日志 2.  linux定时删除7天前文件  

    2024年02月04日
    浏览(34)
  • Oracle 的归档日志文件

    归档是将联机重做日志以文件的形式保存到硬盘,联机日志归档的前提条件是数据库要处于归档模式。当数据库处于 ARCHIVELOG 模式并进行日志切换时,后台进程 ARCH 会将联机重做日志的内容保存到归档日志中,当数据库出现介质故障时,使用数据文件备份、归档日志和联机重

    2024年02月11日
    浏览(39)
  • Oracle——清理归档日志

    有时候oracle的归档日志满了,导致登录不了oracle。 解决办法,删除归档日志即可。 1、首先使用df -h 查看磁盘使用情况。 查看服务器的磁盘空间: 2、进入oracle的日志目录,清理日志文件, cd /home/oracle19c/dbs/ rm -rf arch*  注:只是清理了文件不能释放空间所以需要使用rman释放

    2024年02月08日
    浏览(36)
  • oracle rac-归档满处理

    有客户反馈数据库无法使用了,客户手动启动报错如下 SQL startup; ORACLE instance started. Total System Global Area 2.6924E+10 bytes Fixed Size            2265984 bytes Variable Size         1.3959E+10 bytes Database Buffers     1.2952E+10 bytes Redo Buffers           11202560 bytes Database mounted. ORA-16038: l

    2024年02月08日
    浏览(44)
  • 使用 Lambda 函数将 CloudWatch Log 中的日志归档到 S3 桶中

    作者:SRE运维博客 博客地址:https://www.cnsre.cn/ 文章地址:https://www.cnsre.cn/posts/221205544069/ 相关话题:https://www.cnsre.cn/tags/aws/ 躺了好久,诈尸了。因为换了工作,所以比较忙一直没有时间去更新博客的内容(主要还是因为懒🤔) 话不多说 直接上干货。 最近在看费用的时候发

    2024年02月03日
    浏览(38)
  • oracle归档日志满了导致启动不起来解决

    原因:闪回归档区的空间满了 解决方法1:增大闪回恢复区 解决方法2:使用rman删除存档日志 查看归档日志使用情况 清空归档日志

    2024年02月11日
    浏览(35)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包