Forum Widgets
Latest Discussions
Azure SQL Managed Instance - DB Backup Retention
Dear All, We have requirement for backup retention as below: (1) PITR for 2 months (2) To be able to restore backup of any day (time doesn't matter) for 1 year Can you please advise how to accoplish above? Thank you.SolvedAlwaysTheLearnerJul 31, 2025Copper Contributor158Views0likes3CommentsDecrease used storage in Azure
Hello, I want to reduce the storage used by an azure SQL database. I have managed to reduce the "allocated space" to below 6 GB. Can I change the "Max storage" to 6 GB without impact on the database itself? I can not find a definite answer online. Kind Regards, BasSolvedbstraaten1973Mar 19, 2025Copper Contributor203Views0likes3CommentsUnable to enable RCSI
We created our Azure SQL database few years ago and at that time RCSI was not a default setting. I am trying to enable RCSI now but unsuccessful. Database details: We have Azure SQL database (single database) in East US. A read replica (Geo-replication) was created against it. Steps identified from documentation to enable RCSI: ALTER DATABASE [DatabaseName] REMOVE SECONDARY ON SERVER [SecondaryServerName]; ALTER DATABASE [DatabaseName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; ALTER DATABASE [DatabaseName] SET READ_COMMITTED_SNAPSHOT ON; ALTER DATABASE [DatabaseName] SET MULTI_USER; ALTER DATABASE [DatabaseName] ADD SECONDARY ON SERVER [SecondaryServerName]; Second script to set single user returns below error. I am unable to proceed after this. Any help to resolve the problem and enable RCSI is appreciated. Msg 1468, Level 16, State 1, Line 1 The operation cannot be performed on database "[DatabaseName]" because it is involved in a database mirroring session or an availability group. Some operations are not allowed on a database that is participating in a database mirroring session or in an availability group. Msg 5069, Level 16, State 1, Line 1 ALTER DATABASE statement failed.SolvedswaroopdandalaDec 23, 2024Copper Contributor227Views0likes2CommentsLog Reader Agent throwing errors on Azure SQL Managed Instance
I configured Azure SQL Managed Instance for transactional replication, it is a publisher with local distributor. I got it set up and the snapshot agent runs successfully, but the log reader agent is throwing errors: The last step did not log any message! (Source: MSSQL_REPL, Error number: MSSQL_REPL22037) Get help: http://help/MSSQL_REPL22037 I tried setting up with TSQL script as well as via replication wizard. Still no luck with the logreader agent. Note - this instance of MI was migrated from on-premise. I verified that the replAgentUser was created and does exist. USE master GO EXEC sp_adddistributor = @@SERVERNAME, @password = NULL GO EXEC sp_adddistributiondb @database = N'distribution' , @min_distretention = 0 , _distretention = 72 , @history_retention = 48 , @deletebatchsize_xact = 5000 , @deletebatchsize_cmd = 2000 , @security_mode = 1 GO EXEC sp_adddistpublisher @publisher = @@SERVERNAME , @distribution_db = N'distribution' , @security_mode = 0 , @login = '<login>' , @password = '<password>' , @working_directory = N'\\<name>.file.core.windows.net\replshare' , @storage_connection_string = N'DefaultEndpointsProtocol=https;AccountName=<name>;AccountKey=<key>;EndpointSuffix=core.windows.net' GO EXEC sp_replicationdboption @dbname = N'db1' , @optname = N'publish' , @value = N'true' GO USE [db1] GO -- Adding the transactional publication EXEC sp_addpublication @publication = N'pub1' , @description = N'Transactional publication' , @sync_method = N'concurrent' , @retention = 0 , @allow_push = N'true' , @allow_pull = N'true' , @allow_anonymous = N'true' , @enabled_for_internet = N'false' , _in_defaultfolder = N'true' , @compress_snapshot = N'false' , @ftp_port = 21 , @ftp_login = N'anonymous' , @allow_subscription_copy = N'false' , @add_to_active_directory = N'false' , @repl_freq = N'continuous' , @status = N'active' , @independent_agent = N'true' , _sync = N'true' , @allow_sync_tran = N'false' , @autogen_sync_procs = N'false' , @allow_queued_tran = N'false' , @allow_dts = N'false' , @replicate_ddl = 1 , @allow_initialize_from_backup = N'false' , @enabled_for_p2p = N'false' , @enabled_for_het_sub = N'false' GO EXEC sys.sp_changelogreader_agent @job_login = '<login>' , @job_password = '<password>' , @publisher_security_mode = 0 , @publisher_login = N'<login>' , @publisher_password = '<password>' GO EXEC sp_addpublication_snapshot @publication = N'pub1' , @frequency_type = 1 , @frequency_interval = 0 , @frequency_relative_interval = 0 , @frequency_recurrence_factor = 0 , @frequency_subday = 0 , @frequency_subday_interval = 0 , @active_start_time_of_day = 0 , @active_end_time_of_day = 235959 , @active_start_date = 0 , @active_end_date = 0 , @job_login = '<login>' , @job_password = '<password>' , @publisher_security_mode = 0 , @publisher_login = N'<login>' , @publisher_password = '<password>' GO EXEC sp_addarticle @publication = N'pub1' , @article = N'table1' , @source_owner = N'dbo' , @source_object = N'table1' , @type = N'logbased' , @description = N'' , @creation_script = N'' , @pre_creation_cmd = N'drop' , @schema_option = 0x00000000080350DF , @identityrangemanagementoption = N'none' , @destination_table = N'table1' , @destination_owner = N'dbo' , @status = 24 , @vertical_partition = N'false' , @ins_cmd = N'CALL [sp_MSins_dbotable1]' , @del_cmd = N'CALL [sp_MSdel_dbotable1]' , @upd_cmd = N'SCALL [sp_MSupd_dbotable1]' GO EXEC sp_startpublication_snapshot @publication = N'pub1'; GO Looking at the results of MSlogreader_history table, all changes are being replicated, however there are many runstatus = 6, which means failure.SolvedgyvkoffAug 13, 2024Brass Contributor352Views0likes1CommentCreate login from Entra ID Security Group rather than individual
https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-azure-ad-logins-tutorial?view=azuresql says I can create a Login in Azure SQL Server from a Microsoft EntraID Security Group. I can, and it works, and it appears in sys.server_principals as type_desc 'EXTERNAL_GROUP' and type 'X'. (I note that non-group EntraID logins appear as type_desc 'EXTERNAL_LOGIN' and type 'E'.) But when I try the next step in the article, which is to create a User from the Login, I get the error '<EntraIDGroupName> is not a valid login or you do not have permission'. I have successfully created Users from non-group Logins, so I don't think it's a permission problem. Is it the case that, despite the article, you can't actually create a group user this way - I have to create individual logins and users for each potential EntraID user I want to have access the database? Or am I missing a trick somewhere?SolvedJonathanGibbsJan 17, 2024Copper Contributor1.6KViews2likes2CommentsCannot scale database to Hyperscale
I have an Azure SQL database currently in service tier Standard (DTU-based purchasing model). I am trying to migrate/scale it to Hyperscale (vCore-based purchasing model). I am getting error: Failed to scale from Standard S12: 3000 DTUs, 1 TB storage to Hyperscale - Serverless: Standard-series (Gen5), 8 vCores for database: <dbname>. Error code: . Error message: The database '<dbname>' on server '<servername>' has service level objective 'SQLDB_HS_S_Gen5_8' which is not supported for use as a job agent database. I'm unclear what is causing this error. No elastic jobs or agents exist or are defined.SolvedgyvkoffDec 19, 2023Brass Contributor750Views0likes1Comment60MB Azure SQL database restore taking over 50 minutes?
I kicked off a restore of an Azure SQL Database via the Azure Portal. Its only 60MB in size and is LRS so expected it to be pretty quick. 50+ minutes later it is still "Restoring..." wondered is this normal? I don't have a support plan so not sure if just to leave it or create a support case. Is there anything in Azure platform where this is escalated if it takes too long or does it stay restoring forever until customers raise support tickets (at cost!). Appreciate any insights 🙂Solvedabri_dparkerJun 08, 2023Copper Contributor8.2KViews0likes9CommentsEncrypted backups using Asymmetric key
Hello, I am creating asymmetric keys at the master level and at the database level. Asymmetric keys are showing in the security option, but when I am trying to take encrypted backup using asymmetric keys no keys are visible. I have already created an encrypted backup by using certificates, now I am trying to create an encrypted backup using an asymmetric key.SolvedAyushtzNov 08, 2021Copper Contributor2.6KViews0likes4CommentsAzure SQL Hyperscale Best Practices
I am hoping you can help answer this question. Previously whenever we upgraded or downgraded a SQL database, we always followed best practices. This included do the following three things: Rebuild all indexes Update Statistics Clear Procedure Cache We have now moved to HyperScale and the databases will scale up and down as needed. Do we need to continue doing these best practices or is this taken care of in Azure automatically? Thank you.SolvedParthKhemkaAug 16, 2021Copper Contributor2KViews0likes1CommentDATE_FORMAT is not supported for EXTERNAL FILE FORMAT.
I have been trying to create an external table from a CSV data set that does not use the default date format that synapse understands. So according to the documentation (https://docs.microsoft.com/en-us/sql/t-sql/statements/create-external-file-format-transact-sql?view=azure-sqldw-latest&tabs=delimited#examples) I should be able to specify a user defined format string as you can see in the picture below. But if I do so I get the following error "DATE_FORMAT is not supported for EXTERNAL FILE FORMAT." and I'm not sure what I'm missing in the documentation. I'm currently running in the Serverless SQL pool so could it be that this is just supported for dedicated pools? Thank you for your time and any help or insights would be greatly appreciated.SolvedGKanitzMay 20, 2021Copper Contributor3.2KViews0likes1Comment
Resources
Tags
- azure sql database19 Topics
- azure sql16 Topics
- Managed Instance6 Topics
- sql server5 Topics
- development4 Topics
- SQL Connector4 Topics
- azure active directory3 Topics
- security2 Topics
- azure1 Topic