Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Backup OCI Autonmous DB to an Oracle Object Storage OSS

Haytham-aJul 20 2025 — edited Jul 20 2025

I am using Always Free Oracle Autonmous Database (19c). I want to be take a full DB back to Oracel Object Storage OSS.

I followed through the steps here to generate PL/SQL code (on my local desktop) that I can run on SQL Developer Web. Below is the generated code:

set scan off 
set serveroutput on 
set escape off 
whenever sqlerror exit 
DECLARE 
/************************* 
* The following plsql will perform 
* 
* Data pump export to local (to the exporting database) Dump file 
* 
* This block will not move the locally exported data pump file to OSS 
* There is an import wizard to generate custom import PL/SQL 
* The wizard producing this block can also do copy to OSS and Full Import. 
* Copy to OSS and Full Import code are not included in this PL/SQL block. 
* 
*************************/ 
h1 number; 
s varchar2(1000):=NULL; 
errorvarchar varchar2(100):= 'ERROR'; 
tryGetStatus number := 0; 
success_with_info EXCEPTION; 
PRAGMA EXCEPTION_INIT(success_with_info, -31627); 
begin 
h1 := dbms_datapump.open (operation => 'EXPORT', job_mode => 'FULL', job_name => 'EXP_SD_15640-03_17_53', version => 'COMPATIBLE'); 
tryGetStatus := 1; 
dbms_datapump.set_parameter(handle => h1, name => 'COMPRESSION', value => 'ALL'); 
dbms_datapump.set_parallel(handle => h1, degree => 1); 
dbms_datapump.add_file(handle => h1, filename => 'EXPDAT-'||'03_17_53'||'.LOG', directory => 'DATA_PUMP_DIR', filetype => 3); 
dbms_datapump.set_parameter(handle => h1, name => 'KEEP_MASTER', value => 1); 
dbms_datapump.add_file(handle => h1, filename => 'EXPDAT%U-'||'03_17_53'||'.DMP', directory => 'DATA_PUMP_DIR', filesize => '500M', filetype => 1); 
dbms_datapump.set_parameter(handle => h1, name => 'INCLUDE_METADATA', value => 1); 
dbms_datapump.set_parameter(handle => h1, name => 'DATA_ACCESS_METHOD', value => 'AUTOMATIC'); 
dbms_datapump.set_parameter(handle => h1, name => 'ESTIMATE', value => 'BLOCKS'); 
dbms_datapump.start_job(handle => h1, skip_current => 0, abort_step => 0); 
s := NULL /* 'COMPLETED' */ ; 
DBMS_DATAPUMP.WAIT_FOR_JOB(h1, s); 
errorvarchar := 'NO_ERROR'; 
tryGetStatus:=0; 
DBMS_OUTPUT.PUT_LINE('WAIT_FOR_JOB_RETURN:'||s); 
IF (( s IS NULL) OR (s!= 'COMPLETED')) THEN 
RAISE SUCCESS_WITH_INFO; 
END IF; 
EXCEPTION 
WHEN OTHERS THEN 
BEGIN 
IF ((errorvarchar = 'ERROR')AND(tryGetStatus=1)) THEN 
DBMS_DATAPUMP.DETACH(h1); 
END IF; 
EXCEPTION 
WHEN OTHERS THEN 
NULL; 
END; 
RAISE; 
END; 
/ 

I don't see anything in this code that copies to OSS. Also, in the comments section, it states:

* The wizard producing this block can also do copy to OSS and Full Import. 
* Copy to OSS and Full Import code are not included in this PL/SQL block.

I don't want the import part. I just want to make the full backup available in OSS bucket.

When I reach this step:

and click ‘next’, I get prompted to enter User Name and Auth Token

Do I need these? Where do I get these from? I have created OSS volume. But I can't see where to get user name and auth token for this step. This blog did not help with this

My understand is using SQL Developer Wizard on my local desktop to generate the code, and then to copy it to my Cloud SQL Developer Web (Database Actions) and run it there because the code has to run on the same server where the database is.

This post has been answered by Mike Kutz on Jul 22 2025
Jump to Answer
Comments
Post Details
Added on Jul 20 2025
1 comment
245 views