SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL backup from RDS to AWS S3 failing as a agent job


SQL backup from RDS to AWS S3 failing as a agent job

Author
Message
SeattleDBA
SeattleDBA
Right there with Babe
Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)Right there with Babe (743 reputation)

Group: General Forum Members
Points: 743 Visits: 96
This code works perfectly in an SSMS query window.
The backup ends up in the AWS S3 bucket that I want it to be.

But it fails when in a SQL Server Agent Job.
I have tested this on two different RDS instances. Same behavior on both.

Both are running as the correct DBO account. The error from the job history says it is running as the same account.
This error doesn't make sense. The account is a member of the db_owner role.

Is this perhaps a limitation of RDS?
Are we not allowed to use the native SQL backups in the SQL Server agent?

Exec msdb.dbo.rds_backup_database
@source_db_name=',my_database',
@S3_arn_to_backup_to='arn:aws:s3:::<target buck in S3>'

Error:
The job failed. The Job was invoked by User <my user>. The last step to run was step 7 (Backup db '<my database>' to AWS S3).

Message
Executed as user: <my user>. Database backups can only be performed by members of db_owner or db_backupoperator roles in source database [SQLSTATE 42000] (Error 50000) USAGE: EXECUTE msdb.dbo.rds_backup_database @source_db_name, @S3_arn_to_backup_to
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search