SYSTEM$UNMANAGE_FROM_DCM_PROJECT

functionnot supportedContainer services & dev toolingpreview

docs.snowflake.com ↗

System functions

Removes entities, grants, and data metric function attachments from the management scope of a DCM project without dropping, revoking, or detaching them. You specify what to unmanage with the same statements that you use in the project definition files.

Syntax

SYSTEM$UNMANAGE_FROM_DCM_PROJECT(
  '<project_name>' ,
  '<definitions>' )

Parameters

NameRequiredDescription
'project_name'requiredName of the DCM project that currently manages the entities, grants, and data metric function attachments, for example my_db.my_schema.my_project.
'definitions'requiredString that contains one or more statements, each terminated by a semicolon, that identify what to unmanage. The function accepts DEFINE, GRANT, and ATTACH DATA METRIC FUNCTION statements as they appear in DCM Projects definition files. ATTACH TAG and policy attachments aren’t supported. For more information, see Limitations. Because definition statements often contain single quotes, use a dollar-quoted string constant to avoid escaping them.

Returns

Returns the number of items that were unmanaged. Each DEFINE, GRANT, and ATTACH DATA METRIC FUNCTION item counts, so grants and data metric function attachments are included in the count. For example, a call with one DEFINE, one GRANT, and one ATTACH DATA METRIC FUNCTION statement returns 3. Statements for items that the DCM project doesn’t manage aren’t included in the count. For more information, see the usage notes.

Usage notes

Access control requirements

A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes OWNERSHIP | DCM project | MONITOR or READ on the DCM project isn’t sufficient. Any | Each entity that the statements reference | The entity must be visible to the role. For example, SELECT on a table is sufficient. OWNERSHIP of the entity isn’t required. Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema. For instructions on creating a custom role with a specified set of privileges, see Creating custom roles. For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Limitations

- Of the ATTACH statements, the function supports only ATTACH DATA METRIC FUNCTION. Unmanaging tag attachments (ATTACH TAG) and policy attachments, such as ATTACH MASKING POLICY, isn’t supported.

See also

Referenced by