How Do I Recover Database From A Detached Backup Device?
Nov 29, 2007
I ran into a problem today where I had to pull a backup file from an older tape. The file was originally is a backup that was stored in a device like :
EXEC sp_addumpdevice
'disk', --type
'c2000_BackupDevice', --logical name
'\UNCPathackupFile.bak' --physical location
I put the file from the tape on a File Server and then tried to create a new backup device pointing to the file. That's easy enough, but when I try to restore from it I get an device error saying it's offline.
How can I get that device attached to my server and then extract the backup files stored inside it?
Please advise b/c this is an interesting problem I hadn't anticipated and it argues that I should change my backup strategy .
Hi all: In order to test database restore, I create a backup driver and puporse delete one table, then I try to restore my databse use backup, but the delete table donot show up.
I created a new database and want to recover data from a backup this script
use master go restore database new from disk='D: ew.bak' go
but get an error
Message 3141, Level 16, State 0, Line 1
The database to be restored was named 'ats342'. Reissue the statement using the WITH REPLACE option to overwrite the 'new' database. Message 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally.
Every hour I make a backup of the log files of a database to a backup device. Each backup is appended to this backup device.
Now to restore at a point in time I normally use the following script;
RESTORE DATABASE mcs_carolus FROM disk='E:sqlserver_databasesmcs_carolus_data.bak' WITH REPLACE, NORECOVERY go RESTORE LOG MCS_CAROLUS FROM disk='E:sqlserver_databasesmcs_carolus_log.bak' WITH FILE = 1, NORECOVERY GO RESTORE LOG MCS_CAROLUS FROM disk='E:sqlserver_databasesmcs_carolus_log.bak' WITH FILE = 2, NORECOVERY GO RESTORE LOG MCS_CAROLUS FROM disk='E:sqlserver_databasesmcs_carolus_log.bak' WITH FILE = 3, NORECOVERY GO RESTORE LOG MCS_CAROLUS FROM disk='E:sqlserver_databasesmcs_carolus_log.bak' WITH FILE = 4, NORECOVERY GO RESTORE LOG MCS_CAROLUS FROM disk='E:sqlserver_databasesmcs_carolus_log.bak' WITH FILE = 5, NORECOVERY GO RESTORE LOG MCS_CAROLUS FROM disk='E:sqlserver_databasesmcs_carolus_log.bak' WITH FILE = 6, NORECOVERY GO RESTORE LOG MCS_CAROLUS FROM disk='E:sqlserver_databasesmcs_carolus_log.bak' WITH FILE = 7, RECOVERY,STOPAT = 'Nov 25, 2004 11:59 AM'
Is there a simpler way of restoring without going through this long process.
This is probably a simple question but I have to ask it anyway. When backing up I can backup to a file on my local drive but I also can create a device to the same location on my local drive. Is this doing the same thing. If I so desire to backup to the local drive(bear with me) what is the difference between creating a device and a file called mybackup or just choosing to backup to a file called mybackup? Should I always create a device? I know these are dumb question but....
How do we know the list of all the backups that are present in a particualr backup device like file# and time of backup taken etc for the purose of restore?
When I run : RESTORE HEADERONLY FROM BackupDeviceName
it doesn't give that info. Can anyone tell me the exact command to list all the files of a backup device so that I can restore the right one?? Thanks. Shalini.
I feel that I have done something stupid here.I used SSMSE to detach my database so that I could create a copy - no problem here.But then in SSMSE I right-clicked Databases, chose attach and expected to see my original database. But there are no databases shown in the attach window!I have tried to find the original database in SSMSE but nothing I do allows me to see it. However, Windows Explorer shows me that the files are still where they were when I detached them.Please help - this is driving me crazy.ThanksChris
I currently have an application that uses a Access/JET database for a desktop application. The application is single-user and outside of a few corrupt MDBs occasionally, the setup is working fine.
I am thinking about switching out from using the Access database to using a SQL Server Express detached database. I'm not sure if this is a "proper" usage of a detached database, but I've verified that I can access and query a detached one...
Is this something that is recommended? Are there any performance issues associated with it (I believe the detached would be faster than the JET database.) What kind of maintainence would be needed for the SQL Server file? (I currently have a "Repair and Compact" option for the Access file...anything along those lines needed?) Is there anything else I should be aware of?
Hello all, I'm using SQL 2005 Express edition. I'm currently connecting to the database file directrly (from ASP.NET) and that db file is not attached to the server. My question is this: What is the difference ? Will the performance improve if the db is attached and I connect to it throught the server ? I'm really not sure what the difference is. Thanks
Hello all, I'm using SQL 2005 Express edition. I'm currently connecting to the database file directrly (from ASP.NET) and that db file is not attached to the server. My question is this: What is the difference ? Will the performance improve if the db is attached and I connect to it throught the server ? I'm really not sure what the difference is. Thanks
I have detached the database via sp_detach_db in a job, (I was trying to use a job to detach the database, then make copies of the mdf file, then attach the databases as different copies, somehow the job failed due to file locked) I tried to delete the physical files, but they were still locked. I tried several times, two of them I was able to delete the mdf files, but not the ldf file. The other one both mdf file and ldf file can not be deleted. I was not able to see the database via Management studio.
I am using SQL 2012 SE. I am trying to move .mdf and .ndf files after a database is detached. Here is my code that is just to copy the mdf file. I am testing it against this file now and if it worked then I would do the move ldf file the same way.
EXEC master.dbo.sp_configure 'show advanced options', 1 RECONFIGURE WITH OVERRIDE GO EXEC master.dbo.sp_configure 'xp_cmdshell', 1 RECONFIGURE WITH OVERRIDE DECLARE @cmd nvarchar(4000)
[Code] ...
The only message is I see while the query is executing is :Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.
If I manually copy over the file it takes 30 seconds since the file is only 2GB and the script takes 45 minutes and still executing.
Is there any benefit in creating a backup device and using that in the backup statement over just using a disk file in the backup statement. It seems like extra work to create the backup device with sp_addumpdevice with the file location. Whereas I could just specify the file location right in the BACKUP statement by specifying DISK as the backup device.
In SQL 2000, is there an advantage to defining and using a backupdevice versus just backing up to disk?Currently, I've got a SQL Backup job set to run once per day, withtransaction log backups running every hour. The db and backups arewritten directly to folders on an external disk array. I've neverconfigured an actual Backup Device within SQL. Does creating a BackupDevice offer any advantages not available with my current backupmethod?Thank you for any help.Jason
Does any body have the experience to execute data warehouse backup/recover? What I want to know is how to backup/recover database in data warehouse and cubes.
I want to store bakup file on the computer on netword, so make a backup device on the other computer, it ok. after that i make an full backup, there is an error : "Can not open the bakup device " . please show me, best regard.
I asked this question before but never received a decent answer. When a restore fails, what are the steps to re-start the restore? This should be a very common issue and for the life of me I have been unable to find it in BOL or the MS site! Please let me in on the secret!!
I have a transaction log which is backed up 5 times a day to a device. The Transaction log is growing quite quickly in between each backup. The backup device is also growing at a much quicker rate. realistically i would like to only keep 2 weeks worth of transaction log backups in the device.
for the transaction log backup i have tried the following transact-Sql 'Backup Log [imsv23] to [imsv23_TL_2] with RetainDays = 7, Init, NoUnload, Name = N'imsv23 TL V2', NoSkip,Stats=10,Noformat'
but due to all of the contents in the backup set not having expired the backup fails.
i need to reduce the size of the backup device. all of the backup sets have expiry dates but none of them are being deleted from device.
so my problem is 1 i need to remove the excessive backups from the device 2 i need to set up the automatic backups so that these datasets are removed when the expiry date is reached.
I have a SQL Server 7.0 with and exteranl SCSI tape device. When I attempt to backup a database in EM the tape device is being greyed out.
I have add the backup device using sp_dumpdevice and made sure that it is in sysdevices table. It will not allow me to add this backup device from the drop down.
1. Why does EM not see this device ? 2. If I try to back this up using T-SQL will I be able to use the registared tape device.
I'm trying to set a backup job to back up my databases to a server other than the server where Sql server is installed. The only options I can see are the local drives on my sql server when I try to set a location or backup device. If I want my backups to go to another server , How do I do that. Currently I'm trying to use a UNC path like \ServerNameBackups. When I try to use a UNC path I get an invalid directory error.
I'm fairly new to SQL Server as you can tell!
Can anyone help me? (I'm using sql server 2000) Thanks GEM
I am a newbie in SQL Server Administration. I decided to make the move within my company that no one else wanted.
I have SQL Server 2000 running at this time; users are connecting and using it. My question I guess pertains to the backups.
I have two drives setup for data and transactions logs (D: E:)
My backups are running but backups are being sent to the d:systems datamssqlackup folder. once backups are comlete I normally copy the backups to a network share that is being backed up nightly to tape.
My question is this:
How do i create a device location under backup properties to point to a network share? i would like for the backups to go straight to a network drive so i do not have to copy the backups every morning when i come in.
I want to be able to take a backup device to another server and then restore the last backup file within the device.
My script creates the backup device using the filename of the file from the other server but when I do the restore it only restores the first file in the device.
How can I get it to restore the last file? In EA I can do a manual resotre and look inside the device and choose say backup number 2.
Hi, I was wondering if someone could help me. I'm having problems using backup in Enterprise Manager, the backup continually fails and points to a hardware problem. However, I have been able to backup files using different software to tape which rules out hardware. I'm trying to create a new backup device incase the problem lies there but I receive the error 'error15061: Add device request denied. A physical device named '%s' already exists'
I want to create a backup device for the tape drive. So I go in "Server Objects"=>"Backup Devices" and create a new device. Problem is: In "Destination" I can't select "Tape:".
The ntbackup.exe program recognizes the tape drive, but SQL2005 not.
I have this: -SQL2005 Enterprise edition 64bit. -Tape drive HP StorageWorks Ultrium 960.
Someone knows how I can create a backupdevice for the tape?
Thanks
IF Debugging = removing bugs from program THEN programming := putting bugs in program;
appending new backup on a same device - yes or no?
if somebody can tell me, is ok to constantly create new backus on a same device? i'm asking that, because in that case, defice file it will grow and grow.
is there any limit or suggestions how many appending is recomended, cause of file growth?