Quantcast
Channel: User Eric Larson - Database Administrators Stack Exchange
Viewing all articles
Browse latest Browse all 12

What's the best method to refresh only a few tables within a test database from production?

$
0
0

I have a very large production database and a very large test environment database in SQL Server 2008R2. Both databases have similar table structure but different users/logins/permissions/roles.

I need to refresh only a few tables in the test database periodically from production, about once a month.

The current way I am planning on doing this is

  1. Use the BCP utility to take an export of the tables I need from Production.
  2. Copy the bcp export file onto test server
  3. Disable indexes and constraints on all tables I am refreshing in Test
  4. Truncate the Test database tables
  5. Load Data back into Test database tables using BCP.
  6. rebuild indexes and re-enable constraints in Test

This all seems a little too complicated for such a small task. It also seems like it would generate a lot of redo (in the t-log) Is there a better way to do this?

Another way I thought of doing this is to restore a backup from Production onto the test environment--but the issue I have is that a full backup would be quite large and I don't need all tables to be refreshed, only a few--and also the users and security in the production database is different from test. That would be overwritten by the security settings in the production database if I restore the whole database.


Viewing all articles
Browse latest Browse all 12

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>