Solved

RESTORE to be possible only for a limited time

Posted on 2013-06-26
6
165 Views
Last Modified: 2013-06-27
I want the backup to be valid only for one day.. so if someone tries to restore on 2nd day, it should say 'not possible- expired'..

but i am not sure EXPIREDATE/RETAINDAYS do that.. are there any other options?
0
Comment
Question by:25112
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 69

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 125 total points
ID: 39279421
Neither EXPIREDATE or RETAINDAYS would do that.  In fact, I don't think there's any way to do that.  

Partly because it's not really logical: they probably figued if you didn't want anyone to use the backup at all, you'd just delete it :-).
0
 
LVL 23

Assisted Solution

by:nemws1
nemws1 earned 250 total points
ID: 39279455
The only way of doing something like this would be to have whomever would do the RESTORE to call a stored procedure instead of doing the RESTORE directly.  You would then program this functionality into your stored procedure (perhaps even making it generic and having the procedure restore the latest "valid" backup automatically).


Otherwise, like ScottPletcher says, you do *NOT* want this.  What if your server crashes and it takes you three days to set up a new one?  In this case, you would be screwed as you wouldn't be able to restore from your "expired" backup.
0
 
LVL 5

Author Comment

by:25112
ID: 39280080
hi - the reason we want this is:
users ask for db backup.. its Ok.. but they are known for not deleting from their local machines or let it sit forever..  and hence cause security concern that someone not authorizaed will get it..if we make it expire it in ___ days, it puts some restraint...

any other tweaks that can be done?
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 23

Assisted Solution

by:nemws1
nemws1 earned 250 total points
ID: 39280092
No - if I get a copy of your database (.bak file), I can restore it and do whatever I want with it for as long as I want.  There is no time functionality built into MSSQL.
0
 
LVL 25

Accepted Solution

by:
jogos earned 125 total points
ID: 39280410
If it is a security concern you definitly should not provide them the files. Have an environment where they can use the restored version for x days.  Central permissions, no one without authority can do anything on it you don't want.  Files can't be copied, restored on local system and backuped again.....
0
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 39281478
You could write a job/process that used the SQL backup history (in msdb) to follow up and delete any local backups made after (n) day(s).
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question