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

Commit 093b08e

Browse files
authored
Merge pull request #23538 from dzsquared/dac-overview
more sqlpackage samples and common issues info
2 parents e115133 + 455c3a7 commit 093b08e

11 files changed

Lines changed: 117 additions & 46 deletions

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59444,6 +59444,11 @@
5944459444
"source_path": "docs/ssms/scripting/transact-sql-debugger-quickwatch-dialog-box.md",
5944559445
"redirect_url": "/sql/ssms/scripting/transact-sql-debugger-information",
5944659446
"redirect_document_id": false
59447+
},
59448+
{
59449+
"source_path": "docs/tools/sqlpackage/troubleshooting-import-export-sqlpackage.md",
59450+
"redirect_url": "/sql/tools/sqlpackage/troubleshooting-issues-and-performance-with-sqlpackage",
59451+
"redirect_document_id": false
5944759452
}
5944859453
]
5944959454
}

docs/toc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10335,8 +10335,8 @@ items:
1033510335
href: tools/sqlpackage/sqlpackage-pipelines.md
1033610336
- name: SqlPackage for Azure Synapse Analytics
1033710337
href: tools/sqlpackage/sqlpackage-for-azure-synapse-analytics.md
10338-
- name: Troubleshooting Import/Export
10339-
href: tools/sqlpackage/troubleshooting-import-export-sqlpackage.md
10338+
- name: Troubleshooting SqlPackage
10339+
href: tools/sqlpackage/troubleshooting-issues-and-performance-with-sqlpackage.md
1034010340
- name: SQL Server Profiler
1034110341
href: tools/sql-server-profiler/sql-server-profiler.md
1034210342
items:

docs/tools/sqlpackage/sqlpackage-deploy-drift-report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ SqlPackage {parameters}{properties}{SQLCMD Variables}
138138
|**/p:**|IgnoreWithNocheckOnForeignKeys=(BOOLEAN)|Specifies whether differences in the value of the WITH NOCHECK clause for foreign keys will be ignored or updated when you publish to a database.|
139139
|**/p:**|IncludeCompositeObjects=(BOOLEAN)|Include all composite elements with the same database as part of a single publish operation.|
140140
|**/p:**|IncludeTransactionalScripts=(BOOLEAN)|Specifies whether transactional statements should be used where possible when you publish to a database.|
141-
|**/p:**|LongRunningCommandTimeout=(INT32)| Specifies the long running command timeout in seconds when executing queries against SQL Server. Use 0 to wait indefinitely.|
141+
|**/p:**|LongRunningCommandTimeout=(INT32 '0')| Specifies the long running command timeout in seconds when executing queries against SQL Server. Use 0 to wait indefinitely.|
142142
|**/p:**|NoAlterStatementsToChangeClrTypes=(BOOLEAN)|Specifies that publish should always drop and re-create an assembly if there is a difference instead of issuing an ALTER ASSEMBLY statement. |
143143
|**/p:**|PopulateFilesOnFileGroups=(BOOLEAN 'True')|Specifies whether a new file is also created when a new FileGroup is created in the target database. |
144144
|**/p:**|RegisterDataTierApplication=(BOOLEAN)|Specifies whether the schema is registered with the database server.

docs/tools/sqlpackage/sqlpackage-download.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ Evergreen links are available for downloading the latest Sqlpackage versions:
5757
2. To extract the file and launch SqlPackage, open a new Terminal window and type the following commands:
5858

5959
```bash
60-
$ cd ~
61-
$ mkdir sqlpackage
62-
$ unzip ~/Downloads/sqlpackage-linux-<version string>.zip -d ~/sqlpackage
63-
$ echo "export PATH=\"\$PATH:$HOME/sqlpackage\"" >> ~/.bashrc
64-
$ chmod a+x ~/sqlpackage/sqlpackage
65-
$ source ~/.bashrc
66-
$ sqlpackage
60+
cd ~
61+
mkdir sqlpackage
62+
unzip ~/Downloads/sqlpackage-linux-<version string>.zip -d ~/sqlpackage
63+
echo "export PATH=\"\$PATH:$HOME/sqlpackage\"" >> ~/.bashrc
64+
chmod a+x ~/sqlpackage/sqlpackage
65+
source ~/.bashrc
66+
sqlpackage
6767
```
6868

6969
> [!NOTE]
@@ -72,26 +72,26 @@ Evergreen links are available for downloading the latest Sqlpackage versions:
7272
**Debian:**
7373

7474
```bash
75-
$ sudo apt-get install libunwind8
75+
sudo apt-get install libunwind8
7676
```
7777

7878
**Redhat:**
7979

8080
```bash
81-
$ yum install libunwind
82-
$ yum install libicu
81+
yum install libunwind
82+
yum install libicu
8383
```
8484

8585
**Ubuntu:**
8686

8787
```bash
88-
$ sudo apt-get install libunwind8
88+
sudo apt-get install libunwind8
8989

9090
# install the libicu library based on the Ubuntu version
91-
$ sudo apt-get install libicu55 # for 16.x
92-
$ sudo apt-get install libicu57 # for 17.x
93-
$ sudo apt-get install libicu60 # for 18.x
94-
$ sudo apt-get install libicu66 # for 20.x
91+
sudo apt-get install libicu55 # for 16.x
92+
sudo apt-get install libicu57 # for 17.x
93+
sudo apt-get install libicu60 # for 18.x
94+
sudo apt-get install libicu66 # for 20.x
9595
```
9696

9797
## macOS (.NET Core)
@@ -100,25 +100,25 @@ Evergreen links are available for downloading the latest Sqlpackage versions:
100100
2. To extract the file and launch SqlPackage, open a new Terminal window and type the following commands:
101101

102102
```bash
103-
$ mkdir sqlpackage
104-
$ unzip ~/Downloads/sqlpackage-osx-<version string>.zip -d ~/sqlpackage
105-
$ chmod +x ~/sqlpackage/sqlpackage
106-
$ echo 'export PATH="$PATH:~/sqlpackage"' >> ~/.bash_profile
107-
$ source ~/.bash_profile
108-
$ sqlpackage
103+
mkdir sqlpackage
104+
unzip ~/Downloads/sqlpackage-osx-<version string>.zip -d ~/sqlpackage
105+
chmod +x ~/sqlpackage/sqlpackage
106+
echo 'export PATH="$PATH:~/sqlpackage"' >> ~/.bash_profile
107+
source ~/.bash_profile
108+
sqlpackage
109109
```
110110

111111
> [!NOTE]
112112
> Security settings may require modification to run SqlPackage on macOS. Use the following commands to interact with Gatekeeper from the command line.
113113
114114
**Before executing SqlPackage:**
115115
```bash
116-
$ sudo spctl --master-disable
116+
sudo spctl --master-disable
117117
```
118118

119119
**After executing SqlPackage:**
120120
```bash
121-
$ sudo spctl --master-enable
121+
sudo spctl --master-enable
122122
```
123123

124124
## Windows (.NET Core)

docs/tools/sqlpackage/sqlpackage-export.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ SqlPackage /a:Export /ssn:"{yourserver}.database.windows.net,1433" /sdn:"Adventu
3737
# example export using Azure Active Directory Service Principal
3838
SqlPackage /Action:Export /TargetFile:"C:\AdventureWorksLT.bacpac" \
3939
/SourceConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;Authentication=Active Directory Service Principal;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
40+
41+
# example export connecting using Azure Active Directory username and password
42+
SqlPackage /Action:Export /TargetFile:"C:\AdventureWorksLT.bacpac" \
43+
/SourceConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;Authentication=Active Directory Password;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;User ID={yourusername};Password={yourpassword}"
44+
45+
# example export connecting using Azure Active Directory universal authentication
46+
SqlPackage /Action:Export /TargetFile:"C:\AdventureWorksLT.bacpac" /UniversalAuthentication=True \
47+
/SourceConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
4048
```
4149

4250
## Parameters for the Export action
@@ -74,7 +82,7 @@ SqlPackage /Action:Export /TargetFile:"C:\AdventureWorksLT.bacpac" \
7482
|**/p:**|DatabaseLockTimeout=(INT32 '60')| Specifies the database lock timeout in seconds when executing queries against SQLServer. Use -1 to wait indefinitely.|
7583
|**/p:**|HashObjectNamesInLogs=(BOOLEAN)|Specifies whether to replace all object names in logs with a random hash value.|
7684
|**/p:**|IgnoreIndexesStatisticsOnEnclaveEnabledColumns=(BOOLEAN)|Specifies whether indexes or statistics on columns encrypted using randomized encryption and enclave-enabled column encryption keys should be ignored (not included in the generated bacpac). By default (false) any index or a statistic on a column encrypted using randomized encryption and an enclave-enabled column encryption key will block the export action.|
77-
|**/p:**|LongRunningCommandTimeout=(INT32)| Specifies the long running command timeout in seconds when executing queries against SQL Server. Use 0 to wait indefinitely.|
85+
|**/p:**|LongRunningCommandTimeout=(INT32 '0')| Specifies the long running command timeout in seconds when executing queries against SQL Server. Use 0 to wait indefinitely.|
7886
|**/p:**|Storage=({File&#124;Memory} )| Specifies the type of backing storage for the schema model used during extraction. 'Memory' is default for .NET Core version of SqlPackage. 'File' is only available and default for .NET Framework version of SqlPackage. |
7987
|**/p:**|TableData=(STRING[])|Indicates the table from which data will be extracted. Specify the table name with or without the brackets surrounding the name parts in the following format: schema_name.table_identifier. This option may be specified multiple times.|
8088
|**/p:**|TargetEngineVersion=({Default&#124;Latest&#124;V11&#124;V12} 'Latest')|This property is deprecated and use is not recommended. Specifies the version the target engine for Azure SQL Database is expected to be.|
@@ -85,4 +93,4 @@ SqlPackage /Action:Export /TargetFile:"C:\AdventureWorksLT.bacpac" \
8593
## Next Steps
8694

8795
- Learn more about [SqlPackage](sqlpackage.md)
88-
- [Troubleshooting Import/Export with SqlPackage](./troubleshooting-import-export-sqlpackage.md)
96+
- [Troubleshooting with SqlPackage](./troubleshooting-issues-and-performance-with-sqlpackage.md)

docs/tools/sqlpackage/sqlpackage-extract.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,28 @@ SqlPackage /Action:Extract {parameters} {properties}
3333
SqlPackage /Action:Extract /TargetFile:{filename}.dacpac /DiagnosticsFile:{logFile}.log /p:ExtractAllTableData=false /p:VerifyExtraction=true \
3434
/SourceServerName:{serverFQDN} /SourceDatabaseName:{databaseName} /SourceUser:{username} /SourcePassword:{password}
3535

36-
3736
# example extract to create a .sql file containing the schema definition of the database
3837
SqlPackage /Action:Extract /TargetFile:{filename}.dacpac /DiagnosticsFile:{logFile}.log /SourceServerName:{serverFQDN} \
3938
/SourceDatabaseName:{databaseName} /SourceUser:{username} /SourcePassword:{password} /p:ExtractTarget:File
4039

40+
# example extract to create a .dacpac file with data connecting using SQL authentication
41+
SqlPackage /Action:Extract /TargetFile:{filename}.dacpac /DiagnosticsFile:{logFile}.log /p:ExtractAllTableData=true /p:VerifyExtraction=true \
42+
/SourceServerName:{serverFQDN} /SourceDatabaseName:{databaseName} /SourceUser:{username} /SourcePassword:{password}
43+
44+
4145
# example extract to create a schema-only .dacpac file connecting using Active Directory Service Principal
4246
SqlPackage /Action:Extract /TargetFile:"C:\AdventureWorksLT.dacpac" \
4347
/SourceConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;Authentication=Active Directory Service Principal;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
4448

45-
# example extract to create a .dacpac file with data connecting using SQL authentication
46-
SqlPackage /Action:Extract /TargetFile:{filename}.dacpac /DiagnosticsFile:{logFile}.log /p:ExtractAllTableData=true /p:VerifyExtraction=true \
47-
/SourceServerName:{serverFQDN} /SourceDatabaseName:{databaseName} /SourceUser:{username} /SourcePassword:{password}
49+
50+
# example extract to create a schema-only .dacpac file connecting using Azure Active Directory username and password
51+
SqlPackage /Action:Extract /TargetFile:"C:\AdventureWorksLT.dacpac" \
52+
/SourceConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;Authentication=Active Directory Password;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;User ID={yourusername};Password={yourpassword}"
53+
54+
55+
# example extract to create a schema-only .dacpac file connecting using Azure Active Directory universal authentication
56+
SqlPackage /Action:Extract /TargetFile:"C:\AdventureWorksLT.dacpac" /UniversalAuthentication=True \
57+
/SourceConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
4858
```
4959

5060
## Parameters for the Extract action
@@ -97,7 +107,7 @@ SqlPackage /Action:Extract /TargetFile:{filename}.dacpac /DiagnosticsFile:{logFi
97107
|**/p:**|IgnoreExtendedProperties=(BOOLEAN)|Specifies whether extended properties should be ignored.|
98108
|**/p:**|IgnorePermissions=(BOOLEAN 'True')|Specifies whether permissions should be ignored.|
99109
|**/p:**|IgnoreUserLoginMappings=(BOOLEAN)|Specifies whether relationships between users and logins are ignored.|
100-
|**/p:**|LongRunningCommandTimeout=(INT32)| Specifies the long running command timeout in seconds when executing queries against SQL Server. Use 0 to wait indefinitely.|
110+
|**/p:**|LongRunningCommandTimeout=(INT32 '0')| Specifies the long running command timeout in seconds when executing queries against SQL Server. Use 0 to wait indefinitely.|
101111
|**/p:**|Storage=({File&#124;Memory})|Specifies the type of backing storage for the schema model used during extraction. 'Memory' is default for .NET Core version of SqlPackage. 'File' is only available and default for .NET Framework version of SqlPackage.|
102112
|**/p:**|TableData=(STRING[])|Indicates the table from which data will be extracted. Specify the table name with or without the brackets surrounding the name parts in the following format: schema_name.table_identifier. This option may be specified multiple times.|
103113
|**/p:**|TempDirectoryForTableData=(STRING)|Specifies the temporary directory used to buffer table data before being written to the package file.|
@@ -108,3 +118,4 @@ SqlPackage /Action:Extract /TargetFile:{filename}.dacpac /DiagnosticsFile:{logFi
108118
## Next Steps
109119

110120
- Learn more about [SqlPackage](sqlpackage.md)
121+
- [Troubleshooting with SqlPackage](./troubleshooting-issues-and-performance-with-sqlpackage.md)

docs/tools/sqlpackage/sqlpackage-import.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ SqlPackage /a:Import /tsn:"{yourserver}.database.windows.net,1433" /tdn:"Adventu
3737
# example import using Azure Active Directory Service Principal
3838
SqlPackage /Action:Import /SourceFile:"C:\AdventureWorksLT.bacpac" \
3939
/TargetConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;Authentication=Active Directory Service Principal;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
40+
41+
# example import connecting using Azure Active Directory username and password
42+
SqlPackage /Action:Import /SourceFile:"C:\AdventureWorksLT.bacpac" \
43+
/TargetConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;Authentication=Active Directory Password;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;User ID={yourusername};Password={yourpassword}"
44+
45+
# example import connecting using Azure Active Directory universal authentication
46+
SqlPackage /Action:Import /SourceFile:"C:\AdventureWorksLT.bacpac" /UniversalAuthentication=True \
47+
/TargetConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
4048
```
4149

4250
## Parameters for the Import action
@@ -80,12 +88,12 @@ SqlPackage /Action:Import /SourceFile:"C:\AdventureWorksLT.bacpac" \
8088
|**/p:**|ImportContributorArguments=(STRING)|Specifies deployment contributor arguments for the deployment contributors. This property should be a semi-colon delimited list of values.|
8189
|**/p:**|ImportContributorPaths=(STRING)|Specifies paths to load additional deployment contributors. This property should be a semi-colon delimited list of values.|
8290
|**/p:**|ImportContributors=(STRING)|Specifies the deployment contributors, which should run when the bacpac is imported. This property should be a semi-colon delimited list of fully qualified build contributor names or IDs.|
83-
|**/p:**|LongRunningCommandTimeout=(INT32)| Specifies the long running command timeout in seconds when executing queries against SQL Server. Use 0 to wait indefinitely.|
91+
|**/p:**|LongRunningCommandTimeout=(INT32 '0')| Specifies the long running command timeout in seconds when executing queries against SQL Server. Use 0 to wait indefinitely.|
8492
|**/p:**|PreserveIdentityLastValues=(BOOLEAN)|Specifies whether last values for identity columns should be preserved during deployment.|
8593
|**/p:**|RebuildIndexesOfflineForDataPhase=(BOOLEAN FALSE)|When true, rebuilds indexes offline after importing data into SQL Server.|
8694
|**/p:**|Storage=({File&#124;Memory})|Specifies how elements are stored when building the database model. For performance reasons the default is InMemory. For large databases, File backed storage is required.|
8795

8896
## Next Steps
8997

9098
- Learn more about [SqlPackage](sqlpackage.md)
91-
- [Troubleshooting Import/Export with SqlPackage](./troubleshooting-import-export-sqlpackage.md)
99+
- [Troubleshooting with SqlPackage](./troubleshooting-issues-and-performance-with-sqlpackage.md)

docs/tools/sqlpackage/sqlpackage-publish.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ SqlPackage /a:Publish /tsn:"{yourserver}.database.windows.net,1433" /tdn:"Advent
4141
SqlPackage /Action:Publish /SourceFile:"C:\AdventureWorksLT.dacpac" \
4242
/TargetConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;Authentication=Active Directory Service Principal;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
4343

44+
# example publish connecting using Azure Active Directory username and password
45+
SqlPackage /Action:Publish /SourceFile:"C:\AdventureWorksLT.dacpac" \
46+
/TargetConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;Authentication=Active Directory Password;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;User ID={yourusername};Password={yourpassword}"
47+
48+
# example publish connecting using Azure Active Directory universal authentication
49+
SqlPackage /Action:Publish /SourceFile:"C:\AdventureWorksLT.dacpac" /UniversalAuthentication=True \
50+
/TargetConnectionString:"Server=tcp:{yourserver}.database.windows.net,1433;Initial Catalog=AdventureWorksLT;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
51+
4452
# example publish with 2 SQLCMD variables
4553
# as seen in a post deployment script for user passwords
4654
# https://github.com/Azure-Samples/app-sql-devops-demo-project/blob/main/sql/wwi-dw-ssdt/PostDeploymentScripts/AddUsers.sql
@@ -189,7 +197,7 @@ SqlPackage /Action:Publish /SourceFile:"C:\AdventureWorksLT.dacpac" \
189197
|**/p:**|IncludeCompositeObjects=(BOOLEAN)|Include all composite elements with the same database as part of a single publish operation.|
190198
|**/p:**|IncludeTransactionalScripts=(BOOLEAN)|Specifies whether transactional statements should be used where possible when you publish to a database.|
191199
|**/p:**|IsAlwaysEncryptedParameterizationEnabled=(BOOLEAN 'False')|Enables variable parameterization on Always Encrypted columns in pre/post deployment scripts.|
192-
|**/p:**|LongRunningCommandTimeout=(INT32)|Specifies the long running command timeout in seconds when executing queries against SQL Server. Use 0 to wait indefinitely.|
200+
|**/p:**|LongRunningCommandTimeout=(INT32 '0')|Specifies the long running command timeout in seconds when executing queries against SQL Server. Use 0 to wait indefinitely.|
193201
|**/p:**|NoAlterStatementsToChangeClrTypes=(BOOLEAN)|Specifies that publish should always drop and re-create an assembly if there is a difference instead of issuing an ALTER ASSEMBLY statement.|
194202
|**/p:**|PopulateFilesOnFileGroups=(BOOLEAN 'True')|Specifies whether a new file is also created when a new FileGroup is created in the target database.|
195203
|**/p:**|PreserveIdentityLastValues=(BOOLEAN)|Specifies whether last values for identity columns should be preserved during deployment.|
@@ -221,4 +229,5 @@ The following table describes the format of the option that you can use to overr
221229

222230
## Next Steps
223231

224-
- Learn more about [SqlPackage](sqlpackage.md)
232+
- Learn more about [SqlPackage](sqlpackage.md)
233+
- [Troubleshooting with SqlPackage](./troubleshooting-issues-and-performance-with-sqlpackage.md)

0 commit comments

Comments
 (0)