December 5, 2017 at 12:00 am
Comments posted to this topic are about the item Keeping tables online during loading with schema swapping using SSIS
December 5, 2017 at 2:56 am
In my experience this sort of pattern has some sort of blocking issue to deal with. What about using synonyms instead of a schema swap / lock? We have had to remove this pattern from our DW load (introduced by a previous BI developer) as it was causing severe locking issues. Yes our DW loads are certainly not best practice but I still think synonyms are a much better solution.
December 5, 2017 at 6:59 am
I can't put my finger on it but, IIRC, I've seen the graphics for this article from another article here on SSC, particularly that first one and the article was on the same subject but a bit longer.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 5, 2017 at 8:58 am
His first article perhaps?
December 5, 2017 at 9:32 am
How is this any better than renaming the tables with sp_rename?
December 5, 2017 at 9:41 am
Bobby Russell - Tuesday, December 5, 2017 9:32 AMHow is this any better than renaming the tables with sp_rename?
Job security?
December 5, 2017 at 10:06 am
Lynn Pettis - Tuesday, December 5, 2017 9:41 AMBobby Russell - Tuesday, December 5, 2017 9:32 AMHow is this any better than renaming the tables with sp_rename?Job security?
😀
December 5, 2017 at 11:25 am
A couple of honest questions:
1. What happens to indexes, triggers, and other dependent objects with schema swapping? You may not want an index on the table in the shadow schema, but you probably will want that index in the active reporting schema. Does the index in the dbo schema need to be rebuilt when the updated table is swapped in?
2. Is there any benefit to setting this up in a SSIS package rather than doing the schema swap as a Transact-SQL job step?
3. Technet specifies that "All permissions associated with the securable that is being transferred are dropped when it is moved." So it sounds like you would have to set up steps in your ETL to restore any object specific permissions?
December 5, 2017 at 11:51 am
Lynn Pettis - Tuesday, December 5, 2017 8:58 AMHis first article perhaps?
Yeah.... that's the one.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 5, 2017 at 1:15 pm
andrea4618 - Tuesday, December 5, 2017 11:25 AMA couple of honest questions:
1. What happens to indexes, triggers, and other dependent objects with schema swapping? You may not want an index on the table in the shadow schema, but you probably will want that index in the active reporting schema. Does the index in the dbo schema need to be rebuilt when the updated table is swapped in?
2. Is there any benefit to setting this up in a SSIS package rather than doing the schema swap as a Transact-SQL job step?
3. Technet specifies that "All permissions associated with the securable that is being transferred are dropped when it is moved." So it sounds like you would have to set up steps in your ETL to restore any object specific permissions?
If it is anything like a partition swap you need to have the indexes. Other things you would have to test. I found with partition swapping I didn't need the default constraints, not sure about indexes as the ones on the tables I was working with we dropped the indexes before to the work to complete the data cut on the database. DRI may need to be there, but the two tables in this particular database with foreign keys weren't affected.
August 2, 2019 at 9:26 am
This is something we've been looking at as part of our load (just an idea at the minute).
We have a multi-part process to load our tables as follows:-
Questions:-
We want to have minimal downtime (don't we all?) when updating the tables and we currently only do a load once a day. We are looking at trying several loads a day but need a method of keeping downtime to a minimum.
Any help on this would be greatly appreciated.
Richard
August 2, 2019 at 10:06 am
Hi, will this affect ongoing jobs on the table beeing refreshed? Ie should jobs running at swap time be killed or will they be able to read the old table until finished?
Thanks for a great tip!
Br Håkan B
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply