Solved

RESTORE to be possible only for a limited time

Posted on 2013-06-26
6
160 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

752 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