Query Availability Group Permissions to CREATE ANY DATABASE

Crain, Brett 31 Reputation points
2022-08-11T15:55:58.337+00:00

When configuring an availability group with automatic seeding, the secondary replicas must be given the following permission in order to automatically create/seed new databases.

ALTER AVAILABILITY GROUP [????] GRANT CREATE ANY DATABASE

Question: Are there any system views that can be utilized to query IF this configuration/permission has been granted? I'm working on validating the configuration of secondary replicas and wanted to include a check on this configuration setting. I've looked all over the sys.availability_* and permissions views and haven't found anything.

Thanks,

SQL Server Other
{count} votes

Accepted answer
  1. YufeiShao-msft 7,146 Reputation points
    2022-08-16T06:33:40.12+00:00

    Hi @Crain, Brett ,

    Create any database is a proprietary Microsoft SQL Server permission, it is not associated with a user so it does not appear in sys.server_permissions.
    You can check out this doc:
    Use automatic seeding to initialize a secondary replica for an Always On availability group

    If the availability group has not granted the correct permissions, you will see the error message in the SQL Server log of the secondary replica, if you want to verify that the automatic seeding is configured successfully, it also can be seen in the SQL Server log, and the DMV:
    sys.dm_hadr_automatic_seeding and sys.dm_hadr_physical_seeding_stats.

    to monitor seeding

    -------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.