SQL 2012 :: Restore MDF Then Apply Logs / Point In Time
Jun 6, 2014
Our backup system has worked ok for us to date. We can restore back to either full saves or up to a certain log (we take log backups on the hour). We've never had to, but wanted to test restoring to a point-in-time with the backup data.
What the system does is generates .mdf and .ldf files, which is essentially a full backup say in the middle of the night. It then creates .bak files for the log backups based on the backup set you want to restore.
I can detach the database and apply the .mdf and .ldf and re-attach the database, but to apply the .bak files I need to get the database into a (recovering) state. I can't seem to do that. Otherwise when I try to apply the .bak files the system says: The log or differential backup cannot be restored because no files are ready to rollforward.
How to apply a .mdf and then apply the .bak files?
If I have a database backup from sunday, and a failure occurs monday... Can the backup .mdf and .ldf files be attached, and the backup log after the point of failure be applied to them? The problem I am having is it looks like you can only restore from a .bak file, and then apply the log at the point of failure. IT doesn't look like you can restore the .ldf/.mdf files, and then apply the backup log from the point of failure.
Can someone please help? I'm in desparate need of fixing this !
We run a disk backup (full) early in the evening, and then another bull backup to tape later at night. We also keep independent backups of the logs.
It seems that any full backup "resets" the ability to apply logs when restoring?
I want to be able to restore a full backup, and apply logs forward possibly more than 1 day, in case a backup is corrupted and not usable. But it seems I can only apply logs up until the time of the next full backup.
I can't "point in time restore" a test DB if I had only a Full DB Backup (with overwrite option).
Example 12:00 Fullbackup new (overwrite) 12:01 update any rows 12:02 update any rows 12:03 delete any rows 12:05 Transaction Log backup (overwrite) RESTORE: We can't set "point in Time" to 12:01 od 12:02 ???
My database is in full recovery mode. When I have created some full backups of the database, I would like try to point in time restore. Unfortunately, this option is greyed out on the restore screen. What have I done wrong?
I know NOTHING about SQL. I have a SQL 2005 database. I'm trying to restore a point in time. I get the error:
RESTORE FAILED...AMT12-2-13.TRN... CANNOT FIND THE FILE SPECIFIED.
The file exists, and in the proper location. something is wrong with it. Is there any way to rebuild the entire TRN so that a point in time recovery will work?
I have a SQLServer 2005 database running in Windows 2003 Advanced Server environment. I want to restore from the backup to 2 days back point in time. I am using the Microsoft SQLServer Managment Studio. After I pick the file and specify the time I keep getting the error:
System.Data.SqlClient.SqlError: RESTORE cannot process database 'DBNAME' because it is in use by this session. It is recommended that the master database be used when performing this operation. (Microsoft.SqlServer.Smo)
I did a server reboot to clear off any hanging session.Stil I am getting the message. Please suggest.
I have full backup of database at 13:00and another full backup at 17:00.I've made backup of transaction log at 17:05When I try to restore database to state at15:10 (point in time) , the dialogue in Enterprise Managersays that only time after 17:05 is valid.It seems to me that I've done something wrong at 17:05 while takingtrans. log backup.But, again, if I have full backups at 13:00 and 17:00 restoringdatabase to point in time at 15:10 should be possible ?!Any help is appreciated.Pagus
I have a SQLServer 2005 database. I want to restore from the backup to 2 days back point in time. I am using the Microsoft SQLServer Managment Studio. After I pick the file and specify the time I keep getting the error:
[System.Data.SqlClient.SqlError: RESTORE cannot process database 'DBNAME' because it is in use by this session. It is recommended that the master database be used when performing this operation. (Microsoft.SqlServer.Smo)
I did a server reboot to clear off any hanging session.Stil I am getting the message. Please suggest.
I have lost a table's contents and need to restore them urgently. I backed up the database. I selected the backup set in order to restore it, but the "Point in time restore " was disabled and I couldn't select it to set the time to which to restore.Could anyone tell me the reason behing that? Another interesting thing is that when I backup a database, I only have two options for backing it up, 1. database complete 2. database differential
In the hereunder written message I talk about point in time restore.It is now based upon the fact that there are no hardware problems or what soever.I just would like to roll back to a situation of some time (minutes, hoursor what ever) ago.Used to the ingres database a point in time restore can take place UP toany, any, any time since the last FULL backup. (any time up to now !!!)I can't understand why a point in time restore can only be done based upontransaction log backups. The current transaction log is also available in myopinion. (Turn off the power, turn on the power and you will notice that theautomatic recovery is based upon this transaction log file; so in that casethis file is used)That's what my question is about. Is it correct that a point in time restorein a SQL server environment can only be done up to the last transaction logbackup.ByeArno de Jong,The Netherlands.
I will make it simpler to look...I have DB1 - as backup for day 1LOg1 as backup of logsT1 T2 T3 T4 T5 ...some transaction on day 2Now i backup againDB2Log2I want to restore the database till the point of transaction T3 say. Iknow the time or i assume a certain time.Is this possible .....i tried several options but hand in between forsome reason or the other. How can i achieve my solution. Is there someextra parameter i will require or what....i am wondering now that it isnot at all possible. Please help.RVGIf possible guys can you please mail me the sloution onJoin Bytes!*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
Is it possible to restore to a point in time without a preexisting full backup? The situation is this:
I have a table in the DB from which an unknown number of records were accidentally deleted. The table in questio has about 2 million records; the user ran a query to delete all records from the table by accident, and cancelled the query after about 3 seconds.
The DB recovery mode is full, so I should be able to do a point in time restore to go back to just before the deletion, but unfortunately, the DB has never been backed up, so I have no backup to work from.
The DB has not been used since the incident, and is otherwise operational, but I need to recover these records if at all possible. All the instructions I've seen for this involve restoring from a full backup first, then restoring the log backup second. Is there any way for me to accomplish the same task?
Can I use a full and differential backup to restore to a point of time?
Or I have to use full and transaction log backups in order to do a point of time restore?
I found today when I tried to restore a db from another database at the point of time for example 3:10 pm, SSMS automatically select the full backup + the transaction backup that is done at 3:00 pm, but not select full + the differential backup I did at 3:12pm.
So I lost those records entered after 3:00pm.
I supposed it should use the differential backup and restore to 3:10. but it didn't.
First off, I appreciate the time that those of you reading and responding to this request are offering. My quesiton is a theoretical and hopefully simple one, and yet I have been unable to find an answer to it on other searches or sources.
Here's the situation. I am working with SQL Server 2005 on a Windows Server 2003 machine. I have a series of databases, all of which are in Full recovery mode, using a backup device for the full database backups and a separate device for the log backups. The full backups are run every four days during non-business hours. The log backups are run every half hour.
Last week, one of my coworkers found that some rarely-used data was unavailable, and wanted to restore a database to a point in time where the data was available. He told me that point in time was some time back in November.
To accomplish this, I restored the database (in a separate database, as to not overwrite my production database) using the Point in Time Recovery option. I selected November from the "To a point in time" window (I should note that this window is always grey, never white like most active windows, it seems), and the full database backup and the subsequent logs all became available in the "Select the backup sets to restore" window.
I then tried a bevy of different options from the "Options" screen. However, every restore succeeds (ie: it doesn't error out), but seems to be bringing the database back to a current point in time. It's never actually going back to the point in time I specify.
My questions are as follows:
a) Is it possible to do a point in time recovery to a point in time BEFORE the last full database backup?
b) If so, what options would you recommend I use? (ie: "Overwrite the existing database", restore with recovery, etc etc).
I again appreciate any and all advice I receive, and I look forward to hearing from anyone and everyone on this topic. Thank you.
In Windows Server 2012. How do I do a System Restore to a previous restore point?I need to install the 64 bit and 32 bit Oracle Client Install for connections in SSIS and to create Oracle Linked Servers.
If you make a mistake it is not fun removing it. Sometimes it corrupts the machine and it is difficult to uninstall since there is not an Oracle Universal installer for Oracle 11g.If you install the 32 bit before the 64 you mess up the machine.how to create a restore point.
I am reading about the RESTORE command to a point in time using logs, I would like to know the minimum point in time recovery for a backup image using T-SQL command before applying a log restore and what are the log ranges needed for the restore during restore.
I make two full backups on Oct 1 and Oct 10. I want to restore the server to a state in Oct 5. So I just do as follows:
1.Perform a transaction log backup on the server on Oct 23. I have never backup transaction log in the past. 2. Restore the server with Oct 1 full backup with NORECOVERY option. 3.Try to restore to the point at Oct 5 12:00, with the transaction log.
But the restore fails and SQL Server said the transaction log does not contain the point. The point is too early. Why? Also my .LDF file is about 13G, but the transaction log backup is only 200MB. Why?
I make two full backups on Oct 1 and Oct 10. I want to restore the server to a state in Oct 5. So I just do as follows:
Perform a transaction log backup on the server on Oct 23. I have never backup transaction log in the past. Restore the server with Oct 1 full backup with NORECOVERY option.Try to restore to the point at Oct 5 12:00, with the transaction log.
But the restore fails and SQL Server said the transaction log does not contain the point. The point is too early. Why? Also my .LDF file is about 13G, but the transaction log backup is only 200MB. Why?
I make two full backups on Oct 1 and Oct 10. I want to restore the server to a state in Oct 5. So I just do as follows:
1.Perform a transaction log backup on the server on Oct 23. I have never backup transaction log in the past. 2. Restore the server with Oct 1 full backup with NORECOVERY option. 3.Try to restore to the point at Oct 5 12:00, with the transaction log.
But the restore fails and SQL Server said the transaction log does not contain the point. The point is too early. Why? Also my .LDF file is about 13G, but the transaction log backup is only 200MB. Why?
Hi, I am pretty new to Analysis Services and I have come across a small problem to do with point in time balances, I guess that this is similar shiver72's post titled 'Date Range Problem'. I am not really after a solution as such (although that would be great :-), more interested in a pointer to some resource(s) which I can read up on myself.
Here is the scenario:
A student enrols into a course that has a start and finish date. This enrolment has a certain value based upon its length, the course type etc which means that each enrolment's 'value' can vary at any time between the start and finish dates.
For example a student may enrol in a full year basket weaving course with a value of 0.0500, they then enrol in a part year course titled 'Dimensional Modelling 101' with a value of 1.000
The client wishes to know at any point in time the 'value' of their enrolments. These values can vary due to a student starting or finishing their enrolment, withdrawing, having their enrolment suspended etc, etc
Now, in the Data Warehouse Toolkit it mentions point in time balances in the 'Financial Services' section but it uses SQL to prove the point which is no use to me because I am using MS Analysis Services to dynamically create the result.
As it says in the book its no use creating a row in the fact table to represent the value for each day that the enrolment is in effect because with 400,000 enrolments that works out to over 140 million rows. The alternative is to create one row for each occurence of the variation in the value of the enrolment and then the facts would be completely additive and useful.
I would be looking at using something similar to the following:
fact table ---------- fkdate value fksudent fkcourse <possibly some degenerate measure like the UID of the course enrolment held in the source system>
dimensions ---------- Student - and of course a whole heap of related dimensions like gender, age, ethnicity etc Course
For example given the above information the fact table would look like this:
(Student UID is 2005123, course UIDs are 1000 and 1001)
That way I can run a query at, say 15-JUN-2005 and sum the values and it will come out with the correct balance - and yes I know that this idea is straight out of the book :-)
OK, if you've read to this point then I take it that you are an extremely patient person and therefore will forgive my next question.
My question is this, my clients use simple tools like Excel pivot tables to gouge the information they want out of the warehouse, sure, I can write an MDX query to get a point in time balance (just as soon as I learn a bit more about it) but is there _any_ way/means/algorithm/trick/way to hold your head to one side, that I can use so that they can still just 'drag and drop' using the pivot table service as opposed to having to me having to create an MDX-based report for them ?
We have been testing point of time recovery using EM and found that this does not work. We enter date and time and do net get the logs restored. Even if we use the default date it does not work. In Query Analyser we have have managed to recover to a point in time. Anybody got any idea why EM does not work. We are using 2000 sp3
For complete database backup, I use the below syntax:
BACKUP DATABASE myDB TO DISK= @File1 WITH DESCRIPTION = @Desc
For transaction log backup, I use the below syntax: BACKUP LOG myDB TO DISK= @File1 WITH DESCRIPTION = @Desc
With this scenario, can I accomplish a point in time recovery? For example, if my database crashes on thursday night. How do i do complete recovery till that time?
I'm having a real problem with this query at the moment... Basically I have to produce a query which will tell me the total number of people employed by the company at any given date and the total salary for all these people.
We have a people table and a career table. People(unique_identifier, known_as_and_surname, start_date, termination_date ...) Career(unique_identifier, parent_identifier, career_date, basic_pay ...) Relationship people.unique_identifier = career.parent_identifier
Employees can be identified like so
SELECT * FROM people WHERE start_date <= DateSelected AND (termination_date > DateSelected OR termination_date IS NULL)
Passing the selected date to the query is no trouble at all I am just having problems with the point in time side of this.
All and any help is greatly appreciated :) ~George
I am currently running MSSQL on DB1 server with 12 DBs I am running a full backup nightly at 8:00pm and coping it over to DB2. I am sending transaction logs every 15 minutes to DB2.
Is there a script or procedure for rolling in all the logs once the restore is finished. I realize the basic way to do this is here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/howtosql/ht_7_backpc_7veh.asp But writing a script with say 22 files each for each db is fairly time consuming.
I have contemplated writing a script that takes the content of the logs directory, parses it based on db name and builds the sql statements but did not want to go through all of it if someone else has already done the leg work.