none
Move transaction logs with Power Shell? RRS feed

  • Question

  • I'm new to Power Shell, but would like to see how powerful it is.  I need to move some transaction logs from one volume to another with more space.  Is it possible with Power Shell?

    -Steve


    Friday, May 13, 2011 10:24 PM

Answers

All replies

  • Hello,

    i know only one way to do this : to detach and attach the database see this link

    http://www.mssqltips.com/tip.asp?tip=1774

    these operations can be done with PowerShell scripts but don't forget : you must have the exclusive access to the database ( so no connected user... )

    There is something i have not understood : how many transaction logs have you for each database ?

    I will do some more search and i will post the result ( even if negative )

    Have a nice day


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.
    • Proposed as answer by Mr. Wharty Thursday, May 19, 2011 2:18 AM
    • Marked as answer by KJian_ Friday, May 20, 2011 7:41 AM
    Saturday, May 14, 2011 10:35 AM
    Moderator
  • You could use PowerShell and leverage the move-item or copy-item cmdlets to move or copy files, however these cmdlets are much slower than using robocopy.exe. If you have many or large transaction logs to move, take a look at robocopy.
    Saturday, May 14, 2011 2:09 PM
  • Use Powershell to fire a SQL Command that would alter the database to move the files.

    http://msdn.microsoft.com/en-us/library/bb522469.aspx

    Moving User Databases http://msdn.microsoft.com/en-us/library/ms345483.aspx

     


    http://www.virtualrealm.com.au - XNA Game Programming News and Resources from Downunder.
    Monday, May 16, 2011 1:48 AM