The backup scheduler in Teratrax Database Manager provides more control over backups by allowing you to customize the actual SQL script the scheduler runs. The following example illustrates the steps required to add archiving to your backups. The resulting backup job will keep separate backup files with time stamps instead of overwriting the backup file every time the scheduler runs:
Beekeeper Studio는 무료 & 오픈 소스 데이터베이스 GUI입니다
제가 사용해 본 최고의 SQL 쿼리 & 편집기 도구입니다. 데이터베이스 관리에 필요한 모든 것을 제공합니다. - ⭐⭐⭐⭐⭐ Mit
Beekeeper Studio는 빠르고 직관적이며 사용하기 쉽습니다. Beekeeper는 많은 데이터베이스를 지원하며 Windows, Mac, Linux에서 훌륭하게 작동합니다.
- Connect to your server and navigate to the “Databases” node in the Server Explorer pane.
- Right-click your database name and select “Backup…” (This example uses the Northwind database).
- In the “Backup File” box, enter the path of the backup file (For example, “C:\Northwind.bkp”).
- Click the “Schedule” button to open the Job dialog.
- In the “SQL Script” box, Teratrax Database Manager will generate the following script:
BACKUP DATABASE [Northwind]
TO DISK = N'C:\Northwind.bkp'
WITH INIT, NOUNLOAD, NAME = N'Northwind backup',
NOSKIP, STATS = 10, NOFORMAT
RESTORE VERIFYONLY FROM DISK = N'C:\Northwind.bkp'
- Insert the following code at the beginning of the script (Replace “Northwind_” with your own path and file name):
DECLARE @filename VARCHAR(255)
SELECT @filename = 'c:\Northwind_' +
LTRIM(STR(DATEPART(year, GETDATE()))) + '_' +
LTRIM(STR(DATEPART(month, GETDATE()))) + '_' +
LTRIM(STR(DATEPART(day, GETDATE()))) + '_' +
LTRIM(STR(DATEPART(hour, GETDATE()))) + '_' +
LTRIM(STR(DATEPART(minute, GETDATE()))) + '_' +
LTRIM(STR(DATEPART(second, GETDATE()))) + '.bkp'
- Change the original part of the script (Replace “C:\Northwind.bkp” with @filename and “Northwind” with your database name):
BACKUP DATABASE [Northwind]
TO DISK = @filename
WITH INIT, NOUNLOAD, NAME = N'Northwind backup',
NOSKIP, STATS = 10, NOFORMAT
RESTORE VERIFYONLY FROM DISK = @filename
- Set the schedule for the job from the “Schedule” box in the Job dialog.
- Click “Ok” to schedule the backup. This will take you back to the Backup Database dialog. Click “Cancel” to exit.
- Test your backup by navigating to the “Jobs” node in Server Explorer and right-clicking the new job name then selecting “Start”.
At this point, you have a scheduled backup job that will run at the specified date and time. Each resulting backup file will have a different time stamp appended to its name leaving you with an archive of backups at your disposal. Make sure you check disk space from time to time so your disk will not run out of space. Database backups can take a lot of space.
While SQL Agent needs to be running for the job to execute, Teratrax Database Manager does not have to be open when the scheduler runs.