IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 大数据 -> Oracle 19c DG断档恢复 -> 正文阅读

[大数据]Oracle 19c DG断档恢复

一、模拟dg断档

1.1 备端关闭日志应用和数据库
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
shutdown immediate

1.2 主端多次切换归档
alter system switch logfile;

1.3 主端删除最近的归档日志
rm -rf thread_2_seq_65.424.1098461429
rm -rf thread_2_seq_66.425.1098461449

1.4 备端开启同步进程
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

1.5 备端检查断档

SQL> SELECT * FROM V$ARCHIVE_GAP;

  THREAD#  LOW_SEQUENCE# HIGH_SEQUENCE#  CON_ID
---------- ------------- -------------- --------
	 2	        65	         66 	       1

可以看到丢了线程2的65和66两个归档日志。

二、断档恢复

2.1 备库关闭日志应用
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

2.2 断档恢复
RMAN> RECOVER STANDBY DATABASE FROM SERVICE orcl;

Starting recover at 04-MAR-22
using target database control file instead of recovery catalog
Oracle instance started

Total System Global Area 1828712616 bytes

Fixed Size 9138344 bytes
Variable Size 469762048 bytes
Database Buffers 1342177280 bytes
Redo Buffers 7634944 bytes

contents of Memory Script:
{
restore standby controlfile from service ‘orcl’;
alter database mount standby database;
}
executing Memory Script

Starting restore at 04-MAR-22
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=4 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service orcl
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
output file name=/data/controlfile/current01.ctl
Finished restore at 04-MAR-22

released channel: ORA_DISK_1
Statement processed
Executing: alter system set standby_file_management=manual

contents of Memory Script:
{
recover database from service ‘orcl’;
}
executing Memory Script

Starting recover at 04-MAR-22
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1162 device type=DISK
skipping datafile 5; already restored to SCN 15154323
skipping datafile 6; already restored to SCN 15154323
skipping datafile 8; already restored to SCN 15154323
skipping datafile 10; already restored to SCN 16682725
skipping datafile 11; already restored to SCN 16682725
skipping datafile 12; already restored to SCN 16682725
skipping datafile 13; already restored to SCN 16682725
skipping datafile 14; already restored to SCN 16682725
skipping datafile 40; already restored to SCN 16682725
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service orcl
destination for restore of datafile 00001: /data/datafile/system.278.1093269883
channel ORA_DISK_1: restore complete, elapsed time: 00:00:27
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service orcl
destination for restore of datafile 00003: /data/datafile/sysaux.279.1093269935
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service orcl
destination for restore of datafile 00004: /data/datafile/undotbs1.280.1093269971
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service orcl
destination for restore of datafile 00007: /data/datafile/users.281.1093269975
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service orcl
destination for restore of datafile 00009: /data/datafile/undotbs2.291.1093271573
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01

starting media recovery

media recovery complete, elapsed time: 00:00:00
Finished recover at 04-MAR-22
Executing: alter system set standby_file_management=auto
Finished recover at 04-MAR-22

恢复完成后,备库处于mount状态,需要启动到read only。

  大数据 最新文章
实现Kafka至少消费一次
亚马逊云科技:还在苦于ETL?Zero ETL的时代
初探MapReduce
【SpringBoot框架篇】32.基于注解+redis实现
Elasticsearch:如何减少 Elasticsearch 集
Go redis操作
Redis面试题
专题五 Redis高并发场景
基于GBase8s和Calcite的多数据源查询
Redis——底层数据结构原理
上一篇文章      下一篇文章      查看所有文章
加:2022-03-24 00:37:48  更:2022-03-24 00:40:43 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/24 7:59:34-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码