how to Create index online?

  • Below is the script for creating index and how can I change the script to create index onlie?

    what are benfits and disadvangates of online and offile?

    CREATE NONCLUSTERED INDEX [_dta_index_dClientCode_16_437576597__K7_K3_1] ON [dbo].[dClientCode]

    (

    [ClientGenericId] ASC,

    [Code] ASC

    )

    INCLUDE ( [ClientCodeId]) WITH (SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [Data_Data]

  • How to modify the above script for creating index online.

  • What didn't you understand in my previous post?

    What part of ONLINE = SOMETHING OTHER THAN OFF GOES HERE are you having troubles with?

  • CREATE NONCLUSTERED INDEX [_dta_index_dClientCode_16_437576597__K7_K3_1] ON [dbo].[dClientCode]

    (

    [ClientGenericId] ASC,

    [Code] ASC

    )

    INCLUDE ( [ClientCodeId]) WITH (SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = ON) ON [Data_Data]

    Use online= off recommended,some indexes will not create with online option ON

    Regards,
    Syed Jahanzaib Bin Hassan
    BSCS | MCTS | MCITP | OCA | OCP | OCE | SCJP | IBMCDBA

    My Blog
    www.aureus-salah.com

  • Ninja's_RGR'us (5/26/2011)


    What didn't you understand in my previous post?

    What part of ONLINE = SOMETHING OTHER THAN OFF GOES HERE are you having troubles with?

    It is comments like this that makes me shy away from this site. It is completely unnecessary. For those who care to know a more appropriate response, something this would have been more effective:

    "Take a closer look at my previous comments in regard to ONLINE. If you still don't understand, then please provide very specific details about what you don't understand, and I'll try to help."

  • tlunsf (3/28/2014)


    Ninja's_RGR'us (5/26/2011)


    What didn't you understand in my previous post?

    What part of ONLINE = SOMETHING OTHER THAN OFF GOES HERE are you having troubles with?

    It is comments like this that makes me shy away from this site. It is completely unnecessary. For those who care to know a more appropriate response, something this would have been more effective:

    "Take a closer look at my previous comments in regard to ONLINE. If you still don't understand, then please provide very specific details about what you don't understand, and I'll try to help."

    Good point!

  • Apologies and hope things are working for you.

  • Ranzz (5/26/2011)


    Below is the script for creating index and how can I change the script to create index onlie?

    what are benfits and disadvangates of online and offile?

    CREATE NONCLUSTERED INDEX [_dta_index_dClientCode_16_437576597__K7_K3_1] ON [dbo].[dClientCode]

    (

    [ClientGenericId] ASC,

    [Code] ASC

    )

    INCLUDE ( [ClientCodeId]) WITH (SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [Data_Data]

    An online index (build) allows access / modification of the data while the index maintenance operations take place. It is (correct me if I'm wrong) an Enterprise feature. To create an online index, set the ONLINE flag to ONLINE = ON.

    I cannot think of any disadvantages but the price of the Enterprise edition 😎

  • Yes, Enterprise Edition only

    http://technet.microsoft.com/en-us/library/cc645993.aspx#Scalability

  • There are other caveates that will prevent an index from being bilt/rebuilt in an online fashion unless you have 2k14. If the table has blobs in them, then the clustered index cannot be built or rebuilt in an online fashion and the non-clustered indexes cannot be created or rebuilt if the index contains a blob in the INCLUDE clause.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • tlunsf (3/28/2014)


    Ninja's_RGR'us (5/26/2011)


    What didn't you understand in my previous post?

    What part of ONLINE = SOMETHING OTHER THAN OFF GOES HERE are you having troubles with?

    It is comments like this that makes me shy away from this site. It is completely unnecessary. For those who care to know a more appropriate response, something this would have been more effective:

    "Take a closer look at my previous comments in regard to ONLINE. If you still don't understand, then please provide very specific details about what you don't understand, and I'll try to help."

    I agree but don't let the few drive you away from the many. There are lot's of good folks on this site and I've learned a lot from them.

    Shifting gears a bit, the reason why I call this site "home" is because that type of thing actually happens a whole lot less here (especially in the last year) than what I've observed on other sites and the quality of the good answers and the fact that discussions about the answers are encouraged makes it all very worthwhile to me.

    Heh... and no... I'm not an employee of this site or the parent company.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (3/29/2014)


    tlunsf (3/28/2014)


    Ninja's_RGR'us (5/26/2011)


    What didn't you understand in my previous post?

    What part of ONLINE = SOMETHING OTHER THAN OFF GOES HERE are you having troubles with?

    It is comments like this that makes me shy away from this site. It is completely unnecessary. For those who care to know a more appropriate response, something this would have been more effective:

    "Take a closer look at my previous comments in regard to ONLINE. If you still don't understand, then please provide very specific details about what you don't understand, and I'll try to help."

    I agree but don't let the few drive you away from the many. There are lot's of good folks on this site and I've learned a lot from them.

    Shifting gears a bit, the reason why I call this site "home" is because that type of thing actually happens a whole lot less here (especially in the last year) than what I've observed on other sites and the quality of the good answers and the fact that discussions about the answers are encouraged makes it all very worthwhile to me.

    Heh... and no... I'm not an employee of this site or the parent company.

    I have to agree with Jeff on this. We all make mistakes and respond in inappropriate ways at times, but for the most part we are a very professional group and have done a very good job of self policing ourselves and work very hard at trying to be a professional site for new comers and old residents.

Viewing 13 posts - 1 through 12 (of 12 total)

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