"RESTORE LOG" works even if filegroup doesn't exist?

Hello, everyone!
   I’m working on a Log Shipping scenario where a filegroup  called “MyDatabaseFileStream” only exists on the Primary
database, not at the Secondary. The filegroup in question is huge, and I don’t need a copy on the Secondary. I just need a copy of the “PRIMARY” filegroup, so I use the “FILEGROUP”
when I try to restore the database from a ".bak" file (command below)…
   RESTORE DATABASE MyDatabase
   FILEGROUP = 'PRIMARY'
   FROM DISK = N'D:\MyDatabase.bak'
   WITH
      STANDBY = N'D:\ROLLBACK_UNDO_MyDatabase.BAK'
… and If the path of some file doesn't exist on the server, the restore fails:
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "S:\ MyDatabase.MDF"
failed with the operating system error 3(The system cannot find the path specified.).
Msg 3156, Level 16, State 3, Line 1
File ' MyDatabase_Data'
cannot be restored to 'S:\ MyDatabase.MDF'. Use WITH MOVE to identify a valid location
for the file. Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "S:\ MyDatabase.LDF"
failed with the operating system error 3(The system cannot find the path specified.).
Msg 3156, Level 16, State 3, Line 1
File ' MyDatabase_Log'
cannot be restored to 'S:\ MyDatabase.LDF'. Use WITH MOVE to identify a valid location
for the file. …
   Then, I use "WITH MOVE"...
   RESTORE DATABASE MyDatabase
   FILEGROUP = 'PRIMARY'
   FROM DISK = N'D:\MyDatabase.bak'
   WITH
      STANDBY = N'D:\ROLLBACK_UNDO_MyDatabase.BAK',
      MOVE N'MyDatabase_Data' TO N'D:\MyDatabase.mdf',
      MOVE N'MyDatabase_Log' TO N'D:\MyDatabase.ldf'
... and everything goes fine. The database is restored (database in "Standby/ReadOnly") on the Secondary, without the filegroup
“MyDatabaseFileStream” (just the “PRIMARY”).
Processed 536 pages for database 'MyDatabase', file 'MyDatabase_Data' on file 1.
Processed 1 pages for database 'MyDatabase', file 'MyDatabase_Log' on file 1.
RESTORE DATABASE ... FILE=<name> successfully processed 537 pages in 0.377 seconds (11.128 MB/sec).
   And finally, the question is: when a try to restore a log (from a ".trn" file) using the command below...
RESTORE log MyDatabase
FROM Disk='D:\MyDatabase_20150220184253.trn'
WITH STANDBY = N'D:\ROLLBACK_UNDO_MyDatabase.BAK'
... and the restore succeeds. The command above does not have any filegroup specified, and the restore succeeds even when some transaction
inserts, updates or deletes data from tables based on the “MyDatabaseFileStream” filegroup.
Processed 0 pages for database ' MyDatabase',
file 'MyDatabase_Data' on file 1.
Processed 1 pages for database 'MyDatabase', file 'MyDatabase_Log' on file 1.
RESTORE LOG successfully processed 1 pages in 0.212 seconds (0.020 MB/sec).
   OK, ok… Restoring a log will restore only the log file (nothing at the “PRIMARY”, neither at the “MyDatabaseFileStream”),
but at the next log restore, the data inside
the log file is moved to the data files, correct? The “MyDatabaseFileStream” related data (inside the transaction log) goes where? I was expecting an error at some point (like when restoring the database without the “WITH
MOVE”).
   I'm not complaining. In fact, I'm glad it works. J  But,
at the same time, I'm unsure... Can I rely on this behavior? Am I missing something?

Thank you for your answer Erland.
   I really get an error (Msg 601, Level 12, State
3, Line 1 Could not continue scan with NOLOCK due to data movement.) when I try a select on the table that references the filegroup "MyDatabaseFileStream". And you
are right about the backup, too: if I restore the "Primary" and "MyDatabaseFileStream" filegroups and apply the log backups, I get the database "full" synchronized. So, the "MyDatabaseFileStream" related data are actually
inside the log backups, but as you said they are not applied anywhere if the filegroup is missing.
   Now I understanding better and feeling more confident about the solution for our scenario.

Similar Messages

  • How do I know if my update didn't work because the record doesn't exist

    I am updating a row in a table and I want to know if the update didn't work because the record doesn't exist. Is there any way of knowing this? I want to avoid doing a select first if at all possible. I am using sqlj with Oracle 9i on Linux and JDK 1.3.1.

    I got it. So if anybody else needs to know this here it is.
    import sqlj.runtime.ExecutionContext;
    ExecutionContext ec = new ExecutionContext();
    #sql [ec] {update statement};
    if (ec.getUpdateCount() == 0){
    throw new SQLException("No rows for update");

  • System restore not working, even with recovery disks

    I have a Touchsmart Tx2 1020us. I want to completely restore it to factory settings.
    when i use the recovery manager it pops up saying that there isn't a recovery partition and to insert disk #1. i bought the recovery disk set from HP and put disk 1 in. it then says to click on next. when i click on next the computer just shuts itself down. it never restarts, just turns itself off. 
    i also tried using the "press f11 repeatedly at startup" method. after pressing f11 a ton of times my computer just begins this shrill beeping sound and will not stop until you stop pressing f11. 
    so basically i've tried every method on this page :http://h10025.www1.hp.com/ewfrf/wc/document?cc=us&lc=en&dlc=en&docname=c00809678#N554    with absolutely no results. 
    any ideas on how to get this stupid system restore to work? 

    Hi,
    Since you deleted your recovery partitions and your recovery disk set has issues you will need to purchase a set of recovery disks from HP or from an HP Partner. the cost is around $25.00 USD.
    It is unfortunate, but when you deleted the recovery partitions you limited the options that were previously available to you.
    Nonexistance or modification of the recovery partition is the reason that neither F11 from startup nor Recovery Manager from within Windows does not work. 
    Best regards,
    erico
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • Hyjacked HP G56 ~ restore not working ~ Even to origonal config.

    Friday at 10am I noticed my emails stopped. i have outlook express.
    I went to yahoo and could not sign in.
    I changed my password 4 times , no luck.
    I went to a site that said yahoo fix, thought I was dealing with yahoo
    but pretty sure it was an indian that just wanted $199.99 to do a online fix.
    He took control of my computer and showed me how someone possessed it. My administration was hacked too.
    So for 2 days tried to do a "restore" to an earlier time.  Each time after my attempt I recieved a message
    restore failed.
    I tried to do the back up disks when I got this HP but failed...it downloaded about 80% then stopped.
    I am not afraid to lose everything on my computer.  Could this evil person have messed with my bio's or
    if I bought HP resstore CD's should I be okay ?
    Still dont know what to do about Yahoo mail. I had a sbcglobal email and they merged with
    Yahoo..now yahoo is ATT.  Yahoo said go to ATT.
    Att does not care.  
    for today, I would just like to get an opinion that a fresh windows install would work.
    Thanks in advance. 
    steve

    Hi, Steve:
    It is unlikely that someone has messed with anything but stealing your e-mail account which I hope you can get closed.
    System restore, while it normally works, does not always work.
    If your notebook has a recovery partition, you should be able to restart the PC, tap the F11 key at the beginning of the HP welcome screen to launch the system recovery manager program.
    See if you can use that to reset your PC to factory state.
    Back up any files first before proceeding.
    If the F11 doesn't work, then you will need to purchase a set of recovery disks.
    Also, if you have W7 on your PC and you can read the 25 character windows 7 product key on the bottom of your PC, you can make your own plain W7 installation media by reading the info below.
    Use your 25 character W7 product key to install and activate Windows 7.
    Follow these instructions and see if you can get W7 installed that way.
    I would use the MS ISO to USB tool.
    Make absolutely sure you get the entire ISO file when you see the download complete message.
    Sometimes it reports the download is complete and your ISO file is much smaller than what it said was downloading.
    Use the Windows 7 USB/DVD installation tool to compile the ISO file you download from Digital River. Link  below. You need a 4 GB flash drive to use the USB method of compilation.
    http://download.cnet.com/Windows-7-USB-DVD-Download-Tool/3000-18513_4-10972600.html
    Then go to the PC's support and driver page to install the drivers you need.
    Link to the W7 ISO file downloads is below.
    http://forums.mydigitallife.info/threads/14709-Windows-7-Digital-River-direct-links-Multiple-Languag...

  • Write Spreadsheet To File even if path doesn't exist (yet)

    I am interested in using Write Spreadsheet To File to log some data to my disk.  What is the easiest way to include this VI and tell it to create the folders if they don't already exist.
    For example:
    Using that example, if no "Data" folder can be found on my Desktop, how can I have LabVIEW create the "Data" and "Test1" folders necessary to create Test1.csv in the specified location?
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If someone helped you out, please select their post as the solution and/or give them Kudos!
    Solved!
    Go to Solution.

    I ended up making a VI out of this community example https://decibel.ni.com/content/docs/DOC-23385
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If someone helped you out, please select their post as the solution and/or give them Kudos!

  • LOGERROR: **theProduct := index.sucatalog doesn't exist in the catalog!

    I keep getting this error in my Software Update Server log:
    LOGERROR: **theProduct := index.sucatalog doesn't exist in the catalog!
    This is after a clean install of Tiger Server.
    Mirrored updates show 91.
    I'll upgrade the server to 10.4.6 and hope that that helps.
    How do I put index.sucatalog in the catalog?
    Thanks,
    James.

    Gave up.

  • How do I know if an update failed because the record doesn't exist

    I am updating a row in a table and I want to know if the update didn't work because the record doesn't exist. Is there any way of knowing this? I want to avoid doing a select if at all possible. I am using sqlj with Oracle 9i on Linux and JDK 1.3.1.

    ...and I want to know if the update didn't work because the record doesn't exist. It is possible that you are looking at the problem wrong. An update doesn't 'fail' if there is nothing to update. So it works whether anything was updated or not. And so it might simply not be possible to see whether zero or more rows were updated. (Returning how many rows were updated might represent an enhancement rather than a necessity.)
    I didn't find anything specifically that said this was or wasn't supported by briefly looking at the Oracle docs and searching google.
    If nothing else you could always do a select first with the same where clause and then do the update if the select returns a non-empty set.

  • HT1430 Hi I am having a problem to delete call log in iPhone 3GS from last 1 month, I have restore iPhone many times but it doesn't works, pls give me a solution , whenever I try to delete call log it's hang for some time.

    Hi I am having a problem to delete call log in iPhone 3GS from last 1 month, I have restore iPhone many times but it doesn't works, pls give me a solution , whenever I try to delete call log it's hang for some time, pls tell me how to restore call delete option

        jsavage9621,
    It pains me to hear about your experience with the Home Phone Connect.  This device usually works seamlessly and is a great alternative to a landline phone.  It sounds like we've done our fair share of work on your account here.  I'm going to go ahead and send you a Private Message so that we can access your account and review any open tickets for you.  I look forward to speaking with you.
    TrevorC_VZW
    Follow us on Twitter @VZWSupport

  • Iphone 4 front camera not working even after reboot,resets and restore.

    i am using iphone 4 .I have problem that front camera is not working even after reboot,resets and restore with itunes.I thing there is a hardware problem.
    Now i wont to go apple store for replace the phone because phone is under warranty period.But problem is that i lost the receipt.Will apple store help me without my receipt ?please help me

    If setting up as new device without using the latest backup does not bring the camera function back, get it looked at or serviced by Apple:
    How to back up your data and set up as a new device
    Apple - Support - Service Answer Center

  • When I try to turn on my homesharing on apple TV it says that either my apple id doesn't exist or the password is wrong. However, I've been using the id for almost half a year and I even changed my password and it still wouldn't work. How do I fix this?

    When I try to turn on my homesharing on apple TV it says that either my apple id doesn't exist or the password is wrong. However, I've been using the id for almost half a year and I even changed my password and it still wouldn't work. What can I do to fix this?

    Not sure if this Term is Relevant towards an iPhone but, my iPhone won't Post unless if it's plugged into a Charger.

  • When I try to restore my iPod, it stops restoring at the same place and doesn't work. How do I fix this and make it completely restore itself?

    When I try to restore my iPod, it stops restoring at the same place and doesn't work. How do I fix this and make it completely restore itself?

    Did you make sure that your security software allows iTunes to contact Apple during the restore process? http://support.apple.com/kb/TS3125

  • Problem to detect Wifi networks. I restored without back up and it doesn't work. suggestions?

    Problem to detect Wifi networks. I restored without back up and it doesn't work. suggestions?

    I detected one time networks with the trick (air plane mode on, power off, sim card out, power on, sim card in, air plane mode off...). since nothing. I think it's a software problem. suggestions ?

  • My iPod camera won't work. The shutter doesn't open at all. I backed up and restored my iPod but it didn't make it work. Now I'm so mad and confused. Please help.

    My iPod camera won't work. The shutter doesn't open at all. I backed up and restored my iPod but it didn't make it work. Now I'm so mad and confused. Please help.

    If you restored to factory settings/new iPod via iTunes (Not via Settings>General>Reset>Erase all Content and Setting) and still have the problem that indicates a hardware problem.
    Make an appointment at the Genius Bar of an Apple store..
    Apple Retail Store - Genius Bar

  • HT1212 ipod Touch 5th generation. I changed the original passcode and then forgot, so it says 'iPod is disabled'. It hadn't been synced with iTunes, so I switched it off, held home button, connected to Mac, did restore on iTunes twice but it doesn't work.

    ipod Touch 5th generation. I changed the original passcode and then forgot, so it says 'iPod is disabled'. It hadn't been synced with iTunes, so I switched it off, held home button, connected to Mac, did restore on iTunes twice but it doesn't work. Help!

    Disabled
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up     
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        

  • Cannot Log-On even though the internet works fine?

    Cannot Log-On even though the internet works fine? I have not made any changes to my system. Anyone else having the same problem. My handle is an AIM handle, if this helps. Is it because its the first of a new year?
    Thanks in Advance!
    Mark

    I found out its my IM archiving company thats is down. Global Relay.
    Thanks anyway!
    Mark

Maybe you are looking for

  • Simple Email Campaign - Extracting reports

    Hi everyone, I have a simple email campaign running (still active) and I am wondering how you can export the clicks, opens of this campaign. I can't see it in Insights as a campaign and there's nothing in the settings apart from campaign audit, entry

  • Hide Command Bar and Menu Bar

    Hello there, Iam trying to display a transaction in portal. For this iam using a Transaction I View. But iam able to find two menus and the command box at the top of the iview. How can i restrict these from appearing? Iam using ECC6. EP7  (Integrated

  • How do you select the ical calendar which an event is added to?

    Since switching from iPhone 3GS to iPhone 4, I cannot choose which ical calendar to add an event to. It used to be an option when you created a new event, but now it creates all events in a new calendar, called 'calendar', which I neither want, nor s

  • RSCRM_REPORT without access to sm37

    To perform T-Code RSCRM_REPORT  we need to launch jobs in Production. So we need access to launch any job in SM37.  However, the users don't have access to SM37.  If there is some other way for the users to launch a job other than through SM37 would

  • 1 month and my issue is not fixed yet you closed my thread?

    I never got the credit applied to my account.  My account is still not fixed and its been a month! Now my bill is due! Thanks so much comcast for showing me the worst customer service ive ever seen in my entire life. What do I have to do to get this