April 15, 2005 at 11:59 am
I am running a DTS package that makes a backup of a production database and then restores that backup as a reporting database every three hours. The problem I have is that when I restore the database, not all Views are there. The original DB has 23,000 views, but the restored DB only has 18,000. Does anyone know what is going on?
Here are my scripts:
BACKUP:
BACKUP DATABASE
ADPPROD
TO
DISK = N'D:\Backup\ADPPROD.bak'
WITH
INIT ,
NOUNLOAD ,
NAME = N'ADPPROD backup for Reporting',
NOSKIP ,
STATS = 10,
NOFORMAT
RESTORE:
RESTORE DATABASE
ADPPROD_REPORTING
FROM
DISK = N'D:\MSSBACKUP\adpprod'
WITH
FILE = 1,
NOUNLOAD ,
STATS = 10,
RECOVERY ,
REPLACE ,
MOVE N'ADP_DATA01' TO N'D:\mssdata\ADPPROD\ADPPROD_REPORTING_1.mdf',
MOVE N'ADP_INDEX01' TO N'D:\mssdata\ADPPROD\ADPPROD_REPORTING_2.mdf',
MOVE N'ADP_LOG01' TO N'D:\mssdata\ADPPROD\ADPPROD_REPORTING_log.ldf',
MOVE N'ADP_PRIMARY' TO N'D:\mssdata\ADPPROD\ADPPROD_REPORTING.mdf'
Thanks!
Clif
April 15, 2005 at 12:37 pm
Run "select count(*) from sysobjects where xtype = 'V'" on your original database and the database you restored.
In your backup command, you create the backup in "DISK = N'D:\Backup\ADPPROD.bak' " but in your restore command, you specify different file "DISK = N'D:\MSSBACKUP\adpprod' ", That could be the problem.
April 15, 2005 at 12:40 pm
OOPS! My typo mistake. Thank you for catching that for me. I will correct the restore script and try again.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply