温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

[AlwaysOn] 创建SQL Server高可用性组T-SQL语法:DATABASE子句

发布时间:2020-08-10 21:20:00 来源:ITPUB博客 阅读:234 作者:cow977 栏目:关系型数据库

DATABASE database_name

指定本地SQL Server实例(即创建可用性组的服务器实例)上一个或多个用户数据库的列表。Specifies a list of one or more user databases on the local SQL Server instance (that is, the server instance on which you are creating the availability group). 可以为一个可用性组指定多个数据库,但每个数据库只能属于一个可用性组。You can specify multiple databases for an availability group, but each database can belong to only one availability group. 有关可用性组可以支持的数据库类型的信息,请参阅“永不停机的可用性组(SQL Server)”的前提条件、限制和建议。For information about the type of databases that an availability group can support, see Prerequisites, Restrictions, and Recommendations for Always On Availability Groups (SQL Server). 要找出哪些本地数据库已经属于某个可用性组,请参阅sys.databases目录视图中的replica_id列。To find out which local databases already belong to an availability group, see the replica_id column in the sys.databases catalog view.

DATABASE 子句是可选的。The DATABASE clause is optional. 如果省略了它,则新的可用性组为空。If you omit it, the new availability group is empty.

创建可用性组之后,请连接到承载辅助副本的每个服务器实例,然后准备每个辅助数据库并将其加入到可用性组中。After you have created the availability group, connect to each server instance that hosts a secondary replica and then prepare each secondary database and join it to the availability group. 有关详细信息,请参阅在始终打开的辅助数据库(SQL Server)上启动数据移动。For more information, see Start Data Movement on an Always On Secondary Database (SQL Server).

注释 Note

稍后,您可以在承载当前主副本的服务器实例上向可用性组添加符合条件的数据库。Later, you can add eligible databases on the server instance that hosts the current primary replica to an availability group. 还可以从可用性组中删除数据库。有关详细信息,请参阅alter availability group(Transact-SQL)。You can also remove a database from an availability group. For more information, see ALTER AVAILABILITY GROUP (Transact-SQL).

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI