oracle dg 主、备切换SWITCHOVER 全过程记录

[[email protected] trace]$ ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::64d8:a56d:a1af:ef20 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:23:25:0d txqueuelen 1000 (Ethernet)
RX packets 313 bytes 25282 (24.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 475 bytes 37678 (36.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.56.118 netmask 255.255.255.0 broadcast 192.168.56.255
inet6 fe80::283a:c36b:b773:c4d8 prefixlen 64 scopeid 0x20<link>
inet6 fe80::3765:e61f:d653:f584 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:ae:62:fc txqueuelen 1000 (Ethernet)
RX packets 992188 bytes 1473325892 (1.3 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 47580 bytes 30037450 (28.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 13897 bytes 1135717 (1.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 13897 bytes 1135717 (1.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[[email protected] trace]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:39:43 2019

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

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

SQL> select switchover_status,database_role from v$database;

SWITCHOVER_STATUS DATABASE_ROLE
-------------------- ----------------
TO STANDBY PRIMARY

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] trace]$ ssh 192.168.56.117
[email protected]‘s password:
Last login: Thu Jul 4 11:42:57 2019
[[email protected] ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:45:47 2019

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

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

SQL> select switchover_status,database_role from v$database;

SWITCHOVER_STATUS DATABASE_ROLE
-------------------- ----------------
NOT ALLOWED PHYSICAL STANDBY

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] ~]$ exit
登出
Connection to 192.168.56.117 closed.
[[email protected] trace]$ sqlplus test/test

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:46:02 2019

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

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

SQL> select * from test;

no rows selected

SQL> insert into test values(1,2);

1 row created.

SQL> commit;

Commit complete.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] trace]$ ssh 192.168.56.117
[email protected]‘s password:
Last login: Thu Jul 4 13:45:34 2019 from 192.168.56.118
[[email protected] ~]$ sqlplus test/test

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:46:57 2019

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

ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Process ID: 0
Session ID: 0 Serial number: 0

Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied

Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[[email protected] ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:47:15 2019

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

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

SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter database open read only;

Database altered.

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

Database altered.

SQL> select switchover_status,database_role from v$database;

SWITCHOVER_STATUS DATABASE_ROLE
-------------------- ----------------
NOT ALLOWED PHYSICAL STANDBY

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] ~]$ sqlplus test/test

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:48:18 2019

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

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

SQL> select * from test;

ID NUMS
---------- ----------
1 2

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] ~]$ exit
登出
Connection to 192.168.56.117 closed.
[[email protected] trace]$ sqlplus test/test

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:48:31 2019

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

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

SQL> insert into test values(1,3);

1 row created.

SQL> insert into test values(1,4);

1 row created.

SQL> insert into test values(1,5);

1 row created.

SQL> commit;

Commit complete.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] trace]$ ssh 192.168.56.117
[email protected]‘s password:
Last login: Thu Jul 4 13:46:51 2019 from 192.168.56.118
[[email protected] ~]$ sqlplus test/test

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:48:59 2019

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

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

SQL> select * from test;

ID NUMS
---------- ----------
1 3
1 4
1 5
1 2

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] ~]$ exit
登出
Connection to 192.168.56.117 closed.
[[email protected] trace]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:52:31 2019

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

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

SQL> SELECT OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS FROM V$DATABASE;

OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
-------------------- ---------------- --------------------
READ WRITE PRIMARY TO STANDBY

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] trace]$ ssh 192.168.56.117
[email protected]‘s password:
Last login: Thu Jul 4 13:48:55 2019 from 192.168.56.118
[[email protected] ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:52:48 2019

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

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

SQL> SELECT OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS FROM V$DATABASE;

OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
-------------------- ---------------- --------------------
READ ONLY WITH APPLY PHYSICAL STANDBY NOT ALLOWED

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] ~]$ exit
登出
Connection to 192.168.56.117 closed.
[[email protected] trace]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:53:05 2019

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

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

SQL> SELECT OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS FROM V$DATABASE;

OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
-------------------- ---------------- --------------------
READ WRITE PRIMARY TO STANDBY

SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;

Database altered.

SQL> shutdown immdiate;
SP2-0717: illegal SHUTDOWN option
SQL> shutdown immdiate
SP2-0717: illegal SHUTDOWN option
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] trace]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:54:09 2019

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

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

SQL> STARTUP MOUNT;
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> shutdown immediate
ORA-01092: ORACLE instance terminated. Disconnection forced
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] trace]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:54:40 2019

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

Connected to an idle instance.

SQL> STARTUP MOUNT;
ORACLE instance started.

Total System Global Area 768294912 bytes
Fixed Size 2232312 bytes
Variable Size 457179144 bytes
Database Buffers 306184192 bytes
Redo Buffers 2699264 bytes
Database mounted.
SQL> SELECT OPEN_MODE,SWITCHOVER_STATUS FROM V$DATABASE;

OPEN_MODE SWITCHOVER_STATUS
-------------------- --------------------
MOUNTED RECOVERY NEEDED

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] trace]$ ssh 192.168.56.117
[email protected]‘s password:
Last login: Thu Jul 4 13:52:44 2019 from 192.168.56.118
[[email protected] ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:55:14 2019

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

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

SQL> SELECT OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS FROM V$DATABASE;

OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
-------------------- ---------------- --------------------
READ ONLY WITH APPLY PHYSICAL STANDBY SESSIONS ACTIVE

SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;

Database altered.

SQL> ALTER DATABASE OPEN;

Database altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:56:13 2019

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.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;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION
*
ERROR at line 1:
ORA-01665: control file is not a standby control file

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] ~]$ exit
登出
Connection to 192.168.56.117 closed.
[[email protected] trace]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:56:49 2019

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

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

SQL> SELECT OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS FROM V$DATABASE;

OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
-------------------- ---------------- --------------------
MOUNTED PHYSICAL STANDBY RECOVERY NEEDED

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

Database altered.

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 0
Next log sequence to archive 0
Current log sequence 0
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] trace]$ ssh 192.168.56.117
[email protected]‘s password:
Last login: Thu Jul 4 13:55:11 2019 from 192.168.56.118
[[email protected] ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:57:48 2019

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

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

SQL> ALTER SYSTEM SWITCH LOGFILE;

System altered.

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 43
Next log sequence to archive 45
Current log sequence 45
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] ~]$ exit
登出
Connection to 192.168.56.117 closed.
[[email protected] trace]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 13:58:45 2019

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

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

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 44
Next log sequence to archive 0
Current log sequence 45
SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter database open read only;

Database altered.

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

Database altered.

SQL> SELECT OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS FROM V$DATABASE;

OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
-------------------- ---------------- --------------------
READ ONLY WITH APPLY PHYSICAL STANDBY NOT ALLOWED

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] trace]$ sqlplus test/test

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 14:00:07 2019

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

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

SQL> select * from test;

ID NUMS
---------- ----------
1 3
1 4
1 5
1 2

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] trace]$ ssh 192.168.56.117
[email protected]‘s password:
Last login: Thu Jul 4 13:57:34 2019 from 192.168.56.118
[[email protected] ~]$ sqlplus test/test

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 14:00:37 2019

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

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

SQL> select * from test;

ID NUMS
---------- ----------
1 3
1 4
1 5
1 2

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 14:01:15 2019

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

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

SQL> SELECT OPEN_MODE,DATABASE_ROLE,SWITCHOVER_STATUS FROM V$DATABASE;

OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
-------------------- ---------------- --------------------
READ WRITE PRIMARY TO STANDBY

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] ~]$ sqlplus test/test

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 14:01:23 2019

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

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

SQL> select * from test;

ID NUMS
---------- ----------
1 3
1 4
1 5
1 2

SQL> insert into test select * from test;

4 rows created.

SQL> commit;

Commit complete.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[[email protected] ~]$ exit
登出
Connection to 192.168.56.117 closed.
[[email protected] trace]$ sqlplus test/test

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 4 14:01:54 2019

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

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

SQL> select * from test;

ID NUMS
---------- ----------
1 3
1 4
1 5
1 2
1 3
1 4
1 5
1 2

8 rows selected.
至此,Switchover切换完成!
总结:Switchover为主、备之间的正常切换,切换前要保证主、备库的数据一致,而且要先主切备,后备切主,避免同时存在两个主库。

原文地址:https://blog.51cto.com/860143/2417052

时间: 2024-10-14 01:50:59

oracle dg 主、备切换SWITCHOVER 全过程记录的相关文章

ORACLE DataGuard主备切换

主库磁盘问题,导致主库宕机,因为归档还没有应用,导致备库无法转为主库 先查看一下备库当前的信息: SQL> select * from v$version; BANNER ---------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production PL/SQL Release 11.

DG主备切换主要说明

alter system switch logfile; 切换主库日志 select max(sequence#) from v$archived_log; 对比主备库日志,同步才能做下一步 alter database commit to switchover to standby with session shutdown; 有用户登录,主库强制切换 主备库都重启到 mount状态下,备库执行转换命令 :alter database commit to switchover to prima

oracle DG 主备库为RAC及一个主库对多个从库的实验环境搭建

主库 RAC :192.168.1.210 node1 192.168.1.211 node2 备库(1) RAC:    192.168.1.247 rac1 192.168.1.248 rac2 备库(2) 单实例:192.168.1.219 dataguard 以上均为ASM管理. 实验步骤: 配置备库(1)的静态监听: SID_LIST_LISTENER=       (SID_LIST=       (SID_DESC=       (GLOBAL_DBNAME=SMS)      

Oracle 11.2.0.4.0 Dataguard部署和日常维护(5)-Datauard 主备切换和故障转移篇

1. dataguard主备切换 1.1. 查看当前主备库是否具备切换条件 on slave select sequence#,first_time,next_time,archived,applied from v$archived_log where SEQUENCE#=(select max(SEQUENCE#) from v$archived_log); SEQUENCE# FIRST_TIME NEXT_TIME ARCHIVED APPLIED ---------- --------

Oracle11g搭建DataGuard及主备切换方法总结【亲测可用】

2019-04-11 分类:Oracle 阅读(2626) 评论(0) 文章目录[隐藏] 一.DataGuard 工作原理 二.搭建环境 三.主库配置 四.备库配置 五.主备切换 一.DataGuard 工作原理 Data Gurad 通过冗余数据来提供数据保护,Data Gurad 通过日志同步机制保证冗余数据和主数之前的同步,这种同步可以是实时,延时,同步,异步多种形式.Data Gurad 常用于异地容灾和小企业的高可用性方案,虽然可以在Standby 机器上执行只读查询,从而分散Prim

oracle11g ADG主备切换

oracle11g ADG主备切换 1.主库 SQL> select name,open_mode,switchover_status from v$database; NAME OPEN_MODE SWITCHOVER_STATUS--------- -------------------- --------------------PROD1 READ WRITE TO STANDBY SQL> alter system switch logfile; System altered. SQL

mysql主从配置&&基于keepalived的主备切换

mysql互为主从设置 && 主备切换配置 需求说明: 1.公司架构一直是一台单独的mysql在线上跑,虽然一直没有出现什么宕机事件,但是出于一个高可用的考虑,提出主从备份.主备切换的需求: 2.实现这个需求的前一段时间只是在做数据库备份的时候实现了主从热备,为了实现主备切换功能,继续操作上述需求: 实验环境: master1:10.1.156.3:3306 master2:10.1.156.5:3306 my.cnf配置文件关于主从这块的修改: master1: server-id =

Redis安装,主从,主备切换

网络环境: 主:10.187.120.5 从:10.187.69.58 从:10.187.69.59 一.安装 mv redis-2.8.19.tar.gz /export/servers/ cd /export/servers/ tar zxf redis-2.8.19.tar.gz cd redis-2.8.19 make && make install 二,主从环境搭建 主:10.187.120.5 conf/redis_6379.conf (src/redis-server con

DRBD主备切换

DRBD主备切换 在系统维护的时候,或者在高可用群集中,当主用节点出现故障的时候,就需要将主备节点的角色互换,主备节点切换有两种形式,分别是停止DRBD服务切换和正常切换 (1) 停止DRBD服务切换 关闭主用节点服务,此时挂载的DRBD分区就自动在主用节点卸载了,操作如下, /etc/init.d/drbd stop cat /proc/drbd (细节请看http://liumingyuan.blog.51cto.com/9065923/1712824) 从输出结果可以看到,现在主用节点的状