Skip to content

Fatih Acar's blog

About of Database Systems and Information Technologies

Menu
  • Home
  • About Me
  • Contact Me
Menu

Oracle 11g Data Guard Failover With Python Script

Posted on 12/01/201614/01/2016 by Fatih Acar

I wrote a python script to perform failover steps and to take product database IP addresses when product database is down. If you dont use data guard broker or other application for failover operations, you can use this script for failover. My scenario is that I have Oracle 11gR2 2 nodes RAC product database and 1 node standby real time apply type data guard database. When the product database is fail, the data guard database can run as product database with take product database IP addresses and service name. Python script will do all steps that take product IP address, take product service name, perform failover steps.

I made test when data guard was archivelog apply type, script could run correctly.

Systems

Product Database : Oracle 11g R2 (11.2.0.3) RAC
Data Guard : Oracle 11g R2 (11.2.0.3) Single Instance With Grid Infrastructure
Operating System : Oracle Linux 6.6
Data Guard Type : Real Time Apply From Redo Logs
Script Name : failover.py

Python script file is failover.py .Firstly, we have to change parameters in script. You can use vi editor. I generally create python files under /opt/scripts directory.

failover_parameters

Script has 3 types take virtual IP process. If you can not see product virtual IP address when you run ifconfig command after run failover.py script, you can use other type virtual IP process.

The product database is fail. We have to run data guard database like product database. We can use failover.py script.

Run failover.py

[root@dg scripts]# python failover.py

runfailover

If all parameters are correct, you can write “evet” and push enter.

runfailover2

You can choose 1 or 2. If you choose 1, you can do only IP operations. If you choose 2, you can do both IP operations and failover steps. Firstly, you should choose 2 because of the fact that you have to take IP addresses and perform failover steps.

runfailover3

You can choose 1,2 or 3. I recommend 1. If you dont see IP address when you run ifconfig command after run failover.py, you can use others.

When you choose 1 and enter, you can see like below if processes are smooth.

runfailover4

runfailover5

Control Database

runfailover6

Control IP Address

ifconfig

If everything is okey, you can control your database and client connections.

This failover.py script can not comply with your system. You have to make test on your test environment.

Share this:

  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook

1 thought on “Oracle 11g Data Guard Failover With Python Script”

  1. Pingback: Oracle 11g Data Guard Failover With Python Script – 一站

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.



View Fatih ACAR's profile on LinkedIn

Categories

  • Databases (329)
    • MsSQL Server (18)
      • Administration (16)
      • Errors and Solutions (4)
      • SQL (2)
    • MySQL (5)
      • Administration (4)
      • Backup And Recovery (1)
      • Errors and Solutions (1)
    • Oracle (290)
      • Administration (79)
      • Backup And Recovery (29)
      • Errors and Solutions (195)
      • Procedure (10)
      • SQL (32)
    • PostgreSQL (16)
      • Administration (15)
      • Errors and Solutions (3)
      • SQL (2)
    • Redis (1)
  • Microsotf Dynamics CRM (1)
  • Operating Systems (47)
    • Linux & Unix (34)
    • Windows (13)
  • Programing (5)
    • Python (5)
  • SAP (15)
    • Errors and Solutions (4)
    • SAP Basis (12)
  • Security (8)
    • Database Security (6)
    • Information Security (1)
    • System Security (4)
  • VMware (4)

Recent Posts

  • Redis 7 Sentinel Infrastructure Installation
  • Oracle Database 19c Multi Data Guard and DML Redirect, Switchover-Failover Operations on Oracle Linux 8
  • Oracle Database 23ai Free Installation Steps on Oracle Linux 9
  • Oracle Database 19c Active Data Guard Installation and DML Redirect, Switchover-Failover Operations on Oracle Linux 8
  • Oracle Database 19c Installation and 19.22 RU Patch Apply on Oracle Linux 8

Resources

  • Oracle
  • PostgreSQL

Blogroll

  • Gökhan Atıl
  • H. Koray Gündüz
  • Hakan Talip Öztürk
  • Zekeriya Beşiroğlu

Web Pages

  • BT Çözümleri

Tag Cloud

Administration Backup and Recovery Cluster Systems Database Administration Database Security Linux Linux Administration MsSQL Server MsSQL Server Error and Solutions MySQL MySQL Administration ORA-00018 ORA-00020 Oracle Oracle 12c Oracle 19c Oracle Administration Oracle Backup and Restore Oracle Data Guard Oracle Data Guard Failover Oracle Data Guard Switchover Oracle Error Solutions Oracle Linux Oracle Rman Backup Oracle Security Oracle SQL Query PostgreSQL PostgreSQL Administration PostgreSQL High Availability PostgreSQL Hot Standby Python SAP Basis Sap Errors and Solutions Sap System Administration SQL SQL Server Administration SQL Server Availability Group Stored Procedure System Administration System Security VMware VMware Administration Windows Windows Batch Script Windows Server

Social

  • View facar1987’s profile on Twitter
  • View facar’s profile on LinkedIn

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 17 other subscribers
©2026 Fatih Acar's blog | Built using WordPress and Responsive Blogily theme by Superb