Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit ff1a1ac

Browse files
20250615 edit pass
1 parent ad3f7e1 commit ff1a1ac

6 files changed

Lines changed: 155 additions & 148 deletions

File tree

azure-sql/database/elastic-database-recovery-manager.md

Lines changed: 63 additions & 53 deletions
Large diffs are not rendered by default.
Lines changed: 49 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,64 @@
11
---
2-
title: Report across scaled-out cloud databases
2+
title: Report Across Scaled-Out Cloud Databases
33
description: Use cross database database queries to report across multiple databases.
4-
author: bgavrilovicMS
5-
ms.author: bgavrilovic
6-
ms.reviewer: wiassaf, mathoma
7-
ms.date: 12/15/2021
4+
author: WilliamDAssafMSFT
5+
ms.author: wiassaf
6+
ms.reviewer: bgavrilovic, mathoma
7+
ms.date: 06/13/2025
88
ms.service: azure-sql-database
99
ms.subservice: scale-out
1010
ms.topic: how-to
11-
ms.custom: sqldbrb=1
11+
ms.custom:
12+
- sqldbrb=1
13+
monikerRange: "=azuresql || =azuresql-db"
1214
---
1315
# Report across scaled-out cloud databases (preview)
16+
1417
[!INCLUDE[appliesto-sqldb](../includes/appliesto-sqldb.md)]
1518

1619
You can create reports from multiple databases from a single connection point using an [elastic query](elastic-query-overview.md). The databases must be horizontally partitioned (also known as "sharded").
1720

18-
If you have an existing database, see [Migrating existing databases to scaled-out databases](elastic-convert-to-use-elastic-tools.md).
21+
If you have an existing database, see [Migrate existing databases to scale out](elastic-convert-to-use-elastic-tools.md).
1922

20-
To understand the SQL objects needed to query, see [Query across horizontally partitioned databases](elastic-query-horizontal-partitioning.md).
23+
To understand the SQL objects needed to query, see [Reporting across scaled-out cloud databases (preview)](elastic-query-horizontal-partitioning.md).
2124

2225
## Prerequisites
2326

24-
Download and run the [Getting started with Elastic Database tools sample](elastic-scale-get-started.md).
27+
Download and run the [Get started with Elastic Database Tools](elastic-scale-get-started.md).
2528

2629
## Create a shard map manager using the sample app
30+
2731
Here you will create a shard map manager along with several shards, followed by insertion of data into the shards. If you happen to already have shards setup with sharded data in them, you can skip the following steps and move to the next section.
2832

2933
1. Build and run the **Getting started with Elastic Database tools** sample application by following the steps in the article section [Download and run the sample app](elastic-scale-get-started.md#download-and-run-the-sample-app-1). Once you finish all the steps, you will see the following command prompt:
3034

31-
![command prompt][1]
32-
2. In the command window, type "1" and press **Enter**. This creates the shard map manager, and adds two shards to the server. Then type "3" and press **Enter**; repeat the action four times. This inserts sample data rows in your shards.
33-
3. The [Azure portal](https://portal.azure.com) should show three new databases in your server:
35+
:::image type="content" source="media/elastic-query-getting-started/cmd-prompt.png" alt-text="Screenshot from the command prompt of the Elastic Database Tools starter kit.":::
3436

35-
![Visual Studio confirmation][2]
37+
1. In the command window, type `1` and press **Enter**. This creates the shard map manager, and adds two shards to the server. Then type `3` and press **Enter**; repeat the action four times. This inserts sample data rows in your shards.
38+
1. The [Azure portal](https://portal.azure.com) should show three new databases in your server:
3639

37-
At this point, cross-database queries are supported through the Elastic Database client libraries. For example, use option 4 in the command window. The results from a multi-shard query are always a **UNION ALL** of the results from all shards.
40+
:::image type="content" source="media/elastic-query-getting-started/portal.png" alt-text="Screenshot of the Visual Studio confirmation creating three databases.":::
41+
42+
At this point, cross-database queries are supported through the Elastic Database client libraries. For example, use option `4` in the command window. The results from a multi-shard query are always a `UNION ALL` of the results from all shards.
3843

3944
In the next section, we create a sample database endpoint that supports richer querying of the data across shards.
4045

4146
## Create an elastic query database
4247

4348
1. Open the [Azure portal](https://portal.azure.com) and log in.
44-
2. Create a new database in Azure SQL Database in the same server as your shard setup. Name the database "ElasticDBQuery."
49+
1. Create a new database in Azure SQL Database in the same server as your shard setup. Name the database `ElasticDBQuery`.
4550

46-
![Azure portal and pricing tier][3]
51+
You can use an existing database. If you can do so, it must not be one of the shards that you would like to execute your queries on. This database will be used for creating the metadata objects for an elastic database query.
4752

48-
> [!NOTE]
49-
> you can use an existing database. If you can do so, it must not be one of the shards that you would like to execute your queries on. This database will be used for creating the metadata objects for an elastic database query.
50-
>
5153

5254
## Create database objects
55+
5356
### Database-scoped master key and credentials
57+
5458
These are used to connect to the shard map manager and the shards:
5559

5660
1. Open SQL Server Management Studio or SQL Server Data Tools in Visual Studio.
57-
2. Connect to ElasticDBQuery database and execute the following T-SQL commands:
61+
1. Connect to `ElasticDBQuery` database and execute the following T-SQL commands:
5862

5963
```sql
6064
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '<master_key_password>';
@@ -64,10 +68,11 @@ These are used to connect to the shard map manager and the shards:
6468
SECRET = '<password>';
6569
```
6670

67-
"username" and "password" should be the same as login information used in step 3 of section [Download and run the sample app](elastic-scale-get-started.md#download-and-run-the-sample-app) in the **Getting started with Elastic Database tools** article.
71+
Both "username" and "password" should be the login information you created in previous steps.
6872

6973
### External data sources
70-
To create an external data source, execute the following command on the ElasticDBQuery database:
74+
75+
To create an external data source, execute the following command on the `ElasticDBQuery` database:
7176

7277
```sql
7378
CREATE EXTERNAL DATA SOURCE MyElasticDBQueryDataSrc WITH
@@ -79,10 +84,11 @@ CREATE EXTERNAL DATA SOURCE MyElasticDBQueryDataSrc WITH
7984
) ;
8085
```
8186

82-
"CustomerIDShardMap" is the name of the shard map, if you created the shard map and shard map manager using the elastic database tools sample. However, if you used your custom setup for this sample, then it should be the shard map name you chose in your application.
87+
`CustomerIDShardMap` is the name of the shard map, if you created the shard map and shard map manager using the elastic database tools sample. However, if you used your custom setup for this sample, then it should be the shard map name you chose in your application.
8388

8489
### External tables
85-
Create an external table that matches the Customers table on the shards by executing the following command on ElasticDBQuery database:
90+
91+
Create an external table that matches the Customers table on the shards by executing the following command on `ElasticDBQuery` database:
8692

8793
```sql
8894
CREATE EXTERNAL TABLE [dbo].[Customers]
@@ -96,53 +102,45 @@ WITH
96102
```
97103

98104
## Execute a sample elastic database T-SQL query
105+
99106
Once you have defined your external data source and your external tables you can now use full T-SQL over your external tables.
100107

101-
Execute this query on the ElasticDBQuery database:
108+
Execute this query on the `ElasticDBQuery` database:
102109

103110
```sql
104111
select count(CustomerId) from [dbo].[Customers]
105112
```
106113

107114
You will notice that the query aggregates results from all the shards and gives the following output:
108115

109-
![Output details][4]
116+
:::image type="content" source="media/elastic-query-getting-started/details.png" alt-text="Output details.":::
110117

111118
## Import elastic database query results to Excel
112-
You can import the results from of a query to an Excel file.
113119

114-
1. Launch Excel 2013.
115-
2. Navigate to the **Data** ribbon.
116-
3. Click **From Other Sources** and click **From SQL Server**.
120+
You can import the results from of a query to an Excel file.
117121

118-
![Excel import from other sources][5]
119-
4. In the **Data Connection Wizard** type the server name and login credentials. Then click **Next**.
120-
5. In the dialog box **Select the database that contains the data you want**, select the **ElasticDBQuery** database.
121-
6. Select the **Customers** table in the list view and click **Next**. Then click **Finish**.
122-
7. In the **Import Data** form, under **Select how you want to view this data in your workbook**, select **Table** and click **OK**.
122+
1. Launch Microsoft Excel.
123+
1. Navigate to the **Data** ribbon.
124+
1. Select **From Other Sources** and select **From SQL Server**.
125+
1. In the **Data Connection Wizard** type the server name and login credentials. Then select **Next**.
126+
1. In the dialog box **Select the database that contains the data you want**, select the `ElasticDBQuery` database.
127+
1. Select the `Customers` table in the list view and select **Next**. Then select **Finish**.
128+
1. In the **Import Data** form, under **Select how you want to view this data in your workbook**, select **Table** and select **OK**.
123129

124-
All the rows from **Customers** table, stored in different shards populate the Excel sheet.
130+
All the rows from `Customers` table, stored in different shards populate the Excel sheet.
125131

126132
You can now use Excel's powerful data visualization functions. You can use the connection string with your server name, database name and credentials to connect your BI and data integration tools to the elastic query database. Make sure that SQL Server is supported as a data source for your tool. You can refer to the elastic query database and external tables just like any other SQL Server database and SQL Server tables that you would connect to with your tool.
127133
128134
### Cost
135+
129136
There is no additional charge for using the Elastic Database Query feature.
130137
131138
For pricing information see [SQL Database Pricing Details](https://azure.microsoft.com/pricing/details/sql-database/).
132139
133-
## Next steps
134-
135-
* For an overview of elastic query, see [Elastic query overview](elastic-query-overview.md).
136-
* For a vertical partitioning tutorial, see [Getting started with cross-database query (vertical partitioning)](elastic-query-getting-started-vertical.md).
137-
* For syntax and sample queries for vertically partitioned data, see [Querying vertically partitioned data)](elastic-query-vertical-partitioning.md)
138-
* For syntax and sample queries for horizontally partitioned data, see [Querying horizontally partitioned data)](elastic-query-horizontal-partitioning.md)
139-
* See [sp\_execute \_remote](/sql/relational-databases/system-stored-procedures/sp-execute-remote-azure-sql-database) for a stored procedure that executes a Transact-SQL statement on a single remote Azure SQL Database or set of databases serving as shards in a horizontal partitioning scheme.
140-
140+
## Related content
141141
142-
<!--Image references-->
143-
[1]: ./media/elastic-query-getting-started/cmd-prompt.png
144-
[2]: ./media/elastic-query-getting-started/portal.png
145-
[3]: ./media/elastic-query-getting-started/tiers.png
146-
[4]: ./media/elastic-query-getting-started/details.png
147-
[5]: ./media/elastic-query-getting-started/exel-sources.png
148-
<!--anchors-->
142+
- [Azure SQL Database elastic query overview (preview)](elastic-query-overview.md)
143+
- [Get started with cross-database queries (vertical partitioning) (preview)](elastic-query-getting-started-vertical.md)
144+
- [Query across cloud databases with different schemas (preview)](elastic-query-vertical-partitioning.md)
145+
- [Reporting across scaled-out cloud databases (preview)](elastic-query-horizontal-partitioning.md)
146+
- [sp_execute_remote](/sql/relational-databases/system-stored-procedures/sp-execute-remote-azure-sql-database)

0 commit comments

Comments
 (0)