I was thinking maybe the way to go would be create a new tmp table and transfer the table data from Primary FileGroup to the History in batches say 150,000 records at a time inserts...
My source table is just History data so wouldn't have to worry about locking... do I need to worry about TEMPDB size?
If my table layout is like below could someone share a table copy script that shows progress as I have over 2 trillion rows
to move from this table..
After script completion I could just rename table and then truncate source table after validation...
To regain that space from Primary filegroup and free space on that volume(Shrinkdb) ?
Current space consumption:
34437.5625 -- free space 34MB
2,048,165 -- db size 2TB
2.013.727.5 -- dbused size TB
Appreciate help and suggestions from prior posts.
CREATE TABLE [dbo].[tmp_sqlt_data_1_2022_10](
[tagid] [int] NOT NULL,
[intvalue] [bigint] NULL,
[floatvalue] [float] NULL,
[stringvalue] [nvarchar](255) NULL,
[datevalue] [datetime] NULL,
[dataintegrity] [int] NULL,
[t_stamp] [bigint] NOT NULL,
PRIMARY KEY CLUSTERED
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [History]