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

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) .


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/81227/viewspace-2653853/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/81227/viewspace-2653853/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值