Where is the standby file method/property in SMO.Database

Hello,
I'm trying to locate the method / property in SMO.Database for StandByFile (undo backup file). I'm able to set it during a restore using SMO.Restore.StandByFile, but I'm currently building a empty DB from the properties of an exisitng DB and this is a property
I need to at least read from if not modify directly.
Hoping for some help.
EDIT: Adding small part of script for context
# Restore the database
function Restore-Database ($srv, $dname, $src, $dst, $stby){
try {
$SMORestore = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Restore
if ($stby) {
Write-Host 'Restoring' ([System.IO.Path]::GetFileName($src)) 'to' $dname 'with standby...'
$SMORestore.StandbyFile = $tmpdir + $tmpdbname + '_standby.bak'
} else {
Write-Host 'Restoring' ([System.IO.Path]::GetFileName($src)) 'to' $dname 'with recovery...'
$SMORestore.Action = "Database"
$SMORestore.NoRecovery = $false
$SMORestore.ReplaceDatabase = $true
$SMORestore.Database = $dname
$SMORestore.Devices.AddDevice($src, "File")
$filearray = $SMORestore.ReadFileList($srv)
foreach ($file in $filearray){
$newfile = New-Object Microsoft.SqlServer.Management.Smo.RelocateFile
$newfile.LogicalFileName = $file.LogicalName
$newfile.PhysicalFileName = $dst + ([System.IO.Path]::GetFileName($file.PhysicalName))
$SMORestore.RelocateFiles.Add($newfile) | Out-Null
$SMORestore.SqlRestore($srv)
Write-Host ([System.IO.Path]::GetFileName($src)) 'successfully restored to' $dname
} catch {
$_.Exception
if ($Error.Count -gt 0) {
$error[0] | fl -force
} #Restore-Database $DSTServer $tmpdbname $bkup $tmpdir $false # - $bkup = .bak not defined | $stby = bool
and another piece
function New-Database ($refdb, $dstsrv, $tname, $tdir) {
Write-Host 'Creating database' $tname 'based on settings from' $refdb.name '...'
$dstdb = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Database -ArgumentList $dstsrv, $tname
# Loop through the original db's filegroup to grab all the settings for the new filegroup
try {
foreach ($group in $refdb.filegroups) {
$fg = New-Object -TypeName Microsoft.SqlServer.Management.Smo.FileGroup -ArgumentList $dstdb, $group.name
$dstdb.FileGroups.Add($fg)
if ($group.IsDefault -eq $true) {
$fgdefault = $group.Name
# Loop through the data files in the filegroup and grab the settings for the new files
foreach ($file in $group.Files) {
$datafile = new-object -TypeName Microsoft.SqlServer.Management.Smo.DataFile -ArgumentList $fg, $file.name
$fg.Files.Add($datafile)
$file
$datafile.FileName = $tdir + ([System.IO.Path]::GetFileName($file.FileName))
$datafile.Size = $file.Size
$datafile.IsPrimaryFile = $file.IsPrimaryFile
$datafile.GrowthType = $file.GrowthType
$datafile.Growth = $file.Growth
$datafile.MaxSize = $file.MaxSize
# Loop through the log files in the filegroup and grab the settings for the new files
foreach ($file in $refdb.LogFiles) {
$logfile = New-Object Microsoft.SqlServer.Management.Smo.LogFile -ArgumentList $dstdb, $file.name
$dstdb.LogFiles.Add($logfile)
$file
$logfile.Name = $file.name
$logfile.FileName = $tdir + ([System.IO.Path]::GetFileName($file.FileName))
$logfile.Size = $file.Size
$logfile.GrowthType = $file.GrowthType
$logfile.Growth = $file.Growth
$logfile.MaxSize = $file.MaxSize
} catch {
$_.Exception
# Create the database
try {
$dstdb.Create()
Write-Host 'Database' $tname 'created successfully'
} catch {
if ($Error.Count -gt 0) {
$error[0] | fl -force
break
# Make sure the right filegroup is the default
If ($dstdb.FileGroups[$fgdefault].IsDefault -ne $true){
Write-Host 'Setting' $fgdefault 'filegroup as default'
$fgdef = $dstdb.FileGroups[$fgdefault]
$fgdef.IsDefault = $true
$fgdef.Alter()
$dstdb.Alter()
} #New-Database $srcdb $DSTServer $tmpdbname $tmpdir

How were you able to see the tuf in your ldf? Using a simple text editor i'm unable to see mine.
if you open that file with text editor, you can't use "find" functionality because its not an ASCII text. It took some time for me to locate the text which you are seeing in image which I posted.
Also how certain are you that it is not possible, do you have experience programming with SMO? Not that I don't believe you but I have spent some time developing a ps script that somewhat hinges on this, so not happy if it was all for not.
I have NEVER worked with SMO and have no experience. But Since I have spent 10 years of my life working with Microsoft with SQL Server Product support team, I can tell you that it's not stored in any table in database. It's part of LDF and there is no way
to get that without parsing the LDF file.
Here is one of the blog written by my friend, who was working in my team.
http://blogs.msdn.com/b/batala/archive/2011/07/21/how-to-see-the-standby-file-path-when-we-restore-the-database-in-standby-mode.aspx
Balmukund Lakhani
Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
This posting is provided "AS IS" with no warranties, and confers no rights.
My Blog |
Team Blog | @Twitter
| Facebook
Author: SQL Server 2012 AlwaysOn -
Paperback, Kindle

Similar Messages

  • How to upload words, exel, PDF file from the pc via itune to the iPad, and where will the uploaded file be saved? In the apps?

    How to upload words, exel, PDF file from the pc via itune to the iPad, and where will the uploaded file be saved? In the apps?

    You will need an app (or apps) on your iPad that is capable of reading the documents, as they will be saved with the app - if you don't have such an app then there is nothing to transfer them to or to read/access them.
    One method of transferring them is toconnect your iPad to your computer's iTunes, select it's app tab, and then scroll to the bottom of it - you should the apps That you've got that are capable of file-sharing (if you've got any).  Selecting/high-lighting one of them should then allow you to add files to it via the box to the right of it.
    An alternative way to get the documents onto your iPad is if the app that you want to transfer them to has a wifi setting, which will then allow you to transfer the documents wirelessly. You can also send the documents to yourself as attachments and then use Mail's 'open in' facility to copy them into your chosen app.
    Edit : more info on file sharing from the manual :
    File Sharing lets you transfer files between iPad and your computer. You can share files created with a compatible app and saved in a supported format.
    Apps that support file sharing appear in the File Sharing Apps list in iTunes. For each app, the Files list shows the documents that are on iPad. See the app’s documentation for how it shares files; not all apps support this feature.
    Connect iPad to your computer.
    In iTunes, select iPad in the Devices list, then click Apps at the top of the screen.
    In the File Sharing section, select an app from the list on the left.
    On the right, select the file you want to transfer, then click “Save to” and choose a destination on your computer.
    Transfer a file from your computer to iPad:
    Connect iPad to your computer.
    In iTunes, select iPad in the Devices list, then click Apps at the top of the screen.
    In the File Sharing section, click Add.
    Select a file, then click Choose (Mac) or OK (PC).
    The file is transferred to your device and can be opened using an app that supports that file type. To transfer more than one file, select each additional file.
    Delete a file from iPad: Select the file in the Files list, then tap Delete.
    Message was edited by: King_Penguin

  • Nokia PC Suite - Where are the Backup Files

    Hi.
    Where are the backup files store and what is the extension , I have tried to find them.
    I want to store them on my D: drive for safety
    Thanks.
    Nokia 5800
    FW 21.0.025
    Solved!
    Go to Solution.

    I can find the backup files using pc suite without any problems, but as i said i want to copy them to my d: drive.
    I have unhidden the entire c: drive and searched for  .nbu .ncc .nfb .nfc .ngr all nokia backup extensions without result.
    I am using Vista and have checked in every directory for my user name.
    Thanks for the help.
    EDIT : I managed to find the backup files, they were in the directory i had created on my d: drive for my nokia games and software with the extension .nbu , how they got there i dont know?
    Message Edited by tinderboxuk on 05-Jun-2009 11:22 AM
    Nokia 5800
    FW 21.0.025

  • Where are the help files?, Where are the help files?

    Where are the help files for iPhoto? When I am in any part of iPhoto and click on "Help," I get a blank page.

    Hi georgekfromnewyourk
    Please try the following:
    http://support.apple.com/kb/TS3577
    This was found by using the search feature in the upper right of these screens.
    Cordially,
    RicD

  • Where are the backup files for my iPad located on my macbook pro with maverick ?

    where are the backup files for my iPad located on my macbook pro with maverick ?

    As an addendum, if I need to, and hopefully won't, unless I switch computers, how can I revert from a copy of a different backup?  Thanks. :-)

  • Where are the audio files in an iPad mini?

    Hi.
    Where are the audio files in an iPad mini? (iTunes, Garage band...)
                                                                                                                         W.W.

    Thanks Jonathan.
    To be more specific. After you record an audio file with Garageband on the iPad mini where is it stored, to be copied, transfired?
                                W.W.

  • Where are the help files in itunes 10.5

    where have the help files gone in itunes 10.5

    The same thing happend to me as well, Updated both my Iphone4 and Itunes to IOS.5 and iTunes 10.5 and the Ringtone on both my computers and the tab is gone under my library, not only that but when i click on my iPhone device the "RINGTONE" option appears every other time, i asked my friends if theirs is gone too, they said no.... i really hope someone helps up out with this, its kind of ******* me off

  • Where are the MMB files stored in unix box

    Hi all,
    Can anyone tell where are the MMB files stored in unix box. Thanks in advance.
    Regards,
    Sandeep V

    Hi Thomas,
    Thanks for the reply, I got the FNDMENU.mmb file , but Iam not able to find the menu item which Iam searching for. There are some special menu items like SPECIAL , SPECIALB and SPECIALC. So, when I select release from plan menu item special27 is called , but Iam not able to find release in this menu. Can you please help me in this regard.
    Regards,
    Sandeep V

  • Where are the "exercise files" referenced in the video tutorial for After Effects?

    Where are the "exercise files" referenced in the video tutorial for After Effects?  A search yielded no results.

    Creating your first project | Learn After Effects CC | Adobe TV

  • Where are the audio files located?

    You know how when your video source is missing, it shows that ! with a yellow triangle around it? Then, when you hover over the !, it shows you where iMovie expected to find the video, and then you can just move the video there and it's fixed. But for audio, it doesn't show you where it is supposed to be located when you hover over the ! in the audio file (music green bar).
    So, where are the music files supposed to be located so that it can find them?
    Thanks!

    To the best of my knowledge, iMovie simply links to the music file from wherever it is located in your system. That could be the iTunes Library, your Desktop, an external drive, or other places. So if you move the music to a different location, I assume that iMovie will lose track of it. iMovie doesn't actually import the music to the project - it's just referencing it (as far as I'm aware).
    If you know the name of the track (or tracks, or artists), try doing a search both within iTunes and on your hard drive using Spotlight. If found, the best solution is probably to drag it again into your project, then do the necessary edits if applicable.
    Note that, in iMovie the music tracks are identified by song name - it's shown at the beginning of the green audio bar. So the songs shouldn't be too difficult to track down. It's just a pain having to re-instate them.
    John

  • Where are the book files located

    Where are the iBook files located in OS X 10.10.1? I do NOT want to use iCloud but much prefer to make hard backups of all my books but I can't find the files

    You may also be interested in ;
    * [[What is Firefox Sync?]]

  • HT3986 Where are the individual files located in iphoto

    Where are the individual files located in iphoto, thanks for your help

    They are all stored in the iPhoto Library.  You would need to examine its contents to see them separately (outside of iPhoto).

  • Where is the tftp file archive path in ciscoworks server?

    Dear all,
    I want to use ciscoworks up/down load IOS.but do not know where is the IOS file path in ciscoworks
    Would you please help tell me?
    Thanks and best regards!

    It depends on the platform. On Windows, it's NMSROOT\tftpboot. On Solaris, it's typically /tftpboot.

  • Where is the jar file contain this package

    Dear Everybody
    Could you tell me where is the .jar file that contain this package
    oracle.security.idm
    Thanks for your help

    Hi,
    check jdeveloper_home\jdeveloper_10133_<version>\jlib\identitystore.jar
    Frank

  • Where is the .jar file that contain this package oracle.security.idm

    Dear Everybody
    Could you tell me where is the .jar file that contain this package
    oracle.security.idm
    Thanks for your help

    Hi,
    check jdeveloper_home\jdeveloper_10133_<version>\jlib\identitystore.jar
    Frank

Maybe you are looking for

  • Compression and non-compression questions

    Hi Folks, I want to use my PC as a music juke box. I plan on having an audio output lead plugged into my living room stereo from my PC and using iTunes to do the playing and managing of the downloaded music files. I want to import my music CDs into t

  • Error in GR postings

    Hi All, I am doing GR for domestic PO, all values in PO condition tab are correct but when i posted GR,the FI postings are entirely different.that is GRIR clearing a/c got posted for the value which is entirely different from the actual and same amou

  • Win 2003 server SATA2 RAID 0 install errors

    I keep getting the following error when trying to install Win 2003 server, as it is loading drivers: "The file iaStor.sys is corrupted. Press any key to continue." Note: I get this error on every copy of win2003 server that I have AND I get it when t

  • I'm using an iPhone 4S on IOS 7 and I am unable to select a message to delete can anyone help?

    Even when I try to select multiple messages to delete under the edit function the selected messages unselect themselves.   How can I resolve this issue? Many thanks

  • Can show_window call to create a detached window in FORMS 10g?

    Now, I am migrating forms6i to form10g. In Form6i, show_window can create a new window not in the area of the current window. However, in forms10g, I can only create a window in the area of current window, and can not move it out current window.