Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.
SQLWriter VSS and AddNewTarget error

問題 SQLWriter VSS and AddNewTarget error

  • 2012年5月4日 上午 10:05
     
      包含代碼

         I encountered the following problem. When I try to restore a file in the alternativedirectory with

    HRESULT AddNewTarget(
      [in]  VSS_ID writerId,
      [in]  VSS_COMPONENT_TYPE ct,
      [in]  LPCWSTR wszLogicalPath,
      [in]  LPCWSTR wszComponentName,
      [in]  LPCWSTR wszPath,
      [in]  LPCWSTR wszFileName,
      [in]  bool bRecursive,
      [in]  LPCWSTR wszAlternatePath
    );

    and pass wszPathC:\some_dir all is well. But when I pass C:\ (because my database files located at the C:\), alternate path did not applied.

    Does anyone know how to solve?

所有回覆

  • 2012年5月5日 上午 12:42
    版主
     
     
    What is the error that you are getting? Are you sure that you aren't getting an Access denied/Permissions issue with this?  The root of the disk is protected under UAC so you might need to verify that you aren't getting a problem from that.

    Jonathan Kehayias | Principal Consultant, SQLSkills.com
    SQL Server MVP | Microsoft Certified Master: SQL Server 2008
    Author of Troubleshooting SQL Server: A Guide for Accidental DBAs
    Feel free to contact me through My Blog or Twitter. Become a SQLskills Insider!
    Please click the Mark as Answer button if a post solves your problem!

  • 2012年5月7日 上午 05:44
     
     

    SQLWriter fails at PostRestore. <FAILED_AT_POST_RESTORE(0x800423f4 - VSS_E_WRITERERROR_NONRETRYABLE)>. SQLServer has all the rights to the root drive.

    Steps to reproduce:

    1. Create database DB (E:\DB.mdf, E:\DB.ldf)

    2. Perform full VSS backup.

    3. Delete database DB.

    4. Run restore DB to new target with AddNewTarget (move E:\DB.mdf => C:\SomeFolder\DB.mdf, E:\DB.ldf => C:\SomeFolder\DB.ldf)

    5. Restore fails at PostRestore.

    In the SQL Server profiler I see that the SQLWriter still uses the old path to recovery. E:\DB.mdf instead C:\SomeFolder\DB.mdf. He looks for a file E:\DB.mdf.