SCSM 2012 SP1 Data Warehouse Jobs failed with error message of <xxxx>vw is not updatable because a partitioning column was not found.

Wyatt Wong 116 Reputation points
2020-12-02T06:55:13.05+00:00

I found 4 data warehouse jobs have a Failed status. After further checking, the error messages mentioned "UNION ALL view '<xxxx>vw' is not updatable because a partitioning column was not found." How can I resolve the issue ?

Load.Common
Transform.Common
Load.CMDWDataMart
Load.OMDWDataMart

Service Manager
Service Manager
A family of System Center products for managing incidents and problems.
210 questions
{count} votes

Accepted answer
  1. D B 111 Reputation points
    2020-12-03T23:38:36.76+00:00

    steps provided by MS Support...I did these with all the job schedules disabled...

    on the datawarehouse SQL server...

    select max(datekey) from DWRepository..DateDim --should be 20501230
    select max(datekey) from DwDataMart..DateDim --should be 20501230
    select max(datekey) from CMDwDataMart..DateDim --should be 20501230
    select max(datekey) from OMDwDataMart..DateDim --should be 20501230

    If your errors are caused by this issue, the above queries will return 20201230

    If date keys are from Dec 2020, please use the below steps:

    1. Backup all DW DBs
    2. Add additional date keys until 2050
      Exec DWRepository.dbo.PopulateDateDim '20210101','20501231'
      Exec DwDataMart.dbo.PopulateDateDim '20210101','20501231'
      Exec CMDwDataMart.dbo.PopulateDateDim '20210101','20501231'
      Exec OMDwDataMart.dbo.PopulateDateDim '20210101','20501231'
    3. rebuild the constraints on all 2021 fact tables by using the following script Run the following on DWRepository, DWDatamart, CMDwDatamart, OMDwDatamart

    declare @objName sysname, @newChk as nvarchar(max)
    declare c cursor local FORWARD_ONLY READ_ONLY for
    select name from sys.sysobjects where xtype='C' and name like '%_2020_Dec_Chk' escape '\' order by 1
    open c; while 1=1 begin; fetch c into @objName if @@Fetch _STATUS<>0 break;
    set @objName = replace(@objName,'_2020_Dec_','_2021_Jan_')
    set @objName = replace(@objName,'_Chk','')
    set @newChk=replace('ALTER TABLE [dbo].[XYZFact_2021_Jan] WITH CHECK ADD CONSTRAINT [XYZFact_2021_Jan_Chk] CHECK (([DateKey]>=(20210101)));ALTER TABLE [dbo].[XYZFact_2021_Jan] CHECK CONSTRAINT [XYZFact_2021_Jan_Chk];','XYZFact_2021_Jan',@objName)
    exec sp_executesql @newChk
    end; close c; deallocate c;

    1. Restart Microsoft Monitoring Agent

    After this I was able to manually start each of the failed jobs, waited for completion, then enabled my job schedules.

    6 people found this answer helpful.

38 additional answers

Sort by: Most helpful
  1. Zakaria Muhammad 161 Reputation points
    2020-12-08T21:46:20.883+00:00

    I ran this but seems like the 2021_Jan Fact tables is missing the Range compare to 2020_Jan

    USE [DWDataMart]
    ALTER TABLE [dbo].[EntityManagedTypeFact_2020_Jan] WITH CHECK ADD CONSTRAINT [EntityManagedTypeFact_2020_Jan_Chk] CHECK (([DateKey]>=(20200101) AND [DateKey]<=(20200131)))
    ALTER TABLE [dbo].[EntityManagedTypeFact_2021_Jan] WITH CHECK ADD CONSTRAINT [EntityManagedTypeFact_2021_Jan_Chk] CHECK (([DateKey]>=(20210101)))

    USE [DWRepository]
    ALTER TABLE [dbo].[EntityManagedTypeFact_2021_Jan] WITH CHECK ADD CONSTRAINT [EntityManagedTypeFact_2021_Jan_Chk] CHECK (([DateKey]>=(20210101)))
    ALTER TABLE [dbo].[EntityManagedTypeFact_2020_Jan] WITH CHECK ADD CONSTRAINT [EntityManagedTypeFact_2020_Jan_Chk] CHECK (([DateKey]>=(20200101) AND [DateKey]<=(20200131)))

    I will wait for the next month to see if these are fixed. Also if we see the PopulateDateDim it still have

       @StartDay  smalldatetime = **'20000101',**
       @EndDay    smalldatetime =  **'20201231'**
    

  2. Jim Finke 1 Reputation point
    2020-12-09T16:06:06.603+00:00

    After running the accepted answer, my jobs were still failing. I modified the script as follows:

    declare @objName sysname, @newChk as nvarchar(max), anonymous userChk as nvarchar(max)
    declare c cursor local FORWARD_ONLY READ_ONLY for
    select name from sys.sysobjects where xtype='C' and name like '%_2020_Dec_Chk' escape '\' order by 1
    open c; while 1=1 begin; fetch c into @objName if @@Fetch _STATUS<>0 break;
    set @objName = replace(@objName,'2020_Dec','2021_Jan')
    set @objName = replace(@objName,'_Chk','')
    set anonymous userChk=replace('ALTER TABLE [dbo].[XYZFact_2021_Jan] DROP CONSTRAINT [XYZFact_2021_Jan_Chk];','XYZFact_2021_Jan',@objName)
    set @newChk=replace('ALTER TABLE [dbo].[XYZFact_2021_Jan] WITH CHECK ADD CONSTRAINT [XYZFact_2021_Jan_Chk] CHECK (([DateKey]>=(20210101) AND [DateKey]<=(20210131)));ALTER TABLE [dbo].[XYZFact_2021_Jan] CHECK CONSTRAINT [XYZFact_2021_Jan_Chk];','XYZFact_2021_Jan',@objName)
    print anonymous userChk
    print @newChk
    print '';
    end; close c; deallocate c;

    I had to add the drop constraint because they were created when I originally tried this. I added an end date to the Jan constraint of 20210131. Also, I used the print command that @Wyatt Wong suggested instead of the execute command. I copied the results and executed them in another query window.

    Next, I made the following changes to set the Dec constraints to an end date of 20201231 instead of 20201230:

    --December
    declare @objName sysname, @newChk as nvarchar(max), anonymous userChk as nvarchar(max)
    declare c cursor local FORWARD_ONLY READ_ONLY for
    select name from sys.sysobjects where xtype='C' and name like '%_2020_Dec_Chk' escape '\' order by 1
    open c; while 1=1 begin; fetch c into @objName if @@Fetch _STATUS<>0 break;
    --set @objName = replace(@objName,'2020_Dec','2021_Jan')
    set @objName = replace(@objName,'_Chk','')
    set anonymous userChk=replace('ALTER TABLE [dbo].[XYZFact_2021_Jan] DROP CONSTRAINT [XYZFact_2021_Jan_Chk];','XYZFact_2021_Jan',@objName)
    set @newChk=replace('ALTER TABLE [dbo].[XYZFact_2021_Jan] WITH CHECK ADD CONSTRAINT [XYZFact_2021_Jan_Chk] CHECK (([DateKey]>=(20201201) AND [DateKey]<=(20201231)));ALTER TABLE [dbo].[XYZFact_2021_Jan] CHECK CONSTRAINT [XYZFact_2021_Jan_Chk];','XYZFact_2021_Jan',@objName)
    print anonymous userChk
    print @newChk
    print '';
    end; close c; deallocate c;

    After this, my jobs ran successfully.


  3. Shumail Khalid 1 Reputation point
    2020-12-31T08:59:54.773+00:00

    Hi,

    It was worked previously after executig script shared by DB-7386 , but today again we face the same problem after 12 am.
    may be it is because of 31/12/2020 date? any resolution for this issue? below is the error we are facing in the DW job error log

    Module name: TransformEntityRelatesToEntityFact
    Message: ErrorNumber="4457" Message="The attempted insert or update of the partitioned view failed because the value of the partitioning column does not belong to any of the partitions." Severity="16" State="1" ProcedureName="TransformEntityRelatesToEntityFactProc" LineNumber="305" Task="Step 8: Inserting new records into destination fact"

    Stack: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() 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, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
    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.ExecuteReader()
    at Microsoft.SystemCenter.Warehouse.Utility.SqlHelper.ExecuteReader(SqlConnection sqlCon, CommandType cmdType, String cmdText, SqlParameter[] parameters)
    at Microsoft.SystemCenter.Warehouse.Etl.StoredProcedure.Execute(IXPathNavigable config, Watermark wm, DomainUser sourceConnectionUser, DomainUser destinationConnectionUser)
    at Microsoft.SystemCenter.Warehouse.Etl.TransformModule.Execute(IXPathNavigable config, Watermark wm, DomainUser sourceConnectionUser, DomainUser destinationConnectionUser, Int32 batchSize)
    at Microsoft.SystemCenter.Warehouse.Etl.TransformModule.Execute(IXPathNavigable config, Watermark wm, DomainUser sourceConnectionUser, DomainUser destinationConnectionUser)

    Thanks


  4. Shumail Usmani 1 Reputation point
    2021-01-01T08:25:58.16+00:00

    After applying fix SalimAssaf-7299 getting below error

    ETL Module Execution failed:
    ETL process type: Load
    Batch ID: 2225732
    Module name: LoadDWDataMartServiceRequestStatusDurationFact
    Message: UNION ALL view 'DWDataMart.dbo.ServiceRequestStatusDurationFactvw' is not updatable because a partitioning column was not found.

    Stack: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
    at Microsoft.SystemCenter.Warehouse.Utility.SqlBulkOperation.PartitionedViewUpdate(SqlConnection sourceConnection, String sourceQuery, String destinationTable, Dictionary2 mapping, SqlConnection destinationConnection, Collection1 pkColumns)
    at Microsoft.SystemCenter.Warehouse.Utility.SqlBulkOperation.PartitionedViewUpsert(String sourceConnectionString, String sourceQuery, String destinationTable, Dictionary2 mapping, String destinationConnectionString, Collection1 pkColumns, Int32& insertCount, Int32& updateCount, DomainUser sourceSecureUser, DomainUser destSecureUser, SqlResourceStore targetStore)
    at Microsoft.SystemCenter.Warehouse.Etl.ADOInterface.PartitionedViewUpsert(DomainUser sourceConnectionUser, DomainUser destinationConnectionUser)
    at Microsoft.SystemCenter.Warehouse.Etl.ADOInterface.Execute(IXPathNavigable config, Watermark wm, DomainUser sourceConnectionUser, DomainUser destinationConnectionUser)
    at Microsoft.SystemCenter.Warehouse.Etl.LoadModule.Execute(IXPathNavigable config, Watermark wm, DomainUser sourceConnectionUser, DomainUser destinationConnectionUser, Int32 loadBatchSize)
    at Microsoft.SystemCenter.Warehouse.Etl.LoadModule.Execute(IXPathNavigable config, Watermark wm, DomainUser sourceConnectionUser, DomainUser destinationConnectionUser)
    at Microsoft.SystemCenter.Etl.ETLModule.OnDataItem(DataItemBase dataItem, DataItemAcknowledgementCallback acknowledgedCallback, Object acknowledgedState, DataItemProcessingCompleteCallback completionCallback, Object completionState)

    0 comments No comments