DBCC FLUSHAUTHCACHE (Transact SQL)DBCC FLUSHAUTHCACHE (Transact-SQL)

适用对象:否SQL Server 是Azure SQL 数据库 否Azure Synapse Analytics (SQL DW) 否并行数据仓库 APPLIES TO: noSQL Server yesAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

SQL 数据库SQL Database 中当前用户数据库清空包含有关登录名和防火墙规则信息的数据库身份验证缓存。Empties the database authentication cache containing information about logins and firewall rules, for the current user database in SQL 数据库SQL Database. 此语句不适用于逻辑 master 数据库,因为 master 数据库包含登录名和防火墙规则信息的物理存储。This statement doesn't apply to the logical master database, because the master database contains the physical storage for the information about logins and firewall rules. 执行该语句的用户和当前连接的其他用户保持连接状态。The user executing the statement and other currently connected users remain connected. SQL 数据仓库SQL Data Warehouse 暂不支持 DBCC FLUSHAUTHCACHE。)(DBCC FLUSHAUTHCACHE isn't currently supported for SQL 数据仓库SQL Data Warehouse.)

文章链接图标 Transact-SQL 语法约定Article link icon Transact-SQL Syntax Conventions

语法Syntax

DBCC FLUSHAUTHCACHE [ ; ]  

参数Arguments

无。None.

RemarksRemarks

身份验证缓存创建 master 中存储的登录名和服务器防火墙规则的副本,并将它们放在用户数据库的内存中。The authentication cache makes a copy of logins and server firewall rules stored in master, and places them in memory in the user database. 由于包含的数据库用户的相关信息已存储在用户数据库中,因此包含的数据库用户不是身份验证缓存的一部分。Since information about contained database users is already stored in the user database, contained database users aren't part of the authentication cache. SQL 数据库SQL Database 持续保持活动连接需要至少每隔 10 小时进行重新授权(由 数据库引擎Database Engine 执行)。Continuously active connections to SQL 数据库SQL Database require reauthorization (performed by the 数据库引擎Database Engine) at least every 10 hours. 数据库引擎Database Engine 使用最初提交的密码尝试重新授权,且无需用户输入。The 数据库引擎Database Engine attempts reauthorization using the originally submitted password and no user input is required. 为了提升性能,在 SQL 数据库SQL Database 中重置密码时,连接不会重新进行身份验证,即使连接因连接池而重置,也不例外。For performance reasons, when a password is reset in SQL 数据库SQL Database, the connection won't be reauthenticated, even if the connection is reset because of connection pooling. 此行为与本地 SQL ServerSQL Server 的行为不同。This behavior is different from the behavior of on-premises SQL ServerSQL Server. 如果自最初授权连接时已更改密码,必须终止连接,并使用新密码建立新连接。If the password has changed since the connection was initially authorized, the connection must be terminated and a new connection made using the new password. 具有 KILL DATABASE CONNECTION 权限的用户可使用 KILL (Transact-SQL) 命令,显式终止与 SQL 数据库SQL Database 的连接。A user with the KILL DATABASE CONNECTION permission can explicitly terminate a connection to SQL 数据库SQL Database by using the KILL (Transact-SQL) command.

权限Permissions

需要 SQL 数据库SQL Database 管理员帐户。Requires the SQL 数据库SQL Database admin account.

示例Example

以下语句会清除当前数据库的身份验证缓存。The following statement clears the authentication cache for the current database.

DBCC FLUSHAUTHCACHE;  

另请参阅See Also

DBCC (Transact-SQL)DBCC (Transact-SQL)