Link to home
Create AccountLog in
Avatar of shanj
shanj

asked on

Recreate a table with partitions

Hello!

i have a table X with dependencies to other tables,views and the works ( 325 million rows approx.)

cannot use export import as i have to delete the orig.table.
switch partition is not a option "I THINK?"

what do i do?

I MUST USE read only FILEGROUPS on this table. WHY? because of faster backup and the data will never change. ( create partitions for a quarter ( 4 months). most of the queries runs against this table (cannot create a historic DB) and other issues from the departments.
Avatar of lcohan
lcohan
Flag of Canada image

"
i have a table X with dependencies to other tables,views and the works ( 325 million rows approx.)

cannot use export import as i have to delete the orig.table.
switch partition is not a option "I THINK?"

what do i do?

"


Sorry but in my opinion is not clear what do you really need to do therefor could you let us know what the real task is?
Do you need to transfer that table into another server/database/table then drop it??
Avatar of shanj
shanj

ASKER

I would like to create a partition on this table. with about 24 filgroups.
each file group will represent a quater year.( 4 months)
Further more after each quarter  i would like to make these filegroups into read only filegroups. ( i will be taking partial backups?)
"I would like to create a partition on this table. with about 24 filgroups."
I suggest create a new table as above and populate it from the old one than drop the old one but of course do all these in a test environment even if you don't have the 325 million rows in test env.

"each file group will represent a quater year.( 4 months)"
Then why not
1 table with 3 partitions?
    1 old and inactive,
    1 current and active,
    1 future to have it ready for > currentdate + next quarter (4months)
1 archive table with same structure to hold your historical data and where you could switch out/attach obsolete(old and inactive) partitions from above table.

BTW - 1 quarter in my opinion = 3 months (not 4) so you will have a full year sliding window in the active partitioned table with 4 (right boundary) partitions.



"Further more after each quarter  i would like to make these filegroups into read only filegroups. ( i will be taking partial backups?)"

Above scenario works as well for "partial backups" if you consider each partition on its own physical filegroup and backup the one(s) at will.
Avatar of shanj

ASKER

I suggest create a new table as above and populate it from the old one than drop the old one ...

My problem is my old table has a lot of dependencies.?
I think if you create a new partitioned table and keep using the existing one as a read only history/archive you don't need to worry about dependencies however the new one must be obviously added to all the code using old one.
Avatar of shanj

ASKER

OK, this is a solution. i See it. not sure if the developers + users will accept this, they have to change a lot of rapports ( buisness Objects) and have 2 copies of the same report?
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account