Skip to content

Instantly share code, notes, and snippets.

@junalmeida
Created August 22, 2018 14:38
Show Gist options
  • Save junalmeida/c455db6fdb2c84fdd15511557baa26bc to your computer and use it in GitHub Desktop.
Save junalmeida/c455db6fdb2c84fdd15511557baa26bc to your computer and use it in GitHub Desktop.
pl-sql transfer multiple dumps over dblink
BEGIN
FOR loop_counter IN 1 .. 7
LOOP
dbms_output.put_line('EXPDAT' || LPAD(loop_counter, 2, '0') || '.DMP');
DBMS_FILE_TRANSFER.PUT_FILE(
source_directory_object => 'DATA_PUMP_DIR',
source_file_name => 'EXPDAT' || LPAD(loop_counter, 2, '0') || '.DMP',
destination_directory_object => 'DATA_PUMP_DIR',
destination_file_name => 'EXPDAT' || LPAD(loop_counter, 2, '0') || '.DMP',
destination_database => 'to_rds' --dblink
);
END LOOP;
END;
/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment