Oracle OCI --> Oracle OCI

Create Virtual Cloud Network

To create a Virtual Cloud Network, press top right menu button, choose Networking option and press Virtual Cloud Networks link:

From the top menu press Start VCN Wizard button:

Choose “Create VCN with Internet Connectivity option and press Start VCN Wizard button:

Fill in the VCN Creation form:

  1. Name of the VCN: <Name of the VCN>

  2. Choose a Compartment to which the VCN belongs

  3. Configure whole VCN subnet: 10.0.0.0/16

  4. Choose Public subnet: 10.0.0.0/24

  5. Choose Private subnet: 10.0.1.0/24

  6. Press Next button

Review the information provided and confirm the VCN creation.

Create Database Systems

To create the database machines, press Top left menu, then Oracle Database and click on the Oracle Base Database Service.

Click Create DB System:

Fill in following things:

  • Compartment

  • Name of the Machine

  • Availability Domain

  • Shape of the Machine

  • Standard Oracle Database Edition

  • Define a method for access. Either create new keys, upload your own key, or paste the public key

  • Choose the VCN - Virtual Cloud Network

  • Select either public or private interface. If you are going to login from internet, choose the public one

  • Enter prefix of the machine network name

  • Press Next

 

 

In the Database Creation Menu:

  • Fill in the desired Database Name

  • Choose a password for sys user. Hint: #1mpoSSible_Pssw0rd

  • Disable database backups, if the machine is only for testing purposes

  • Press Create DB System

Create Standby Database Machine

Repeat the same steps as for Primary Machine.

Also please enter the same database name during standby database machine creation.

New DB unique name will be issued. Remember to note this down.

Create DNS Resolver (optional)

In order to easily resolve hostname of each machines, you can either edit /etc/hosts file or create an OCI DNS resolver on the VCN you created earlier. Let’s create a DNS resolver for our two machines.

Open the Virtual Cloud Network created before and press the DNS resolver button:

 

Press Manage Private Views button, choose the correct private view and press Save changes

Wait until the private view gets created and click it to see more details:

 

Press Create zone, choose any name you wish and press Create

Open your zone then:

Press Manage records button:

Then press the Add record button and then:

  • specify a hostname of primary machine

  • specify type of IPV4 address

  • put there your machine’s ip address

  • press Add record

Repeat the same step with your standby machine. You should have output similar to following one, press Publish changes button:

 

Confirm the changes:

You can now check, that the resolution of the new machines work:

[opc@machine2 ~]$ ping machine1.oci2oci.lab PING machine1.oci2oci.lab (10.0.0.202) 56(84) bytes of data. ^C --- machine1.oci2oci.lab ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 2030ms [opc@machine2 ~]$ ping machine2.oci2oci.lab PING machine2.oci2oci.lab (10.0.0.123) 56(84) bytes of data. 64 bytes from machine2.sub06141618210.vcnoci2oci.oraclevcn.com (10.0.0.123): icmp_seq=1 ttl=64 time=0.016 ms 64 bytes from machine2.sub06141618210.vcnoci2oci.oraclevcn.com (10.0.0.123): icmp_seq=2 ttl=64 time=0.031 ms

The IP addresses are being resolved correctly, but the security lists are too restrict to let the ping go through the network.

Update Security Lists

In order to be able to connect from one machine to another, you need to open ports in security lists.

You will have to install netcat utility on both machines in order to properly test the network access:

sudo yum install nmap-ncat -y

To update security list please open your Virtual Cloud Network and choose Security Lists menu on the left. Then open the Default Security List for <Your VCN>

Press the Add Ingress Rule and fill in following:

  • Source CIDR, insert your chosen subnet

  • Destination port: 7890 - dbvagentmanager, 5533 - NATS (communication between Dbvisit processes), 4433 (Web Interface)

  • Any description: Eg. dbvagentmanager / NATS / Dbvisit GUI

  • Press Add Ingress Rule

End result should look like this:

In order to make network communication work, you need to delete following iptables rule on both machines:

sudo iptables -D INPUT -j REJECT --reject-with icmp-host-prohibited

Test Network Communication

To test network communication, you can open a port on one machine using nc command:

Then you can test the network connection from the other machine using either nc or telnet command:

Check, that you can connect from standby machine to primary on port 7890 and from primary to standby on ports: 7890, 5533

Drop Database on Standby Machine

The Database Service is created with database running, but you do not need the database to be running on the standby machine. Dbvisit will create a copy of the primary database there. To drop the database, you can follow this procedure:

Copy Primary Database Wallets

In order to successfully restore backups from primary database, that is encrypted, you need to copy the wallet from primary machine to standby machine. You can find out, where the wallet is using following query:

The last part of the parameter is based on db_unique_name, which is different on both machines. You should also consider what will be the db_unique_name of the standby database. In following test, I will reuse the original db_unique_name of the standby database machine.

Download and Install Dbvisit Software

There is nothing special in installing Dbvisit Multiplatform in OCI environment.

First we need to create the DBVISIT_BASE directory on both machines:

Then download the latest release of Dbvisit Multiplatform and start the installation of the agents on both machines. As machine names, provide the service names defined in custom DNS setup (machineX.oci2oci.lab):

The dbvagentmanager needs to be installed on the standby machine too.

Next we need to install Dbvcontrol (GUI) on the standby machine:

The password specified must match the password specified during the dbvagentmanager installation.

At this moment you should be able to access the GUI on port 4433. You need to open security list port to access the port directly or you can tunnel the port using ssh to connect to it:

 

Initial login and password are admin/admin. It is recommended to change it immediately once you log in.

Create Standby Database using Dbvisit Multiplatform

Dbvisit needs a /etc/oratab entry for ASM instance in order to correctly detect the ASM instance running on the machines. Add similar entry to this one, with correct grid ORACLE_HOME to /etc/oratab:

To create the standby Database, press New Configuration menu on the left and Start with Oracle:

 

As a primary host choose your primary machine (machine1.oci2oci.lab)

 

From the list of databases on the primary machine, choose the one, that is going to be the source database for standby:

 

Choose your standby machine as a target of the replication:

 

Then fill in following values:

  • Staging directory, where the archived logs will be stored before sending to standby side

  • Unique database name: It is the unique database name from the OCI GUI, of the standby database system: image-20240620-110113.png

  • Choose a Staging directory, where the archived logs will be stored on standby side

  • Check the switch, that the standby database will use ASM

  • Insert the name of the ASM instance on the standby side: +ASM1

  • Choose a Configuration name. Usually name of the database is a good choice: Eg. TEST01

  • Enter the Dbvisit license key

  • Press Create Configuration button

At this moment you have a configuration, that puts together information about machines and database involved in the standby database installation.

Before you can continue with standby database creation, you need to create directories, that will be used by Dbvisit to create and backup of the primary database. On both machines run following commands:

Now you need to Create Standby Database. Click on the Setup Now link:

After some short time of gathering system information you need to fill in following fields:

  • make sure, that the checkbox to register standby database as clusterware resource is set to No. See chapter: Register Standby Database with Clusterware for more information.

  • make sure, that the checkbox to send newly created archived logs from the beginning of the primary database backup are sent to standby side

  • make sure, that the checkbox that you want to send and apply backups one by one in “parallel”

  • Fill in /u01/dbvisit_backup to both Source and Target Temp location. This will be the location, where the backups will be stored

  • Press the Manage Oracle Parameters Button

  • Update all standby database spfile parameters, that differ from between both databases. Mainly “audit_file_dest” and “wallet_root”, that do not match the correct db_unique_name parameter

  • Make sure, that the checkbox Automated Standby Update is set to Yes

  • Disable observer for now, you can always enable it later after the Standby database is created

  • Press Create Standby Database button

After some time, the standby database gets created:

 

Register Standby Database to Oracle Clusterware

It is advised to create database clusterware resource to let it to start the database automatically.

Dbvisit creates Clusterware resource withouth parameter -instance with the srvctl command. If it is not specified, Oracle by default fills the instance name by db_unique_name parameter without underscore, which leads to missmatch of instance name and Dbvisit database name parameters.