By Mouhamadou Diaw

A far sync instance is like a standby instance as it can receive redo from the primary database and can ship that redo to other members of the Data Guard configuration. But unlike a physical standby instance, a far sync instance does not contain any datafiles and then can not be open for access. A far sync instance just manages a controlfile. A far sync instance cannot be converted to a primary instance or any other type of standby
Far sync instances are part of the Oracle Active Data Guard Far Sync feature, which requires an Oracle Active Data Guard license.
Until Oracle 20c, the creation of a far sync install was manual. Until Oracle 20c the far sync install must be manually added to the broker.

Starting with Oracke 20c, Oracle now can create a far sync instance for us and also add it in the broker configuration.

In this blog I am showing how to use this functionnality. Below the actual configuration I am using

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
DGMGRL> show configuration
Configuration - prod20
  Protection Mode: MaxAvailability
  Members:
  prod20_site1 - Primary database
    prod20_site2 - Physical standby database
    prod20_site4 - Physical standby database
Fast-Start Failover:  Disabled
Configuration Status:
SUCCESS   (status updated 55 seconds ago)
DGMGRL>

And I am going to create a far sync instance fs_site3 to receive changes from the primary database prod20_site20 and to ship these changes to prod20_site4 as shown in this figure

With Oracle there is a new CREATE FAR_SYNC command whichh will create the far sync instance for us. But before using this command there are some steps.
First we have to configure Secure External Password Store for the netalias we use.

In our case we are using following aliases
prod20_site1
prod20_site2
prod20_site3
prod20_site4

1
2
3
4
5
6
oracle@oraadserver:/home/oracle/ [prod20 (CDB$ROOT)] tnsping prod20_site1
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = oraadserver)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = prod20_site1_dgmgrl)))
OK (0 msec)
1
2
3
4
5
oracle@oraadserver:/home/oracle/ [prod20 (CDB$ROOT)] tnsping prod20_site2
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = oraadserver2)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = prod20_site2_dgmgrl)))
1
2
3
4
5
6
oracle@oraadserver:/home/oracle/ [prod20 (CDB$ROOT)] tnsping prod20_site3
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = oraadserver3)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = fs_site3_dgmgrl)))
OK (0 msec)
1
2
3
4
5
6
7
oracle@oraadserver:/home/oracle/ [prod20 (CDB$ROOT)] tnsping prod20_site4
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = oraadserver4)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = prod20_site4_dgmgrl)))
OK (0 msec)
oracle@oraadserver:/home/oracle/ [prod20 (CDB$ROOT)]

Basically to configure Secure External Password Store

1
2
3
4
5
mkstore -wrl wallet_location -create
mkstore -wrl wallet_location -createCredential prod20_site1 sys
mkstore -wrl wallet_location -createCredential prod20_site2 sys
mkstore -wrl wallet_location -createCredential prod20_site3  sys

And after you will have to update your sqlnet.ora file with the location of the wallet.

If everything is OK, you normally should be able to connect using your tnsalias

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
CDB$ROOT)] sqlplus /@prod20_site1 as sysdba
SQL*Plus: Release 20.0.0.0.0 - Production on Sat May 30 19:20:21 2020
Version 20.2.0.0.0
Copyright (c) 1982, 2019, Oracle.  All rights reserved.
Heure de la derniere connexion reussie : Sam. Mai   30 2020 18:36:15 +02:00
Connecte a :
Oracle Database 20c Enterprise Edition Release 20.0.0.0.0 - Production
Version 20.2.0.0.0
SQL> show parameter db_unique_name
NAME                     TYPE    VALUE
------------------------------------ ----------- ------------------------------
db_unique_name               string  prod20_site1
SQL>

After I have start instance fs_site3 in a no mount mode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
SQL> startup nomount
ORACLE instance started.
Total System Global Area  314570960 bytes
Fixed Size          9566416 bytes
Variable Size         188743680 bytes
Database Buffers      113246208 bytes
Redo Buffers            3014656 bytes
SQL> show parameter db_unique_name
NAME                     TYPE    VALUE
------------------------------------ ----------- ------------------------------
db_unique_name               string  FS_SITE3
SQL>

And then connection to the broker I can use the command CREATE FAR_SYNC

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
oracle@oraadserver:/u01/ [prod20 (CDB$ROOT)] dgmgrl
DGMGRL for Linux: Release 20.0.0.0.0 - Production on Sat May 30 19:25:31 2020
Version 20.2.0.0.0
Copyright (c) 1982, 2020, Oracle and/or its affiliates.  All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect /
Connected to "prod20_site1"
Connected as SYSDG.
DGMGRL> CREATE FAR_SYNC fs_site3 AS CONNECT IDENTIFIER IS "prod20_site3";
Creating far sync instance "fs_site3".
Connected to "prod20_site1"
Connected to "FS_SITE3"
far sync instance "fs_site3" created
far sync instance "fs_site3" added
DGMGRL>

The far sync instance is created and added in the configuration as we can verify

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
DGMGRL> show configuration
Configuration - prod20
  Protection Mode: MaxAvailability
  Members:
  prod20_site1 - Primary database
    prod20_site2 - Physical standby database
    prod20_site4 - Physical standby database
    fs_site3     - Far sync instance (disabled)
      ORA-16905: The member was not enabled yet.
Fast-Start Failover:  Disabled
Configuration Status:
SUCCESS   (status updated 31 seconds ago)
DGMGRL>

Let’s enable the far sync instance

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
DGMGRL> enable far_sync fs_site3;
Enabled.
DGMGRL> show configuration
Configuration - prod20
  Protection Mode: MaxAvailability
  Members:
  prod20_site1 - Primary database
    prod20_site2 - Physical standby database
    prod20_site4 - Physical standby database
    fs_site3     - Far sync instance
Fast-Start Failover:  Disabled
Configuration Status:
SUCCESS   (status updated 38 seconds ago)
DGMGRL>

Now that the far sync is created, we can configure the redoroutes for the databases.
The following configuration means
-If prod20_site1 is the primary database, it will send the changes to prod20_site2 and to fs_site3
-And the fs_site3 will send the changes to prod20_site4 if prod20_site1 is the primary database

1
2
3
4
5
DGMGRL> edit database prod20_site1 set property redoroutes='(local:prod20_site2,fs_site3)';
Property "redoroutes" updated
DGMGRL> edit far_sync fs_site3 set property redoroutes='(prod20_site1:prod20_site4 ASYNC)';
Property "redoroutes" updated

We will talk in deep in redoroutes configuration in coming blogs