Unable to rebuilding clustered index in SQL Azure

Hi,
I'm trying to rebuild a clustered index in SQL Azure.  The table is quite large, and I'm attempting an offline rebuild using:
ALTER INDEX PK_Asset ON dbo.Asset
REBUILD 
Unfortunately, I'm unable to complete this operation because the operation fails with a timeout.  I've tried it several times, but with no success.
The index fragmentation is estimated to be around 85%, so I'm quite keen to reduce this.
Does anyone have any tips for getting around this in SQL Azure?
Thanks,
Nick

I believe you must be getting these error messages while tyring this operation:
Msg 40552, Level 20, State 1, Line 1
The session has been terminated because of excessive transaction log space usage. Try modifying fewer rows in a single transaction.
Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command.  The results, if any, should be discarded.
Creating, rebuilding and dropping indexes could generate a lot of transaction log records and may hit this error msg on larger tables. You may be able to work around the issue by creating a new table with the desired index layout, and then move the data
in smaller chunks over to the new table. However in most cases, you can minimize transaction log space usage with index operations by using the ONLINE option with your statement. Specifying the ONLINE=ON with CREATE, ALTER and DROP INDEX operations change
the characteristics of the execution. Instead of a single large transaction, the operation is performed in multiple shorter transactions in the background without holding exclusive locks for extended periods of time on the rows. This both improves concurrency
during the execution of the operation, and it eases the transaction log space requirement for the operation. This can help you avoid the 40552 exception.
PS: The rebuild command using the ONOINE=ON may also fail if you have BLOB datatype colume (datatype like ttext, image, varchar(max), nvarchar(max), varbinary(max), xml, or large CLR type).
HTH,
Thanks and regards,
__Raman
Raman Sharma - MSFT Microsoft

Similar Messages

  • How do I set access 2002 Upsizing Wizard to create clustered-index on SQL 2005

    Here is an extract from the Acc2Sql2.doc  >>
    By default, the Upsizing Wizard
    transfers all indexes as nonclustered indexes. You can modify the Upsizing
    Wizard to transfer the primary key index to a clustered index. To make this
    change, start Microsoft Access and open the upsizing wizard library database.
    For Microsoft Access 95, the filename is Wzcs.mda. For Microsoft Access 97, the
    filename is Wzcs97.mda. When the database is open, click the Modules tab and open the
    UT_ModUserConstants module. Search down to the UT_CLUSTERED constant. Change
    the default value from False to True.
    <<< end quote
    Question: I am using ACCESS 2002 upsize wizard, I searched my computer for *.mda and could not find any wzcs*.mda.  How do I set it so that it creates clustered-index instead of non-clustered-index?

    Hi,
    This question is not related to the forum. This is a question regarding MS-ACCESS.
    [Personal Site] [Blog] [Facebook]

  • Space occupied by clustered index Vs non-clustered index

    I am trying to understand the indexes. Does clustered index occupy more space than a non-clustered index because it carries the information about rest of the other columns also. Could you guys please help me understand this. Thanks in advance.
    svk

    Hi czarvk,
    Clustered index in SQL Server takes up more space than non-clustered indexes.
    Clustered index arranges the way records are stored in a table putting them in order (key, value), all the data are sorted on the values of the index.
    A non-clustered index is a completely different object in a table, containing only a subset of columns and a row locator to the table’s rows or to the clustered index’s key.
    So clustered index in SQL Server takes up more space than non-clustered indexes.
    If you have any question, please feel free to let me know.
    Regards,
    Donghui Li

  • How to create clustered index in Oracle ?

    I need to Create unique clustered index idx_col1 on table1(col1) in Oracle 9i.
    Should I declare it at creation of table as index-organized ? My table is created with the code like Create table table1 as select ..... from ....
    Can anybody post an example ?
    Thanks

    Oracle does not have the concept of a clustered index from SQL Server. You may get something similar if you create your table as an index organized table, i.e.
    CREATE TABLE my_iot (
      col1 number primary key,
      col2 number
    organization index;or you may get similar benefits by creating a cluster. It really depends on what functionality you're trying to replicate and what problem your trying to solve. Either way, though, you'll have to have separate steps to create the table and then to insert the data.
    Justin

  • Unable to save a report that includes a datasource of "Microsoft SQL azure" type

    I have install SSRS in azure using the following instructions (http://msdn.microsoft.com/en-us/library/dn449661.aspx) and all seems to work fine, however when I create a report in report builder 2014 (in this case empty) that includes a Microsoft SQL Azure
    datasource type I am unable to save the report and get the following error message (even though when I test connection it succeeds). 
    "The report definition was saved, but one or more errors occurred while setting the report properties"
    Reports with standard sql datasources work fine.
    I have also tried creating the report using Visual Studio 2013 and get a similar error message.
    I have tried this using SQL 2012 and SQL 2014 and get the same error.
    Does anybody know how I can create a report with Microsoft SQL Azure datasource type?

    Hi jamesla,
    Based on my research, the issue can be caused by a deleted shared data source still exist under the Data Sources list in Report Builder. For more details about this scenario, we can refer to the following thread:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/7170dbee-048c-4298-89ba-df4d42924c8e/the-report-definition-was-saved-but-one-or-more-errors-occurred-while-setting-report-properties?forum=sqlreportingservices
    Since the error message without detail information, we can try to render the report to see the detail error message. Besides, we can try to check it in the log file. The SQL Reporting Services log files are found on the reporting services point server, in
    the folder %programfiles%\Microsoft SQL Server\<SQL Server Instance>\Reporting Services\LogFiles.
    For more information about how to use Microsoft SQL azure as the data source of a report, please see:
    http://msdn.microsoft.com/en-IN/library/ff519560.aspx
    http://programming4.us/database/2158.aspx
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Non Clustered Indexing not working for SQL server 2005

    I have create two non clustered index on two particular tables. Now the problem is its working fine..but after restarting my server its working stop and then again I have to delete that index and recreate it.

    try these links 
    http://blog.sqlauthority.com/2009/02/07/sql-server-introduction-to-force-index-query-hints-index-hint/
    http://blog.sqlauthority.com/2009/02/08/sql-server-introduction-to-force-index-query-hints-index-hint-part2/
    http://www.brentozar.com/archive/2013/10/index-hints-helpful-or-harmful/
    Hope it Helps!!

  • SQL Server 2014 Bug - with Clustered Index On Temp Table with Identity Column

    Hi,
    Here's a stored procedure.  (It could be shorter, but this will show the problem.)
              CREATE PROCEDURE dbo.SGTEST_TBD_20141030 AS
              IF OBJECT_ID('TempDB..#Temp') IS NOT NULL
                 DROP TABLE #Temp
              CREATE TABLE #Temp
               Col1        INT NULL
              ,Col2        INT IDENTITY NOT NULL
              ,Col3        INT NOT NULL
              CREATE CLUSTERED INDEX ix_cl ON #Temp(Col2)
              SET IDENTITY_INSERT #Temp ON;
              RAISERROR('Preparing to INSERT INTO #Temp...',0,1) WITH NOWAIT;
              INSERT INTO #Temp (Col1, Col2, Col3)
              SELECT 1,2,3
              RAISERROR('Insert Success!!!',0,1) WITH NOWAIT;
              SET IDENTITY_INSERT #Temp OFF;
    In SQL Server 2014, If I execute this (EXEC dbo.SGTEST_TBD_20141030)   It works.   If I execute it a second time - It fails hard with: 
            Msg 0, Level 11, State 0, Line 0
            A severe error occurred on the current command.  The results, if any, should be discarded.
            Msg 0, Level 20, State 0, Line 0
            A severe error occurred on the current command.  The results, if any, should be discarded.
    In SQL Server 2012, I can execute it over and over, with no problem.  I've discovered two work-a-rounds:   
    1) Add "WITH RECOMPILE" to the SP CREATE/ALTER statement, or 
    2) Declare the cluster index in the TABLE CREATE statement, e.g. ",UNIQUE CLUSTERED (COL2)" 
    This second option only works though, if the column is unique.    I've opted for the "WITH RECOMPILE" for now.  But, thought I should share.

    Hi,
    I did not get any error Message:
             CREATE TABLE #Temp
               Col1        INT NULL
              ,Col2        INT IDENTITY NOT NULL
              ,Col3        INT NOT NULL
              CREATE CLUSTERED INDEX ix_cl ON #Temp(Col2)
              SET IDENTITY_INSERT #Temp ON;
              RAISERROR('Preparing to INSERT INTO #Temp...',0,1) WITH NOWAIT;
              INSERT INTO #Temp (Col1, Col2, Col3)
              SELECT 1,2,3
              RAISERROR('Insert Success!!!',0,1) WITH NOWAIT;
              SET IDENTITY_INSERT #Temp OFF;
    SELECT * FROM #Temp
    OUTPUT:
    Col1 Col2
    Col3
    1 2 3
    1 2 3
    1 2 3
    Select @@version
    --Microsoft SQL Server 2012 (SP1) - 11.0.3000.0 (X64) 
    Oct 19 2012 13:38:57 
    Copyright (c) Microsoft Corporation
    Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
    Thanks Shiven:) If Answer is Helpful, Please Vote

  • I'm unable to create a new Table on SQL Azure.

    I'm trying to create a new table in my custom database. But i'm getting this error message:
    'Filegroup reference and partitioning scheme' is not supported in this version of SQL Server.'
    Here is the sample create schema:
    CREATE TABLE dbo.[Contact](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [FirstName] [nvarchar](250) NULL,
    [LastName] [nvarchar](250) NULL,
    [InsertDateTime] [datetime] NULL,
    [UpdateDateTime] [datetime] NULL,
    [PhoneNo1] [nvarchar](50) NULL,
    [CellNo1] [nvarchar](50) NULL,
    [IsActive] [bit] NOT NULL,
    CONSTRAINT [PK_Contact] PRIMARY KEY CLUSTERED
    [ID] ASC
    )WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    BT

    In addition to Neil's comment, I would add that one of the major strengths of SQL Azure is its simplicity from an administrative standpoint while providing as much parity as possible for the relational and programming stack.  In somes
    cases, less is more. SQL Azure is an example.  By having a simpler system we are able to get certain capabilities not available on premise. Take a look at the CREATE DATABASE XYZ AS COPY OF operation for example, you do not have to worry about finding
    a server with enough space; you do not have to worry about moving files around a network or creating shares between machines; and best of all, you do not have to any kind or provisioning of cleanup as a result of cloning a database. The upcoming Data Federation
    feature is another example of what you can achieve when you are free of underlying configuration details.
    That's not to say SQL Azure wouldn't benefit from some capabilties of the SQL Server platform (for example TDE); but personally I am happy that two years later we still don't have to worry about many of those low-level configuration details.
    Herve Roggero, Blue Syntax MVP SQL Azure Co-Author: Pro SQL Azure

  • SQL Azure indexer support for Collection(Edm.String)

    Is there a plan to support "Collection(Edm.String)
    " with a SQL Azure indexer? Maybe via an XML type?
    Unless I'm misunderstanding the supported types
    https://msdn.microsoft.com/en-us/library/azure/dn946880.aspx
    It sort of fizzles out after "time, timespan" but I'm assuming it's Not Supported's all the way down

    http://feedback.azure.com/forums/263029-azure-search/suggestions/7189214-sql-azure-indexer-support-for-collection-edm-strin
    Was going to start there but just wanted to vet that it indeed wasn't there.... I realize it's a bit awkward and anti - sql storing data like that in a column and will probably annoy DBAs.
     Currently the data we'd use this for would be Customer phone numbers, addresses, VIN for vehicles, and some account numbers... So nothing super fancy...   Straight delimiters might get funky with addresses but maybe a standard backspace escape
    sequence or letting user use ascii hexcode if the delimiter is in the text..  
    For now we already have a comma separated SearchText field we've indexed for use with FTS and I just pointed an Edm.string at that column in our DB and it seems to pick up all the comma separated elements... But I'm guessing it's not as efficient as if it
    was stored in more specific collections.

  • FIM SQL rebuild/reorganize indexes

    Hi,
    In FIM 2010 R2, do we need to manually create the SQL jobs to rebuild/reorganize indexes? Or is this a default configuration that just runs on SQL? I am referring to the 2 FIM databases.
    Thanks,
    SK

    Hi SK,
    We have to manually create & schedule SQL Jobs to automate the indexing.
    Regards,
    Manuj Khurana

  • Unable to drop SQL azure table

    Hi,
    I'm trying to drop SQL azure table. However I can delete data inside the table. When using drop command, it is taken long time processing and finally this error message 'Connection Failed'. Please help me. Thanks

    That sounds like an internal error in SQL Server which may be due to corruption. Don't really know how you deal with that in Azure. But if DBCC CHECKDB is available, run it and see what happens.
    Also, do you have any DDL triggers on the database? In such case, disable the trigger, in case it is the trigger that is failing.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Unable to acces a an Azure website that uses SQL Azure?

    I have have uploaded a website to Azure that usese SQL Azure. When I try to access that stie iget the connection error message below.
    "The device or resource (the site URL) is not set up to accept connections on port "The World Wide Web service (HTTP)".
    When I upload a website that does not uses SQL azure, I can access that site without any connection errors.
    Appreciate any feedback.
    Thanks

    Does the site load at all?  If not, can you double check that your endpoints are properly defined in your service definition?
    Have you configured your SQL Azure instance to accept connections from other Windows Azure Services datacenters?  You need to make sure the firewall rule exists with IP Start and End range of 0.0.0.0.  There is a check box you can simply
    check in the SQL Azure firewall settings.
    If neither of those work, can you paste the SQL Connection string (without the server, username, and password).
    Harin

  • SQL Server 2012 Deploy Database to SQL Azure...

    I have spent many days trying to copy a simple test database from my PC to SQL Azure but with little success.  Then I installed SQL Server 2012 and see a new task:
    Deploy Database to SQL Azure...  It looks like an automated extraction to DAC and then creating the Azure database all in one step.
    I was elated, but got hit with the following three types of errors.
    One or more unsupported elements were found in the schema used as part of a data package.
    Error SQL71564: The element Extended Property: [dbo].[Accounts].[Address].[MS_Description] is not supported when used as part of a data package (bacpac).
    Error SQL71564: Table Table: [dbo].[Activities] does not have a clustered index.  Clustered indexes are required for inserting data in this version of SQL Server.
    Error SQL71564: Element User: [NT AUTHORITY\NETWORK SERVICE] has an unsupported property AuthenticationType set and is not supported when used as part of a data package.
     (Microsoft.SqlServer.Dac)
    May I know what I can do on the on-premise database to rid of the first and third error?
    Thanks.

    Hello,
    1) Remove the Extended Property from the (?) column Address in table Accounts.
    BTW, for small databases it's sometimes easiere to generate a script for the database (and modify it slightly) instead of using the Wizard
    Olaf Helper
    Blog
    Xing
    What is Extended Property?   What is this .MS_Description?   I can't see it in the table designer or the Column Properties.  (I don't know whether this was corruption caused by Data Sync I used earlier.)  How do I remove it.
    Of all the methods of copying SQL Server to Azure SQL, this one gives the least mistakes.  If I can solve this Extended Properties thing hopefully I can migrate the database over.

  • Clustered Primary key in Azure search service

    Hi ,
    Can you please let us know if it is possible to created Clustered Primary Key in Azure Search Service.
    We are unable to set the isKey property for more than one field in the index.
    Also can you providers some pointers on enabling search against multiple indexes. we have a use case where the search has to be performed against 3 different tables and the results set is a combination of all the 3 tables.
    Thanks,

    Since you mentioned setting the key property for more than one field, I think you're looking for compound keys, not clustered, is that correct? We don't support compound keys in Azure Search, to work around this you can concatenate (with a separator) the
    all parts of the key into a single string value and use it in Azure Search.
    Regarding multiple indexes, you can't search across multiple indexes in the same request right now. If you have different source tables and don't mind having them in the same index, you can index the content of the 3 tables into a single index (that has
    the combined/overlapped columns of all) and then search that index.
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Unable to drop spatial index

    Hi
    In my Oracle 11.2 Test database, i had accidentally deleted the base tables of a Spatial Domain index that starts with MDRT$.
    I am unable to drop or rebuild the index. I even tried dropping the schema , however the query just hangs forever for both
    SQL> drop index Geo1_ID_1 force;
    SQL> drop user geonom cascade;I checked the AWR and ASH report , those sql are not listed there .
    Please Suggest !

    hi,
    I'm grasping at straws here, but you might want to try recreating the user_sdo_geom_metadata entry. When you do, make sure there aren't any spaces in the table_name or column_name. It looks OK though from what you printed out.
    Also, you might want to consider leaving off the sdo_numtiles and sdo_maxlevel. Oracle is no longer recommending the use of hybrid indexes in almost all cases.
    regards,
    dan

Maybe you are looking for