Cleanup in TempDb T% tables possible in Dynamics AX 2012 R3?

Former Member

Hi

We have a lot of tables in TempDB - top 10:

NAME Count
TaxWithholdTrans 64959
RetailSalesTable 2853
TmpInventSalesOverviewLines 1674
TmpInventSalesOverviewSite 1674
TmpDataAreaRecIdFilter 1231
MyRoles 643
SDSPurchLineTmp 315
WHSLoadLine 290
TmpWMSPrintLabelLine 259
TmpWMSPrintLabelTable 251

I would like to DROP these tables, every night (older than 24 hours), but is it safe? Our Terminal Servers is restarted every night aka "clean-cut".

100 DROP TABLE takes about 3-5 seconds.

WHY:

Our Stop-Service *aos6* can sometimes take A LONG time (hours) - and I then just "kill AX32Serv.exe" - not pretty :-(

We will have minimal down-time during AX delivery (STAGE -> PRODUCTION).

Many of these tables have 0 rows, example: TaxWithholdTrans / 1816 - this may be due to disabling and "Module" in AX. But why do AX not cleanup nicely it self...

If deleting, then users can get errors like:

[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name 'tempdb.DBO.t112850_FBBD0BA9987D477783A6456038688C66'.

[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot find the object "t112850_FBBD0BA9987D477783A6456038688C66" because it does not exist or you do not have permissions.

[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the table 'tempdb.DBO.t112850_FBBD0BA9987D477783A6456038688C66', because it does not exist or you do not have permission.

( this error comes EVEN if the users has been signout, and is not on the "online users" list ... so AX must keep it in the cache files also ?? )

Temporary table name AXID Name create_date
t1816_463CD487502040E0947EF71AD63632DE 1816 TaxWithholdTrans 2018-11-16 11:16:46.457
t1816_DB60A978231B4C0AB4877DE8FFCFA37F 1816 TaxWithholdTrans 2018-11-16 11:16:46.100
t1816_15FFB99D9CFC431493AB98489E9423F3 1816 TaxWithholdTrans 2018-11-16 11:16:45.263
t1816_7CF58C3DDE194EE0ACB26EC80CDB1BDE 1816 TaxWithholdTrans 2018-11-16 11:16:44.107
t1816_238F61091344412AB461A32D4ABC572E 1816 TaxWithholdTrans 2018-11-16 11:16:43.317
t1816_B49769526C33427098EB488EE735AA89 1816 TaxWithholdTrans 2018-11-16 11:16:41.117
t1816_AD80F3BCFCBD455E91C6B22C5A674FFC 1816 TaxWithholdTrans 2018-11-16 11:16:40.787
t1816_E40BF5C8EFF641E2B7AC51454D194BAB 1816 TaxWithholdTrans 2018-11-16 11:16:40.387
t1816_E8496F346F6B4CEDA8B773495103E821 1816 TaxWithholdTrans 2018-11-16 11:16:39.937
t1816_2E04AD9B3713463B8498C62FE835F3F3 1816 TaxWithholdTrans 2018-11-16 11:16:39.570
t1816_8FA3F24B6ECD41158BC77034D6DAE796 1816 TaxWithholdTrans 2018-11-16 11:16:39.263
t1816_C8CA07365DF64520B7F7C2852762BBCA 1816 TaxWithholdTrans 2018-11-16 11:16:38.290
t1816_C1C6002A4D084A189236FA4641CAA9B2 1816 TaxWithholdTrans 2018-11-16 11:16:37.187
t1816_08582085C44841818959FBF32CB8F9E1 1816 TaxWithholdTrans 2018-11-16 11:16:35.833
t1816_5BA0BF4D2F39408F81A27DDFB38FBD96 1816 TaxWithholdTrans 2018-11-16 11:16:33.687
t1816_C54234AE746840328E4D4B8C546F623E 1816 TaxWithholdTrans 2018-11-16 11:16:33.343
t1816_9FAA0D9FAB11479B95DC462C39086B5F 1816 TaxWithholdTrans 2018-11-16 11:16:33.027
t1816_C8AFA8520EC84B7DB6976A897BFE664C 1816 TaxWithholdTrans 2018-11-16 11:16:32.707
t1816_37E3CB41CE5842969DC49B4A51005355 1816 TaxWithholdTrans 2018-11-16 11:16:32.387
t1816_84F2F3BCB710490C9A71EB6AD6C6E3B0 1816 TaxWithholdTrans 2018-11-16 11:16:32.067

/Lars

Related
Recommended