Maximo Open Forum

 View Only
  • 1.  Bulk Update Asset Location -What is the best approach?

    Posted 12-22-2023 01:06

    Hello all,

    We have a requirement to bulk move assets to next parent lelevl location.

    There are 100 thousands of assets and it would be a heavy load for data import and can affect queue performance.

    Can we do it through SQL script ? 

    Insert into ASSETTRANS (assetnum,datemoved,fromloc,toloc,glcreditacct,gldebitacct,transdate,enterby,assettransid,siteid,orgid,
    tositeid,toorgid,assetid,transtype) values ('','','' etc.);

    Update ASSET set location ='xx' where assetnum='yy';

    As I can find, the GLCredit ,GL Debit Accounts in ASSETTRANS table are GL Accounts of 'FROMLOC', 'TOLOC' locations.

    If there any other validation to be cosidered? OR any potential issue with this approach?

    Kindly advise.

    Thanks!


    #EverythingMaximo

    ------------------------------
    Sankar Ganesh V S
    DXC Technology
    ------------------------------


  • 2.  RE: Bulk Update Asset Location -What is the best approach?

    Posted 12-23-2023 03:26

    When you are moving Assets from One Parent to Another parent, do you want to keep the history of movement recorded. If yes then best solution is to use Bulk Move/Modify function from UI, but if data is very high then you can try doing it with MXLoader, but it will not capture the move/modify history.

    You can also use SQL to move but it will better to do move few and then testing of some UI txns on them to ensure you are not running into some data integrity or business logic validation failure.



    ------------------------------
    Prashant Sharma
    Sedin Technologies
    Connect with me @ https://www.linkedin.com/in/psharmamaximo/

    #IBM Champion 2022
    #IBM Champion 2023
    ------------------------------



  • 3.  RE: Bulk Update Asset Location -What is the best approach?

    Posted 12-25-2023 20:44

    Hi Prashath,

    Thanks for your response!

    I tested the Asset Move through Manual action and Data import. (with default Asset Object structrure processing class).

    It works in both cases and ASSETTRANS populated with all relevant fields. 

    I guess, it would be the same for MXLoader also?

    Since the data volume is huge (500k), we are planning to do via SQL Script.  We have idenntified the ASSETTRANS values as below. 

    Field in ASSETTRANS Value
    ASSETNUM Asset Number
    DATEMOVED Sys Date
    FROMLOC Current Location
    TOLOC New Location
    GLCREDITACCT GL Account of Current Location
    GLDEBITACCT GL Account of New Location
    TRANSDATE Sys Date
    ENTERBY MAXADMIN
    ASSETTRANSID (select max(assettransid) from assettrans)
    SITEID Site ID of Asset
    ORGID Org ID of Asset
    TOSITEID Site ID of Asset
    TOORGID Org ID of Asset
    ASSETID Asset ID
    TRANSTYPE MOVED'

    Inset SQL format:

    insert into  [dbo].[assettrans]
    (assetnum,datemoved,fromloc,toloc,glcreditacct,gldebitacct,transdate,enterby,assettransid,siteid,orgid,tositeid,toorgid,assetid,transtype)
    values(<Asset Number>,<sysdate>,<Current Location>,<New Location>,<GL Account of Current Location>,<GL Account of New Location>,<System Date>
    ,'MAXADMIN',(select max(assettransid) from [assettrans]),<SITEID>,<ORGID>,<SITEID>,<ORGID>,<ASSETID>,'MOVED');


    I'd like to confirm the above logic, particularly about the GL accounts population in ASSETTRANS.

    Kindly check and let me know your suggestions.

    Thanks!



    ------------------------------
    Sankar Ganesh V S
    DXC Technology
    ------------------------------



  • 4.  RE: Bulk Update Asset Location -What is the best approach?

    Posted 12-26-2023 08:22

    The general answer is never do SQL when what you need to achieve is doable through the UI/MIF. Often it will lead to issues down the road in a way that would be impossible through the framework. That often makes it very difficult to identify the issue. For example, your query above ignores the fromparent & toparent fields which should be recorded on all assettrans records (even if they are not modified). This feature is used for certain capabilities such as rolling a meter reading down to child assets that were part of the hierarchy when the meter reading was recorded (since meter readings can be backdated).

    There are other updates that may occur depending on the data on the records. For example, if the asset is a calibration asset, there is additional logic that needs to be invoked that you would be bypassing here. There is also validation that you are bypassing as well. If you provide an invalid location for example, the SQL update will allow it, but the MIF would prevent it. 

    While 500,000 records may sound like a lot, it is definitely manageable with the MIF. You want to make sure you are writing to a continuous JMS queue, not something like application import/export that processes each record one at a time as one massive transaction. But 500,000 asset updates can be processed in a reasonable timeframe without downtime.



    ------------------------------
    Steven Shull
    IBM
    ------------------------------



  • 5.  RE: Bulk Update Asset Location -What is the best approach?

    Posted 12-26-2023 23:25

    Hi Steven,

    Thanks for the detailed clarification.

    As you mentioend, the Data import validates, location status etc. 

    I tested using Object structure of ASSET, ASSETTRANS tables and default Asset Processing inbound class. 

    Kindly let me know if we need to include any other objects.

    Thanks!



    ------------------------------
    Sankar Ganesh V S
    DXC Technology
    ------------------------------



  • 6.  RE: Bulk Update Asset Location -What is the best approach?

    Posted 12-26-2023 10:25

    Hi all, I read all the threads, and it has been a great learning experience for me from your answer. As @Prashant Kumar mentioned, we can do it using UI using the Bulk Move/Modify function. So what I am thinking is, can we create any action script that invokes the Bulk Move/Modify function using one-time escalations so it will manage the movement history, And as @Steven Shull mentions about SQL, if something goes wrong with the script, it is very difficult to rollback the changes, and the record count itself is huge. So with my thinking, I am also not sure since I never came across the asset movement functionality, so I really appreciate the suggestions.

     

    Thanks

    Vivek Nagre



    ------------------------------
    Vivek Nagre
    JLL
    ------------------------------