I have SQL server 2016 with multiple databases so i have specific request for one of databases with name Persons. The requirement is that developers need copy of that database on same server with other name ex.PersonsCopy. This task need to be automated so every 17th on the month that database Persons need to be restored with other name PersonsCopy. I want to notice that i have scheduled daily full backup so the backup file name is dynamic ex.Persons_backup_2019_12_15_000002_1287189.
BR
December 18, 2019 at 1:28 pm
That is a requirement, but what is your question?
The list of possibilities goes on. Please ask a specific question.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
RESTORE DATABASE name
WITH REPLACE, --if it's there already
MOVE 'file' TO 'x:\newfile.mdf',
MOVE 'log' TO 'z:\newlogfile.ldf'
Automate this.
However, I think Phil pointed out an excellent question, should development be occurring on a production system? GDPR anyone? CPPA? HIPAA? FERPA? PCI?
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
December 19, 2019 at 12:42 pm
I can manual restore the database with different name, but my point is how to restore database every 3rd day from the latest daily full backup and this process to be scheduled via SQL agent.
p.s forget security, GDPR, production vs test server etc.. this is only for testing purpose.
Thank you
December 19, 2019 at 12:56 pm
In mean time i have found solution.
Tnx guys
BR
December 19, 2019 at 1:24 pm
In mean time i have found solution.
Tnx guys
BR
I assume a script (powershell or t-sql) and SQL Agent? That's how I'd do it.
Posting the solution would be helpful for anyone who finds your question because they have the same problem.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
December 19, 2019 at 2:36 pm
In mean time i have found solution.
Tnx guys
BR
Two way street here... what solution did you come up with?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply