7.2.6 cp

Copy files residing in Exascale or a local file system.

Syntax

cp [ -f | --force ] [ --ftype=file-type ] [ --bs=block-size ]
   [ --template=template-name ] [ --content-type=content-type ]
   [ --media-type=media-type ] [ --redundancy=redundancy ]
   [[ -s | --snap ] | [ -c | --clone ]] [ --aio=naio ] 
   [ --status=status-level] [ --sparse ]
   source1 target1 [ sourceN targetN ]...
   [{ -w | --wallet } wallet-location ] 
   [{ -T | --trace } trace-level ] 
   [{ -j | --json } [ --compact ]]

Command Options

The options for the cp command are:

  • source1-N: Specifies the source file being copied.

  • target1-N: Specifies the location of the file copy. The value cannot be a directory.

  • -f, --force: Forces the target to be overwritten if it exists. This is the default and only behavior.

  • --ftype: Optionally specifies the Oracle Database file type. 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

    This option only applies when copying into Exascale storage.

  • --bs: Optionally specifies the block size (in bytes) to use for copying the file(s).

  • --template: Optionally specifies the name of the Exascale template to use when copying new files into Exascale storage.

    This option only applies when copying new files into Exascale storage.

  • --content-type: Optionally specifies the content type setting for file creation on Exascale storage.

    If not specified, the value is determined by the file type and the associated template. If specified, this setting overrides the template setting. This option only applies when copying new files into Exascale storage.

    Permitted values are:

    • DATA: Principally associated with user data.

    • RECO: Primarily for information used in data recovery operations and to maintain data integrity.

  • --media-type: Optionally specifies the media type setting for file creation on Exascale storage.

    If not specified, the value is determined by the file type and the associated template. If specified, this setting overrides the template setting. This option only applies when copying new files into Exascale storage.

    Permitted 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.

  • --redundancy: Optionally specifies the redundancy setting for file creation on Exascale storage.

    If not specified, the value is determined by the file type and the associated template. If specified, this setting overrides the template setting. This option only applies when copying new files into Exascale storage.

    Permitted values are:

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

  • -s, --snap: Creates a read-only snapshot of the specified source file.

    This option only applies when copying files in Exascale storage.

  • -c, --clone: Creates a writable thin clone of the specified source file.

    This option only applies when copying files in Exascale storage.

  • --aio: Optionally specifies the number of async I/Os to use. The default value is 4.

  • --status: Specifies the level of status information output during a long-running operation.

    Permitted values are:

    • progress: Periodically shows progress statistics.

    • none: Suppresses progress statistics and only shows applicable error messages. This is the default setting.

  • --sparse: Tries to seek rather than write to output for Exascale sparse input blocks.

    This option only applies when copying files in Exascale storage.

  • -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.

Usage Notes

Note the following information when using this command:

  • If both the source and target locations reside on Exascale storage, you can use a wildcard (%) in the source location to specify multiple source files, in which case the corresponding target location must also contain a matching wildcard. For example, see Example 7-15.

Examples

Example 7-13 Copy a File to Exascale

The following example copies the local file at /tmp/file1 to @my-data/file1.copy on Exascale storage.

$ xsh cp /tmp/file1 @my-data/file1.copy

Example 7-14 Copy a File from Exascale

The following example copies the Exascale file at @my-data/file2 to /tmp/file2.copy on the local file system.

$ xsh cp @my-data/file2 /tmp/file2.copy

Example 7-15 Copy Multiple Files on Exascale Storage

The following example uses the wildcard character (%) to copy multiple files from @my-data/location1/prefix1% to @my-data/location2/anotherlocation/prefix2%. Using the example command, a file named @my-data/location1/prefix1mydata would be copied to @my-data/location2/anotherlocation/prefix2mydata.

$ xsh cp @my-data/location1/prefix1% @my-data/location2/anotherlocation/prefix2%