如何用SqlPackage.exe對SQL Azure資料庫做備份
SqlPackage.exe 是一個命令列實用工具,可自動完成以下資料庫開發任務:
提取:從活動的 SQL Server 或 Windows Azure SQL Database 建立資料庫快照 (.dacpac) 檔案。
匯出:將活動資料庫(包括資料庫架構和使用者資料)從 SQL Server 或 Windows Azure SQL Database 匯出到 BACPAC 包(.bacpac 檔案)。
匯入:將架構和表資料從 BACPAC 包匯入到 SQL Server 或 Windows Azure SQL Database 的例項中的新使用者資料庫中。
釋出:以增量方式更新資料庫架構以匹配源 .dacpac 檔案的架構。如果資料庫不存在於伺服器上,則釋出操作將建立該資料庫。否則,將更新現有資料庫。
DeployReport:建立將由釋出操作完成的更改的 XML 報表。
DriftReport:建立自注冊資料庫註冊以來已對其做出的更改的 XML 報表。
指令碼:建立 Transact-SQL 增量更新指令碼,該指令碼可更新目標的架構以匹配源的架構。
透過 SqlPackage.exe 命令列,您可以指定這些操作以及特定於操作的引數和屬性。
命令列格式如下:
sqlpackage.exe /Action:export /tsn:< server_name > /tdn:< database_name > /tu:< user_name > /tp:< password > /tf:< target_file >
< server_name > 目標伺服器名稱
< database_name > 目標資料庫名稱
< user_name > 目標伺服器中的使用者名稱
< password > 使用者的密碼
< target_file > 要匯出的 BACPAC 檔案的檔名和位置
匯出sql database例子:
E:\backup>"c:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin\SqlPackage.exe" /a:export /ssn:test.itpub.cn /sdn:chenfeng /su:sctest/sp:"st&xus7e6a2AC5u=atHa" /tf:e:\backup\sc-test\20171009.bacpac
Connecting to database 'chenfeng' on server 'test.itpub.cn'.
Extracting schema
Extracting schema from database
Resolving references in schema model
Validating schema model
Validating schema model for data package
Validating schema
Exporting data from database
Exporting data
Processing Export.
Processing Table '[dbo].[_XJYTL_dealers_in_storage]'.
Processing Table '[dbo].[_test01_users]'.
Processing Table '[dbo].[_TEST2017001_distribution_role]'.
Processing Table '[dbo].[_XJYTL_dealers_in_storage_detail]'.
Processing Table '[dbo].[_test01_warehouse]'.
Processing Table '[dbo].[_TEST2017001_distribution_role_fields]'.
Processing Table '[dbo].[_XJYTL_dealers_in_storage_terminal_user]'.
Processing Table '[dbo].[_test01_warehouse_stock]'.
Processing Table '[dbo].[_TEST2017001_distribution_role_res]'.
Processing Table '[dbo].[_XJYTL_dealers_out_storage]'.
Processing Table '[dbo].[_test01_warehouse_stock_check_plan]'.
Processing Table '[dbo].[_TEST2017001_distribution_sys_res]'.
Processing Table '[dbo].[_XJYTL_dealers_out_storage_detail]'.
Processing Table '[dbo].[_test01_warehouse_stock_check_task]'.
Processing Table '[dbo].[_TEST2017001_distribution_terminal_shop]'.
Processing Table '[dbo].[_XJYTL_dealers_out_storage_terminal_user]'.
Processing Table '[dbo].[_test01_warehouse_stock_details]'.
Processing Table '[dbo].[_XJYTL_dealers_stock]'.
Processing Table '[dbo].[_TEST2017001_factory]'.
Processing Table '[dbo].[_test01_workshop]'.
Processing Table '[dbo].[_XJYTL_dealers_warehouse]'.
Processing Table '[dbo].[_TEST2017001_in_storage]'.
Processing Table '[dbo].[gyl_test_table]'.
Processing Table '[dbo].[_XJYTL_devanning_packing_box]'.
Processing Table '[dbo].[_TEST2017001_in_storage_detail]'.
Processing Table '[dbo].[_XJYTL_dismantle_pile_stack]'.
Processing Table '[dbo].[_TEST2017001_in_storage_terminal_user]'.
Processing Table '[dbo].[_XJYTL_distribution_acct_reg_audit]'.
Processing Table '[dbo].[_TEST2017001_ipc]'.
Processing Table '[dbo].[_XJYTL_distribution_acct_role]'.
Processing Table '[dbo].[_TEST2017001_ipc_user_info]'.
Processing Table '[dbo].[_XJYTL_distribution_dealers]'.
Processing Table '[dbo].[_TEST2017001_machine_halt_reason]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate]'.
Processing Table '[dbo].[_TEST2017001_out_storage]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_activity]'.
Processing Table '[dbo].[_TEST2017001_out_storage_detail]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_activity_detail]'.
Processing Table '[dbo].[_TEST2017001_out_storage_terminal_user]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_audit]'.
Processing Table '[dbo].[_TEST2017001_pack_standard]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_condition]'.
Processing Table '[dbo].[_TEST2017001_product]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_detail]'.
Processing Table '[dbo].[_TEST2017001_product_category]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_scan_code]'.
Processing Table '[dbo].[_TEST2017001_product_line]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_strategy]'.
Processing Table '[dbo].[_TEST2017001_product_tag]'.
Processing Table '[dbo].[_XJYTL_distribution_role]'.
Processing Table '[dbo].[_TEST2017001_product_tag_mapping]'.
Processing Table '[dbo].[_test01_qr_code_publish_record]'.
Processing Table '[dbo].[_XJYTL_distribution_role_fields]'.
Processing Table '[dbo].[_TEST2017001_product_team]'.
Processing Table '[dbo].[_XJYTL_distribution_role_res]'.
Processing Table '[dbo].[_TEST2017001_production_data_uploads]'.
Processing Table '[dbo].[_XJYTL_distribution_sys_res]'.
Processing Table '[dbo].[_TEST2017001_production_plan]'.
Processing Table '[dbo].[_XJYTL_distribution_terminal_shop]'.
Processing Table '[dbo].[_TEST2017001_production_task]'.
Processing Table '[dbo].[_TEST2017001_production_task_status]'.
Processing Table '[dbo].[_XJYTL_factory]'.
Processing Table '[dbo].[_TEST2017001_qr_code_publish_record]'.
Processing Table '[dbo].[_admin_area]'.
Processing Table '[dbo].[_XJYTL_in_storage]'.
Processing Table '[dbo].[_TEST2017001_sales_area]'.
Processing Table '[dbo].[_admin_area_test]'.
Processing Table '[dbo].[_XJYTL_in_storage_detail]'.
Processing Table '[dbo].[_TEST2017001_sys_config]'.
Processing Table '[dbo].[_test01_dealer_product]'.
Processing Table '[dbo].[_XJYTL_in_storage_terminal_user]'.
Processing Table '[dbo].[_TEST2017001_terminal]'.
Processing Table '[dbo].[_test01_distribution_terminal_shop]'.
Processing Table '[dbo].[_test01_dealer_stock]'.
Processing Table '[dbo].[_XJYTL_ipc]'.
Processing Table '[dbo].[_TEST2017001_terminal_user_info]'.
Processing Table '[dbo].[_test01_dealers]'.
Processing Table '[dbo].[_XJYTL_ipc_user_info]'.
Processing Table '[dbo].[_TEST2017001_users]'.
Processing Table '[dbo].[_test01_dealers_in_storage]'.
Processing Table '[dbo].[_test01_devanning_packing_box]'.
Processing Table '[dbo].[_XJYTL_machine_halt_reason]'.
Processing Table '[dbo].[_TEST2017001_warehouse]'.
Processing Table '[dbo].[_test01_dealers_in_storage_detail]'.
Processing Table '[dbo].[_test01_dismantle_pile_stack]'.
Processing Table '[dbo].[_XJYTL_out_storage]'.
Processing Table '[dbo].[_TEST2017001_warehouse_stock]'.
Processing Table '[dbo].[_test01_dealers_warehouse]'.
Processing Table '[dbo].[_test01_distribution_acct_reg_audit]'.
Processing Table '[dbo].[_XJYTL_out_storage_detail]'.
Processing Table '[dbo].[_TEST2017001_warehouse_stock_check_plan]'.
Processing Table '[dbo].[_test01_distribution_rebate]'.
Processing Table '[dbo].[_test01_distribution_acct_role]'.
Processing Table '[dbo].[_XJYTL_out_storage_terminal_user]'.
Processing Table '[dbo].[_TEST2017001_warehouse_stock_check_task]'.
Processing Table '[dbo].[_test01_distribution_rebate_activity]'.
Processing Table '[dbo].[_test01_distribution_dealers]'.
Processing Table '[dbo].[_XJYTL_pack_standard]'.
Processing Table '[dbo].[_TEST2017001_warehouse_stock_details]'.
Processing Table '[dbo].[_test01_distribution_rebate_activity_detail]'.
Processing Table '[dbo].[_distribution_dealers_acct]'.
Processing Table '[dbo].[_XJYTL_product]'.
Processing Table '[dbo].[_TEST2017001_workshop]'.
Processing Table '[dbo].[_test01_distribution_rebate_audit]'.
Processing Table '[dbo].[_test01_distribution_role]'.
Processing Table '[dbo].[_XJYTL_product_category]'.
Processing Table '[dbo].[_test01_dealers_devanning_packing_box]'.
Processing Table '[dbo].[_test01_distribution_rebate_condition]'.
Processing Table '[dbo].[_test01_distribution_role_fields]'.
Processing Table '[dbo].[_XJYTL_product_line]'.
Processing Table '[dbo].[_test01_dealers_dismantle_pile_stack]'.
Processing Table '[dbo].[_test01_distribution_rebate_detail]'.
Processing Table '[dbo].[_test01_distribution_role_res]'.
Processing Table '[dbo].[_XJYTL_product_tag]'.
Processing Table '[dbo].[_test01_dealers_in_storage_terminal_user]'.
Processing Table '[dbo].[_test01_distribution_rebate_scan_code]'.
Processing Table '[dbo].[_test01_distribution_sys_res]'.
Processing Table '[dbo].[_XJYTL_product_tag_mapping]'.
Processing Table '[dbo].[_test01_distribution_rebate_strategy]'.
Processing Table '[dbo].[_enterprise]'.
Processing Table '[dbo].[_XJYTL_product_team]'.
Processing Table '[dbo].[_test01_dealers_out_storage_detail]'.
Processing Table '[dbo].[_TEST2017001_dealer_stock]'.
Processing Table '[dbo].[_test01_factory]'.
Processing Table '[dbo].[_XJYTL_production_data_uploads]'.
Processing Table '[dbo].[_test01_dealers_out_storage_terminal_user]'.
Processing Table '[dbo].[_TEST2017001_dealers]'.
Processing Table '[dbo].[_test01_in_storage]'.
Processing Table '[dbo].[_XJYTL_production_plan]'.
Processing Table '[dbo].[_test01_dealers_stock]'.
Processing Table '[dbo].[_TEST2017001_dealers_devanning_packing_box]'.
Processing Table '[dbo].[_test01_in_storage_detail]'.
Processing Table '[dbo].[_XJYTL_production_task]'.
Processing Table '[dbo].[_test01_ipc_user_info]'.
Processing Table '[dbo].[_TEST2017001_dealers_dismantle_pile_stack]'.
Processing Table '[dbo].[_test01_in_storage_terminal_user]'.
Processing Table '[dbo].[_XJYTL_production_task_status]'.
Processing Table '[dbo].[_TEST2017001_dealers_in_storage]'.
Processing Table '[dbo].[_test01_ipc]'.
Processing Table '[dbo].[_XJYTL_qr_code_publish_record]'.
Processing Table '[dbo].[_TEST2017001_dealers_out_storage]'.
Processing Table '[dbo].[_TEST2017001_dealers_in_storage_detail]'.
Processing Table '[dbo].[_XJYTL_sales_area]'.
Processing Table '[dbo].[_TEST2017001_dealers_in_storage_terminal_user]'.
Processing Table '[dbo].[_test01_machine_halt_reason]'.
Processing Table '[dbo].[_XJYTL_sys_config]'.
Processing Table '[dbo].[_test01_dealers_out_storage]'.
Processing Table '[dbo].[_test01_out_storage]'.
Processing Table '[dbo].[_XJYTL_terminal]'.
Processing Table '[dbo].[_test01_dealers_stock_details]'.
Processing Table '[dbo].[_TEST2017001_dealers_out_storage_detail]'.
Processing Table '[dbo].[_test01_out_storage_detail]'.
Processing Table '[dbo].[_XJYTL_terminal_user_info]'.
Processing Table '[dbo].[_TEST2017001_dealers_stock_details]'.
Processing Table '[dbo].[_TEST2017001_dealers_out_storage_terminal_user]'.
Processing Table '[dbo].[_test01_out_storage_terminal_user]'.
Processing Table '[dbo].[_XJYTL_users]'.
Processing Table '[dbo].[_TEST2017001_dealers_stock]'.
Processing Table '[dbo].[_test01_pack_standard]'.
Processing Table '[dbo].[_XJYTL_warehouse]'.
Processing Table '[dbo].[_TEST2017001_dealers_warehouse]'.
Processing Table '[dbo].[_test01_product]'.
Processing Table '[dbo].[_XJYTL_warehouse_stock]'.
Processing Table '[dbo].[_TEST2017001_devanning_packing_box]'.
Processing Table '[dbo].[_test01_product_category]'.
Processing Table '[dbo].[_XJYTL_warehouse_stock_check_plan]'.
Processing Table '[dbo].[_TEST2017001_dismantle_pile_stack]'.
Processing Table '[dbo].[_test01_product_line]'.
Processing Table '[dbo].[_XJYTL_warehouse_stock_check_task]'.
Processing Table '[dbo].[_TEST2017001_distribution_acct_reg_audit]'.
Processing Table '[dbo].[_test01_product_tag]'.
Processing Table '[dbo].[_XJYTL_warehouse_stock_details]'.
Processing Table '[dbo].[_TEST2017001_distribution_acct_role]'.
Processing Table '[dbo].[_test01_product_tag_mapping]'.
Processing Table '[dbo].[_XJYTL_workshop]'.
Processing Table '[dbo].[_TEST2017001_distribution_dealers]'.
Processing Table '[dbo].[_test01_product_team]'.
Processing Table '[dbo].[_XJYTL_inspection_records]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate]'.
Processing Table '[dbo].[_test01_production_data_uploads]'.
Processing Table '[dbo].[_XJYTL_inspection_records_detail]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate_activity]'.
Processing Table '[dbo].[_test01_production_plan]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate_activity_detail]'.
Processing Table '[dbo].[_test01_production_task]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate_audit]'.
Processing Table '[dbo].[_test01_production_task_status]'.
Processing Table '[dbo].[_XJYTL_dealers_stock_details]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate_condition]'.
Processing Table '[dbo].[_test01_sales_area]'.
Processing Table '[dbo].[_XJYTL_dealers]'.
Processing Table '[dbo].[_test01_sys_config]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate_detail]'.
Processing Table '[dbo].[_XJYTL_dealers_devanning_packing_box]'.
Processing Table '[dbo].[_test01_terminal]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate_scan_code]'.
Processing Table '[dbo].[_XJYTL_dealers_dismantle_pile_stack]'.
Processing Table '[dbo].[_test01_terminal_user_info]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate_strategy]'.
Successfully exported database and saved it to file 'e:\backup\sc-test\20171009.bacpac'.
E:\backup>
匯入資料庫命令:
sqlpackage.exe /Action:Import /tsn:< server_name > /tdn:< database_name > /tu:< user_name > /tp:< password > /sf:< source_file >
引數 說明
< server_name > 目標伺服器名稱
< database_name > 目標資料庫名稱
< user_name > 目標伺服器中的使用者名稱
< password > 使用者的密碼
< source_file > 要匯入的 BACPAC 檔案的檔名和位置
匯入到資料庫例子
提取:從活動的 SQL Server 或 Windows Azure SQL Database 建立資料庫快照 (.dacpac) 檔案。
匯出:將活動資料庫(包括資料庫架構和使用者資料)從 SQL Server 或 Windows Azure SQL Database 匯出到 BACPAC 包(.bacpac 檔案)。
匯入:將架構和表資料從 BACPAC 包匯入到 SQL Server 或 Windows Azure SQL Database 的例項中的新使用者資料庫中。
釋出:以增量方式更新資料庫架構以匹配源 .dacpac 檔案的架構。如果資料庫不存在於伺服器上,則釋出操作將建立該資料庫。否則,將更新現有資料庫。
DeployReport:建立將由釋出操作完成的更改的 XML 報表。
DriftReport:建立自注冊資料庫註冊以來已對其做出的更改的 XML 報表。
指令碼:建立 Transact-SQL 增量更新指令碼,該指令碼可更新目標的架構以匹配源的架構。
透過 SqlPackage.exe 命令列,您可以指定這些操作以及特定於操作的引數和屬性。
命令列格式如下:
sqlpackage.exe /Action:export /tsn:< server_name > /tdn:< database_name > /tu:< user_name > /tp:< password > /tf:< target_file >
< server_name > 目標伺服器名稱
< database_name > 目標資料庫名稱
< user_name > 目標伺服器中的使用者名稱
< password > 使用者的密碼
< target_file > 要匯出的 BACPAC 檔案的檔名和位置
匯出sql database例子:
E:\backup>"c:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin\SqlPackage.exe" /a:export /ssn:test.itpub.cn /sdn:chenfeng /su:sctest/sp:"st&xus7e6a2AC5u=atHa" /tf:e:\backup\sc-test\20171009.bacpac
Connecting to database 'chenfeng' on server 'test.itpub.cn'.
Extracting schema
Extracting schema from database
Resolving references in schema model
Validating schema model
Validating schema model for data package
Validating schema
Exporting data from database
Exporting data
Processing Export.
Processing Table '[dbo].[_XJYTL_dealers_in_storage]'.
Processing Table '[dbo].[_test01_users]'.
Processing Table '[dbo].[_TEST2017001_distribution_role]'.
Processing Table '[dbo].[_XJYTL_dealers_in_storage_detail]'.
Processing Table '[dbo].[_test01_warehouse]'.
Processing Table '[dbo].[_TEST2017001_distribution_role_fields]'.
Processing Table '[dbo].[_XJYTL_dealers_in_storage_terminal_user]'.
Processing Table '[dbo].[_test01_warehouse_stock]'.
Processing Table '[dbo].[_TEST2017001_distribution_role_res]'.
Processing Table '[dbo].[_XJYTL_dealers_out_storage]'.
Processing Table '[dbo].[_test01_warehouse_stock_check_plan]'.
Processing Table '[dbo].[_TEST2017001_distribution_sys_res]'.
Processing Table '[dbo].[_XJYTL_dealers_out_storage_detail]'.
Processing Table '[dbo].[_test01_warehouse_stock_check_task]'.
Processing Table '[dbo].[_TEST2017001_distribution_terminal_shop]'.
Processing Table '[dbo].[_XJYTL_dealers_out_storage_terminal_user]'.
Processing Table '[dbo].[_test01_warehouse_stock_details]'.
Processing Table '[dbo].[_XJYTL_dealers_stock]'.
Processing Table '[dbo].[_TEST2017001_factory]'.
Processing Table '[dbo].[_test01_workshop]'.
Processing Table '[dbo].[_XJYTL_dealers_warehouse]'.
Processing Table '[dbo].[_TEST2017001_in_storage]'.
Processing Table '[dbo].[gyl_test_table]'.
Processing Table '[dbo].[_XJYTL_devanning_packing_box]'.
Processing Table '[dbo].[_TEST2017001_in_storage_detail]'.
Processing Table '[dbo].[_XJYTL_dismantle_pile_stack]'.
Processing Table '[dbo].[_TEST2017001_in_storage_terminal_user]'.
Processing Table '[dbo].[_XJYTL_distribution_acct_reg_audit]'.
Processing Table '[dbo].[_TEST2017001_ipc]'.
Processing Table '[dbo].[_XJYTL_distribution_acct_role]'.
Processing Table '[dbo].[_TEST2017001_ipc_user_info]'.
Processing Table '[dbo].[_XJYTL_distribution_dealers]'.
Processing Table '[dbo].[_TEST2017001_machine_halt_reason]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate]'.
Processing Table '[dbo].[_TEST2017001_out_storage]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_activity]'.
Processing Table '[dbo].[_TEST2017001_out_storage_detail]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_activity_detail]'.
Processing Table '[dbo].[_TEST2017001_out_storage_terminal_user]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_audit]'.
Processing Table '[dbo].[_TEST2017001_pack_standard]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_condition]'.
Processing Table '[dbo].[_TEST2017001_product]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_detail]'.
Processing Table '[dbo].[_TEST2017001_product_category]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_scan_code]'.
Processing Table '[dbo].[_TEST2017001_product_line]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_strategy]'.
Processing Table '[dbo].[_TEST2017001_product_tag]'.
Processing Table '[dbo].[_XJYTL_distribution_role]'.
Processing Table '[dbo].[_TEST2017001_product_tag_mapping]'.
Processing Table '[dbo].[_test01_qr_code_publish_record]'.
Processing Table '[dbo].[_XJYTL_distribution_role_fields]'.
Processing Table '[dbo].[_TEST2017001_product_team]'.
Processing Table '[dbo].[_XJYTL_distribution_role_res]'.
Processing Table '[dbo].[_TEST2017001_production_data_uploads]'.
Processing Table '[dbo].[_XJYTL_distribution_sys_res]'.
Processing Table '[dbo].[_TEST2017001_production_plan]'.
Processing Table '[dbo].[_XJYTL_distribution_terminal_shop]'.
Processing Table '[dbo].[_TEST2017001_production_task]'.
Processing Table '[dbo].[_TEST2017001_production_task_status]'.
Processing Table '[dbo].[_XJYTL_factory]'.
Processing Table '[dbo].[_TEST2017001_qr_code_publish_record]'.
Processing Table '[dbo].[_admin_area]'.
Processing Table '[dbo].[_XJYTL_in_storage]'.
Processing Table '[dbo].[_TEST2017001_sales_area]'.
Processing Table '[dbo].[_admin_area_test]'.
Processing Table '[dbo].[_XJYTL_in_storage_detail]'.
Processing Table '[dbo].[_TEST2017001_sys_config]'.
Processing Table '[dbo].[_test01_dealer_product]'.
Processing Table '[dbo].[_XJYTL_in_storage_terminal_user]'.
Processing Table '[dbo].[_TEST2017001_terminal]'.
Processing Table '[dbo].[_test01_distribution_terminal_shop]'.
Processing Table '[dbo].[_test01_dealer_stock]'.
Processing Table '[dbo].[_XJYTL_ipc]'.
Processing Table '[dbo].[_TEST2017001_terminal_user_info]'.
Processing Table '[dbo].[_test01_dealers]'.
Processing Table '[dbo].[_XJYTL_ipc_user_info]'.
Processing Table '[dbo].[_TEST2017001_users]'.
Processing Table '[dbo].[_test01_dealers_in_storage]'.
Processing Table '[dbo].[_test01_devanning_packing_box]'.
Processing Table '[dbo].[_XJYTL_machine_halt_reason]'.
Processing Table '[dbo].[_TEST2017001_warehouse]'.
Processing Table '[dbo].[_test01_dealers_in_storage_detail]'.
Processing Table '[dbo].[_test01_dismantle_pile_stack]'.
Processing Table '[dbo].[_XJYTL_out_storage]'.
Processing Table '[dbo].[_TEST2017001_warehouse_stock]'.
Processing Table '[dbo].[_test01_dealers_warehouse]'.
Processing Table '[dbo].[_test01_distribution_acct_reg_audit]'.
Processing Table '[dbo].[_XJYTL_out_storage_detail]'.
Processing Table '[dbo].[_TEST2017001_warehouse_stock_check_plan]'.
Processing Table '[dbo].[_test01_distribution_rebate]'.
Processing Table '[dbo].[_test01_distribution_acct_role]'.
Processing Table '[dbo].[_XJYTL_out_storage_terminal_user]'.
Processing Table '[dbo].[_TEST2017001_warehouse_stock_check_task]'.
Processing Table '[dbo].[_test01_distribution_rebate_activity]'.
Processing Table '[dbo].[_test01_distribution_dealers]'.
Processing Table '[dbo].[_XJYTL_pack_standard]'.
Processing Table '[dbo].[_TEST2017001_warehouse_stock_details]'.
Processing Table '[dbo].[_test01_distribution_rebate_activity_detail]'.
Processing Table '[dbo].[_distribution_dealers_acct]'.
Processing Table '[dbo].[_XJYTL_product]'.
Processing Table '[dbo].[_TEST2017001_workshop]'.
Processing Table '[dbo].[_test01_distribution_rebate_audit]'.
Processing Table '[dbo].[_test01_distribution_role]'.
Processing Table '[dbo].[_XJYTL_product_category]'.
Processing Table '[dbo].[_test01_dealers_devanning_packing_box]'.
Processing Table '[dbo].[_test01_distribution_rebate_condition]'.
Processing Table '[dbo].[_test01_distribution_role_fields]'.
Processing Table '[dbo].[_XJYTL_product_line]'.
Processing Table '[dbo].[_test01_dealers_dismantle_pile_stack]'.
Processing Table '[dbo].[_test01_distribution_rebate_detail]'.
Processing Table '[dbo].[_test01_distribution_role_res]'.
Processing Table '[dbo].[_XJYTL_product_tag]'.
Processing Table '[dbo].[_test01_dealers_in_storage_terminal_user]'.
Processing Table '[dbo].[_test01_distribution_rebate_scan_code]'.
Processing Table '[dbo].[_test01_distribution_sys_res]'.
Processing Table '[dbo].[_XJYTL_product_tag_mapping]'.
Processing Table '[dbo].[_test01_distribution_rebate_strategy]'.
Processing Table '[dbo].[_enterprise]'.
Processing Table '[dbo].[_XJYTL_product_team]'.
Processing Table '[dbo].[_test01_dealers_out_storage_detail]'.
Processing Table '[dbo].[_TEST2017001_dealer_stock]'.
Processing Table '[dbo].[_test01_factory]'.
Processing Table '[dbo].[_XJYTL_production_data_uploads]'.
Processing Table '[dbo].[_test01_dealers_out_storage_terminal_user]'.
Processing Table '[dbo].[_TEST2017001_dealers]'.
Processing Table '[dbo].[_test01_in_storage]'.
Processing Table '[dbo].[_XJYTL_production_plan]'.
Processing Table '[dbo].[_test01_dealers_stock]'.
Processing Table '[dbo].[_TEST2017001_dealers_devanning_packing_box]'.
Processing Table '[dbo].[_test01_in_storage_detail]'.
Processing Table '[dbo].[_XJYTL_production_task]'.
Processing Table '[dbo].[_test01_ipc_user_info]'.
Processing Table '[dbo].[_TEST2017001_dealers_dismantle_pile_stack]'.
Processing Table '[dbo].[_test01_in_storage_terminal_user]'.
Processing Table '[dbo].[_XJYTL_production_task_status]'.
Processing Table '[dbo].[_TEST2017001_dealers_in_storage]'.
Processing Table '[dbo].[_test01_ipc]'.
Processing Table '[dbo].[_XJYTL_qr_code_publish_record]'.
Processing Table '[dbo].[_TEST2017001_dealers_out_storage]'.
Processing Table '[dbo].[_TEST2017001_dealers_in_storage_detail]'.
Processing Table '[dbo].[_XJYTL_sales_area]'.
Processing Table '[dbo].[_TEST2017001_dealers_in_storage_terminal_user]'.
Processing Table '[dbo].[_test01_machine_halt_reason]'.
Processing Table '[dbo].[_XJYTL_sys_config]'.
Processing Table '[dbo].[_test01_dealers_out_storage]'.
Processing Table '[dbo].[_test01_out_storage]'.
Processing Table '[dbo].[_XJYTL_terminal]'.
Processing Table '[dbo].[_test01_dealers_stock_details]'.
Processing Table '[dbo].[_TEST2017001_dealers_out_storage_detail]'.
Processing Table '[dbo].[_test01_out_storage_detail]'.
Processing Table '[dbo].[_XJYTL_terminal_user_info]'.
Processing Table '[dbo].[_TEST2017001_dealers_stock_details]'.
Processing Table '[dbo].[_TEST2017001_dealers_out_storage_terminal_user]'.
Processing Table '[dbo].[_test01_out_storage_terminal_user]'.
Processing Table '[dbo].[_XJYTL_users]'.
Processing Table '[dbo].[_TEST2017001_dealers_stock]'.
Processing Table '[dbo].[_test01_pack_standard]'.
Processing Table '[dbo].[_XJYTL_warehouse]'.
Processing Table '[dbo].[_TEST2017001_dealers_warehouse]'.
Processing Table '[dbo].[_test01_product]'.
Processing Table '[dbo].[_XJYTL_warehouse_stock]'.
Processing Table '[dbo].[_TEST2017001_devanning_packing_box]'.
Processing Table '[dbo].[_test01_product_category]'.
Processing Table '[dbo].[_XJYTL_warehouse_stock_check_plan]'.
Processing Table '[dbo].[_TEST2017001_dismantle_pile_stack]'.
Processing Table '[dbo].[_test01_product_line]'.
Processing Table '[dbo].[_XJYTL_warehouse_stock_check_task]'.
Processing Table '[dbo].[_TEST2017001_distribution_acct_reg_audit]'.
Processing Table '[dbo].[_test01_product_tag]'.
Processing Table '[dbo].[_XJYTL_warehouse_stock_details]'.
Processing Table '[dbo].[_TEST2017001_distribution_acct_role]'.
Processing Table '[dbo].[_test01_product_tag_mapping]'.
Processing Table '[dbo].[_XJYTL_workshop]'.
Processing Table '[dbo].[_TEST2017001_distribution_dealers]'.
Processing Table '[dbo].[_test01_product_team]'.
Processing Table '[dbo].[_XJYTL_inspection_records]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate]'.
Processing Table '[dbo].[_test01_production_data_uploads]'.
Processing Table '[dbo].[_XJYTL_inspection_records_detail]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate_activity]'.
Processing Table '[dbo].[_test01_production_plan]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate_activity_detail]'.
Processing Table '[dbo].[_test01_production_task]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate_audit]'.
Processing Table '[dbo].[_test01_production_task_status]'.
Processing Table '[dbo].[_XJYTL_dealers_stock_details]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate_condition]'.
Processing Table '[dbo].[_test01_sales_area]'.
Processing Table '[dbo].[_XJYTL_dealers]'.
Processing Table '[dbo].[_test01_sys_config]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate_detail]'.
Processing Table '[dbo].[_XJYTL_dealers_devanning_packing_box]'.
Processing Table '[dbo].[_test01_terminal]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate_scan_code]'.
Processing Table '[dbo].[_XJYTL_dealers_dismantle_pile_stack]'.
Processing Table '[dbo].[_test01_terminal_user_info]'.
Processing Table '[dbo].[_TEST2017001_distribution_rebate_strategy]'.
Successfully exported database and saved it to file 'e:\backup\sc-test\20171009.bacpac'.
E:\backup>
匯入資料庫命令:
sqlpackage.exe /Action:Import /tsn:< server_name > /tdn:< database_name > /tu:< user_name > /tp:< password > /sf:< source_file >
引數 說明
< server_name > 目標伺服器名稱
< database_name > 目標資料庫名稱
< user_name > 目標伺服器中的使用者名稱
< password > 使用者的密碼
< source_file > 要匯入的 BACPAC 檔案的檔名和位置
匯入到資料庫例子
匯入到本地SQLServer資料庫:
E:\backup>SqlPackage.exe /a:import /tcs:"Data Source=192.168.0.1,9880;Initatalog=GylPlatform;User Id=sa;Password=123456" /sf:E:test.bacpac
Importing to database 'GylPlatform' on server '192.168.0.1,9880'.
Creating deployment plan
Initializing deployment
Verifying deployment plan
Analyzing deployment plan
Importing package schema and data into database
Updating database
Importing data
Processing Import.
Disabling indexes.
Processing Table '[dbo].[_admin_area]'.
Processing Table '[dbo].[_admin_area_test]'.
Processing Table '[dbo].[_distribution_dealers_acct]'.
Processing Table '[dbo].[_enterprise]'.
Processing Table '[dbo].[_SCTest_dealer_stock]'.
Processing Table '[dbo].[_SCTest_dealers]'.
Processing Table '[dbo].[_SCTest_dealers_devanning_packing_box]'.
Processing Table '[dbo].[_SCTest_dealers_dismantle_pile_stack]'.
Processing Table '[dbo].[_SCTest_dealers_in_storage]'.
Processing Table '[dbo].[_SCTest_dealers_in_storage_detail]'.
Processing Table '[dbo].[_SCTest_dealers_in_storage_terminal_user]'.
Processing Table '[dbo].[_SCTest_dealers_out_storage]'.
Processing Table '[dbo].[_SCTest_dealers_out_storage_detail]'.
Processing Table '[dbo].[_SCTest_dealers_out_storage_terminal_user]'.
Processing Table '[dbo].[_SCTest_dealers_stock]'.
Processing Table '[dbo].[_SCTest_dealers_stock_details]'.
Processing Table '[dbo].[_SCTest_dealers_warehouse]'.
Processing Table '[dbo].[_SCTest_devanning_packing_box]'.
Processing Table '[dbo].[_SCTest_dismantle_pile_stack]'.
Processing Table '[dbo].[_SCTest_distribution_acct_reg_audit]'.
Processing Table '[dbo].[_SCTest_distribution_acct_role]'.
Processing Table '[dbo].[_SCTest_distribution_dealers]'.
Processing Table '[dbo].[_SCTest_distribution_rebate]'.
Processing Table '[dbo].[_SCTest_distribution_rebate_activity]'.
Processing Table '[dbo].[_SCTest_distribution_rebate_activity_detail]'.
Processing Table '[dbo].[_SCTest_distribution_rebate_audit]'.
Processing Table '[dbo].[_SCTest_distribution_rebate_condition]'.
Processing Table '[dbo].[_SCTest_distribution_rebate_detail]'.
Processing Table '[dbo].[_SCTest_distribution_rebate_scan_code]'.
Processing Table '[dbo].[_SCTest_distribution_rebate_strategy]'.
Processing Table '[dbo].[_SCTest_distribution_role]'.
Processing Table '[dbo].[_SCTest_distribution_role_fields]'.
Processing Table '[dbo].[_SCTest_distribution_role_res]'.
Processing Table '[dbo].[_SCTest_distribution_sys_res]'.
Processing Table '[dbo].[_SCTest_distribution_terminal_shop]'.
Processing Table '[dbo].[_SCTest_factory]'.
Processing Table '[dbo].[_SCTest_in_storage]'.
Processing Table '[dbo].[_SCTest_in_storage_detail]'.
Processing Table '[dbo].[_SCTest_in_storage_terminal_user]'.
Processing Table '[dbo].[_SCTest_ipc]'.
Processing Table '[dbo].[_SCTest_ipc_user_info]'.
Processing Table '[dbo].[_SCTest_machine_halt_reason]'.
Processing Table '[dbo].[_SCTest_out_storage]'.
Processing Table '[dbo].[_SCTest_out_storage_detail]'.
Processing Table '[dbo].[_SCTest_out_storage_terminal_user]'.
Processing Table '[dbo].[_SCTest_pack_standard]'.
Processing Table '[dbo].[_SCTest_product]'.
Processing Table '[dbo].[_SCTest_product_category]'.
Processing Table '[dbo].[_SCTest_product_line]'.
Processing Table '[dbo].[_SCTest_product_tag]'.
Processing Table '[dbo].[_SCTest_product_tag_mapping]'.
Processing Table '[dbo].[_SCTest_product_team]'.
Processing Table '[dbo].[_SCTest_production_data_uploads]'.
Processing Table '[dbo].[_SCTest_production_plan]'.
Processing Table '[dbo].[_SCTest_production_task]'.
Processing Table '[dbo].[_SCTest_production_task_status]'.
Processing Table '[dbo].[_SCTest_qr_code_publish_record]'.
Processing Table '[dbo].[_SCTest_sales_area]'.
Processing Table '[dbo].[_SCTest_sys_config]'.
Processing Table '[dbo].[_SCTest_terminal]'.
Processing Table '[dbo].[_SCTest_terminal_user_info]'.
Processing Table '[dbo].[_SCTest_users]'.
Processing Table '[dbo].[_SCTest_warehouse]'.
Processing Table '[dbo].[_SCTest_warehouse_stock]'.
Processing Table '[dbo].[_SCTest_warehouse_stock_check_plan]'.
Processing Table '[dbo].[_SCTest_warehouse_stock_check_task]'.
Processing Table '[dbo].[_SCTest_warehouse_stock_details]'.
Processing Table '[dbo].[_SCTest_workshop]'.
Processing Table '[dbo].[_test]'.
Processing Table '[dbo].[_test_devanning_packing_box]'.
Processing Table '[dbo].[_test_dismantle_pile_stack]'.
Processing Table '[dbo].[_test_in_storage]'.
Processing Table '[dbo].[_test_in_storage_detail]'.
Processing Table '[dbo].[_test_in_storage_terminal_user]'.
Processing Table '[dbo].[_test_out_storage]'.
Processing Table '[dbo].[_test_out_storage_detail]'.
Processing Table '[dbo].[_test_out_storage_terminal_user]'.
Processing Table '[dbo].[_test_stock]'.
Processing Table '[dbo].[_test_stock_details]'.
Processing Table '[dbo].[_test_warehouse]'.
Processing Table '[dbo].[_XJYTL_devanning_packing_box]'.
Processing Table '[dbo].[_XJYTL_dismantle_pile_stack]'.
Processing Table '[dbo].[_XJYTL_distribution_acct_reg_audit]'.
Processing Table '[dbo].[_XJYTL_distribution_acct_role]'.
Processing Table '[dbo].[_XJYTL_distribution_dealers]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_activity]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_activity_detail]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_audit]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_condition]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_detail]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_scan_code]'.
Processing Table '[dbo].[_XJYTL_distribution_rebate_strategy]'.
Processing Table '[dbo].[_XJYTL_distribution_role]'.
Processing Table '[dbo].[_XJYTL_distribution_role_fields]'.
Processing Table '[dbo].[_XJYTL_distribution_role_res]'.
Processing Table '[dbo].[_XJYTL_distribution_sys_res]'.
Processing Table '[dbo].[_XJYTL_distribution_terminal_shop]'.
Processing Table '[dbo].[_XJYTL_factory]'.
Processing Table '[dbo].[_XJYTL_in_storage]'.
Processing Table '[dbo].[_XJYTL_in_storage_detail]'.
Processing Table '[dbo].[_XJYTL_in_storage_terminal_user]'.
Processing Table '[dbo].[_XJYTL_inspection_records]'.
Processing Table '[dbo].[_XJYTL_inspection_records_detail]'.
Processing Table '[dbo].[_XJYTL_ipc]'.
Processing Table '[dbo].[_XJYTL_ipc_user_info]'.
Processing Table '[dbo].[_XJYTL_machine_halt_reason]'.
Processing Table '[dbo].[_XJYTL_out_storage]'.
Processing Table '[dbo].[_XJYTL_out_storage_detail]'.
Processing Table '[dbo].[_XJYTL_out_storage_terminal_user]'.
Processing Table '[dbo].[_XJYTL_pack_standard]'.
Processing Table '[dbo].[_XJYTL_product]'.
Processing Table '[dbo].[_XJYTL_product_category]'.
Processing Table '[dbo].[_XJYTL_workshop]'.
Processing Table '[dbo].[_test_dealer_product]'.
Processing Table '[dbo].[_test_dealer_stock]'.
Processing Table '[dbo].[_test_dealers]'.
Processing Table '[dbo].[_test_dealers_devanning_packing_box]'.
Processing Table '[dbo].[_test_dealers_dismantle_pile_stack]'.
Processing Table '[dbo].[_test_dealers_in_storage]'.
Processing Table '[dbo].[_test_dealers_in_storage_detail]'.
Processing Table '[dbo].[_test_dealers_in_storage_terminal_user]'.
Processing Table '[dbo].[_test_dealers_out_storage]'.
Processing Table '[dbo].[_test_dealers_out_storage_detail]'.
Processing Table '[dbo].[_test_dealers_out_storage_terminal_user]'.
Processing Table '[dbo].[_test_dealers_stock]'.
Processing Table '[dbo].[_test_dealers_stock_details]'.
Processing Table '[dbo].[_test_dealers_warehouse]'.
Processing Table '[dbo].[_test_devanning_packing_box]'.
Processing Table '[dbo].[_test_dismantle_pile_stack]'.
Processing Table '[dbo].[_test_distribution_acct_reg_audit]'.
Processing Table '[dbo].[_test_distribution_acct_role]'.
Processing Table '[dbo].[_test_distribution_dealers]'.
Processing Table '[dbo].[_test_distribution_rebate]'.
Processing Table '[dbo].[_test_distribution_rebate_activity]'.
Processing Table '[dbo].[_test_distribution_rebate_activity_detail]'.
Processing Table '[dbo].[_test_distribution_rebate_audit]'.
Processing Table '[dbo].[_test_distribution_rebate_condition]'.
Processing Table '[dbo].[_test_distribution_rebate_detail]'.
Processing Table '[dbo].[_test_distribution_rebate_scan_code]'.
Processing Table '[dbo].[_test_distribution_rebate_strategy]'.
Processing Table '[dbo].[_test_distribution_role]'.
Processing Table '[dbo].[_test_distribution_role_fields]'.
Processing Table '[dbo].[_test_distribution_role_res]'.
Processing Table '[dbo].[_test_distribution_sys_res]'.
Processing Table '[dbo].[_test_distribution_terminal_shop]'.
Processing Table '[dbo].[_test_factory]'.
Processing Table '[dbo].[_test_in_storage]'.
Processing Table '[dbo].[_test_in_storage_detail]'.
Processing Table '[dbo].[_test_in_storage_terminal_user]'.
Processing Table '[dbo].[_test_ipc]'.
Processing Table '[dbo].[_test_ipc_user_info]'.
Processing Table '[dbo].[_test_machine_halt_reason]'.
Processing Table '[dbo].[_test_out_storage]'.
Processing Table '[dbo].[_test_out_storage_detail]'.
Processing Table '[dbo].[_test_out_storage_terminal_user]'.
Processing Table '[dbo].[_test_pack_standard]'.
Processing Table '[dbo].[_test_product]'.
Processing Table '[dbo].[_test_product_category]'.
Processing Table '[dbo].[_test_product_line]'.
Processing Table '[dbo].[_test_product_tag]'.
Processing Table '[dbo].[_test_product_tag_mapping]'.
Processing Table '[dbo].[_test_product_team]'.
Processing Table '[dbo].[_test_production_data_uploads]'.
Processing Table '[dbo].[_test_production_plan]'.
Processing Table '[dbo].[_test_production_task]'.
Processing Table '[dbo].[_test_production_task_status]'.
Processing Table '[dbo].[_test_qr_code_publish_record]'.
Processing Table '[dbo].[_test_sales_area]'.
Processing Table '[dbo].[_test_sys_config]'.
Processing Table '[dbo].[_test_terminal]'.
Processing Table '[dbo].[_test_terminal_user_info]'.
Processing Table '[dbo].[_test_users]'.
Processing Table '[dbo].[_test_warehouse]'.
Processing Table '[dbo].[_test_warehouse_stock]'.
Processing Table '[dbo].[_test_warehouse_stock_check_plan]'.
Processing Table '[dbo].[_test_warehouse_stock_check_task]'.
Processing Table '[dbo].[_test_warehouse_stock_details]'.
Processing Table '[dbo].[_test_workshop]'.
Processing Table '[dbo].[gyl_test_table]'.
Enabling indexes.
Successfully imported database.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15498/viewspace-2145763/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 怎樣將SQL Azure資料庫備份到本地或者StorageSQL資料庫
- 將資料庫備份到AZURE blob storage資料庫
- 備份SQL Server資料庫SQLServer資料庫
- SQL Server資料庫備份SQLServer資料庫
- SQL資料庫備份管理SQL資料庫
- SQL備份資料庫程式碼SQL資料庫
- sql server 資料庫備份方案SQLServer資料庫
- SQL Server資料庫備份出錯及應對措施SQLServer資料庫
- SQL Azure雲資料庫SQL資料庫
- MS SQL Server 資料庫備份方法SQLServer資料庫
- 備份和恢復SQL Server資料庫SQLServer資料庫
- 細說SQL Server資料庫備份方法SQLServer資料庫
- 資料庫備份資料庫
- SQL SERVER備份資料庫檔案(使用SSMS)SQLServer資料庫SSM
- 資料丟失如當頭棒喝,資料備份重如山!
- SQL Server 資料庫備份還原和資料恢復SQLServer資料庫資料恢復
- SQL Server2019資料庫備份與還原指令碼,資料庫可批量備份SQLServer資料庫指令碼
- Jtti:sql server怎麼增量備份資料庫JttiSQLServer資料庫
- SQL Server 2008 完整資料庫備份SQLServer資料庫
- mysql 資料庫 備份MySql資料庫
- 資料庫備份策略資料庫
- MongoDB資料庫備份MongoDB資料庫
- mysql 資料庫備份MySql資料庫
- 資料庫備份方案資料庫
- oracle資料庫備份之exp增量備份Oracle資料庫
- 如何利用Rman對Oracle資料庫進行備份Oracle資料庫
- 備份後,對資料庫的穩定性檢查資料庫
- 用java做oracle資料庫備份有問題!急急急!!!JavaOracle資料庫
- oracle 備份資料庫,匯出資料庫Oracle資料庫
- SQL Server資料庫備份保護的關鍵UMSQLServer資料庫
- 自動備份SQL資料庫到雲端儲存StorageSQL資料庫
- SQL Server 2008還原資料庫備份SQLServer資料庫
- SQL Server 2008 建立完整資料庫備份SQLServer資料庫
- SQL Server資料庫在ASP.NET中的備份SQLServer資料庫ASP.NET
- SQL SERVER 2000 資料庫備份與還原SQLServer資料庫
- 雲資料庫SQL Azure的基本限制TX資料庫SQL
- Sequelize 連線微軟雲資料庫 SQL Azure微軟資料庫SQL
- SQL Azure方便開發者踏上雲資料庫之路SQL資料庫