You can schedule or automate data export tasks with the help of Data Pump, a task scheduler tool, and a PowerShell script.
Scheduling data export involves the following steps:
First, you need to create a template file for exporting database data.
To create a template file:
1. In Object Explorer, right-click the database you want to export data from, point to Data Pump, and click Export Data.
2. In the Data Export Wizard that opens, go through all wizard tabs and specify the necessary information and settings.
3. When all the necessary settings were made, click Save Template on any of the wizard’s tabs.
Note
- The generated file does not contain password information for security purposes. If the Save Password option is enabled for the selected connection in dbForge Data Pump for SQL Server, you should not do anything regarding the password. If it is not, then you should define the password with the help of the /password option.
- To create a template file, it is not necessary to click Export in the wizard and run the export process.
1. Open any Text editor and type the following command:
"C:\Program Files\Devart\dbForge SQL Tools Professional\dbForge Data Pump for SQL Server\datapump.com" /dataexport /templatefile:<filepath>
Where:
filepath is a path to the template file created in the previous step.
2. Save the file with the .bat extension.
After the batch file for database data export was created, we can proceed with the creation of the export task using the Windows Task Scheduler so that the computer can carry out the task automatically.
To create a Windows synchronization task:
1. Open the Control Panel > Administrative Tools and select Task Scheduler.
2. In the Task Scheduler window that opens, navigate to the Actions pane and click Create Basic Task to create a scheduled task.
Note
For quick access to the Task Scheduler, just start typing task in the Windows 10 search bar. Once you see the Task Scheduler in the list, click it to open.
3. In the Create Basic Task Wizard window that opens, specify the name and description of the task and click Next.
4. On the Trigger tab, choose when to launch the task and then click Next.
5. On the Action tab, click Start a program to schedule a program to start automatically and then click Next.
6. On the Start a Program subtab, click Browse to select the .bat file you have created in the previous step and then click Next.
There are optional fields that you can set:
7. On the Finish tab, verify the settings and click Finish.
The task will be displayed in the Active Tasks section.