COF-C02 practice question 5 of 35

A marketing co-worker has requested the ability to change a warehouse size on their medium virtual warehouse called mktg__WH. Which of the following statements will accommodate this request?

Full set: 778 questions
Answer options
A: ALLOW RESIZE ON WAREHOUSE MKTG__WH TO USER MKTG__LEAD;
B: GRANT MODIFY ON WAREHOUSE MKTG WH TO ROLE MARKETING; Correct answer
C: GRANT MODIFY ON WAREHOUSE MKTG__WH TO USER MKTG__LEAD;
D: GRANT OPERATE ON WAREHOUSE MKTG WH TO ROLE MARKETING;
Correct Answer:
B. GRANT MODIFY ON WAREHOUSE MKTG WH TO ROLE MARKETING;
Explanation

To allow a user to change the size of a virtual warehouse, the MODIFY privilege is required. This privilege grants the ability to alter a warehouse's properties, including its size, auto-suspend/resume settings, and other parameters. According to Snowflake's Role-Based Access Control (RBAC) model, it is a best practice to grant privileges to roles rather than directly to individual users. The statement in option B correctly grants the MODIFY privilege on the specified warehouse to a role, which aligns with the principle of least privilege and manageable access control.

Why Incorrect

A. ALLOW is not a valid SQL command for granting privileges in Snowflake; GRANT is used. Also, RESIZE is not a valid, grantable privilege.
C. While this command would technically work, granting privileges directly to a user is not a recommended best practice in Snowflake's RBAC model. Privileges should be assigned to roles for better management and scalability.
D. The OPERATE privilege allows a role to start, stop, suspend, or resume a warehouse, but it does not grant permission to alter its properties, such as changing its size.

References

1. Snowflake Documentation: Access Control Privileges - Virtual Warehouse Privileges

Section: Virtual Warehouse Privileges

Content: The documentation explicitly lists the privileges for virtual warehouses. It states that the MODIFY privilege "Enables altering a warehouse. This includes changing its size...". It also defines the OPERATE privilege as enabling the changing of a warehouse's state (stop

start

suspend

resume)

confirming it is not the correct privilege for resizing.

2. Snowflake Documentation: Overview of Access Control

Section: Key Concepts Related to Access Control - Roles

Content: This section emphasizes that "Privileges are granted to roles

which are in turn assigned to users. All users in a role inherit the privileges granted to that role." This supports why granting to a ROLE (Option B) is the standard and preferred method over granting to a USER (Option C).

3. Snowflake Documentation: GRANT

Section: Syntax

Content: The official syntax for the GRANT command is provided

confirming that GRANT ON WAREHOUSE TO ROLE ; is the correct structure. This invalidates the syntax used in option A (ALLOW...RESIZE).

Scroll to Top