You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/synapse-analytics/metadata/database.md
+24-18Lines changed: 24 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,45 +12,51 @@ ms.reviewer: wiassaf
12
12
ms.custom: devx-track-csharp
13
13
---
14
14
15
-
# Azure Synapse Analytics shared database
15
+
# Azure Synapse Analytics shared Lake database
16
16
17
-
Azure Synapse Analytics allows the different computational workspace engines to share databases and tables. Currently, the databases and the tables (Parquet or CSV backed) that are created on the Apache Spark pools are automatically shared with the serverless SQL pool engine.
17
+
Azure Synapse Analytics allows the different computational workspace engines to share [Lake databases](../database-designer/concepts-lake-database.md) and tables. Currently, the Lake databases and the tables (Parquet or CSV backed) that are created on the Apache Spark pools, [Database templates](../database-designer/concepts-database-templates.md) or Datavere are automatically shared with the serverless SQL pool engine.
18
18
19
-
A database created with a Spark job will become visible with that same name to all current and future Spark pools in the workspace, including the serverless SQL pool engine. You cannot add custom objects (external tables, views, procedures) directly in this synchronized database using the serverless SQL pool.
19
+
A Lake database will become visible with that same name to all current and future Spark pools in the workspace, including the serverless SQL pool engine. You cannot add custom SQL objects (external tables, views, procedures, functions, schema, users) directly in a Lake database using the serverless SQL pool.
20
20
21
-
The Spark default database, called `default`, will also be visible in the serverless SQL pool context as a database called `default`.
22
-
You can't create a database in Spark and then create another database with the same name in serverless SQL pool.
21
+
The Spark default database, called `default`, will also be visible in the serverless SQL pool context as a Lake database called `default`.
22
+
You can't create a Lake database and then create another database with the same name in serverless SQL pool.
23
23
24
-
Since the databases are synchronized to serverless SQL pool asynchronously, there will be a delay until they appear.
24
+
The Lake databases are created in the serverless SQL pool asynchronously. There will be a delay until they appear.
25
25
26
-
## Manage a Spark created database
26
+
## Manage Lake database
27
27
28
-
To manage Spark created databases, you need to use Apache Spark pools. For example, create or delete it through a Spark pool job.
28
+
To manage Spark created Lake databases, you can use Apache Spark pools or [Database designer](../database-designer/create-empty-lake-database.md). For example, create or delete a Lake database through a Spark pool job.
29
29
30
-
Objects in synchronized databases cannot be modified from serverless SQL pool.
30
+
Objects in the Lake databases cannot be modified from a serverless SQL pool. Use [Database designer](../database-designer/modify-lake-database.md) or Apache Spark pools to modify the Lake databases.
31
31
32
32
>[!NOTE]
33
-
>You cannot create multiple databases with the same name from different pools. If a serverless SQL pool database is created, you won't be able to create a Spark database with the same name. Respectively, if database is created in Spark, you won't be able to create a serverless SQL pool database with the same name.
33
+
>You cannot create multiple databases with the same name from different pools. If a SQL database in the serverless SQL pool is created, you won't be able to create a Lake database with the same name. Respectively, if you create a Lake database, you won't be able to create a serverless SQL pool database with the same name.
34
34
35
35
## Security model
36
36
37
-
The Spark databases and tables, along with their synchronized representations in the SQL engine will be secured at the underlying storage level.
37
+
The Lake databases and tables will be secured at the underlying storage level.
38
38
39
39
The security principal who creates a database is considered the owner of that database, and has all the rights to the database and its objects. `Synapse Administrator` and `Synapse SQL Administrator` will also have all the permissions on synchronized objects in serverless SQL pool by default. Creating custom objects (including users) in synchronized SQL databases is not allowed.
40
40
41
41
To give a security principal, such as a user, Azure AD app or a security group, access to the underlying data used for external tables, you need to give them `read (R)` permissions on files (such as the table's underlying data files) and `execute (X)` on folder where the files are stored + on every parent folder up to the root. You can read more about these permissions on [Access control lists(ACLs)](../../storage/blobs/data-lake-storage-access-control.md) page.
42
42
43
43
For example, in `https://<storage-name>.dfs.core.windows.net/<fs>/synapse/workspaces/<synapse_ws>/warehouse/mytestdb.db/myparquettable/`, security principals need to have `X` permissions on all the folders starting at the `<fs>` to the `myparquettable` and `R` permissions on `myparquettable` and files inside that folder, to be able to read a table in a database (synchronized or original one).
44
44
45
-
If a security principal requires the ability to create objects or drop objects in a database, additional `W` permissions are required on the folders and files in the `warehouse` folder. Modifying objects in a database is not possible from serverless SQL pool, only from Spark.
45
+
If a security principal requires the ability to create objects or drop objects in a database, additional `W` permissions are required on the folders and files in the `warehouse` folder. Modifying objects in a database is not possible from serverless SQL pool, only from Spark pools and [database designer](../database-designer/modify-lake-database.md).
46
46
47
47
### SQL security model
48
48
49
-
Synapse workspace provides T-SQL endpoint that enables you to query the shared database using the serverless SQL pool. As a prerequisite, you need to enable a user to access shared databases in serverless SQL pool. There are two ways to allow a user to access the shared databases:
50
-
- You can assign a `Synapse SQL Administrator` workspace role or `sysadmin` server-level role in the serverless SQL pool. This role has a full control on all databases (note that the shared databases are still read-only even for the administrator role).
49
+
Synapse workspace provides T-SQL endpoint that enables you to query the Lake database using the serverless SQL pool. As a prerequisite, you need to enable a user to access the shared Lake databases in serverless SQL pool. There are two ways to allow a user to access the Lake databases:
50
+
- You can assign a `Synapse SQL Administrator` workspace role or `sysadmin` server-level role in the serverless SQL pool. This role has a full control on all databases (note that the Lake databases are still read-only even for the administrator role).
51
51
- You can grant `GRANT CONNECT ANY DATABASE` and `GRANT SELECT ALL USER SECURABLES` server-level permissions on serverless SQL pool to a login that will enable the login to access and read any database. This might be a good choice for assigning reader/non-admin access to a user.
52
52
53
-
Learn more about setting [access control on shared databases](../sql/shared-databases-access-control.md).
53
+
Learn more about [setting access control on shared databases here](../sql/shared-databases-access-control.md).
54
+
55
+
## Custom SQL metadata objects
56
+
57
+
Lake databases do not allow creation of custom T-SQL objects, such as schemas, users, procedures, views, and the external tables created on custom locations. If you need to create additional T-SQL objects that reference the shared tables in the Lake database, you have two options:
58
+
- Create a custom SQL database (serverless) that will contain the custom schemas, views, and functions that will reference Lake database external tables using the 3-part names.
59
+
- Instead of Lake database use SQL database (serverless) that will reference data in the lake. SQL database (serverless) enables you to create external tables that can reference data in the lake same way as the Lake database, but it allows creation of additional SQL objects. A drawback is that these objects are not automatically available in Spark.
54
60
55
61
## Examples
56
62
@@ -59,16 +65,16 @@ Learn more about setting [access control on shared databases](../sql/shared-data
59
65
First create a new Spark database named `mytestdb` using a Spark cluster you have already created in your workspace. You can achieve that, for example, using a Spark C# Notebook with the following .NET for Spark statement:
60
66
61
67
```csharp
62
-
spark.Sql("CREATE DATABASE mytestdb")
68
+
spark.Sql("CREATE DATABASE mytestlakedb")
63
69
```
64
70
65
-
After a short delay, you can see the database from serverless SQL pool. For example, run the following statement from serverless SQL pool.
71
+
After a short delay, you can see the Lake database from serverless SQL pool. For example, run the following statement from serverless SQL pool.
66
72
67
73
```sql
68
74
SELECT*FROMsys.databases;
69
75
```
70
76
71
-
Verify that `mytestdb` is included in the results.
77
+
Verify that `mytestlakedb` is included in the results.
0 commit comments