6.2.8.9 mkfile

Create a file.

Purpose

The mkfile command creates a file within a vault.

Syntax

mkfile file-name [ --template template ] 
       [ --attributes attribute=value[,attribute=value]... ]

Command Options

The options for the mkfile command are:

  • file-name: Specifies the name of the file you are creating. The file name cannot contain wildcard characters. Only one file name can be specified.

  • --template: Creates the file using the specified template.

  • --attributes: Optionally specifies attributes to change.

    Use the describe mkfile command to see details about the file attributes you can set. See also Describing Resources and Attributes.

Usage Notes

Note the following information when using this command:

  • You can set the file size by specifying the size attribute.

    File sizes can be specified using suffixes K, KB, M, MB, G, GB, T, TB. The suffix is not case-sensitive.

    Regardless of the file size setting, storage space is physically materialized only when the file contents is written. So, after the mkfile command, the file initially consumes no physical storage space. The file only consumes physical storage space when data is written to it.

  • You can explicitly set the file storage attributes:

    • mediaType: Specifies the physical media type used to store the file. Possible values are:

      • HC: Identifies high capacity storage, using hard disk drives (HDDs) on high-performance Exadata storage servers.

      • EF: Identifies extreme flash storage, using low-latency, high-throughput flash devices.

      • XT: Identifies extended storage, using HDDs on Exadata storage servers optimized for cost-effective online storage of less frequently accessed data.

    • redundancy: Specifies the number of data copies that are maintained. Currently, the only permitted value is:

      • high: Indicates three mirrored copies of the file data.

    • contentType: Specifies the type of content in the file. Exascale internally uses this attribute to place file extents on physically separate devices in a manner that maximizes availability in the event of a failure. Possible values are:

      • DATA: Principally associated with user data.

      • RECO: Primarily for data used in backup and recovery operations.

    Additionally, starting with Oracle Exadata System Software release 26.1.0, you can set the storagePool attribute to specify the name of a storage pool used to store the file.

    If you explicitly set any of the file storage attributes, the specified value overrides the setting in the default template. If you specify both mediaType and storagePool, the values must be compatible. For example, you cannot specify the use of high capacity (HC) storage media (mediaType=HC) and also specify the name of a storage pool that uses extreme flash (EF) storage.

  • You can set the Exascale file type by specifying the fileType attribute.

    Every Exascale file type is associated with an Exascale template. So, you can view a complete list of the Exascale file types by using the ESCLI lstemplate command. For example:

    @> lstemplate --cluster
    @> lstemplate --vault vault2

Examples

Example 6-111 Create a File in a Vault

The following example shows creating a file named my-file in a vault named my-data.

@my-data/> mkfile my-file --attributes size=20k
File created.

@my-data/> ls -l
  20.0k   08 Jan 15:53 my-file 

Example 6-112 Create a File with a Specified File Type

The following example shows creating a file named my-data-file in a vault named my-data using a specified file type (fileType=DATAFILE).

@> mkfile @my-data/my-data-file --attributes fileType=DATAFILE

Example 6-113 Create a File with a Specified File Template

The following example shows creating a file named my-data-file2 in a vault named my-data using a specified file template (--template DATAFILE).

@> mkfile @my-data/my-data-file2 --template DATAFILE

Example 6-114 Create a File with Explicit File Storage Attributes

The following example shows creating a file named my-data-file3 in a vault named my-data using specified file storage attributes (storagePool=my-pool1,contentType=DATA).

@> mkfile @my-data/my-data-file3 --attributes storagePool=my-pool1,contentType=DATA