Creating a Partition Scheme

  • Hello,

    I am trying to partition a DB, I have created the filegroups correctly (I think), I had to add a couple of filegroups along the way as I had an error with the amount of partitions compared to filegroups (I have trouble getting my head round this), so I added a few more files to the filegroup, I have created a partition function without problem, but when I try to create the partition scheme I get the following error:

    Msg 208, Level 16, State 58, Line 1

    Invalid object name 'FG2'.

    I am new and doing this to learn, so please excuse me if I havent given enough information. I have included everything I have done below, thank you for any help.

    -------------Create a Range based partition, first, the partition function--

    --create partition function part_Proj_No(int)

    --as range left for values (100,200)

    --go

    ------The following error

    --Msg 7707, Level 16, State 1, Line 1

    --The associated partition function 'part_Proj_No' generates more partitions than there are file groups mentioned in the scheme 'partscheme_AssignDB'.

    -- Makes me look at changing the partition function and add an addition range. I'm thinking I need more filegroups to make this work.

    --alter partition function part_Proj_No()

    --split range (300);

    -------------Add addition filegroups

    --alter database AssignDB

    --add file

    --(

    --Name=FG2_dat,

    --FileName='C:\ClassAssign\FG2.ndf',

    --Size=30MB,

    --MaxSize=50MB,

    --Filegrowth=5MB

    --)

    --to filegroup FG1;

    --alter database AssignDB

    --add file

    --(

    --Name=FG3_dat,

    --FileName='C:\ClassAssign\FG3.ndf',

    --Size=30MB,

    --MaxSize=50MB,

    --Filegrowth=5MB

    --)

    --to filegroup FG1;

    --alter database AssignDB

    --add file

    --(

    --Name=FG4_dat,

    --FileName='C:\ClassAssign\FG4.ndf',

    --Size=30MB,

    --MaxSize=50MB,

    --Filegrowth=5MB

    --)

    --to filegroup FG1;

    -------------Create the Partition Scheme--

    create partition scheme partscheme_AssignDB

    as Partition part_Proj_No TO

    ([FG1],[FG2],[FG3],[FG4])

    go

    Msg 208, Level 16, State 58, Line 1

    Invalid object name 'FG2'.

    I have had a look on the web, but I cannot find anything that relates to this, thank you again for any help given.

    Kind Regards,

    D.

  • Hello,

    Thank you all for the replys, which I got via e-mail, but cant see here for some reason. Its very obvious to me now thats it been pointed out that I add new files to the filegroup but not new filegroups, thank you very much.

    Kind Regards,

    D.

  • You have added all files to FG1 !!!

    FG2 does not exist !

    --alter database AssignDB

    --add file

    --(

    --Name=FG3_dat,

    --FileName='C:\ClassAssign\FG3.ndf',

    --Size=30MB,

    --MaxSize=50MB,

    --Filegrowth=5MB

    --)

    --to filegroup FG1;

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply