7.2.4 cp

Copy files.

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 ] 
   [{ -w | --wallet } wallet-location ] [{ -T | --trace } trace-level ] 
   source1 target1 [ sourceN targetN ]...

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
    • RECO
  • --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 media, which uses hard disk drives (HDDs).
    • EF: Identifies extreme flash storage media, which uses 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:

    • normal: Indicates 2 mirrored copies of the file data.
    • 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 into Exascale storage.

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

    This option only applies when copying into Exascale storage.

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

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

  • -T, --trace: Optionally enables tracing and sets the trace level to 1 (minimum tracing), 2 (medium tracing), or 3 (maximum tracing).

    If the $ADR_BASE environment variable is set, the trace file is written to:

    $ADR_BASE/diag/EXC/xsh_<username>/<hostname>/trace/xsh_<date>.trc

    Otherwise, the trace file is written to:

    /tmp/diag/EXC/xsh_<username>/<hostname>/trace/xsh_<date>.trc

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

Examples

Example 7-6 Copy a File to Exascale

The following example copies the local file at /tmp/file-1 to @MYDATA/file-1.copy on Exascale storage.

$ xsh cp /tmp/file-1 @MYDATA/file-1.copy

Example 7-7 Copy a File from Exascale

The following example copies the Exascale file at @MYDATA/file-2 to /tmp/file-2.copy on the local file system.

$ xsh cp @MYDATA/file-2 /tmp/file-2.copy

Example 7-8 Copy Multiple Files on Exascale Storage

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

$ xsh cp @MYDATA/location1/prefix1% @MYDATA/location2/anotherlocation/prefix2%