Skip to main content

Example of installing Oracle Data Guard environment with Vagrant

Example of installing Oracle Data Guard environment with Vagrant

Under Windows 11, installing a standard Data Guard environment (the default is non-CDB mode) through Vagrant takes about 26 minutes and generates a total of 2 virtual machines. The following is the installation log:

    ...
host2: Welcome to DGMGRL, type "help" for information.
host2: Connected to "DB193H1"
host2: Connected as SYSDBA.
host2: DGMGRL> Database "db193h1_stdby" added
host2: DGMGRL> DGMGRL for Linux: Release 19.0.0.0.0 - Production on Fri Jan 12 11:39:44 2024
host2: Version 19.3.0.0.0
host2:
host2: Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
host2:
host2: Welcome to DGMGRL, type "help" for information.
host2: Connected to "DB193H1"
host2: Connected as SYSDBA.
host2: DGMGRL> Enabled.
host2: DGMGRL> -----------------------------------------------------------------
host2: INFO: 2024-01-12 11:40:05: Setup standby env
host2: -----------------------------------------------------------------
host2:
host2: SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jan 12 11:40:05 2024
host2: Version 19.3.0.0.0
host2:
host2: Copyright (c) 1982, 2019, Oracle. All rights reserved.
host2:
host2:
host2: Connected to:
host2: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
host2: Version 19.3.0.0.0
host2:
host2: SQL> ORACLE instance started.
host2:
host2: Total System Global Area 3305108784 bytes
host2: Fixed Size 8901936 bytes
host2: Variable Size 654311424 bytes
host2: Database Buffers 2634022912 bytes
host2: Redo Buffers 7872512 bytes
host2: Database mounted.
host2: SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
host2: Version 19.3.0.0.0
host2: DGMGRL for Linux: Release 19.0.0.0.0 - Production on Fri Jan 12 11:41:18 2024
host2: Version 19.3.0.0.0
host2:
host2: Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
host2:
host2: Welcome to DGMGRL, type "help" for information.
host2: Connected to "DB193H1"
host2: Connected as SYSDBA.
host2: DGMGRL>
host2: Configuration - db_broker_config
host2:
host2: Protection Mode: MaxPerformance
host2: Members:
host2: db193h1 - Primary [database](/search?q=database)
host2: db193h1_stdby - Physical standby database
host2: Warning: ORA-16854: apply lag could not be determined
host2:
host2: Fast-Start Failover: Disabled
host2:
host2: Configuration Status:
host2: WARNING (status updated 79 seconds ago)
host2:
host2: DGMGRL>
host2: Database - db193h1
host2:
host2: Role: PRIMARY
host2: Intended State: TRANSPORT-ON
host2: Instance(s):
host2: DB193H1
host2:
host2: Database Status:
host2: SUCCESS
host2:
host2: DGMGRL>
host2: Database - db193h1_stdby
host2:
host2: Role: PHYSICAL STANDBY
host2: Intended State: APPLY-ON
host2: Transport Lag: 0 seconds (computed 1 second ago)
host2: Apply Lag: 0 seconds (computed 1 second ago)
host2: Average Apply Rate: 0 Byte/s
host2: Real Time Query: OFF
host2: Instance(s):
host2: DB193H1
host2:
host2: Database Status:
host2: SUCCESS
host2:
host2: DGMGRL> -----------------------------------------------------------------
host2: INFO: 2024-01-12 11:41:20: Setup DB autostart
host2: -----------------------------------------------------------------
host2: Created symlink from /etc/systemd/system/multi-user.target.wants/dbora.service to /usr/lib/systemd/system/dbora.service.
host2: -----------------------------------------------------------------
host2: INFO: 2024-01-12 11:41:20: Running user-defined post-setup scripts
host2: -----------------------------------------------------------------

real 25m50.651s
user 0m0.015s
sys 0m0.031s


![Example of installing Oracle Data Guard environment with Vagrant](6b44e99974d17195ee2722671aabdc1f.png)

Check the status of the active and standby machines:

    $ [vagrant](/search?q=vagrant) status

│▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
Oracle DG (Database Dataguard) Vagrant box for KVM/libVirt or VirtualBox
Copyright (c) 1982-2021 Oracle and/or its affiliates
--------------------------------------------------------------------------
Author: Ruggero Citton <ruggero.citton@[oracle](/search?q=oracle).com>
RAC Pack, Cloud Innovation and Solution Engineering Team
│▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│


--------------------
Detected virtualbox
--------------------
getting Proxy Configuration from Host...
Current machine states:

host1 running (virtualbox)
host2 running (virtualbox)

This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run `vagrant status NAME`.


![Example of installing Oracle Data Guard environment with Vagrant](6b44e99974d17195ee2722671aabdc1f.png)

Use ssh to log in to host1, which is the Primary host:

    PS C:\Users\****\Desktop\WORKSPACE\vagrant-projects\OracleDG\OL7> vagrant ssh host1

│▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
Oracle DG (Database Dataguard) Vagrant box for KVM/libVirt or VirtualBox
Copyright (c) 1982-2021 Oracle and/or its affiliates
--------------------------------------------------------------------------
Author: Ruggero Citton <ruggero.citton@oracle.com>
RAC Pack, Cloud Innovation and Solution Engineering Team
│▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│


--------------------
Detected virtualbox
--------------------
getting Proxy Configuration from Host...

Welcome to Oracle Linux Server release 7.9 (GNU/Linux 5.4.17-2136.325.5.el7uek.x86_64)

The Oracle Linux End-User License Agreement can be viewed here:

* /usr/share/eula/eula.en_US

For additional packages, updates, documentation and community help, see:

* https://yum.oracle.com/

[vagrant@primary ~]$


![Example of installing Oracle Data Guard environment with Vagrant](6b44e99974d17195ee2722671aabdc1f.png)

The space occupied is 25.2GB, which actually includes 5.54GB of software in the ORCL_software directory, namely Oracle DB and GI software (the GI software is not actually used, I just put it there).
Example of installing Oracle Data Guard environment with Vagrant
When the virtual machines are started, the two virtual machines actually occupy about 10G of memory:
Example of installing Oracle Data Guard environment with Vagrant
When using SQL Developer to connect, please note that you need to add a tcp1521 entry in the port forwarding. For example, the primary's 1521 port is mapped to 15211, and the standby's 1521 port is mapped to 15212:
Example of installing Oracle Data Guard environment with Vagrant

Management interface in SQL Developer:
Example of installing Oracle Data Guard environment with Vagrant

Replenish

On February 23, 2024, another experiment was conducted. The time taken this time is as follows:

        host2: DGMGRL>
host2: Database - db193h1_stdby
host2:
host2: Role: PHYSICAL STANDBY
host2: Intended State: APPLY-ON
host2: Transport Lag: 0 seconds (computed 0 seconds ago)
host2: Apply Lag: 0 seconds (computed 0 seconds ago)
host2: Average Apply Rate: 1.00 KByte/s
host2: Real Time Query: OFF
host2: Instance(s):
host2: DB193H1
host2:
host2: Database Status:
host2: SUCCESS
host2:
host2: DGMGRL> -----------------------------------------------------------------
host2: INFO: 2024-02-23 15:46:20: Setup DB autostart
host2: -----------------------------------------------------------------
host2: Created symlink from /etc/systemd/system/multi-user.target.wants/dbora.service to /usr/lib/systemd/system/dbora.service.
host2: -----------------------------------------------------------------
host2: INFO: 2024-02-23 15:46:21: Running user-defined post-setup scripts
host2: -----------------------------------------------------------------

real 26m17.609s
user 0m0.000s
sys 0m0.031s

$ vagrant status

│▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
Oracle DG (Database Dataguard) Vagrant box for KVM/libVirt or VirtualBox
Copyright (c) 1982-2021 Oracle and/or its affiliates
--------------------------------------------------------------------------
Author: Ruggero Citton <ruggero.citton@oracle.com>
RAC Pack, Cloud Innovation and Solution Engineering Team
│▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│


--------------------
Detected virtualbox
--------------------
getting Proxy Configuration from Host...
Current machine states:

host1 running (virtualbox)
host2 running (virtualbox)

This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run `vagrant status NAME`.



![Example of installing Oracle Data Guard environment with Vagrant](6b44e99974d17195ee2722671aabdc1f.png)

The space occupies 28G.