ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

ADG 备库数据文件损坏处理

2019-12-12 21:00:11  阅读:370  来源: 互联网

标签:备库 数据文件 database ADG 2019 SQL 20 RMAN channel


一、描述
单实例ADG数据库,备库system01.dbf文件损坏,需要重新恢复数据文件,保证主库库数据一致。

二、处理过程

1、数据库启动到mount状态
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Dec 12 20:42:35 2019

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database (not started)

RMAN> startup mount;

Oracle instance started
database mounted

Total System Global Area 3089920000 bytes

Fixed Size 2257232 bytes
Variable Size 654315184 bytes
Database Buffers 2415919104 bytes
Redo Buffers 17428480 bytes

2、使用RMAN恢复
$rman target sys/xxxx@devdb auxiliary sys/xxx@devdbdg

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Dec 12 20:43:53 2019

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: DEVDB (DBID=931475173)
connected to auxiliary database: DEVDB (DBID=931475173, not open)

RMAN> run {
allocate channel d1 type disk ;
allocate channel d2 type disk ;
backup as copy reuse
datafile 1 auxiliary format '/oradata/devdbdg/system01.dbf';

}2> 3> 4> 5> 6>

using target database control file instead of recovery catalog
allocated channel: d1
channel d1: SID=1145 device type=DISK

allocated channel: d2
channel d2: SID=1715 device type=DISK

Starting backup at 12-DEC-2019 20:45:23
channel d1: starting datafile copy
input datafile file number=00001 name=/oradata/devdb/system01.dbf

output file name=/oradata/devdbdg/system01.dbf tag=TAG20191212T204523
channel d1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 12-DEC-2019 20:45:38
released channel: d1
released channel: d2

RMAN>
RMAN> exit

Recovery Manager complete.
<devdb01:devdb:/oradata/devdbdg>$sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Dec 12 20:45:50 2019

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter database recover managed standby database using current logfile disconnect from session;

Database altered.

SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter database open;

Database altered.

SQL> alter database recover managed standby database using current logfile disconnect from session;

Database altered.

SQL> *select from t;**

ID

 1
 2
 3
 4

SQL>
SQL> select process,status from v$managed_standby;

PROCESS STATUS


ARCH CONNECTED
ARCH CONNECTED
ARCH CLOSING
ARCH CONNECTED
RFS IDLE
RFS IDLE
RFS IDLE
MRP0 APPLYING_LOG

标签:备库,数据文件,database,ADG,2019,SQL,20,RMAN,channel
来源: https://blog.51cto.com/roidba/2458183

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有