Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update known-issues-and-errors-change-data-capture.md #9939

Open
wants to merge 2 commits into
base: live
Choose a base branch
from

Conversation

valecanto
Copy link
Contributor

@valecanto valecanto commented Nov 20, 2024

@MashaMSFT as previously discussed, I added an error in modifying metadata when a trigger is enabled on the db

Copy link
Contributor

@valecanto : Thanks for your contribution! The author(s) have been notified to review your proposed change.

Copy link
Contributor

Learn Build status updates of commit 8159ad3:

✅ Validation status: passed

File Status Preview URL Details
docs/relational-databases/track-changes/known-issues-and-errors-change-data-capture.md ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

@Court72
Copy link
Contributor

Court72 commented Nov 20, 2024

@croblesm

Can you review the proposed changes?

Important: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator bot added the aq-pr-triaged tracking label for the PR review team label Nov 20, 2024
…s-change-data-capture.md

Co-authored-by: Masha Thomas (MSFT) <32783170+MashaMSFT@users.noreply.github.com>
Copy link
Contributor

Learn Build status updates of commit 7f6ee42:

⚠️ Validation status: warnings

File Status Preview URL Details
docs/relational-databases/track-changes/known-issues-and-errors-change-data-capture.md ⚠️Warning Details

docs/relational-databases/track-changes/known-issues-and-errors-change-data-capture.md

  • Line 162, Column 75: [Warning: disallowed-html-tag - See documentation] HTML tag 'database' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

@@ -159,6 +159,12 @@ These are the different troubleshooting categories included in this section:

* **Recommendation**: Ensure the `cdc` user has the `db_owner` role assigned. To create the `cdc` user, see the example [Create cdc user and assign role](#create-user-and-assign-role).

#### Error 22830 - Could not update the metadata that indicates database <database name> is enabled for Change Data Capture. The failure occurred when executing the command 'sp_cdc_create_functions'.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#### Error 22830 - Could not update the metadata that indicates database <database name> is enabled for Change Data Capture. The failure occurred when executing the command 'sp_cdc_create_functions'.
#### Error 22830 - Could not update the metadata that indicates database `<database name>` is enabled for Change Data Capture. The failure occurred when executing the command 'sp_cdc_create_functions'.

@@ -159,6 +159,12 @@ These are the different troubleshooting categories included in this section:

* **Recommendation**: Ensure the `cdc` user has the `db_owner` role assigned. To create the `cdc` user, see the example [Create cdc user and assign role](#create-user-and-assign-role).

#### Error 22830 - Could not update the metadata that indicates database <database name> is enabled for Change Data Capture. The failure occurred when executing the command 'sp_cdc_create_functions'.

* **Cause**: presence of a trigger that is inserting data in master database on objects creation. Enabling cdc is done by a temporary cdc user, so sp_cdc_create_functions will be executed under this cdc user, the trigger will go off and try to insert data in master database (under the same cdc user) and then this error appears because cdc user does not have required permissions on master database.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* **Cause**: presence of a trigger that is inserting data in master database on objects creation. Enabling cdc is done by a temporary cdc user, so sp_cdc_create_functions will be executed under this cdc user, the trigger will go off and try to insert data in master database (under the same cdc user) and then this error appears because cdc user does not have required permissions on master database.
* **Cause**: This error occurs when a 'CREATE OBJECT' trigger exists in the database and a user that does not have permission to write data to the `master` database tries to enable change data capture (CDC). The `sp_cdc_create_functions` stored procedure is automatically executed by the user when trying to enable CDC, which fires the trigger. Since the user doesn't have permission to write to the `master` database, the trigger fails, which causes the CDC stored procedure to fail with error 22830.

#### Error 22830 - Could not update the metadata that indicates database <database name> is enabled for Change Data Capture. The failure occurred when executing the command 'sp_cdc_create_functions'.

* **Cause**: presence of a trigger that is inserting data in master database on objects creation. Enabling cdc is done by a temporary cdc user, so sp_cdc_create_functions will be executed under this cdc user, the trigger will go off and try to insert data in master database (under the same cdc user) and then this error appears because cdc user does not have required permissions on master database.
* **Recommendation**: Before enabling cdc on a database, disable the trigger. Enable the trigger again, once cdc is configured.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* **Recommendation**: Before enabling cdc on a database, disable the trigger. Enable the trigger again, once cdc is configured.
* **Recommendation**: To resolve this error, if you don't have write permission to the `master` database, disable the CREATE trigger before you try to enable CDC on a database. Reenable the trigger after CDC is successfully enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants