acfsutil snap create

Purpose

Creates a read-only or read-write snapshot of an Oracle ACFS file system or an existing snapshot.

Syntax and Description

acfsutil snap create -h
acfsutil snap create [-r|-w] [-p parent_snapshot] snapshot mount_point

acfsutil snap create -h displays help text and exits.

Table 16-98 contains the options available with the acfsutil snap create command.


Table 16-98 Options for the acfsutil snap create command

Option Description

-r

Creates a read-only snapshot. This is the default setting.

-w

Creates a read-write snapshot.

snapshot

Specifies a name for the snapshot. The name provided must be a valid directory name. The.ACFS/snaps directory itself cannot be snapped.

-p parent_snapshot

Specifies the name of an existing snapshot image within the Oracle ACFS file system.

mount_point

Specifies the directory where the file system is mounted.


acfsutil snap create creates a read-only or read-write snapshot of the Oracle ACFS file system mounted on mount_point or creates a snapshot of an existing snapshot if the -p option is specified. You can specify -r for read-only or -w for read-write; read-only is the default if neither -r or -w are specified.

The read-write snapshot enables the fast creation of an Oracle ACFS snapshot image that can be both read and written without impacting the state of the Oracle ACFS file system hosting the snapshot images. You can use the read-write functionality for testing new versions of application software or running test scenarios on production file data without modifying the original file system.

Snapshots are not separate file systems. The snapshot appears in the .ACFS/snaps/snapshot directory and initially is a complete replica of the file system at the time the snapshot command was given. A read-only snapshot continues to preserve that initial point-in-time view. A read-write snapshot can be modified by updates written directly to the files located within the .ACFS/snaps/snapshot hierarchy.

A symbol link (symlink) file is a pointer to a path specified at the time that the symlink is created. For any existing symlink in the source of the afsutil snap create command, a new link is made in the snapshot; however, the stored path to the symlink target is not modified during snap creation time. When an absolute path is used as the target of the link, the link target of the snapshot still refers to the absolute path, outside the newly-created snapshot namespace. Future modifications to the targeted file can occur through the snapshot symlink, not to a new target inside the snapshot namespace. The contents of the targeted file can also be changed outside of the snapshot. Because of this behavior, you should use relative path targets for all symlinks that are within the same file system.

Any user can access the snapshot directory by specifying the path name. However, the .ACFS directory itself is hidden from directory listings of the root of the file system. This prevents recursive commands, such as rm -rf or acfsutil tag set -r, from the root of the file system inadvertently operating on snapshot files.

Snapshots usually use very little storage initially as they share file system blocks with the original file system until a file changes.

Tools such as du report the total disk space usage of the snapshotted files, which includes the storage shared with the original versions of the files. To determine the total space used for the snapshots, use the acfsutil snap info or acfsutil info fs command. See "acfsutil info fs".

Oracle ACFS snapshots are immediately available for use after they are created. They are always online under the.ACFS/snaps directory when the original file system is mounted. No separate command is needed to mount them.

The acfsutil snap create operation fails if the cluster is in rolling migration.

Creation from an existing snapshot is not permitted if there are:

  • Any snapshots present in the file system that were created with the ADVM compatibility set to less than 12.1

  • Any snapshots of the file system that were created after ADVM compatibility was set to 12.1 but while 11.2 snapshots existed

  • Any snapshot deletion cleanup operations still running in the background for the above conditions

    You can display pending snapshot operations with the acfsutil snap info command. For information, refer to "acfsutil snap info".

Administrator privileges are required to use this command or you must be a member of the Oracle ASM administrator group.

For more information about Oracle ACFS snapshots, refer to "About Oracle ACFS Snapshots". For information about the number of snapshots supported, refer to "Oracle ACFS Disk Space Usage".

Examples

Example 16-92 shows the use of the acfsutil snap create command to create snapshots on a Linux platform.

Example 16-92 Using the acfsutil snap create command on Linux

$ acfsutil snap create -w midday_test1 /acfsmounts/critical_apps

$ acfsutil snap create -w midday_test2 /acfsmounts/critical_apps

$ /sbin/acfsutil snap create payroll_report1 /acfsmounts/critical_apps

$ /sbin/acfsutil snap create payroll_report2 /acfsmounts/critical_apps

$ ls /acfsmounts/critical_apps/.ACFS/snaps
midday_test1  midday_test2  payroll_report1  payroll_report2

Example 16-93 shows the use of the acfsutil snap create command to create snapshots on a Windows platform. This example shows the creation of a snapshot from an existing snapshot.

Example 16-93 Using the acfsutil snap create command on Windows

$ /sbin/acfsutil snap create /w snap_1 e:

$ /sbin/acfsutil snap create /w snap_1-1 /p snap_1 e: