728x90
반응형
I have SQL Server Central Management Servers setup in my environment. How can I get a list of the registered servers and their associated properties? Are there any queries I can issue? Check out this tip to learn more.
Sometimes we came across a situation where we need to query the SQL Server Central Management Servers to get the list of the registered servers and groups. You can query the two MSDB system tables below to get a list of the registered servers and their groups.
- msdb.dbo.sysmanagement_shared_registered_servers_internal
- msdb.dbo.sysmanagement_shared_server_groups_internal
We can use these system tables for the following:
- Find out the list of registered servers and their groups
- Find out servers which are registered twice in different folders
- Compare the query result to check out the servers registered in an incorrect group or decommissioned servers
Query to list server groups and types
USE msdb;
GO
/* Query to list out Server Groups and Types */
SELECT *
FROM msdb.dbo.sysmanagement_shared_server_groups_internal;
GO
Query to list the registered servers
USE msdb ;
GO
/* Query to list out the registered servers */
SELECT *
FROM msdb.dbo.sysmanagement_shared_registered_servers_intrnal;
GO
Query to list the server and groups
/* Servers and groups */
SELECT DISTINCT groups.name AS 'Server Group Name'
,svr.server_name AS 'Server Name'
FROM msdb.dbo.sysmanagement_shared_server_groups_internal groups
INNER JOIN msdb.dbo.sysmanagement_shared_registered_servers_internal svr
ON groups.server_group_id = svr.server_group_id;
GO
http://www.mssqltips.com/sqlservertip/2397/sql-server-central-management-servers-system-tables/ql
728x90
반응형
'운영 > SQL Server 관리 도구' 카테고리의 다른 글
[스크랩] Disable or Turn-off SQL Server Telemetry Service (0) | 2020.09.24 |
---|---|
SSMS에서 코드 자동 정렬 (0) | 2019.07.03 |
테이블 리스트가 많을 경우 필터 적용하기 (0) | 2013.11.30 |
테이블의 컬럼 많고 SELECT 절에 대부분 명시해야 할때 (0) | 2013.11.30 |
대소문자 변환 (0) | 2013.11.30 |