I have a client that is using the free MSDE database engine. There is no graphical interface that I know of to manage the day-to-day tasks. I need to do a daily backup to a disk file. I want to start the backup at 7:40pm. My client then will copy that disk file to tape duing his system-wide backup at midnight. I setup a batch file and executed it in osql but the job is not working. No disk file has been created in the last 3 weeks. I don't have a clue what I am missing. Can someone please look at this and tell me how to fix it?
Thanks in Advance!
Debbie Erickson
USE master
EXEC msdb..sp_delete_jobserver
@.job_name='PetDB Backup',
@.server_name='Server06'
GO
USE master
EXEC msdb..sp_delete_jobschedule
@.job_name='PetDB Backup',
@.name = 'ScheduledBackup'
GO
USE master
EXEC msdb..sp_delete_jobstep
@.job_name='PetDB Backup',
@.step_id=0
GO
USE master
EXEC msdb..sp_delete_job
@.job_name='PetDB Backup'
GO
USE master
EXEC msdb..sp_add_job
@.job_name='PetDB Backup',
@.enabled=1,
@.description='Backup Petdb'
GO
USE master
EXEC msdb..sp_add_jobstep
@.job_name='PetDB Backup',
@.step_name='Nightly petdb maint',
@.subsystem='TSQL',
@.command='BACKUP DATABASE Petdb TO DISK = ''E:Petlic\Data Backup\Petdb.bak''',
@.database_name='petdb'
GO
USE master
EXEC msdb..sp_add_jobschedule
@.job_name='PetDB Backup',
@.name = 'ScheduledBackup',
@.freq_type=4,
@.freq_interval=1,
@.active_start_time='194000'
GO
USE master
EXEC msdb..sp_add_jobserver
@.job_name='PetDB Backup',
@.server_name='Server06'
GO
Hello again. I decided to go a slightly different path. The backup statement works fine in osql. So I put that command in a text file by itself. Then I created a dos batch file that runs osql with sql batch file. Then I used a windows scheduler to run my dos batch file. Not exactly how I wanted to solve this, but it works.
Debbie
No comments:
Post a Comment