Configuring the DBFS file system

To replicate DBFS file system operations, use a configuration that is similar to the standard bi-directional configuration for DML.

Some guidelines to follow while configuring Oracle GoldenGate for DBFS are:

  • Use matched pairs of identically structured tables.

  • Allow each database to have write privileges to opposite tables in a set, and set the other one in the set to read-only. For example:

    • Node1 writes to local table t1 and these changes are replicated to t1 on Node2.

    • Node2 writes to local table t2 and these changes are replicated to t2 on Node1.

    • On Node1, t2 is read-only. On Node2, t1 is read-only.

DBFS file systems make this kind of table pairing simple because:

  • The tables that underlie the DBFS file systems have the same structure.

  • These tables are modified by simple, conventional DML during higher-level file system operations.

  • The DBFS ContentAPI provides a way of unifying the namespace of the individual DBFS stores by means of mount points that can be qualified as read-write or read-only.

The following steps create two DBFS file systems (in this case named FS1 and FS2) and set them to be read-write or read, as appropriate.

  1. Run the following procedure to create the two file systems. (Substitute your store names for FS1 and FS2.)
  2. Run the following procedure to give each file system the appropriate access rights. (Substitute your store names for FS1 and FS2.)

    In this example, note that on Node 1, store FS1 is read-write and store FS2 is read-only, while on Node 2 the converse is true: store FS1 is read-only and store FS2 is read-write.

    Note also that the read-write store is mounted as local and the read-only store is mounted as remote. This provides users on each system with an identical namespace and identical semantics for read and write operations. Local path names can be modified, but remote path names cannot.

Example 13-3

declare
dbms_dbfs_sfs.createfile system('FS1');
dbms_dbfs_sfs.createfile system('FS2');
 
dbms_dbfs_content.registerStore('FS1',
'posix', 'DBMS_DBFS_SFS');
dbms_dbfs_content.registerStore('FS2',
'posix', 'DBMS_DBFS_SFS');
commit;
end;
/

Example 13-4 Node 1

declare
dbms_dbfs_content.mountStore('FS1', 'local');
dbms_dbfs_content.mountStore('FS2', 'remote',
read_only => true);
commit;
end;
/

Example 13-5 Node 2

declare
dbms_dbfs_content.mountStore('FS1', 'remote',
read_only => true);
dbms_dbfs_content.mountStore('FS2', 'local');
commit;
end;
/