Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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:

image-20240618-124427.pngImage Added

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:

image-20240618-125429.pngImage Added

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:

image-20240618-130649.pngImage Added

Confirm the changes:

...

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

Code Block
[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:

Code Block
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:

Code Block
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:

Code Block
nc -l 5533 

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

Code Block
[opc@machine2 ~]$ nc -zv machine1.oci2oci.lab 7890
Ncat: Version 7.92 ( https://nmap.org/ncat )
Ncat: Connected to 10.0.0.202:7890.
Ncat: 0 bytes sent, 0 bytes received in 0.01 seconds.

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

...

Code Block
rman target /
RMAN> startup mount force dba;
RMAN> drop database including backups noprompt;

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:

Code Block
sqlplus / as sysdba
SQL> show parameter wallet_root

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
wallet_root                          string      /opt/oracle/dcs/commonstore/wa
                                                 llets/TEST01_955_iad

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.

Code Block
[oracle@machine1 ~]$ scp -rp /opt/oracle/dcs/commonstore/wallets/TEST01_955_iad/* oracle@machine2.oci2oci.lab:/opt/oracle/dcs/commonstore/wallets/TEST01_492_iad
pdb_ocids.json                                                                                                                                                                                           100%  311   257.8KB/s   00:00
cdb_ocids.json                                                                                                                                                                                           100%  302   246.4KB/s   00:00
ewallet.p12                                                                                                                                                                                              100% 5465     4.5MB/s   00:00
cwallet.sso                                                                                                                                                                                              100% 5510     4.5MB/s   00:00
ewallet_2024061707512097.p12                                                                                                                                                                             100% 2553     2.5MB/s   00:00
ewallet.p12.lck                                                                                                                                                                                          100%    0     0.0KB/s   00:00
cwallet.sso.lck                                                                                                                                                                                          100%    0     0.0KB/s   00:00
ewallet_2024061707573735.p12                                                                                                                                                                             100% 3993     3.5MB/s   00:00

Download and Install Dbvisit Software

...