Get region from within SQL Server RDS instance.

0

• Can I query the region from within the SQL Server itself?

Anything like rdsadmin.dbo.rds_show_configuration that include instance specs?

I have an SP that is clearing all backup tables from production to a secondary DB.

I want to back it up to S3 and drop those tables.

I have the backup command ready:

declare @BackupCMD varchar(4000) = concat('exec msdb.dbo.rds_backup_database @source_db_name=''', 'BackupTables', ''', @s3_arn_to_backup_to=''arn:aws:s3:::', @bucket, '/', @file_name, '.bak''
	, @kms_master_key_arn=''', @arn, '''')

The issue is we have instances over several regions and bucket and key need to match the same region as the instance.

If I can I will be able to cross it with the ARN / buckets list that need to match.

Thank you!

Barak
질문됨 일 년 전327회 조회
1개 답변
0

you could try https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/xp-cmdshell-transact-sql?view=sql-server-ver16 and give an AWS CLI command to obtain current region: 'aws configure get region'

profile pictureAWS
전문가
답변함 일 년 전
  • This is blocked by security team. Would work...

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인