Skip to content

RDS Oracle download backup failed on "RDSADMIN.RDSADMIN_S3_TASK.DOWNLOAD_FROM_S3" invalid identifier

0

Hello,

I have backup from client and try to roll up it on new instance of RDS Oracle 19. According to this guide https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-s3-integration.using.html I did all including:

  • Create rds-s3-integration-role with all listed permissions;
  • Extended default Oracle options with Options Group containing S3_INTEGRATION
  • Uploaded my file to S3

But when I execute:

SELECT rdsadmin.rdsadmin_s3_tasks.download_from_s3(
    p_bucket_name    => 'ora_my_bucket',
    p_s3_prefix      => 'EXPORT_01.DMP',
    p_directory_name => 'DATA_PUMP_DIR'
) AS task_id FROM DUAL;

I'm getting the error: Error executing SELECT statement. ORA-00904: "RDSADMIN"."RDSADMIN_S3_TASKS"."DOWNLOAD_FROM_S3": invalid identifier.

Meanwhile next:

SELECT * FROM TABLE(RDSADMIN.RDS_FILE_UTIL.LISTDIR('DATA_PUMP_DIR'));

works well and shows that DATA_PUMP_DIR exists. Also tried to export using dbms_datapump.add_file(... without any succeed.

Thank you in advance!

asked 4 months ago213 views
6 Answers
0
Accepted Answer

Well, I found the solution. The issue was that my RDS Instance was Oracle Single Edition (se), when I switched to Enterprise Edition (ee) all objects like rdsadmin_s3_tasks became available.

answered 3 months ago
0

It appears you're encountering an issue with the procedure name when trying to download files from S3 to your RDS for Oracle instance. The correct procedure name for downloading files from S3 to RDS Oracle is rdsadmin.rdsadmin_s3_tasks.download_from_s3 (which you're using), but there might be a configuration issue with your S3 integration.

Here are a few things to check:

  1. Make sure that both your RDS for Oracle DB instance and the S3 bucket are in the same AWS Region. This is a requirement for S3 integration with RDS for Oracle.

  2. Verify that the S3_INTEGRATION option has been properly added to your option group and that the option group is associated with your DB instance. You may need to wait for the option to be fully applied to your instance.

  3. Ensure that the IAM role you created (rds-s3-integration-role) is correctly attached to your RDS instance and has the necessary permissions to access the S3 bucket.

  4. Try using the correct case for the procedure name. Oracle identifiers are case-sensitive when quoted. The correct format is:

SELECT rdsadmin.rdsadmin_s3_tasks.download_from_s3(
p_bucket_name    => 'ora_my_bucket',
p_s3_prefix      => 'EXPORT_01.DMP',
p_directory_name => 'DATA_PUMP_DIR'
) AS task_id FROM DUAL;

If you're still encountering issues, you might need to check if there are any specific requirements or limitations for your Oracle version. The S3 integration feature allows you to transfer files between your RDS for Oracle DB instance and an Amazon S3 bucket, which can be used with Oracle Database features such as Oracle Data Pump.
Sources
Amazon S3 integration - Amazon Relational Database Service

answered 4 months ago
AWS
EXPERT
reviewed 3 months ago
  • Thank you for this quick response. 1, 2, 3 - looks reasonable and I've already doublechecked it. 4 - I can see rdsadmin schema and it contains following list of objects (and they work for me - like I can select/explore them): MANAGE_TRACEFILES, MANAGE_TRACEFILES_CTX, RDSADMIN, RDSADMIN_ADRCI_UTIL, RDSADMIN_ARCHIVE_LOG_DOWNLOAD, RDSADMIN_DBMS_GOLDENGATE_AUTH, RDSADMIN_DBMS_IJOB, RDSADMIN_DBMS_REPAIR, RDSADMIN_DBMS_SCHEDULER, RDSADMIN_DIAGNOSTIC_UTIL, RDSADMIN_KERBEROS_AUTH_TASKS, RDSADMIN_M_STER_UTIL, RDSADMIN_OSWBB_UTIL, RDSADMIN_PASSWORD_VERIFY, RDSADMIN_PATCH_UTIL, RDSADMIN_PRIVILEGES_UTIL, RDSADMIN_PUB_UTIL, RDSADMIN_RMAN_SCHEDULER_TASKS, RDSADMIN_RMAN_UTIL, RDSADMIN_TRANSPORT_UTIL, RDSADMIN_TRIGGER_UTIL, RDSADMIN_TRIGGER_UTIL2, RDSADMIN_UTIL, RDS_FILE_UTIL, RDS_XS_ACL. As you can see nothing related to S3 there, so I am inclined to agree with your assumption: " limitations for your Oracle version". Can you please point me what version should I use in RDS console?

0

Hi,

Please ensure that the S3_INTEGRATION option is successfully added to option group that is associated with the instance.

If this option group isn't in the in-sync state and you try to add the S3_INTEGRATION option, then the option isn't added. It's a best practice to make sure that the option group is in the in-sync state.

Below aws cli command can be used to check the option group sync status,

aws rds describe-db-instances \--db-instance-identifier example-db-instance \
--query 'DBInstances[*].[OptionGroupMemberships[*]]'

Once the S3_INTEGRATION is added, you should be able to see the below package in your RDS DB instance.

SQL> desc rdsadmin.rdsadmin_s3_tasks
FUNCTION DOWNLOAD_FROM_S3 RETURNS VARCHAR2
 Argument Name                  Type                    In/Out Default?
 ------------------------------ ----------------------- ------ --------
 P_BUCKET_NAME                  VARCHAR2                IN
 P_DIRECTORY_NAME               VARCHAR2                IN
 P_S3_PREFIX                    VARCHAR2                IN     DEFAULT
 P_DECOMPRESSION_FORMAT         VARCHAR2                IN     DEFAULT
 P_ERROR_ON_ZERO_DOWNLOADS      VARCHAR2                IN     DEFAULT
FUNCTION RDS_VERSION RETURNS VARCHAR2
FUNCTION UPLOAD_TO_S3 RETURNS VARCHAR2
 P_BUCKET_NAME                  VARCHAR2                IN

Please check if your DB instance has IAM role with the permissions to upload and download from S3 and the S3 bucket should be in the same region. Below is aws cli command to check the roles associated with your DB instance and verify if it has S3 bucket permissions to read and write to the bucket.

aws rds describe-db-instances \--db-instance-identifier example-db-instance \--query 'DBInstances[*].[AssociatedRoles[*]]'

Sharing the below detailed troubleshooting doc, which should help to troubleshoot all the required steps if you are still facing issues.

https://repost.aws/knowledge-center/rds-oracle-s3-integration

AWS
answered 3 months ago
AWS
EXPERT
reviewed 3 months ago
  • Thank you for the response. This desc rdsadmin.rdsadmin_s3_tasks - is is incorrect because Oracle has no object rdsadmin_s3_tasks in schema rdsadmin. And yes S3_INTEGRATION is totally configured. I found the issue - rdsadmin_s3_tasks only appears for Oracle Enterprise Edition setup. When I switched from Single Edition to EE all objects has appeared in rdsadmin schema.

0

Hi,

Please be informed that the S3_INTEGRATION is available for both RDS Oracle Enterprise Edition (EE) and Standard Edition (SE2), so you should be able to use the package RDSADMIN_S3_TASKS in both the RDS Oracle versions.

Please review the below screenshot from the RDS Oracle Standard Edition (SE2) which has the package RDSADMIN_S3_TASKS under RDSADMIN schema. The issue you would have faced is that the S3_INTEGRATION was not added correctly through the option group and not in sync to your RDS Oracle database instance.

RDS Oracle SE2 Screenshot

AWS
answered 3 months ago
AWS
EXPERT
reviewed 3 months ago
  • Couldn't you please elaborate more on " S3_INTEGRATION was not added correctly through the option group and not in sync to your RDS Oracle database instance." ? Because I have this in very straight form like this:

    Current IAM roles for this instance (1) rds-s3-integration-role <-> S3_INTEGRATION

    What else can be tuned there?

0

Hi,

Please verify that the you have added a custom option group to your RDS Oracle instance which has the S3_INTEGRATION option enabled to the options group and also the status is In sync.

Below screen shot for the custom options group with S3_INTEGRATION enabled, DB Options Group

Below screen shot where the custom options group is associated and in sync with the RDS Oracle instance, DB options group in sync

Documentation reference - https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-s3-integration.preparing.option-group.html

This will ensure the required S3 Integration packages are created in the RDS Oracle instance.

The role assignment is required to access the S3 bucket for read and write operations on the S3 bucket objects from the RDS Oracle Instance. Both the role and S3_INTEGRATION are required for the RDS Oracle instance to transfer files between your RDS for Oracle DB instance and an Amazon S3 bucket.

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

AWS
answered 3 months ago
AWS
EXPERT
reviewed 3 months ago
  • Thank you for this answer, but I have already applied this option group. SE Oracle doesn't recognize rdsadmin_s3_tasks even with this option.

0

Hi,

As shown above, RDS Oracle SE2 will work with S3_INTEGRATION and not sure of the issue you are facing with your RDS instance.

You can run the below aws cli commands to verify that the option group is associated with your RDS oracle SE2 instance is in sync and has the S3_INTEGRATION enabled.

Note : Replace the database identifier with your RDS Oracle SE2 database identifier and option group name with your option group name in below cli commands to get similar output

[cloudshell-user@ip-<hidden> ~]$ aws rds describe-db-instances --db-instance-identifier rdsdbse20822 --query 'DBInstances[*].[OptionGroupMemberships[*]]'
[
    [
        [
            {
                "OptionGroupName": "oracle-se2-19c-opgroup",
                "Status": "in-sync"
            }
        ]
    ]
]
[cloudshell-user@ip-<hidden> ~]$ aws rds describe-option-groups --option-group-name oracle-se2-19c-opgroup
{
    "OptionGroupsList": [
        {
            "OptionGroupName": "oracle-se2-19c-opgroup",
            "OptionGroupDescription": "oracle-se2-19c-opgroup",
            "EngineName": "oracle-se2",
            "MajorEngineVersion": "19",
            "Options": [
                {
                    "OptionName": "S3_INTEGRATION",
                    "OptionDescription": "Enables S3_INTEGRATION for data ingestion",
                    "Persistent": false,
                    "Permanent": false,
                    "OptionVersion": "1.0",
                    "OptionSettings": [],
                    "DBSecurityGroupMemberships": [],
                    "VpcSecurityGroupMemberships": []
                }
            ],
            "AllowsVpcAndNonVpcInstanceMemberships": false,
            "VpcId": "<hidden>",
            "OptionGroupArn": "arn:aws:rds:us-east-1:<hidden>:oracle-se2-19c-opgroup"
        }
    ]
}

You can share the output here as well for the above commands.

AWS
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.