Author |
Topic |
gorashy
Starting Member
15 Posts |
Posted - 2015-01-11 : 18:01:07
|
hi ,allhi,tarawhen I tried to restore the database on mirror server I got the follwing errorMsg 3154, Level 16, State 4, Line 1The backup set holds a backup of a database other than the existing 'mirror' database.Msg 3013, Level 16, State 1, Line 1RESTORE DATABASE is terminating abnormally.the code I wrote as followsRESTORE DATABASE mirrorFROM DISK = 'C:\backup\mymirror.bak'WITH NORECOVERYplease help |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2015-01-12 : 09:10:34
|
Please post the results of RESTORE FILELISTONLY from your backup file. |
|
|
gorashy
Starting Member
15 Posts |
Posted - 2015-01-12 : 10:10:28
|
sorry gbritton, I am new to sql server, what is FILELISTONLY? |
|
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2015-01-12 : 11:05:51
|
Did you look it up?e.g.RESTORE FILELISTONLY FROM StorageMor_Backup WITH FILE = 1GO returnsLogicalName PhysicalName Type FileGroupName StorageMor C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014EXPRESS\MSSQL\DATA\StorageMor.mdf D PRIMARY StorageMor_log C:\Program Files\Microsoft SQL Server\MSSQL12.SQL2014EXPRESS\MSSQL\DATA\StorageMor_log.ldf L NULL |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
gorashy
Starting Member
15 Posts |
Posted - 2015-01-13 : 12:12:25
|
it returned the followingLogicalName PhysicalName Type FileGroupName Size MaxSize FileId CreateLSN DropLSN UniqueId ReadOnlyLSN ReadWriteLSN BackupSizeInBytes SourceBlockSize FileGroupId LogGroupGUID DifferentialBaseLSN DifferentialBaseGUID IsReadOnly IsPresent TDEThumbprint-------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---- -------------------------------------------------------------------------------------------------------------------------------- -------------------- -------------------- -------------------- --------------------------------------- --------------------------------------- ------------------------------------ --------------------------------------- --------------------------------------- -------------------- --------------- ----------- ------------------------------------ --------------------------------------- ------------------------------------ ---------- --------- ------------------------------------------mirror C:\Program Files\Microsoft SQL Server\MSSQL12.MYPUBLISHER\MSSQL\DATA\mirror.mdf D PRIMARY 5242880 35184372080640 1 0 0 344EB430-44D3-4780-8CEC-2D2596E2FB5C 0 0 2818048 512 1 NULL 41000000018100037 956B5417-8A0E-4F1A-8D48-B69FB749E4CF 0 1 NULLmirror_log C:\Program Files\Microsoft SQL Server\MSSQL12.MYPUBLISHER\MSSQL\DATA\mirror_log.ldf L NULL 2359296 2199023255552 2 0 0 E2E2D7ED-F586-4EEF-9510-1CFBE5438D11 0 0 0 512 0 NULL 0 00000000-0000-0000-0000-000000000000 0 1 NULL(2 row(s) affected) |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2015-01-13 : 12:48:46
|
Add REPLACE to your command.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
gorashy
Starting Member
15 Posts |
Posted - 2015-01-13 : 14:02:36
|
USE [master]BACKUP LOG [mirror] TO DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MYPUBLISHER\MSSQL\Backup\mirror_LogBackup_2015-01-13_10-28-10.bak' WITH NOFORMAT, NOINIT, NAME = N'mirror_LogBackup_2015-01-13_10-28-10', NOSKIP, NOREWIND, NOUNLOAD, NORECOVERY , STATS = 5RESTORE DATABASE [mirror] FROM DISK = N'C:\mirrorbackup\mymirror.bak' WITH FILE = 1, NORECOVERY, NOUNLOAD, REPLACE, STATS = 5GObut failedI got the following errorMsg 3104, Level 16, State 1, Line 2RESTORE cannot operate on database 'mirror' because it is configured for database mirroring or has joined an availability group. If you intend to restore the database, use ALTER DATABASE to remove mirroring or to remove the database from its availability group.Msg 3013, Level 16, State 1, Line 2BACKUP LOG is terminating abnormally.Msg 3104, Level 16, State 1, Line 3RESTORE cannot operate on database 'mirror' because it is configured for database mirroring or has joined an availability group. If you intend to restore the database, use ALTER DATABASE to remove mirroring or to remove the database from its availability group.Msg 3013, Level 16, State 1, Line 3RESTORE DATABASE is terminating abnormally. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2015-01-13 : 14:10:30
|
The error indicates mirroring is already in place. If you are starting over, then you need to first remove mirroring.This is the command: ALTER DATABASE dbname SET PARTNER OFFTara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
gorashy
Starting Member
15 Posts |
Posted - 2015-01-15 : 14:11:51
|
It worked finereturned100 percent processed.Processed 5 pages for database 'mirror', file 'mirror_log' on file 1.BACKUP LOG successfully processed 5 pages in 0.218 seconds (0.147 MB/sec).7 percent processed.12 percent processed.17 percent processed.21 percent processed.26 percent processed.31 percent processed.36 percent processed.41 percent processed.46 percent processed.51 percent processed.55 percent processed.60 percent processed.65 percent processed.70 percent processed.75 percent processed.80 percent processed.85 percent processed.92 percent processed.97 percent processed.100 percent processed.Processed 328 pages for database 'mirror', file 'mirror' on file 1.Processed 2 pages for database 'mirror', file 'mirror_log' on file 1.RESTORE DATABASE successfully processed 330 pages in 0.685 seconds (3.752 MB/sec).35 percent processed.70 percent processed.100 percent processed.Processed 0 pages for database 'mirror', file 'mirror' on file 2.Processed 23 pages for database 'mirror', file 'mirror_log' on file 2.RESTORE LOG successfully processed 23 pages in 0.083 seconds (2.129 MB/sec).what is the next step?do I issue the following command?alter database mirror set partner onplease be patient |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
gorashy
Starting Member
15 Posts |
Posted - 2015-01-16 : 16:55:55
|
very good blog, Tara |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|