Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
gäller för:SQL Server
Azure SQL Database
Azure SQL Managed Instance
SQL-databas i Microsoft Fabric
The extraction process creates a DAC package file (.dacpac
) that contains definitions of the database objects and their related instance-level elements. For example, a .dacpac
file contains the database tables, stored procedures, views, and users, along with the logins that map to the database users. The .dacpac
file can be used to deploy the database to another instance of SQL Server or Azure SQL Database or to register the database as a data-tier application (DAC) in the current instance.
Options for extracting a .dacpac
include:
- the Extract Data-tier Application wizard in SQL Server Management Studio (SSMS)
- SQL Server Data Tools
- SqlPackage command-line utility
Behörigheter
Extracting a .dacpac
requires at least ALTER ANY LOGIN
and database scope VIEW DEFINITION
permissions, and SELECT
permissions on sys.sql_expression_dependencies
. Members of the securityadmin fixed server role who are also members of the database_owner fixed database role are eligible to extract a .dacpac
. Members of the sysadmin fixed server role or the built-in SQL Server system administrator account named sa
can also extract a .dacpac
.
Use the Extract Data-tier Application Wizard
To Extract a DAC Using a Wizard
- In Object Explorer, expand the node for the instance containing the database from which the
.dacpac
is to be extracted. - Expand the Databases node.
- Right-click the node for the database from which the
.dacpac
is to be extracted, point to Tasks, and then select Extract Data-tier Application... - Complete the wizard dialogs:
Introduktionssida för guiden
På den här sidan beskrivs stegen för att extrahera ett program på datanivå.
Visa inte den här sidan igen. – Markera kryssrutan för att förhindra att sidan visas i framtiden.
Nästa > – fortsätter till sidan Välj metod.
Cancel - Ends the wizard without extracting a data-tier application from the database.
Välj datasida
Välj de referensdata som du vill inkludera i DAC-paketfilen (datanivåprogram). Det är valfritt att inkludera data i DAC-paketet. The .dacpac
includes the schema of all supported database objects and instance objects related to your database.
Du kan inkludera upp till 10 MB referensdata i DAC-paketfilen. However, for tables to be included in the DAC, they might not contain binary large object (BLOB) data types such as image or varchar(max). Om du vill extrahera större mängder data för överföring till en annan databas använder du SQL Server Integration Services, masskopieringsverktyget eller någon av många andra datamigreringstekniker.
database table – Markera kryssrutan bredvid databastabellerna som innehåller de data som du vill inkludera i DAC-paketet. You can select up to 10 tables that have 10,000 rows or less.
Ange egenskapssida
Använd den här sidan i guiden för att beskriva datanivåprogrammet (DAC). Dessa egenskaper används för att identifiera DAC och hjälpa till att skilja den från andra.
Namn – Det här namnet identifierar DAC. Det kan skilja sig från namnet på DAC-paketfilen och bör beskriva ditt program. For example, if the database is used for a finance application, you might wish to name the DAC Finance.
Version (använd xx.xx.xx.xx, där x är ett tal) – ett numeriskt värde som identifierar DAC-versionen. DAC-versionen används i Visual Studio för att identifiera vilken version av DAC som utvecklare arbetar med. When a .dacpac
is deployed, the version is stored in the msdb
database and can later be viewed under the Data-tier Applications node in SQL Server Management Studio.
Beskrivning: – Valfritt. Beskriver DAC:n. When a .dacpac
is deployed, the description is stored in the msdb
database and can later be viewed under the Data-tier Applications node in Management Studio.
Spara till DAC-paketfilen (inkludera .dacpac-tillägget med filnamnet): – Sparar DAC till en DAC-paketfil med filnamnstillägget .dacpac. Select the Browse button to specify a name and location for the file.
Skriv över befintlig fil – Markera den här kryssrutan om du vill ersätta DAC-paketfilen om det redan finns en fil med samma namn.
Verifierings- och sammanfattningssida
On this page, the wizard validates that all database objects are supported in a data-tier application (DAC). Den kontrollerar också beroenden mellan databasobjekt för att fastställa vilken uppsättning objekt som kan inkluderas i DAC: et. After that, it displays the validation report and summarizes the options that you selected in this wizard. Om du vill ändra ett alternativ väljer du Föregående. To begin extracting a DAC, select Next.
Anmärkning
If one or more objects aren't supported by a DAC, then the Next button is disabled and the extraction process might not continue. In such cases, it's recommended to remove the unsupported objects and then run this wizard again.
Summary - A summary of the options you selected are listed under DAC properties. Resultatet av valideringen visas under DAC-objekt. Det finns tre typer av resultat från valideringen:
objekt inkluderade i DAC framgångsrikt: dessa objekt och deras beroenden stöds och kan inkluderas i DAC:n på ett framgångsrikt sätt.
Objects included in DAC with warnings: these objects are supported, but depend on other objects that aren't supported in a DAC.
Objects not included in DAC: these objects aren't supported and must be removed from the database before successfully extracting a DAC.
Valideringsprocessen kontrollerar flera nivåer av beroenden. Om en lagrad procedur till exempel är beroende av en tabell som använder CLR-datatypen som inte stöds visas den lagrade proceduren under Objekt som ingår i DAC med varningar.
If one or more objects aren't supported by a DAC, then the Next button is disabled and the extraction process won't continue. In such cases, it's recommended to remove the objects that aren't supported and then run this wizard again.
Spara rapport – Gör att du kan spara en HTML-baserad fil som visar alla objekt under noden DAC-objekt i sammanfattningen. This report can be useful when some of your database objects aren't supported in a DAC. Use the report to change or remove objects that aren't supported, before trying to extract the DAC again.
Build package page
Use this page to monitor the progress of the wizard as it extracts the data-tier application (DAC).
Åtgärd – Under åtgärden Skapa och spara DAC-paketfilen extraherar guiden en DAC från SQL Server-databasen. Sedan skapas ett DAC-paket i minnet och sparas på den plats som du angav. Välj länkarna i kolumnen Result för att se resultatet av motsvarande steg.
Spara rapport – Välj för att spara resultatet av guidens förlopp i en fil.
Finish - Select to close the wizard after processing has completed, or if an error occurs.