Oracle ASM Cluster File System (ACFS) tagging was introduced in 18.104.22.168 for Linux. It allows you to group files together across directories or file systems—such as all files used by the HR department or all photos that include your daughters. It also allows you to group together all files in the file system you want to replicate, which means that you do not necessarily have to replicate an entire file system.
Tags can be up to 32 ASCII characters and can be created on files or directories. Tagging is accomplished by adding files and directories to or removing them from a tag set with the acfsutil tag set/unset command. If you tag a directory, only files created after that time will also inherit the tag—so you’d have to add the existing files manually.
Here’s how you add files:
[root]# /sbin/acfsutil tag set mycriticalfiles /u02/app/oracle/acfsdbhome1/emergency_procedures
Or you can add a whole directory’s contents:
[root]# /sbin/acfsutil tag set -r myrdbmslogs /u02/app/oracle/diag/rdbms/
You can see the files in the tag set using the acfsutil tag info command:
[root]# /sbin/acfsutil tag info -t mycriticalfiles /u02/app/oracle/acfsdbhome1/emergency_procedures
And you can remove them using unset:
/sbin/acfsutil tag unset –r myrdbmslogs /u02/app/oracle/diag/rdbms/
Tagging uses file extended attributes, and some operating system tools will clear those attributes when writing back a file, unless specific flags are used. For example, tar requires the –xattrs flag to keep attribute data, and vi requires the bkc=yes switch to ensure that the new file retains the tags and not the old copy. For mv and cp, you will need to be on Oracle Enterprise Linux 5 Update 4 and install coreutils-5.97-23.el5_4.1.src.rpm (32-bit) or coreutils-5.97-23.el5_4.2.x86_64.rpm (64-bit) or later to get the commands that preserve extended attributes. You should check the Oracle ASM Storage Administrator’s Guide for the full set of requirements and test the tools before using them in production, because the tags can be lost.