Quantcast
Channel: SQL Server High Availability and Disaster Recovery forum
Viewing all articles
Browse latest Browse all 4532

Converting primary key id column from int to bigint in AG VLDB database

$
0
0

Hi 

I have a VLDB database (3.2 TBs) that is an Availability group that is going to run out of ids soon on a couple of tables. I need to check but I am guessing at least one of these tables is over TB.  I need to convert the int to bigint and the column is not a "clustered" index but it is the primary key.  I still need to check to see if there are foreign keys on the id as well but assume there are. 

The SQL Server is getting upgraded to 2016 in the next week or two. I've read most recommendations advocate for copying over the data into a new table with bigint as the primary key, etc. and re-applying the indexes and foreign key constraints. 

Some questions: 

Is there any scenario that would allow you to keep the database in the AG group? 

Could you use the "Alter Table" online that is available starting in SQL Server 2016 to change the primary NON-Clustered key from int to bigint?

If yes, would you need to drop the DB out of the availability group?  What are the ramifications to the db logging and how much would it cause the database mdf/ndfs and ldfs to grow? Can you keep the application online and users connected if you can use this method? Any other considerations? 

Thanks,

Sue


Sue


Viewing all articles
Browse latest Browse all 4532

Trending Articles