We can find the SQL server database last restore time using the system table in msdb.Īs part of our Server Management Services, we assist our customers with several SQL queries. Today, let’s focus on Database Backup and the last restore time.ĭatabase Backup and restores are common tasks for any database administrator. Similarly, we can also get information about the last restore time of the database. There is a system table named restorehistory in msdb system database that captures this information. We run the T-SQL code below to get this info: use msdb go select Destination_database_name AS ,user_name AS ,restore_date As from restorehistory where Destination_database_name like (‘qa%’) We need to gather information from this table to get the data. Once we run the above command, we will get output. Here, we can see the database name, a user that has restored the database, and the last restore date and time. Restorehistory system table is very informative in case we need information for audit or database forensics purposes. This table contains the row for each database restoration performed. We get the following database restoration history.In this way, if you encounter problems, your schema won't be lost. Create or Upgrade a Schema into the Database Before starting this operation, please save the model to a file. ![]()
0 Comments
Leave a Reply. |