Categories:

Account & Session DDL

CREATE MANAGED ACCOUNT

Creates a new managed account. Currently used by data providers to create reader accounts for their consumers. For more details, see Managing Reader Accounts.

See also:

DROP MANAGED ACCOUNT , SHOW MANAGED ACCOUNTS

Syntax

CREATE MANAGED ACCOUNT <name>
    ADMIN_NAME = <username> , ADMIN_PASSWORD = <user_password> ,
    TYPE = READER ,
    [ COMMENT = '<string_literal>' ]

Required Parameters

name

Identifier for the managed account; must be unique for your account.

In addition, the identifier must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (e.g. "My object").

For more details, see Identifier Requirements.

Important

The identifier for the managed account is not the same as the account name, which is required to access the account. The account name, also known as the locator, is assigned by Snowflake.

ADMIN_NAME = username

Identifier, as well as login name, for the initial user in the managed account. This user serves as the account administrator for the account (i.e. this user is automatically created when the account is created and is assigned the ACCOUNTADMIN role).

Once the account is created, you will log into the account as this user to configure (i.e. “bootstrap”) the account.

ADMIN_PASSWORD = user_password

Password for the initial user in the managed account. The password is a string literal that must be enclosed in single or double quotes and must conform to the Snowflake Password Policy.

TYPE = READER

Specifies the type of managed account. Currently, the only type supported is READER (i.e. reader accounts used for data sharing).

Optional Parameters

COMMENT = 'string_literal'

Specifies a comment for the managed account.

Access Control Requirements

A role used to execute this SQL command must have the following privileges at a minimum:

Privilege

Object

Notes

CREATE ACCOUNT

Account

Only the ACCOUNTADMIN role has this privilege by default. The privilege can be granted to additional roles as needed.

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 Access Control in Snowflake.

Usage Notes

  • The number of managed accounts that can be created per account is limited to 20. If you reach the limit and require creating additional accounts, please contact Snowflake Support.

  • If the command completes successfully, it returns a JSON object containing the account name/locator and the URL for accessing the account.

  • Regarding metadata:

    Attention

    Customers should ensure that no personal data (other than for a User object), sensitive data, export-controlled data, or other regulated data is entered as metadata when using the Snowflake service. For more information, see Metadata Fields in Snowflake.

Examples

CREATE MANAGED ACCOUNT reader_acct1
    ADMIN_NAME = user1 , ADMIN_PASSWORD = 'Sdfed43da!44' ,
    TYPE = READER;

+-------------------------------------------------------------------------------+
| status                                                                        |
|-------------------------------------------------------------------------------|
| {"accountName":"RE47190","loginUrl":"https://re47190.snowflakecomputing.com"} |
+-------------------------------------------------------------------------------+
Back to top