none
CRM2011导入数据的上限有多少,我导入数据时总是超时什么问题!!! RRS feed

  • 问题

  • select count(*) from AsyncOperationBase 在部分都是对这个表里的数据进行操作,能不能删除这个表中的数据?

    windows 日志信息如下:

    Query execution time of 10.6 seconds exceeded the threshold of 10 seconds. Thread: 51; Database: sales_MSCRM; Query:
    SET DEADLOCK_PRIORITY LOW
    BEGIN TRANSACTION
        DECLARE @res INT
        EXEC @res = sp_getapplock                
                    @Resource = 'AsyncService_app_lock',
                    @LockMode = 'Exclusive'
        IF @res NOT IN (0, 1)
        BEGIN
            RAISERROR ( 'Unable to acquire App Lock', 16, 1 )
        END
        ELSE
        BEGIN

    With TopSuspendedAsyncOperations(AsyncOperationId)
    AS
    (
    Select Top(2000) AsyncOperationId
    from AsyncOperationBase o1
    where
     StateCode = 1
    and ((PostponeUntil is NULL) or (PostponeUntil <= '05/08/2012 14:57:04'))
    and ((DependencyToken is NULL) or (not exists (
     select AsyncOperationId
     from AsyncOperationBase o2
     where
      o2.Sequence < o1.Sequence
     and o2.DependencyToken = o1.DependencyToken
     and o2.RecurrencePattern is null
     and o2.StateCode in (0,2,1))))
    )
    update AsyncOperationBase
    set
     StateCode = 0,
     StatusCode = 0,
     ModifiedOn = '05/08/2012 14:57:04',
     ModifiedBy = CreatedBy
    From AsyncOperationBase join TopSuspendedAsyncOperations on
    AsyncOperationBase.AsyncOperationId = TopSuspendedAsyncOperations.AsyncOperationId

    EXEC @res = sp_releaseapplock
                                @Resource = 'AsyncService_app_lock'
        END   
    COMMIT.

    2-------------------------------
    The Sandbox Host service has terminated a Sandbox Worker process.
     Source: Microsoft.Crm.Sandbox.HostService.exe (3972)
     Worker: {fd650356-b840-491c-b83c-90f5f3760c8e}:1076
     Reason: TerminateOther
    3------
    Query execution time of 10.2 seconds exceeded the threshold of 10 seconds. Thread: 50; Database: sales_MSCRM; Query:
    SET DEADLOCK_PRIORITY LOW
    BEGIN TRANSACTION
        DECLARE @res INT
        EXEC @res = sp_getapplock                
                    @Resource = 'AsyncService_app_lock',
                    @LockMode = 'Exclusive'
        IF @res NOT IN (0, 1)
        BEGIN
            RAISERROR ( 'Unable to acquire App Lock', 16, 1 )
        END
        ELSE
        BEGIN

    update AsyncOperationBase
    set
     HostId = 'CLOUDCC01.MSCRMAsyncService.a48487b5-8dec-45e5-8077-f2c79d38a16e',
     StateCode = 2,
     StatusCode = 20,
     StartedOn = '05/08/2012 14:53:09',
     ModifiedOn = '05/08/2012 14:53:09',
     ModifiedBy = CreatedBy,
     RetryCount = case coalesce(ErrorCode, 0)
         when 0 then coalesce(RetryCount, 0)
         else coalesce(RetryCount, 0)+1
         end
    output
     INSERTED.AsyncOperationId,
     INSERTED.OperationType,
     INSERTED.Data,
     INSERTED.DependencyToken,
     INSERTED.RegardingObjectId,
     INSERTED.RegardingObjectIdName,
     INSERTED.RegardingObjectTypeCode,
     INSERTED.OwningBusinessUnit,
     INSERTED.OwningExtensionId,
     INSERTED.OwningExtensionIdName,
     INSERTED.OwningExtensionTypeCode,
     INSERTED.OwnerId,
     INSERTED.RetryCount,
     INSERTED.MessageName,
     INSERTED.RecurrencePattern,
     INSERTED.RecurrenceStartTime,
     INSERTED.CorrelationId,
     INSERTED.CorrelationUpdatedTime,
     INSERTED.Depth,
     INSERTED.PrimaryEntityType,
     INSERTED.RequestId,
     INSERTED.CreatedOn,
     INSERTED.ExecutionTimeSpan
    where
    AsyncOperationId in
     (select top(1) AsyncOperationId from AsyncOperationBase WITH (READPAST, READCOMMITTEDLOCK, UPDLOCK)
      where StateCode = 0
      and OperationType IS NOT null
      order by Sequence asc)
    EXEC @res = sp_releaseapplock
                                @Resource = 'AsyncService_app_lock'
        END   
    COMMIT.
    4-------
    Query execution time of 23.1 seconds exceeded the threshold of 10 seconds. Thread: 48; Database: sales_MSCRM; Query: UPDATE ImportFileBase SET StatusCode = 5, CompletedOn = '05/08/2012 14:51:13' WHERE ImportFileId = '2bf0d5e7-1c99-e111-91c0-00e081dd838a' AND StatusCode <> 5.
    5----
    Query execution time of 17.1 seconds exceeded the threshold of 10 seconds. Thread: 50; Database: sales_MSCRM; Query:
    SET DEADLOCK_PRIORITY LOW
    BEGIN TRANSACTION
        DECLARE @res INT
        EXEC @res = sp_getapplock                
                    @Resource = 'AsyncService_app_lock',
                    @LockMode = 'Exclusive'
        IF @res NOT IN (0, 1)
        BEGIN
            RAISERROR ( 'Unable to acquire App Lock', 16, 1 )
        END
        ELSE
        BEGIN

    update AsyncOperationBase WITH  (READPAST,READCOMMITTEDLOCK,UPDLOCK)
    set
     ModifiedOn = '05/08/2012 14:51:19',
     ModifiedBy = CreatedBy
    where
      StateCode = 2
     and HostId = 'CLOUDCC01.MSCRMAsyncService.a48487b5-8dec-45e5-8077-f2c79d38a16e'
    EXEC @res = sp_releaseapplock
                                @Resource = 'AsyncService_app_lock'
        END   
    COMMIT.

    6-------------------
    Query execution time of 22.2 seconds exceeded the threshold of 10 seconds. Thread: 36; Database: sales_MSCRM; Query:
    SET DEADLOCK_PRIORITY LOW
    BEGIN TRANSACTION
        DECLARE @res INT
        EXEC @res = sp_getapplock                
                    @Resource = 'AsyncService_app_lock',
                    @LockMode = 'Exclusive'
        IF @res NOT IN (0, 1)
        BEGIN
            RAISERROR ( 'Unable to acquire App Lock', 16, 1 )
        END
        ELSE
        BEGIN

    update AsyncOperationBase
    set
     HostId = 'CLOUDCC01.MSCRMAsyncService.a48487b5-8dec-45e5-8077-f2c79d38a16e',
     StateCode = 2,
     StatusCode = 20,
     StartedOn = '05/08/2012 14:51:14',
     ModifiedOn = '05/08/2012 14:51:14',
     ModifiedBy = CreatedBy,
     RetryCount = case coalesce(ErrorCode, 0)
         when 0 then coalesce(RetryCount, 0)
         else coalesce(RetryCount, 0)+1
         end
    output
     INSERTED.AsyncOperationId,
     INSERTED.OperationType,
     INSERTED.Data,
     INSERTED.DependencyToken,
     INSERTED.RegardingObjectId,
     INSERTED.RegardingObjectIdName,
     INSERTED.RegardingObjectTypeCode,
     INSERTED.OwningBusinessUnit,
     INSERTED.OwningExtensionId,
     INSERTED.OwningExtensionIdName,
     INSERTED.OwningExtensionTypeCode,
     INSERTED.OwnerId,
     INSERTED.RetryCount,
     INSERTED.MessageName,
     INSERTED.RecurrencePattern,
     INSERTED.RecurrenceStartTime,
     INSERTED.CorrelationId,
     INSERTED.CorrelationUpdatedTime,
     INSERTED.Depth,
     INSERTED.PrimaryEntityType,
     INSERTED.RequestId,
     INSERTED.CreatedOn,
     INSERTED.ExecutionTimeSpan
    where
    AsyncOperationId in
     (select top(1) AsyncOperationId from AsyncOperationBase WITH (READPAST, READCOMMITTEDLOCK, UPDLOCK)
      where StateCode = 0
      and OperationType IS NOT null
      order by Sequence asc)
    EXEC @res = sp_releaseapplock
                                @Resource = 'AsyncService_app_lock'
        END   
    COMMIT.


    -------
    Query execution time of 12.7 seconds exceeded the threshold of 10 seconds. Thread: 24; Database: sales_MSCRM; Query:
    SET DEADLOCK_PRIORITY LOW
    BEGIN TRANSACTION
        DECLARE @res INT
        EXEC @res = sp_getapplock                
                    @Resource = 'AsyncService_app_lock',
                    @LockMode = 'Exclusive'
        IF @res NOT IN (0, 1)
        BEGIN
            RAISERROR ( 'Unable to acquire App Lock', 16, 1 )
        END
        ELSE
        BEGIN

    With TopSuspendedAsyncOperations(AsyncOperationId)
    AS
    (
    Select Top(2000) AsyncOperationId
    from AsyncOperationBase o1
    where
     StateCode = 1
    and ((PostponeUntil is NULL) or (PostponeUntil <= '05/08/2012 14:51:24'))
    and ((DependencyToken is NULL) or (not exists (
     select AsyncOperationId
     from AsyncOperationBase o2
     where
      o2.Sequence < o1.Sequence
     and o2.DependencyToken = o1.DependencyToken
     and o2.RecurrencePattern is null
     and o2.StateCode in (0,2,1))))
    )
    update AsyncOperationBase
    set
     StateCode = 0,
     StatusCode = 0,
     ModifiedOn = '05/08/2012 14:51:24',
     ModifiedBy = CreatedBy
    From AsyncOperationBase join TopSuspendedAsyncOperations on
    AsyncOperationBase.AsyncOperationId = TopSuspendedAsyncOperations.AsyncOperationId

    EXEC @res = sp_releaseapplock
                                @Resource = 'AsyncService_app_lock'
        END   
    COMMIT.


    ------
    Host CLOUDCC01: recovered from error processing organization 516027da-3f6f-488d-a3c2-39b508f943aa.


    ------------------

    Query execution time of 35.0 seconds exceeded the threshold of 10 seconds. Thread: 47; Database: sales_MSCRM; Query:
    SET DEADLOCK_PRIORITY LOW
    BEGIN TRANSACTION
        DECLARE @res INT
        EXEC @res = sp_getapplock                
                    @Resource = 'AsyncService_app_lock',
                    @LockMode = 'Exclusive'
        IF @res NOT IN (0, 1)
        BEGIN
            RAISERROR ( 'Unable to acquire App Lock', 16, 1 )
        END
        ELSE
        BEGIN

    With TopSuspendedAsyncOperations(AsyncOperationId)
    AS
    (
    Select Top(2000) AsyncOperationId
    from AsyncOperationBase o1
    where
     StateCode = 1
    and ((PostponeUntil is NULL) or (PostponeUntil <= '05/08/2012 14:50:44'))
    and ((DependencyToken is NULL) or (not exists (
     select AsyncOperationId
     from AsyncOperationBase o2
     where
      o2.Sequence < o1.Sequence
     and o2.DependencyToken = o1.DependencyToken
     and o2.RecurrencePattern is null
     and o2.StateCode in (0,2,1))))
    )
    update AsyncOperationBase
    set
     StateCode = 0,
     StatusCode = 0,
     ModifiedOn = '05/08/2012 14:50:44',
     ModifiedBy = CreatedBy
    From AsyncOperationBase join TopSuspendedAsyncOperations on
    AsyncOperationBase.AsyncOperationId = TopSuspendedAsyncOperations.AsyncOperationId

    EXEC @res = sp_releaseapplock
                                @Resource = 'AsyncService_app_lock'
        END   
    COMMIT.

    ------------------
    Invalid Trace Directory. Additional Info:[ Unable to Write file , Trace directory not defined (Reporting Process:File Name is Null. LocalTraceSettings: {Filename:  ,FileCountSuffix:1 ,TraceFileSize:10485760 ,TraceDirectory: ,TracingCallStack:Yes ,IsTracingOff:No ,LoadState:LoadSuccessfulUnreported ,RefreshTraceInt:-1 ,SiteWideRefreshTraceInt:-1 ,RegistryRefreshTraceInt:-1 ,Precedence:Organization} ] , AppDomain:CrmAsyncService)

    -------------------
    Invalid Trace Directory. Additional Info:[ Unable to Write file , Trace directory not defined (Reporting Process:File Name is Null. LocalTraceSettings: {Filename:  ,FileCountSuffix:1 ,TraceFileSize:10485760 ,TraceDirectory: ,TracingCallStack:Yes ,IsTracingOff:No ,LoadState:LoadSuccessfulUnreported ,RefreshTraceInt:-1 ,SiteWideRefreshTraceInt:-1 ,RegistryRefreshTraceInt:-1 ,Precedence:Organization} ] , AppDomain:CrmAsyncService) 

    -----
    Query execution time of 35.0 seconds exceeded the threshold of 10 seconds. Thread: 33; Database: sales_MSCRM; Query:
    SET DEADLOCK_PRIORITY LOW
    BEGIN TRANSACTION
        DECLARE @res INT
        EXEC @res = sp_getapplock                
                    @Resource = 'AsyncService_app_lock',
                    @LockMode = 'Exclusive'
        IF @res NOT IN (0, 1)
        BEGIN
            RAISERROR ( 'Unable to acquire App Lock', 16, 1 )
        END
        ELSE
        BEGIN

    update AsyncOperationBase
    set
     HostId = 'CLOUDCC01.MSCRMAsyncService.a48487b5-8dec-45e5-8077-f2c79d38a16e',
     StateCode = 2,
     StatusCode = 20,
     StartedOn = '05/08/2012 14:50:39',
     ModifiedOn = '05/08/2012 14:50:39',
     ModifiedBy = CreatedBy,
     RetryCount = case coalesce(ErrorCode, 0)
         when 0 then coalesce(RetryCount, 0)
         else coalesce(RetryCount, 0)+1
         end
    output
     INSERTED.AsyncOperationId,
     INSERTED.OperationType,
     INSERTED.Data,
     INSERTED.DependencyToken,
     INSERTED.RegardingObjectId,
     INSERTED.RegardingObjectIdName,
     INSERTED.RegardingObjectTypeCode,
     INSERTED.OwningBusinessUnit,
     INSERTED.OwningExtensionId,
     INSERTED.OwningExtensionIdName,
     INSERTED.OwningExtensionTypeCode,
     INSERTED.OwnerId,
     INSERTED.RetryCount,
     INSERTED.MessageName,
     INSERTED.RecurrencePattern,
     INSERTED.RecurrenceStartTime,
     INSERTED.CorrelationId,
     INSERTED.CorrelationUpdatedTime,
     INSERTED.Depth,
     INSERTED.PrimaryEntityType,
     INSERTED.RequestId,
     INSERTED.CreatedOn,
     INSERTED.ExecutionTimeSpan
    where
    AsyncOperationId in
     (select top(1) AsyncOperationId from AsyncOperationBase WITH (READPAST, READCOMMITTEDLOCK, UPDLOCK)
      where StateCode = 0
      and OperationType IS NOT null
      order by Sequence asc)
    EXEC @res = sp_releaseapplock
                                @Resource = 'AsyncService_app_lock'
        END   
    COMMIT.

    ------
    Invalid Trace Directory. Additional Info:[ Unable to Write file , Trace directory not defined (Reporting Process:File Name is Null. LocalTraceSettings: {Filename:  ,FileCountSuffix:1 ,TraceFileSize:10485760 ,TraceDirectory: ,TracingCallStack:Yes ,IsTracingOff:No ,LoadState:LoadSuccessfulUnreported ,RefreshTraceInt:-1 ,SiteWideRefreshTraceInt:-1 ,RegistryRefreshTraceInt:-1 ,Precedence:Organization} ] , AppDomain:CrmAsyncService)

    --------
    Host CLOUDCC01: error while processing organization 516027da-3f6f-488d-a3c2-39b508f943aa. Exception: System.Data.SqlClient.SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
       at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
       at System.Data.SqlClient.TdsParserStateObject.ReadByte()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
       at System.Data.SqlClient.SqlDataReader.get_MetaData()
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
       at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
       at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
       at Microsoft.Crm.CrmDbConnection.InternalExecuteReader(IDbCommand command, Boolean capturePerfTrace)
       at Microsoft.Crm.CrmDbConnection.ExecuteReader(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
       at Microsoft.Crm.Asynchronous.DataAccessBase.ExecuteSqlCommandAndProcessRecords(IDbCommand command, RecordProcessor recordProcessor)
       at Microsoft.Crm.Asynchronous.QueueDataAccess.SelectEvents(Int32 numberOfEvents)


    windows live Id :hellohongfu@hotmail.com


    2012年5月8日 15:01