Oracle ACFS Replication - How does it work ?

Oracle ACFS Replication - How does it work ?

Rate This
  • Comments 3

With the 11.2.0.2 patch set Oracle introduced a new quite interesting feature - ACFS replication. It might be very useful, especially in MAA configurations (Real Application Cluster with Data Guard) in case the primary database creates files on an ACFS filesystem (e.g. with PL/SQL). In this case Data Guard redo transport services transfers redo from the primary to standby side; ACFS replication will transfer files created on that filesystem to the remote side.

In the current version there are some more or less important restrictions, e.g.:

  • it works only with "full" Grid Infrastructure installation, not with Oracle Restart
  • only one standby filesystem for each primary filesystem supported
  • no support with ACFS encryption/security
  • the primary filesystem can be mounted on maximum 8 nodes
  • same OS and architecture on the primary and standby side

  

How does the file transfer work internally ?

1. Files created on the primary filesystem will be split into pieces called replication logs and placed under <mount_point>/.ACFS/repl/ready before transmitting to the standby side:

grid@white:/u00/app/grid/acfsmounts/repl_test/.ACFS/repl/ready/ [+ASM2] ls -ltr
total 925768
-rwxr-xr-x 1 grid oinstall         0 Feb 10 22:23 pause.primary
-rw-rw---- 1 grid asmadmin       512 Feb 21 18:41 rlog.node1.cord204
-rw-rw---- 1 grid asmadmin       512 Feb 21 18:41 rlog.node3.cord204
-rw-rw---- 1 grid asmadmin 439156736 Feb 21 18:42
rlog.node2.cord204
-rw-rw---- 1 grid asmadmin       512 Feb 21 18:42 rlog.node1.cord205
-rw-rw---- 1 grid asmadmin       512 Feb 21 18:42 rlog.node3.cord205
-rw-rw---- 1 grid asmadmin  54630400 Feb 21 18:42
rlog.node2.cord205
-rw-rw---- 1 grid asmadmin       512 Feb 21 18:42 rlog.node1.cord206
...

2. In case replication log compression on the primary side has been activated (-z on parameter), files will be compressed before transmitting over Oracle Net:

grid@white:~/ [+ASM2] acfsutil repl info -c /u00/app/grid/acfsmounts/repl_test
Site:                                Primary
Primary status:                      Online
Primary mount point:                 /u00/app/grid/acfsmounts/repl_test
Primary Oracle Net service name:     PRIMARY
Standby mount point:                 /u00/app/grid/acfsmounts/repl_test
Standby Oracle Net service name:     STANDBY
Standby Oracle Net alias:            sys/****@STANDBY.trivadistraining.com
Replicated tags:                     acfs_data
Log compression:                     On
Debug log level:                     2

The compression takes place on the fly, directly before transmitting the file:

grid@white:/u00/app/grid/acfsmounts/repl_test/.ACFS/repl/ready/ [+ASM2] ls -ltr
...
-rw-rw---- 1 grid asmadmin       512 Feb 21 18:43 rlog.node1.cord229
-rw-rw---- 1 grid asmadmin       512 Feb 21 18:43 rlog.node3.cord229
-rw-rw---- 1 grid asmadmin  19283968 Feb 21 18:43 rlog.node2.cord229
-rw-rw---- 1 grid oinstall    357582 Feb 21 18:43 compress.rlog.node2.cord204

 

3. The file will be then transported to the standby side with the following PL/SQL call

2011-02-21 18:43:20.574: [transprt][/u00/app/grid/acfsmounts/repl_test]usrgExecOCI: SQL: declare
status boolean;
retcode number;
ftypecheck boolean := FALSE;
begin
status := dbms_backup_restore.networkFileTransfer('STANDBY.trivadistraining.com', 'sys', 'manager', 'sysdba', '/u00/app/grid/acfsmounts/repl_test/.ACFS/repl/ready/compress.rlog.node2.cord204.1432829', '/u00/app/grid/acfsmounts/repl_test/.ACFS/repl/ready/compress.rlog.node2.cord204.1432829', 'read', ftypecheck, retcode);
end;

 

4. The standby side will acknowledge the file transmission and apply with the following PL/SQL call:

2011-02-21 18:43:25.357: [transprt][/u00/app/grid/acfsmounts/repl_test]Sending File: /u00/app/grid/acfsmounts/repl_test/.ACFS/repl/ready/receipt.transport.cord204.1298310204

2011-02-21 18:43:25.357: [transprt][/u00/app/grid/acfsmounts/repl_test]usrgExecOCI: SQL: declare
status boolean;
retcode number;
ftypecheck boolean := FALSE;
begin
status := dbms_backup_restore.networkFileTransfer('PRIMARY.trivadistraining.com', 'sys', 'manager', 'sysdba', '/u00/app/grid/acfsmounts/repl_test/.ACFS/repl/ready/receipt.transport.cord204.1298310204', '/u00/app/grid/acfsmounts/repl_test/.ACFS/repl/ready/receipt.transport.cord204.1298310204', 'read', ftypecheck, retcode);
end;

 

2011-02-21 18:43:35.436: [transprt][/u00/app/grid/acfsmounts/repl_test]Sending File: /u00/app/grid/acfsmounts/repl_test/.ACFS/repl/ready/receipt.apply.cord204.0

2011-02-21 18:43:35.436: [transprt][/u00/app/grid/acfsmounts/repl_test]usrgExecOCI: SQL: declare
status boolean;
retcode number;
ftypecheck boolean := FALSE;
begin
status := dbms_backup_restore.networkFileTransfer('PRIMARY.trivadistraining.com', 'sys', 'manager', 'sysdba', '/u00/app/grid/acfsmounts/repl_test/.ACFS/repl/ready/receipt.apply.cord204.0', '/u00/app/grid/acfsmounts/repl_test/.ACFS/repl/ready/receipt.apply.cord204.0', 'read', ftypecheck, retcode);
end;

 

An overview of the replication logs transport and apply:

grid@red:~/ [+ASM1] acfsutil repl info /u00/app/grid/acfsmounts/repl_test
...
Time: Mon Feb 21 18:43:42 2011
Event: Applied Log
Cord Number: 204
Log Create Time: Mon Feb 21 18:41:57 2011
Log Apply Complete Time: Mon Feb 21 18:43:29 2011
...
Time: Mon Feb 21 18:43:30 2011
Event: Transmitted Log
Cord Number: 204
Capture Time: Mon Feb 21 18:43:24 2011
Acknowledged Time: Mon Feb 21 18:43:30 2011

 

5. The primary side will delete at the end the acknowledge files

2011-02-21 18:43:31.483: [ monitor][/u00/app/grid/acfsmounts/repl_test]usrgeDeleteFileWShutdown: Attempting to delete
file
/u00/app/grid/acfsmounts/repl_test/.ACFS/repl/ready/receipt.transport.cord204.1298310204
...

2011-02-21 18:43:42.559: [ monitor][/u00/app/grid/acfsmounts/repl_test]usrgeDeleteFileWShutdown: Attempting to delete
file
/u00/app/grid/acfsmounts/repl_test/.ACFS/repl/ready/receipt.apply.cord204.0

 

 Activation of the standby filesystem

The standby filesystem is in fact mounted in read-write mode, but cannot be used directly to create new files:

blue:~ # mount | grep repl_test
/dev/asm/repl_test-321 on /u00/app/grid/acfsmounts/repl_test type acfs (rw)

blue:~ # touch /u00/app/grid/acfsmounts/repl_test/test
touch: cannot touch `/u00/app/grid/acfsmounts/repl_test/test': Permission denied

There is no framework to graceful switch the roles between the primary and standby sides, without terminating the replication and initializing it again. It means to switch the sides you need to terminate the replication, clean the “old primary” filesystem and initialize the replication again.

grid@blue:~/ [+ASM1] sudo acfsutil repl terminate standby /u00/app/grid/acfsmounts/repl_test
acfsutil repl terminate: ACFS-05060: waiting for ACFS replication to terminate
acfsutil repl terminate: ACFS-05060: waiting for ACFS replication to terminate

After terminating the replication on the standby side, the filesystem can be used in read-write mode

blue:~ # touch /u00/app/grid/acfsmounts/repl_test/test
blue:~ # ls -l /u00/app/grid/acfsmounts/repl_test/test
-rw-r--r-- 1 root root 0 Feb 21 19:21 /u00/app/grid/acfsmounts/repl_test/test

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Post
  • very nice article!

    Good Job.

  • Hi,

    This was my exam question, still not sure about the answer.

    Any help is much appreciatedl

    Which three fragments will complete this statement correctly ?

    In a cluster environmet, an acfs volume

    a-)will be automatically mounted by a node on rebooy by default

    b-) must be manually mounted after a node reboot

    c-) will be automatically mounted by a node if it is defined as cluster stack startup if it is included in the ACFS mount registry.

    d-)will be automatically mounted to all node if it is defined as cluster resource when dependent cluster resource requires access

    e-)will be automatically mounted to all node in the cluster when the file system is registered

    f-)must be mounted before it can be registered.

  • Hi,

    i would say: c,d,e

Page 1 of 1 (3 items)