2 Star 1 Fork 0

HuaweiCloudDeveloper/huaweicloud-solution-migrating-oracle-databases-to-the-cloud-with-dataguard

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

[TOC]

解决方案介绍

该方案基于华为云弹性云服务器ECS,利用Oracle数据库的DataGuard架构,搭建客户端和华为云ECS之间的链路,帮助用户实现业务数据快速迁移。适用于有数据容灾需求的客户和业务场景,当客户端宕机或者数据库出现故障时,可以切换华为云ECS为主库,保证业务正常运行。 解决方案实践详情页面地址:https://www.huaweicloud.com/solution/implementations/migrating-oracle-db-with-dataguard.html

架构图

方案架构

架构描述

该方案涉及的架构均为已有资源,无需创建新资源。客户端架构为包含Oracle数据库的服务器,华为云ECS也需安装Oracle数据库。Oracle源端与目标端数据库需要保持网络互通。

组织结构

huaweicloud-solution-migrating-oracle-databases-to-the-cloud-with-dataguard
├── dataguard-build
    ├── oracle_dataguard_source.sh -- 源端部署脚本
    ├── oracle_dataguard_target.sh -- 目标端部署脚本

脚本执行

源端和目标端的部署脚本在dataguard-build目录下。两个脚本均提供可自定义的部署参数,部署参数中空缺的参数需要补全,提供默认值的参数可根据实际配置进行修改。部署参数示例如下图所示: 脚本部署参数 脚本执行说明:

  • oracle_dataguard_source.sh:源端(客户端)搭建DataGuard链路,在oracle用户(su - oracle)和对应目录下(/home/oracle)执行该脚本。
sh oracle_dataguard_source.sh
  • oracle_dataguard_target.sh:目标端(华为云ecs)搭建DataGuard链路,在oracle用户(su - oracle)和对应目录下(/home/oracle)执行该脚本。
sh oracle_dataguard_target.sh

开始使用

DataGuard日常维护

开启主备库实时同步

主库对应源端,备库对应目标端。

  1. 备库开启至open状态,主库开启至open状态(先备再主,防止有未同步的归档日志)
  2. 主备库开启监听
lsnrctl start
  1. 备库sql执行同步指令
alter database recover managed standby database using current logfile disconnect from session;

!!!warn 须知:主库在进行增删改查等操作后,需要commit提交事务,否则主备库无法完成同步。

关闭主备库实时同步
  1. 备库sql执行中止同步指令
alter database recover managed standby database cancel;

常见问题

使用过程中的常见问题及解决方法。 Q1:目标端rman连接源端, 出现RMAN-04005和ORA-12541报错。 图1 ORA-12541报错 问题1 A1:源端监听器未开启,开启源端监听器,执行"lsnrctl start"。

Q2:备库rman复制主库时,出现RMAN-05500报错。 图2 RMAN-05500报错 问题1 A2:备库需要开启为nomount状态,重启oracle数据库至nomount状态。

sqlplus / as sysdba << end
    shutdown immediate;
    startup nomount;
end

空文件

简介

利用dataguard架构快速迁移oracle数据库 展开 收起
Python
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/HuaweiCloudDeveloper/huaweicloud-solution-migrating-oracle-databases-to-the-cloud-with-dataguard.git
git@gitee.com:HuaweiCloudDeveloper/huaweicloud-solution-migrating-oracle-databases-to-the-cloud-with-dataguard.git
HuaweiCloudDeveloper
huaweicloud-solution-migrating-oracle-databases-to-the-cloud-with-dataguard
huaweicloud-solution-migrating-oracle-databases-to-the-cloud-with-dataguard
master-dev

搜索帮助