7.3 About the Cloud Storage Command Options
You can invoke the Cloud Storage command in SQLcl with
cloudstorage
or cloud_storage
or
cs
.
- Set and show the default cloud storage URI.
- Set and show the transfer method, profile and credential.
- List compartment, bucket and objects in cloud storage.
- Get, put, delete, and peek a Cloud Storage Object.
For a list of the Cloud Storage command options in SQLcl, enter:
help cs
The command options are:-
cs [ uri ] <uri>
: Sets the default Cloud Storage URI. The URI must contain the host and optionally the namespace, bucket, and object.Example: --host cs https://objectstorage.us-ashburn-1.oraclecloud.com --namespace cs https://objectstorage.us-ashburn-1.oraclecloud.com/n/test –-bucket cs https://objectstorage.us-ashburn-1.oraclecloud.com/n/test/b/example --object cs https://objectstorage.us-ashburn-1.oraclecloud.com/n/test/b/example/o/employees.csv
-
cs oci [<profile>]
: Sets the default transfer as OCI. Optionally, specify the profile to be used. cs {DBC | DBMS_CLOUD} [<credential>]
: Sets the default transfer as DBMS_CLOUD. Optionally, specify the credential to use.-
cs clear
: Clears the Cloud Storage URI including URI and transfer options. -
cs show
: Shows the current default Cloud Storage URI, transfer method, profile and credential. -
cs listc [ <compartment> ]
: Lists the compartments in the specified compartment. If compartment is not specified, lists the compartments in the namespace as identified by the profile. (OCI only) -
cs listb <compartment>
: Lists the buckets in a compartment. (OCI only) -
cs listo [ <bucket> ]
: Lists the objects in a bucket. Bucket must be specified in the URI or on thelisto
command. cs delete [<qualifier>]
: Delete the object from cloud storage.cs get [<qualifier>]
: Get the object from cloud storage.cs PUT [file-to-send-as-body] <qualifier>
: Copy the file to cloud storage.-
cs peek [ <qualifier> ] [ { pos | position} <position> ] [ size <size> ]
: Displays the contents of the object where:qualifier is the name of the object, optionally qualified by the namespace and the bucket. The qualified name combined with the default URI specified must fully identify the object URI.
position is the start location in the object for display.
size is the number of characters to display. If omitted, 2000 characters are displayed.