Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  Delete Maximo object without deleting underlying db entity

    Posted 09/13/21 08:38 PM
    Edited by System Admin 03/22/23 11:46 AM
    MAM 7.6.1.2:

    Is there a way to delete a Maximo object (object metadata record), without deleting the underlying db entity?

    For example, for a non-imported view object, is there a way to delete the Maximo object from db config, without deleting the underlying db view?

    The reason I ask:
    That could be a workaround for creating a native db view without having CREATE VIEW privileges in the db.
    • Create a non-imported view object in Maximo (automatically creates a underlying db view).
    • Delete the Maximo object, without deleting the underlying db view.
    • Import the remaining db view as an imported view in Maximo.

    It's not a good solution, I know. It would be much better to just have CREATE VIEW privileges. But I just thought I'd ask in case it was possible option for us "database privilege peasants".

    Thanks.


    A somewhat related RFE:
    Create native db views via Maximo db config
    https://ibm-ai-apps.ideas.ibm.com/ideas/MASM-I-554

    #AssetandFacilitiesManagement
    #Maximo


  • 2.  RE: Delete Maximo object without deleting underlying db entity

    Posted 09/14/21 08:44 AM
    using automation script you can execute the following

    from psdi.server import MXServer
    dbManager = MXServer.getMXServer().getDBManager();
    con = dbManager.getConnection(mbo.getUserInfo().getConnectionKey());
    stmt = con.createStatement();
    stmt.execute("Your DROP STATMENT");
    dbManager.freeConnection(mbo.getUserInfo().getConnectionKey());

    I hope that helps 
    Amir

    ------------------------------
    amir anwar
    ------------------------------



  • 3.  RE: Delete Maximo object without deleting underlying db entity

    Posted 09/14/21 08:45 AM
    That's not possible out of the box. You could in theory purge the data from the MAXOBJECT/MAXOBJECTCFG, MAXATTRIBUTE/MAXATTRIBUTECFG, MAXRELATIONSHIP, etc. tables after ensuring you don't have the object referenced anywhere (automation scripts, integration object structures, etc.) but that's pretty tedious and you would need to reload some caches so Maximo doesn't know about the objects. It could probably be done but I wouldn't recommend it.

    ------------------------------
    Steven Shull
    ------------------------------



  • 4.  RE: Delete Maximo object without deleting underlying db entity

    Posted 12/18/21 02:57 PM
    Edited by System Admin 03/22/23 11:43 AM
    For what it's worth, deleting an imported view object in Maximo db config doesn't seem to drop the underlying view in the db.
    (But that's not what the question was about, since in order to create an imported view, I'd need the CREATE VIEW privilege in the db in the first place.)

    I just thought I'd mention the "deleting an imported view object doesn't drop the underlying db view" thing...just because I always forget that's how it works. So I end up with some junk views in the db...and don't realize until much later that they still need to be cleaned up.