如何自动刷新SQL Server数据库

As a DBA, I am often asked to automate tasks. In addition to this, I generally work with a lot of developers that need to test with data refreshing on a regular basis. A lot of the time, I am asked to either stand up a new test environment or overwrite/refresh an existing one. Now, these tasks are not difficult to complete, but why not just automate them into a SQL Agent job and just run it whenever you need it or schedule it and let the job do all the work? If you have read some of my previous articles (What is causing database slowdowns or Simple SQL Server automated user auditing), you will know I am a big proponent of automating repeatable tasks. The best part of this is if you have multiple clients like I do is that you can script out the job, change the variables and use it over and over again. I cannot tell you how many times I say “I have a job for that” when a client asks me to automate a task.

作为一名DBA,经常有人要求我自动执行任务。 除此之外,我通常与许多需要定期进行数据刷新测试的开发人员一起工作。 很多时候,我要么被要求站立一个新的测试环境,要么覆盖/刷新一个现有的环境。 现在,这些任务并不难完成,但为什么不将它们自动化成一个SQL Agent作业,并在需要时运行它,或者安排它并让该任务完成所有工作呢? 如果您已经阅读了我以前的文章( 是什么导致数据库运行 缓慢或Simple SQL Server自动用户 审核 ),您将知道我是自动化可重复任务的大力支持者。 最好的部分是,如果您像我一样有多个客户端,则可以编写任务脚本,更改变量并一遍又一遍地使用它。 当客户要求我自动执行任务时,我无法告诉您说多少次“我有工作要做”。

现实生活中的情况 (Real Life Situations)

Recently a new client asked me to do such a task. The problem that I needed to solve was to restore the Test/Development Database from a copy of the Production Databas

你可能感兴趣的:(数据库,java,python,大数据,linux)