Keep table downtime to a minimum by renaming old table, then filling a new version?

前端 未结 4 747
醉话见心
醉话见心 2021-01-19 04:19

I have a handful or so of permanent tables that need to be re-built on a nightly basis.

In order to keep these tables \"live\" for as long as possible, and also to

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-19 04:37

    Some things to keep in mind:

    1. Replication - if you use replication, I don't believe you'll be able to easily implement this strategy
    2. Indexes - make sure that any indexes you have on the tables are carried over to your new/old tables as needed
    3. Logging - i don't remember whether or not sp_rename is fully logged, so you may want to test that in case you need to be able to rollback, etc.

    Those are the possible drawbacks I can think of off the top of my head. It otherwise seems to be an effective way to handle the situation.

提交回复
热议问题