Home Database Mysql Tutorial 物理standby的Failover

物理standby的Failover

Jun 07, 2016 pm 03:54 PM
failover standby physics

参考与:《三思笔记》此书 物理standby的 failover 注意几点: 1 failover 之后, 原primary 数据库默认不再是data guard 配置的一部分。 2 多数情况下,其它逻辑/物理standby 数据库不直接参与failover的过程,因此这些数据库不需要做任何操作。 3 某些情况

参考与:《三思笔记》此书

物理standby的 failover

注意几点:

1 failover 之后,原primary 数据库默认不再是data guard 配置的一部分。

2 多数情况下,其它逻辑/物理standby 数据库不直接参与failover的过程,因此这些数据库不需要做任何操作。

3 某些情况下,新的primary 数据库配置之后,需要重新创建其它所有的standby 数据库。

另外,如果待转换角色的standby 处于maximum protection 或maximum availability 模式的话,归档日志应该是连续存在的,这种情况下你可以直接从第3 步执行,否则建议你按照操作步骤从第1 步开始执行。

一般情况下failover 都是表示primary 数据库瘫痪,最起码也是起不来了,因此这种类型的切换基本上不需要primary 数据库做什么操作。所以下列步骤中如果有提到primary 和standby 执行的,只是建议你如果primary还可以用,那就执行一下,即使它能用你却不执行,也没关系,不影响standby 数据库的切换:)

1、检查归档文件是否连续

查询待转换standby 数据库的V$ARCHIVE_GAP 视图,确认归档文件是否连接:

SQL>SELECT THREAD#, LOW_SEQUENCE#,HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;

no rows selected

如果返回的有记录,按照列出的记录号复制对应的归档文件到待转换的standby 服务器。这一步非常重要,必须确保所有已生成的归档文件均已存在于standby 服务器,不然可能会数据不一致造成转换时报错。文件复制之后,通过下列命令将其加入数据字典:

注册:gap文件:

SQL> ALTER DATABASE REGISTER PHYSICAL LOGFILE 'filespec1'; 

2、检查归档文件是否完整

分别在primary/standby 执行下列语句:

该语句取得当前数据库各线程已归档文件最大序号,如果primary 与standby 最大序号不相同,必须将多出的序号对应的归档文件复制到待转换的standby 服务器。不过既然是failover,有可能primary 数据库此时已经无法打开,甚至无法访问。

3、启动failover执行下列语句

15:30:42 scott@felix SQL>conn / assysdba

Connected.

15:30:51 sys@felix SQL>alter database recover managedstandby database finishforce;

Database altered.

FORCE 关键字将会停止当前活动的RFS 进程,以便立刻执行failover。

15:30:58 sys@felix SQL>select swtichover_status from v$database;

select swtichover_status from v$database

*

ERROR at line 1:

ORA-00904: "SWTICHOVER_STATUS":invalid identifier

15:31:21 sys@felix SQL>select status from v$instance;

STATUS

------------------------

MOUNTED

我们可以发现备库已经由open变成mount状态;

15:42:07 sys@felix SQL>alter database open;

Database altered.

15:42:18 sys@felix SQL>

剩下的步骤就与前面switchover 很相似了

4、切换物理standby 角色为primary

15:42:18 sys@felix SQL>alter database commit to switchover to primary;

Database altered.

15:45:18 sys@felix SQL>select switchover_status from v$database;

SWITCHOVER_STATUS

----------------------------------------

NOT ALLOWED

15:45:38 sys@felix SQL>select open_mode from v$database;

OPEN_MODE

----------------------------------------

MOUNTED

15:48:16 sys@felix SQL>alter database open;

Database altered.

15:48:36 sys@felix SQL>select open_mode from v$database;

OPEN_MODE

----------------------------------------

READ WRITE

此时primary 数据库已经不再是data guard 配置的一部分,我们需要做的就是尝试看看能否恢复原primary 数据库,将其改造为新的standby服务器。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to solve the problem of 499 and failover mechanism failure caused by improper nginx configuration How to solve the problem of 499 and failover mechanism failure caused by improper nginx configuration Jun 02, 2023 pm 07:54 PM

The meaning and possible reasons of 499. 499 is not actually the standard status code of the HTTP protocol, but a custom status code of nginx. I have not found a clear explanation of this status code in the official nginx documentation. Here is a blog post that feels more professional. Explanation on: HTTPerror499simplymeansthattheclientshutoffinthemiddleofprocessingtherequestthroughtheserver.The499errorcodeputsbetterlightthatsomethinghappenedwiththeclien

How to convert a virtual machine to a physical machine? How to convert a virtual machine to a physical machine? Feb 19, 2024 am 11:40 AM

Converting a virtual machine (VM) to a physical machine is the process of migrating a virtual instance and associated application software to a physical hardware platform. This conversion helps optimize operating system performance and hardware resource utilization. This article aims to provide an in-depth look at how to make this conversion. How to implement migration from virtual machine to physical machine? Typically, the conversion process between a virtual machine and a physical machine is performed outside the virtual machine by third-party software. This process consists of multiple stages involving the configuration of virtual machines and the transfer of resources. Prepare the physical machine: The first step is to ensure that the physical machine meets the hardware requirements for Windows. We need to back up the data on a physical machine as the conversion process will overwrite the existing data. *Username and password for an administrator account with administrator rights to create system images. will be virtual

How to set horizontal screen standby mode in iOS17? Setup tutorial sharing How to set horizontal screen standby mode in iOS17? Setup tutorial sharing Jan 07, 2024 am 11:41 AM

Apple has introduced a brand new feature in the new iOS17 system, namely StandBy mode. This feature allows the iPhone to enter lock mode while charging and immediately enable standby mode when placed in landscape orientation, turning the iPhone into a smart display instantly. In this way, users can use their iPhone more conveniently during charging while also saving power. The addition of this feature will further enhance the user experience. How to set iPhone to standby mode? How to set landscape standby mode in iOS17? Click on the icons on the home screen, find and click on the icon called "Settings". Open the phone's settings interface, then find and tap the "Standby Mode" option to turn it on. Thus

Physicists prove that humans live in a 'matrix'? The universe is a 'simulation system', and multiple systems confirm that information evolution tends to be stable Physicists prove that humans live in a 'matrix'? The universe is a 'simulation system', and multiple systems confirm that information evolution tends to be stable Nov 27, 2023 pm 01:37 PM

Some physicists have confirmed that human beings actually live in matrix space! ? Can such a seemingly mysterious conclusion be confirmed by science? Melvin Vopson, associate professor of physics at the University of Portsmouth and an expert in information theory, proposed in his new paper that the hypothesis that humans live in a simulated world may exist in the basic laws of information. For example, these laws can be hidden in human DNA genetic information or in digital information stored in computers. Paper link: https://pubs.aip.org/aip/adv/article/13/10/105308/2915332/information The second law of dynamics and his results show that over time

Tsinghua Optics AI appears in Nature! Physical neural network, backpropagation is no longer needed Tsinghua Optics AI appears in Nature! Physical neural network, backpropagation is no longer needed Aug 10, 2024 pm 10:15 PM

Using light to train neural networks, Tsinghua University results were recently published in Nature! What should I do if I cannot apply the backpropagation algorithm? They proposed a Fully Forward Mode (FFM) training method that directly performs the training process in the physical optical system, overcoming the limitations of traditional digital computer simulations. To put it simply, it used to be necessary to model the physical system in detail and then simulate these models on a computer to train the network. The FFM method eliminates the modeling process and allows the system to directly use experimental data for learning and optimization. This also means that training no longer needs to check each layer from back to front (backpropagation), but can directly update the parameters of the network from front to back. To use an analogy, like a puzzle, backpropagation

AI blows up physics! Is 21-degree room temperature superconductivity scheduled for the Nobel Prize? Professor Nature withdraws his manuscript but receives investment from OpenAI AI blows up physics! Is 21-degree room temperature superconductivity scheduled for the Nobel Prize? Professor Nature withdraws his manuscript but receives investment from OpenAI Apr 12, 2023 pm 07:04 PM

Have humans achieved room temperature superconductivity at 21°C? The physics circle is completely exploded! Yesterday afternoon, Beijing time, a thunder exploded at the physics conference held in Las Vegas, USA - high-temperature superconductivity was suspected of achieving a disruptive breakthrough. At the meeting, physicist Ranga Dias of the University of Rochester reported this milestone breakthrough in room temperature superconductivity research. If Ranga Dias really achieves room-temperature superconductivity this time, the global energy consumption problem will be solved from the source - humans will use electrical energy to gain tremendous power. If we can fundamentally master controllable nuclear fusion, we can even conduct long-distance space travel. It can be said that mankind will really take off. And those who master this technology will undoubtedly lead the world. (It’s like science fiction coming into reality.)

What is the relationship between cloud server vCPU and physical CPU? What is the relationship between cloud server vCPU and physical CPU? Feb 19, 2024 pm 07:10 PM

The vCPU in a cloud server is a processor that simulates running on the CPU of a physical server. A physical server can usually support multiple vCPU instances, and each instance runs independently. The number of these vCPUs depends on the configuration of the physical server and the cloud service provider's policies. The relationship between vCPU and physical CPU is achieved through time-division multiplexing technology, which means that the time of the physical CPU is divided into multiple time segments, and each segment is allocated to the vCPU of a virtual machine instance. Therefore, the vCPU of a virtual machine instance can only use the time slice assigned to it, not the entire physical CPU. The performance of a vCPU is limited by the underlying physical CPU. For example, a physical server with 4 CPU cores and 8 threads is most

Hard core to solve Sora's physics bug! Four top universities in the United States jointly released: Install a physics engine for the video generator Hard core to solve Sora's physics bug! Four top universities in the United States jointly released: Install a physics engine for the video generator May 07, 2024 pm 05:01 PM

Some bugs appeared after Sora was released. Users on the Internet discovered some problems. Although the model did not fully understand the physical world, when the puppy was walking, the two front legs would intersect, which was unexpected. game. The interaction of objects is very important for generating video realism, but currently it is still very difficult to synthesize the dynamic behavior of real 3D objects in interaction. Action-conditioned dynamics is a research area that requires the perception of physical material properties of objects and the prediction of 3D motion based on these properties (such as object stiffness). Assessing physical material properties remains a thorny and unsolved problem because measuring physical material properties of real objects is extremely difficult due to lack of data support. Recently, M.I.T.

See all articles