Oracle11gr2_ADG管理之switchover实战
. 环境
db_primary | db_stanby | 备注 | |
---|---|---|---|
db版本 | 11.2.0.4.0 | 11.2.0.4.0 | |
os版本 | centos 6.4 | centos 6.4 | |
db_unique_name | newtest | snewtest | |
db name | newtest | newtest | |
ip | 10.10.0.23 | 10.10.0.24 |
1 主库上查询状态
[oracle@localhost dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:53:39 2018
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> select open_mode ,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
READ WRITE PRIMARY
2 备库上查询状态
[oracle@localhost trace]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:55:23 2018
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> select open_mode ,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
READ ONLY WITH APPLY PHYSICAL STANDBY
3.备库上swichover
[oracle@localhost trace]$ dgmgrl /
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> switchover to snewtest;
Performing switchover NOW, please wait...
New primary database "snewtest" is opening...
Operation requires startup of instance "newtest" on database "newtest"
Starting instance "newtest"...
Unable to connect to database
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Failed.
Warning: You are no longer connected to ORACLE.
Please complete the following steps to finish switchover:
start up instance "newtest" of database "newtest"
4.新备库上开启数据库
[oracle@localhost dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:56:29 2018
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 784998400 bytes
Fixed Size 2257352 bytes
Variable Size 478154296 bytes
Database Buffers 301989888 bytes
Redo Buffers 2596864 bytes
Database mounted.
Database opened.
5. 新备库上查询状态
SQL> select open_mode ,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
READ ONLY PHYSICAL STANDBY
6.我们看到数据库打开了adg 但是 状态还是readonly,此时还没应用redo**
[oracle@localhost dbs]$ dgmgrl /
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production
Copyright (c) 2000, 2009,
Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> edit database newtest set state='ONLINE'
> ;
Succeeded.
DGMGRL> exit
7.再次查看新备库的状态
[oracle@localhost dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:57:35 2018
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> select open_mode ,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
READ ONLY WITH APPLY PHYSICAL STANDBY
8.查看新主库的数据库状态以及dgbroke的状态
[oracle@localhost trace]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:57:24 2018
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> select open_mode ,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
READ WRITE PRIMARY
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@localhost trace]$ dgmgrl /
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> show configuration;
Configuration - dg_newtest
Protection Mode: MaxPerformance
Databases:
snewtest - Primary database
newtest - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
Oracle11gr2_ADG管理之switchover实战的更多相关文章
- Oracle11gr2_ADG管理之switchover补充
之前演示的switchver总是提示下面的错误,并且需要人工干预: Oracle11gr2_ADG管理之switchover实战 DGMGRL> switchover to snewtest; ...
- Oracle11gR2_ADG管理之resinstate实战
主库上打开闪回 SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ YES 模拟断电 SQL> ...
- 项目实战6—Mysql实现企业级日志管理、备份与恢复实战
Mysql实现企业级日志管理.备份与恢复实战 环境背景:随着业务的发展,公司业务和规模不断扩大,网站积累了大量的用户信息和数据,对于一家互联网公司来说,用户和业务数据是根基.一旦公司的数据错乱或者丢失 ...
- Linux操作系统的日志管理之rsyslog实战案例
Linux操作系统的日志管理之rsyslog实战案例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.日志介绍 1>.什么是日志 历史事件: 时间,地点,人物,事件 日志级 ...
- Oracle11gr2_ADG管理之在备库上模拟failover的过程实战
技术建议和方案. 要求failover后不重建备库,并能够把failover的数据库重新切换回备库 主库为newtest,备库为snewtest 备库上已经开启了闪回 得到一个参考的SCN SQL&g ...
- Oracle11gr2_ADG管理之跳归档恢复dg实战
模拟故障 关闭备库 SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut dow ...
- Oracle11gR2_ADG管理之恢复主库的truncate表实战
备库开启flashback database #关闭备库的同步 SQL> alter database recover managed standby database cancel; Data ...
- MongoDB管理与开发实战详解文摘
第1篇 基础篇 第1章 MongoDB简介 关系型数据库面临的问题:数据库并发负载高,海量数据存储与访问,数据库数据越来越大,事务管理的负担,关系型数据库读.写实时性的忽略,多表关联查询被弱化 第2章 ...
- EasyRMS录播管理服务器项目实战:windows上开机自启动NodeJS服务
本文转自EasyDarwin开源团队成员Penggy的博客:http://www.jianshu.com/p/ef840505ae06 近期在EasyDarwin开源团队开发一款基于EasyDarwi ...
随机推荐
- opencv:摄像头和视频的读取
示例代码: #include <opencv.hpp> using namespace cv; int main() { VideoCapture Capture(); //打开默认摄像头 ...
- Activiti快速入门
1.什么是Activiti 在解释activiti之前我们看一下什么是工作流.工作流(Workflow),就是“业务过程的部分或整体在计算机应用环境下的自动化”,它主要解决的是“使在多个参与者之间按照 ...
- SpringCloud 教程 | 第十四篇: 服务注册(consul)
版权声明:本文为博主原创文章,欢迎转载,转载请注明作者.原文超链接 ,博主地址:http://blog.csdn.net/forezp. http://blog.csdn.net/forezp/art ...
- Java加载jar文件并调用jar文件当中有参数和返回值的方法
在工作当中经常遇到反编译后的jar文件,并要传入参数了解其中的某些方法的输出,想到Java里面的反射可以实现加载jar文件并调用其中的方法来达到自己的目的.就写了个Demo代码. 以下的类可以编译生成 ...
- C / C ++中的数组讲解
笔者介绍:姜雪伟,IT公司技术合伙人,IT高级讲师,CSDN社区专家,特邀编辑,畅销书作者,已出版书籍:<手把手教你架构3D游戏引擎>电子工业出版社和<Unity3D实战核心技术详解 ...
- opencv 识别答题卡
参考这个网站,然后自己 找了张图片试了一下 http://blog.csdn.net/cp562090732/article/details/47804003 // test.cpp : 定义控制台应 ...
- 项目中使用的ajax代码_:觉得还好
POST>> submitHandler:function(form){ var username = $('#user_name').val(); var password = $('# ...
- HihoCoder 1185 : 连通性·三(强连通缩点)
连通性·三 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 暑假到了!!小Hi和小Ho为了体验生活,来到了住在大草原的约翰家.今天一大早,约翰因为有事要出去,就拜托小Hi ...
- 小而实用的工具插件集锦(JQGrid,zTree)
jqgrid,JQGrid是一个在jquery基础上做的一个表格控件,看起来感觉还可以,以ajax的方式和服务器端通信 效果图: 这个小东西,多用在在工作流上面. 中文文档: http://blog. ...
- 剑指offer-第六章面试中的各项能力(圆圈中剩下的最后数字)
import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util ...