是否可以将此 SWITCH PARTITION 控制选项用于 Azure SQL 服务器?
Is it possible to use this SWITCH PARTITION control option with Azure SQL Server?
我正在做一些 ETL,使用标准的“预加载”分区模式:将数据加载到 loading
table 的日期分区,然后将该分区切换到 live
table.
我找到了 SWITCH 命令的这些选项:
ALTER TABLE [myLoadingTable] SWITCH PARTITION @partNum TO [myLiveTable] PARTITION @partNum -- Move the New Data in.
WITH ( WAIT_AT_LOW_PRIORITY ( MAX_DURATION = 1 MINUTES, ABORT_AFTER_WAIT = BLOCKERS ))
这些选项似乎是需要定义的有价值的东西(即使在正常操作期间不需要它们)。
不幸的是,当我尝试 运行 时,我得到:
Sql error number: 11423.
Error Message: User does not have permission to use the ABORT_AFTER_WAIT = BLOCKERS option.
进一步阅读证实这是合适的:(link)
BLOCKERS
Kill all user transactions that currently block the SWITCH
or online index rebuild DDL operation so that the operation can continue.
Requires ALTER ANY CONNECTION
permission.
但是当我尝试 GRANT
相关用户的权限时,我得到一个错误:
GRANT ALTER ANY CONNECTION TO [myAdfUser]
Securable class 'server' not supported in this version of SQL Server.
我正在使用 (AFAIK) 普通的 Azure SQL 服务器数据库。
是否有解决此问题的方法? 还是我无法在此数据库上使用这些选项?
看来问题已被@Larnu 的评论解决,只需将其添加为答案即可关闭问题。
If you are using Azure SQL Database, then what the error is telling you is true. Azure SQL Databases are what are known as Partially Contained databases; things like their USER objects have their own Password and the LOGIN objects on the server aren't used for connections. The CONNECTION permission is a server level permission, and thus not supported in Azure SQL Databases.
我正在做一些 ETL,使用标准的“预加载”分区模式:将数据加载到 loading
table 的日期分区,然后将该分区切换到 live
table.
我找到了 SWITCH 命令的这些选项:
ALTER TABLE [myLoadingTable] SWITCH PARTITION @partNum TO [myLiveTable] PARTITION @partNum -- Move the New Data in.
WITH ( WAIT_AT_LOW_PRIORITY ( MAX_DURATION = 1 MINUTES, ABORT_AFTER_WAIT = BLOCKERS ))
这些选项似乎是需要定义的有价值的东西(即使在正常操作期间不需要它们)。
不幸的是,当我尝试 运行 时,我得到:
Sql error number: 11423.
Error Message: User does not have permission to use the ABORT_AFTER_WAIT = BLOCKERS option.
进一步阅读证实这是合适的:(link)
BLOCKERS
Kill all user transactions that currently block theSWITCH
or online index rebuild DDL operation so that the operation can continue.Requires
ALTER ANY CONNECTION
permission.
但是当我尝试 GRANT
相关用户的权限时,我得到一个错误:
GRANT ALTER ANY CONNECTION TO [myAdfUser]
Securable class 'server' not supported in this version of SQL Server.
我正在使用 (AFAIK) 普通的 Azure SQL 服务器数据库。
是否有解决此问题的方法? 还是我无法在此数据库上使用这些选项?
看来问题已被@Larnu 的评论解决,只需将其添加为答案即可关闭问题。
If you are using Azure SQL Database, then what the error is telling you is true. Azure SQL Databases are what are known as Partially Contained databases; things like their USER objects have their own Password and the LOGIN objects on the server aren't used for connections. The CONNECTION permission is a server level permission, and thus not supported in Azure SQL Databases.