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.
Some more info on the CART command:
We’re very nice and even give you some examples 🙂
Here’s ultimately what I’m going to run:
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.
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.
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.
3 Comments
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.
Doozy ! Works for me , thanks Jeff !
-Rahul