New answers tagged

1

I have had this problem for some time now and finally got fed up and started writing my own script to make restoring to Dev or DR work that little bit easier. Point the script at your backup folder, it will read all the files and print to the screen the full restore scripts for each database, it works with Olas backup structure as well. Here is the link to ...


5

I posted this in the comments section but I feel this should give you an answer that is simpler and cleaner. https://paulbrewer.wordpress.com/sp_restoregene/ Simply install the script and run sp_Restoregene. You can pass it @database and @stopat too. This script will script all the restore scripts automagically for you. Including FULLs, DIFFs and LOGs ...


2

I think this query may help you. I took it from this link. SELECT physical_device_name, backup_start_date, backup_finish_date, backup_size/1024.0 AS BackupSizeKB FROM msdb.dbo.backupset b JOIN msdb.dbo.backupmediafamily m ON b.media_set_id = m.media_set_id WHERE database_name = 'YourDB' ORDER BY ...


0

You need to use WITH NORECOVERY at the end of each restore until the very last one. The database was not in the right state to continue restoring backups. You get that error because you didn't do this. With LOG backups you'd probably need to restore more than just one, you need all of the LOG backups taken since your last FULL backup. You'd restore each ...


3

TailLog backup contains the transaction log that was generated after the last log backup.so this is necessary if you want to restore to latest point in time.When we try to restore the database which is online and whose tail log has not been backed up ,SQL Server will throw the error you are getting To avoid this error use NoRecovery. But with above ...


1

I agree with Chad Mattox's answer. But to simplify the process, I'd recommend you to use the following t-sql to do the backup BACKUP DATABASE LiveDB TO DISK = '[tempfile]' WITH COPY_ONLY, INIT; By adding INIT in your backup script, you will always overwrite the existing one and thus simplify your restore script (by no need to find the latest File [X])


-1

Run the following script on source and destination SQL Servers, the versions should either match or the destination should have a higher version of SQL Server otherwise you cannot restore the .bak file: SELECT @@Version


2

I suspected multiple backups might exist in this backup file. If you run: RESTORE HEADERONLY from disk = [tempfile] this will show all the backups that are in the file. You are not restoring the latest backup, use FILE=X to restore the appropriate backup.


0

Chances are something in the backup history tables got out of sync and the UI is going to the last "consistent" full backup. If you're really interested in why it's doing what it's doing, start a profiler trace limited to your account, walk through the restore steps in the GUI, and review the commands captured in the trace that show what the UI is doing ...


1

ApexSQL Restore will mount the backup as virtual Database, and you can query it using SSMS. I also published a PowerShell script that will let you analyze your backups in a given folder. I wrote it for analyzing size but you could easily adjust this to include properties like the date taken and such to find which backup you need to mount. You can find the ...


1

Yes, it can be a good idea. In fact, allowing this was a major feature in the release of PostgreSQL 9.2.


0

On a terminal, type systemctl cat 'postgresql*' That will show you where the PGDATA environment variable is pointing to when you start the service normally via systemd, and all the parameters used for starting and stopping the service.


0

This was a very helpful link: https://mysqlintheenterprise.com/tag/mysql-enterprise-backup/


2

No ! But, you can : 1 script our your database schema and use BCP out and bcp in method or 2 restore the database as a copy on EE or Dev edition, remove all enterprise features and backup the database and restore it on standard edition.


0

Turned out to be a minor corruption of the SQL backup file. After re-running the entire process again, the restore worked fine with no errors. You would think that Postgres would have in-built checking to ensure integrity of exported data!


0

Do a Restore Headeronly With File = '...' If it still fails it's not a valid native SQL Server backup file. It's not an issue of versions. Open it with a hex or text editor, what's the file header look like? Maybe it's compressed with a 3rd party solution like LiteSpeed and those require you to use a tool to convert to native format if you don't have it ...



Top 50 recent answers are included