Hello - I am a newbie and trying to apply multiple transaction logs to a database.
Below is my script - I wrote it weeks ago and do not understand how I can use 'NJnew' (this is the logical name?) in the command "MOVE N'NJnew' TO "
Here is the whole thing....
First back up the database, full recovery
then apply transaction logs...
then restore the database ...
The script makes sense to me except for the MOVE N'NJnew' part - I don't understand where the string 'NJnew' is being assigned to be used with the MOVE command
Also, will this work? I'm not able to test the script and a coworker believes I must
1- Back up the existing database
2- Drop the existing database
3- Restore the database
4- Apply tranlog
5- Open database
Thanks in advance for any input
Dave
Below is my script - I wrote it weeks ago and do not understand how I can use 'NJnew' (this is the logical name?) in the command "MOVE N'NJnew' TO "
Code:
RESTORE DATABASE [NJCCCS$DOE_Dev3] FROM DISK = N'J:\DCF_TEST\TEST_DEEGAN_BACKUP\testbackupfilename'
WITH RECOVERY,
MOVE N'NJnew' TO N'E:\MSSQL10.MSSQLSERVER\MSSQL\Data\NJCCCS$DOE_Dev3.mdf',
MOVE N'NJnew_log' TO N'G:\MSSQL10.MSSQLSERVER\MSSQL\TransLog\NJCCCS$DOE_Dev3.ldf',
NOUNLOAD, STATS = 10
Here is the whole thing....
First back up the database, full recovery
Code:
BACKUP DATABASE [NJCCCS$DOE_Dev3]
TO DISK = N'J:\DCF_TEST\TEST_DEEGAN_BACKUP\testbackupfilename'
WITH NOFORMAT, NOINIT,
NAME = N'NJCCCS$DOE_Dev3-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
then apply transaction logs...
Code:
RESTORE LOG [NJCCCS$DOE_Dev3] FROM DISK = 'J:\DCF_TEST\NJNEW_20101018040002.trn' WITH NORECOVERY
RESTORE LOG [NJCCCS$DOE_Dev3] FROM DISK = 'J:\DCF_TEST\NJNEW_20101018041502.trn' WITH NORECOVERY
RESTORE LOG [NJCCCS$DOE_Dev3] FROM DISK = 'J:\DCF_TEST\NJNEW_20101018043001.trn' WITH NORECOVERY
then restore the database ...
Code:
RESTORE DATABASE [NJCCCS$DOE_Dev3] FROM DISK = N'J:\DCF_TEST\TEST_DEEGAN_BACKUP\testbackupfilename'
WITH RECOVERY,
MOVE N'NJnew' TO N'E:\MSSQL10.MSSQLSERVER\MSSQL\Data\NJCCCS$DOE_Dev3.mdf',
MOVE N'NJnew_log' TO N'G:\MSSQL10.MSSQLSERVER\MSSQL\TransLog\NJCCCS$DOE_Dev3.ldf',
NOUNLOAD, STATS = 10
The script makes sense to me except for the MOVE N'NJnew' part - I don't understand where the string 'NJnew' is being assigned to be used with the MOVE command
Also, will this work? I'm not able to test the script and a coworker believes I must
1- Back up the existing database
2- Drop the existing database
3- Restore the database
4- Apply tranlog
5- Open database
Thanks in advance for any input
Dave