DATAGUARD failover switchover and configuration example

Source: Internet
Author: User

Today, we demonstrated the switching process between switchover and failover on the virtual machine. The customer is concerned with failover. We directly turn off the virtual storage switch to simulate array faults. Failover steps are as follows:

1.

  1. Select NAME, RESETLOGS_TIME, LOG_MODE, OPEN_MODE, PROTECTION_MODE, REMOTE_ARCHIVE,
  2. DATABASE_ROLE, SWITCHOVER_STATUS, FORCE_LOGGING
  3. FromV $Database;

2. Stop the log application
  1. Alter DatabaseRecover managed standbyDatabaseCancel;
3. Disable standby log Transmission
  1. Alter DatabaseRecover managed standbyDatabaseFinishForce;
4. Switch to primary
  1. Alter Database Commit ToSwitchoverTo Primary WithSession shutdown;

If a gap exists during this step, the ORA-16139: Switchover: Media recovery required-standby not in limbo error is reported. During the test, this problem occurs if the master database is started and then the slave database is not waiting for the log transmission of the slave database to complete. Force Switch

  1. Alter DatabaseActivate physical standbyDatabase;
5. Restart the database to the open state.

Attach the dataguard implementation process from a single machine to a single machine in linux.


Prepare the environment

PRIMARY: RHEL 4.7 + Oracle 10.2.0.4 single host + file system Host Name: zhbqdb1

STANDBY: RHEL 4.7 + oracle 10.2.0.4 single host + file system Host Name: zhbqdb2

Create a database named zhdydb1 on the host and enable the archive mode. The backup machine is installed with data software, and the version is upgraded to the same as that of the host.

Configure/etc/hosts on the host and backup machine and create a data storage path

# Do not remove thefollowing line, or various programs
# That require network functionality will fail.
127.0.0.1 localhost. localdomain localhost
172.17.42.29 zhbqdb1
172.17.42.30 zhbqdb2 

Create a directory for storing data files and archives

  1. Mkdir/u01/flash_recovery_area
  2. Mkdir/u01/oradata
  3. Chown oracle: oinstall/u01/flash_recovery_area
  4. Chown oracle: oinstall/u01/oradata

Host Configuration Enable force logging

SQL> alter database force logging;

Check whether the current database is under force logging:

Selectforce_logging from v $ database;

Create an archive directory
  1. Mkdir/u01/flash_recovery_area/ZHDYDB1/arch
  2. Mkdir/u01/flash_recovery_area/ZHDYDB2
  3. Mkdir/u01/flash_recovery_area/ZHDYDB2/arch
  4. Mkdir/u01/flash_recovery_area/ZHDYDB2/archivelog

Configure tnsnames

On zhbqdb1

Vi $ ORACLE_HOME/network/admin/tnsnames. ora

ZHDYDB1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = zhbqdb1) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = zhdydb1)
)
)
 
ZHDYDB2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = zhbqdb2) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = zhdydb2)
)

  • 1
  • 2
  • 3
  • 4
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.