Monday, December 14, 2020

ORA-06553: PLS-306: wrong number or types of arguments in call to 'UPLOAD_TO_S3'

Problem:

When trying to upload a file on an AWS RDS instance to an S3 bucket I was getting this error:

SELECT rdsadmin.rdsadmin_s3_tasks.upload_to_s3(
      p_bucket_name    =>  'db-bucket',       
      p_directory_name =>  'DATA_PUMP_DIR',
      p_prefix         =>  'EXPORT_SCHEMAS.dmp')
   AS TASK_ID FROM DUAL;

ORA-06553: PLS-306: wrong number or types of arguments in call to 'UPLOAD_TO_S3'
06553. 00000 -  "PLS-%s: %s"
*Cause:    
*Action:
Error at Line: 2 Column: 7


Solution:

Add the following mandatory argument for subdirectory "even if it's empty" to the above command:

p_s3_prefix      =>  '',

Final command will be:

SELECT rdsadmin.rdsadmin_s3_tasks.upload_to_s3(
      p_bucket_name    =>  'db-bucket',       
      p_directory_name =>  'DATA_PUMP_DIR',
      p_s3_prefix      =>  '',
      p_prefix         =>  'EXPORT_SCHEMAS.dmp')
   AS TASK_ID FROM DUAL; 

 

Reference:

https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-s3-integration.html#oracle-s3-integration.using.upload

No comments:

Post a Comment