Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[AlwaysOn2017] DMV and DMF-Sys.fn_hadr_distributed_ag_replica of AlwaysOn

2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

24 、 Sys.fn_hadr_distributed_ag_replica

A database in a distributed availability group used to map to a database in a local availability group.

Grammar

Sys.fn_hadr_distributed_ag_database_replica (lag_Id, database_id)

Parameters.

Lag_Id

Is the identifier of the distributed availability group. Lag_Id is the type uniqueidentifier.

Database_id

Is an identifier in a distributed availability group. Database_id is the type uniqueidentifier.

Returned table

Returns the following information.

Column name

Data type

Description

Group_database_id

Uniqueidentifier

The ID of the database in the local availability group.

Example

The following example is passed to the database ID in a distributed availability group. It returns a table with the database ID associated with the local availability group.

DECLARE @ lagId uniqueidentifier = '4A03D1A8-4AE6MurB153murE7E9MusED22A546008D'

DECLARE @ databaseId uniqueidentifier = '3FFA882A-C4C3-5B9E-A203-8F44BD9659F7

SELECT * FROM Sys.fn_hadr_distributed_ag_database_replica (@ lagId, @ databaseId)

GO

Select * from Sys. Availability_databases_cluster

Select column_id, c. Name col_name, t. Name col_type

, c. Max_length, c. Precision, c. Scale

From Sys. All_columns c left join Sys. Types t

On c. System_type_id = t. System_type_id and c. User_type_id = t. User_type_id

Where object_id = OBJECT_ID ('Sys.availability_databases_cluster')

Order by column_id

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report