7.2.29 touch

Create a file or modify attributes of an existing file.

Syntax

touch [ -s num | --size=num ] 
      [ -t file-type | --type=file-type ] 
      [ --bs=block-size ]
      [ -r { true | false } | --read-only={ true | false }] 
      [ -e expiry-time | --lockExpiryTime=expiry-time
      [ -i { true | false } | --lockImmutable={ true | false } ]]
      file-name
      [{ -w | --wallet } wallet-location ] 
      [{ -T | --trace } trace-level ]
      [{ -j | --json } [ --compact ]]

Command Options

The options for the touch command are:

  • file-name: Specifies the file being created or modified.

  • -s, --size: Optionally specifies the size of the file in bytes.

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

    When modifying an existing file, you can grow or shrink the file by specifying a new size.

    Caution:

    If you specify a new size that is smaller than the current file size, the file is truncated to the new size and any data beyond that point is discarded.

  • -t, --ftype: Optionally specifies the Oracle Database file type for a new file. The valid values are:

    • ctrl - control file
    • data - data file
    • olog - on-line log file
    • alog - archived log file
    • temp - temporary sort file
    • init - initialization parameter file
    • pswd - password file
    • flog - flashback log file
    • ctrk - change tracking file
  • --bs: Optionally specifies the block size for a new file.

  • -r, --read-only: Optionally specifies that the file is read-only. When set to true, the file contents and metadata cannot be modified.

  • -e, --lockExpiryTime: Optionally specifies the snapshot lock expiry date and time.

    This option applies only to snapshot files.

    The value can be an ISO 8601-formatted future date and time. Or, to unlock a locked snapshot, you can set the expiry time to 'null' (lockExpiryTime='null'). You can modify this attribute only if the snapshot lock is not immutable (lockImmutable=FALSE).

  • -i, --lockImmutable: Indicates whether the lock is immutable.

    When a lock is immutable, the snapshot cannot be unlocked before the lock expires, and the lock cannot be modified to expire sooner.

    This option applies only to snapshot files and only in conjunction with setting the lock expiry time. If not specified, the default value is false.

  • -w, --wallet: Optionally specifies the path to the Exascale wallet directory.

  • -T, --trace: Optionally enables tracing, with the trace level (trace-level) set to 1 (minimum tracing), 2 (medium tracing), or 3 (maximum tracing). If the trace level is not specified, then minimum tracing is enabled by default.

    The trace file is written to the first accessible location in the following list:

    1. If the $ADR_BASE environment variable is set:

      $ADR_BASE/diag/EXC/xsh_<user-name>/<host-name>/trace/xsh_<date>.trc
    2. /var/log/oracle/diag/EXC/xsh_<user-name>/<host-name>/trace/xsh_<date>.trc
    3. /tmp/diag/EXC/xsh_<user-name>/<host-name>/trace/xsh_<date>.trc
  • -j, --json: Displays the output in JSON format.

  • --compact: Displays JSON formatted output in a compact format, without white space and line breaks.

Examples

Example 7-45 Create or resize an Exascale file

Assuming that @my-data/my-file does not already exist, the following example creates a 1 GB file at @my-data/my-file.

$ xsh touch --size=1G @my-data/my-file

If @my-data/my-file already exists, the command changes the size of the existing file to 1 GB.

Related Topics