I recently talked about how to load up your Oracle Cloud service with your local data.

In that scenario, you’re in the graphical user interface, clicking buttons, doing things more ad-hoc.

But what if you wanted to build an automated process to load up data from an on-premise Oracle Database? You won’t have a GUI available then, so what’s available?

Enter the SQL Developer command-line interface, also known as SDCLI.

In the SQLDEVELOPER/BIN Directory

Here is where you will find the command-line interface program. I’m in Windows, obviously, but this is the same principle for a Mac or *NIX box.

Cart, that sounds promising.
Cart, that sounds promising.

Some more info on the CART command:

So what's expected to run this.
So what’s expected to run this.

We’re very nice and even give you some examples 🙂

Here’s ultimately what I’m going to run:

sdcli cart cloud -cart C:\Users\jdsmith\cloud_cart_cli.xml -cfg C:\Users\jdsmith\deploy_cloud_CLI.xml
sdcli cart cloud -cart C:\Users\jdsmith\cloud_cart_cli.xml -cfg C:\Users\jdsmith\deploy_cloud_CLI.xml

But before you jump into your cmd/shell, you’ll need to setup your parameters file first, IN the GUI.

First Things First

You’ll need your Cloud connection defined.

And then you’ll need your Cart.

Once the Cart is setup, hit the ‘Cloud’ button.

Set up your Cart and your deployment first.
Set up your Cart and your deployment first.

Hit the ‘save’ button to create the deployment XML file that you’ll reference in the command-line run.

Once it runs, you’ll see your ‘Deployment’ show up in the connection tree as normal. Wait a few minutes, and your request will be approved and processed. Which mean, your data will now be available to your cloud applications.

I had three runs, all via the command-line interface.
I had three runs, all via the command-line interface.

If you do run this multiple times, you’ll need to change the name of the ZIP file that’s being created, or build into your script to delete the ZIP file before the Cart runs.

Also, if you start-up SQL Developer, define your Cloud connection, and then try to run the Cart via the command-line, you may get a connection error. We’re not writing out the connection to file until you close SQL Developer – so it’s not available to SDCLI yet. We’ve got that fixed for version 4.1 though.

Author

I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

3 Comments

  1. I am trying do this from SQL developer 4.1 . It works fine when I use cart from SQL developer , but when I try from sdcli it gives me this error :

    !Unable to connect to sftp server with provided details. Ensure that the correct details are saved for the connection.

    • The cloud connection details aren’t written to disk until sql developer shuts down, so it’s not available to sdcli.

      Close SQL Developer and ensure that the cloud connection has been saved before trying the command-line run.

      This has been fixed for our official 4.1 release.

Write A Comment