Create a SQL Agent scheduled task. The task has three steps.
Step 1: Backup the production OnePoint database to a file
BACKUP DATABASE [OnePoint] TO
DISK = N’C:\data\MSSQL$WEBMOM1\BACKUP\OnePointBackup’
WITH INIT , NOUNLOAD , NAME = N’OnePoint backup’, NOSKIP , STATS = 10, NOFORMAT
Step 2: Restore the backup file into the warehouse holding database
RESTORE DATABASE [MOM_HOLDING] FROM
DISK = N’C:\data\sql\MSSQL$MGMTMOM1\BACKUP\OnePointBackup’
WITH FILE=1,NOUNLOAD, STATS=10, RECOVERY, REPLACE,
MOVE ‘EEA_DATA’ to ‘C:\data\MOM_Holding\MOM_Holding_Data.MDF’,
MOVE ‘EEA_LOG’ to ‘C:\data\MOM_Holding\MOM_Holding_Log.LDF’
Step 3: Execute the data warehouse DTS (see notes below)
DTSRun /~E0C11DE740D058919D24F7CCCA76FF726…very long identifier
Notes:
There are a number of configuration tasks that needs to takes place (such as configuring the DTS). Refer to the MOM data warehousing document for the details. The long string after DTSRUN is unique on each box. After you save the DTS package locally on SQL, schedule the DTS package, open the scheduled task to see what the DTS’s identifier is on your machine.