|
1 | | -- A Snowflake [account](https://signup.snowflake.com/) and its [identifier](https://docs.snowflake.com/user-guide/admin-account-identifier). |
| 1 | +- A Snowflake [account](https://signup.snowflake.com/) and its account identifier. |
2 | 2 |
|
3 | 3 | <iframe |
4 | 4 | width="560" |
|
10 | 10 | allowfullscreen |
11 | 11 | ></iframe> |
12 | 12 |
|
13 | | -- The Snowflake [username and its password](https://docs.snowflake.com/user-guide/admin-user-management#creating-users) in the account. |
| 13 | + To get the identifier for the current Snowflake account: |
| 14 | + |
| 15 | + 1. Log in to [Snowsight](https://docs.snowflake.com/user-guide/ui-snowsight-homepage) with your Snowflake account. |
| 16 | + 2. In Snowsight, on the navigation menu, click your username, and then click **Account > View account details**. |
| 17 | + 3. On the **Account** tab, note the value of the **Account Identifier** field. |
| 18 | + |
| 19 | + Alternatively, the following Snowflake query returns the current account's identifier: |
| 20 | + |
| 21 | + ```text |
| 22 | + SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME() AS "Account Identifier" |
| 23 | + ``` |
| 24 | + |
| 25 | +- The Snowflake [user's login name (not its username) and its password](https://docs.snowflake.com/user-guide/admin-user-management#creating-users) in the account. |
14 | 26 |
|
15 | 27 | <iframe |
16 | 28 | width="560" |
|
22 | 34 | allowfullscreen |
23 | 35 | ></iframe> |
24 | 36 |
|
25 | | -- The Snowflake [hostname and its port number](https://docs.snowflake.com/sql-reference/functions/system_allowlist) in the account. |
| 37 | + To view the login name for a user: |
| 38 | + |
| 39 | + 1. Log in to [Snowsight](https://docs.snowflake.com/user-guide/ui-snowsight-homepage) with your Snowflake account. |
| 40 | + 2. In Snowsight, on the navigation menu, click **Admin > Users & Roles**. |
| 41 | + 3. On the **Users** tab, in the list of available users, click the name of the target user. |
| 42 | + 4. In the **About** tile, note the **Login Name** for the user. |
| 43 | + |
| 44 | + Alternatively, the following Snowflake query returns information about the user with the username of `<my-user>`, including their `login_name` value representing their login name: |
| 45 | + |
| 46 | + ```text |
| 47 | + SHOW USERS LIKE '<my-user>'; |
| 48 | + ``` |
| 49 | + |
| 50 | +- The Snowflake warehouse's [hostname and its port number](https://docs.snowflake.com/sql-reference/functions/system_allowlist) in the account. |
| 51 | + |
| 52 | + To view a list of available warehouses in the current Snowflake account: |
| 53 | + |
| 54 | + 1. Log in to [Snowsight](https://docs.snowflake.com/user-guide/ui-snowsight-homepage) with your Snowflake account. |
| 55 | + 2. In Snowsight, on the navigation menu, click **Admin > Warehouses**. This view does not provide access to the warehouses' hostnames or port numbers. To get this information, you must run a Snowflake query. |
| 56 | + |
| 57 | + The following Snowflake query returns a list of available warehouse types, hostnames, and port numbers in the current account. Look for the row with a `type` of `SNOWFLAKE_DEPLOYMENT`: |
| 58 | + |
| 59 | + ```text |
| 60 | + SELECT t.VALUE:type::VARCHAR as type, |
| 61 | + t.VALUE:host::VARCHAR as host, |
| 62 | + t.VALUE:port as port |
| 63 | + FROM TABLE(FLATTEN(input => PARSE_JSON(SYSTEM$ALLOWLIST()))) AS t; |
| 64 | + ``` |
| 65 | + |
26 | 66 | - The name of the Snowflake [database](https://docs.snowflake.com/sql-reference/sql/create-database) in the account. |
27 | 67 |
|
28 | 68 | <iframe |
|
35 | 75 | allowfullscreen |
36 | 76 | ></iframe> |
37 | 77 |
|
| 78 | + To view a list of available databases in the current Snowflake account: |
| 79 | + |
| 80 | + 1. Log in to [Snowsight](https://docs.snowflake.com/user-guide/ui-snowsight-homepage) with your Snowflake account. |
| 81 | + 2. In Snowsight, on the navigation menu, click **Data > Databases**. |
| 82 | + |
| 83 | + Alternatively, the following Snowflake query returns a list of available databases in the current account: |
| 84 | + |
| 85 | + ```text |
| 86 | + SHOW DATABASES; |
| 87 | + ``` |
| 88 | + |
38 | 89 | - The name of the [schema](https://docs.snowflake.com/sql-reference/sql/create-schema) in the database. |
39 | 90 |
|
40 | 91 | <iframe |
|
47 | 98 | allowfullscreen |
48 | 99 | ></iframe> |
49 | 100 |
|
| 101 | + To view a list of available schemas for a database in the current Snowflake account: |
| 102 | + |
| 103 | + 1. Log in to [Snowsight](https://docs.snowflake.com/user-guide/ui-snowsight-homepage) with your Snowflake account. |
| 104 | + 2. In Snowsight, on the navigation menu, click **Data > Databases**. |
| 105 | + 3. Expand the name of the target database. |
| 106 | + |
| 107 | + Alternatively, the following Snowflake query returns a list of available schemas in the current account: |
| 108 | + |
| 109 | + ```text |
| 110 | + SHOW SCHEMAS; |
| 111 | + ``` |
| 112 | + |
| 113 | + The following Snowflake query returns a list of available schemas for the database named `<database-name>` in the current account: |
| 114 | + |
| 115 | + ```text |
| 116 | + SHOW SCHEMAS IN DATABASE <database-name>; |
| 117 | + ``` |
| 118 | + |
50 | 119 | - The name of the [table](https://docs.snowflake.com/sql-reference/sql/create-table) in the schema. |
51 | 120 |
|
52 | 121 | <iframe |
|
59 | 128 | allowfullscreen |
60 | 129 | ></iframe> |
61 | 130 |
|
| 131 | + To view a list of available tables for a schema in a database in the current Snowflake account: |
| 132 | + |
| 133 | + 1. Log in to [Snowsight](https://docs.snowflake.com/user-guide/ui-snowsight-homepage) with your Snowflake account. |
| 134 | + 2. In Snowsight, on the navigation menu, click **Data > Databases**. |
| 135 | + 3. Expand the name of the database that contains the target schema. |
| 136 | + 4. Expand the name of the target schema. |
| 137 | + 5. Expand **Tables**. |
| 138 | + |
| 139 | + Alternatively, the following Snowflake query returns a list of available tables for the schema named `<schema-name>` in the datbase named |
| 140 | + `<database-name>` in the current account: |
| 141 | + |
| 142 | + ```text |
| 143 | + SHOW TABLES IN SCHEMA <database-name>.<schema-name>; |
| 144 | + ``` |
| 145 | + |
62 | 146 | Snowflake requires the target table to have a defined schema before Unstructured can write to the table. The recommended table |
63 | 147 | schema for Unstructured is as follows: |
64 | 148 |
|
|
107 | 191 | PRIMARY KEY (ID) |
108 | 192 | ); |
109 | 193 | ``` |
| 194 | + |
| 195 | +- The name of the column in the table that uniquely identifies each record (for example, `RECORD_ID`). |
| 196 | +- The name of the Snowflake [role](https://docs.snowflake.com/sql-reference/sql/create-role) that the user belongs to and that also has sufficient access to the Snowflake database, schema, table, and host. |
| 197 | + |
| 198 | + - To create a database in Snowflake, the role needs to be granted `CREATE DATABASE` privilege at the current account level; and `USAGE` privilege on the warehouse that is used to create the database. |
| 199 | + - To create a schema in a database in Snowflake, the role needs to be granted `USAGE` privilege on the database and the warehouse that is used to create the schema; and `CREATE SCHEMA` on the database. |
| 200 | + - To create a table in a schema in Snowflake, the role needs to be granted `USAGE` privilege on the database and schema and the warehouse that is used to create the table; and `CREATE TABLE` on the schema. |
| 201 | + - To write to a table in Snowflake, the role needs to be granted `USAGE` privilege on the database and schema and the warehouse that is used to write to the table; and `INSERT` on the table. |
| 202 | + - To read from a table in Snowflake, the role needs to be granted `USAGE` privilege on the database and schema and the warehouse that is used to write to the table; and `SELECT` on the table. |
| 203 | + |
| 204 | + To view a list of available roles in the current Snowflake account: |
| 205 | + |
| 206 | + 1. Log in to [Snowsight](https://docs.snowflake.com/user-guide/ui-snowsight-homepage) with your Snowflake account. |
| 207 | + 2. In Snowsight, on the navigation menu, click **Admin > Users & Roles**. |
| 208 | + 3. Click the **Roles** tab. |
| 209 | + |
| 210 | + Alternatively, the following Snowflake query returns a list of available roles in the current account: |
| 211 | + |
| 212 | + ```text |
| 213 | + SHOW ROLES; |
| 214 | + ``` |
| 215 | + |
| 216 | + [Grant privileges to a role](https://docs.snowflake.com/sql-reference/sql/grant-privilege). [Learn more](https://docs.snowflake.com/user-guide/security-access-control-privileges). |
0 commit comments