A good portion of Autonomous Database (ADB) users export and store their data in Oracle Cloud Object Storage. Last year, I had written this guide to help users export database dump files, using the Data Pump tool, to Oracle's object-store. Once completed, an export, depending on the export filesize parameters, may have created several dump file parts. You may then download your dump file parts using a tool with Swift API support such as the popular cURL tool; most newer operation systems have cURL preinstalled.
Recently, we have had users, that use cURL to download their files, reach out to ask how they may download all their exported dump file parts at once. cURL lacks support for wildcard or substitution characters in its URL, so it isn't a simple one-line command. Since my job is to make your life easier, below I provide a sample, easy-to-invoke bash script to download the multiple dump file parts of an export job from the object store, using cURL.
Once you have run your export job and the dump file parts are in the object store, download the shell script “get_objects.sh” by clicking this link and unzipping it. You may open this script in a text editor and read the detailed notes and description of what this script does and the parameters it accepts.
Once you have downloaded the get_objects.sh script, open the Terminal and navigate to the folder where you downloaded the script above. Run the script with bash command below, replacing in:
bash get_objects.sh -f 'https://swiftobjectstorage.<region identifier>.oraclecloud.com/v1/<object store namespace>/<bucketname>/exp%U.dmp' -a '<username>':'<SWIFT auth token>' –verbose
Once executed, the script will begin downloading all the dump files that match the name pattern in the URL provided! Follow the notes in the bash script if you need to use additional parameters in this bash invocation, for things like specifying your proxy or downloading to a specific folder.
I hope this time-saving example helps many of you easily download your exported dump files from the object store in one easy go!