Author Topic: How to delete single statements from a CMOD Load File  (Read 3543 times)

tjspencer2

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
How to delete single statements from a CMOD Load File
« on: December 20, 2018, 08:28:39 AM »
Happy Holidays to everyone!!

I have an issue where I'm trying to unload one statement (the metadata) from a load file without unloading ALL the statements in the load file.

I know this can be done, but IBM CMOD Support says you can't do it.

I think it's a simple as removing the metadata from the db2 statement table where the criteria exist.

This effectively renders the statement unviewable even though it exists on your platform

I even think there were some articles published about this but I for the life of me cannot find them :(

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2228
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: How to delete single statements from a CMOD Load File
« Reply #1 on: December 20, 2018, 09:20:44 AM »
Weird that IBM Support wouldn't know that 'arsdoc delete' exists.  :)

Check it out in the Admin Guide, it will tell you everything you need to know.  Please make sure that you do a substantial amount of testing in lower regions before doing this in your production environment.  One screw-up can wipe out a LOT of data.  Also...  backups backups backups backups.  :)

-JD.
« Last Edit: December 20, 2018, 01:47:23 PM by Justin Derrick »
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

tjspencer2

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: How to delete single statements from a CMOD Load File
« Reply #2 on: December 20, 2018, 09:48:36 AM »
Thanks Justin, and in their defense it's maybe how I phrased my question - asked to unload - and can't do that, BUT you can Arsdoc Delete as you note. 

I posed this question and found the response here, as well for future reference: http://www.odusergroup.org/forums/index.php?topic=2192.0 .


nikeshpj

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: How to delete single statements from a CMOD Load File
« Reply #3 on: January 08, 2019, 03:03:21 AM »
I have done an actual unload of one logical document from a load.
But it is a bit of manual process.
1. Extract the document and indexer file using "arsdoc get"
2. Find of which logical document (metadata and offset  details from the indexer file you want to unload)
3. Remove the content from the Reportfile(using the offset details)
4. Remove the metadata from the indexer file.
5. Change the offset for the other logical documents.
6. Load this report file and index file again to OD.
7. Unload the Previous load.

I know that this is not someone would suggest. But this helps :)

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: How to delete single statements from a CMOD Load File
« Reply #4 on: January 08, 2019, 05:31:40 AM »
Or even simpler than that (without playing with indexes, or whatever offser/length fields)

- Get the LoadID where the document you want to unload is (let say in old format: 123-123FAAA-1-0-12345-12345)
- Remove the index you don't want (arsdoc delete)
- retrieve all the documents from the LoadID from first step (arsdoc get -c -X loadID ...)
- archive the what you have retrieved in the previous point (arsload -X G -g ... -a ... ) You will have duplicates after this step is finished
- unload the whole original LoadID (that you took in the first step) (arsadmin unload -L LoadID -g ... )

Of course each of these steps must be successful in order to go to the next step, otherwise you will have lost documents! So again backup backup backup before trying/testing/... !

And of course after this method the LOAD will be different that the original one, so if you keep a database/file of the loadids... you might be careful with that method.
Basically this method is used by the CMOD module called ERM (Enhanced Retention Management), which gives you also a new LoadID!!
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

Stephen McNulty

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: How to delete single statements from a CMOD Load File
« Reply #5 on: January 09, 2019, 06:32:37 AM »
Or even simpler than that (without playing with indexes, or whatever offser/length fields)

- Get the LoadID where the document you want to unload is (let say in old format: 123-123FAAA-1-0-12345-12345)
- Remove the index you don't want (arsdoc delete)
- retrieve all the documents from the LoadID from first step (arsdoc get -c -X loadID ...)
- archive the what you have retrieved in the previous point (arsload -X G -g ... -a ... ) You will have duplicates after this step is finished
- unload the whole original LoadID (that you took in the first step) (arsadmin unload -L LoadID -g ... )

Of course each of these steps must be successful in order to go to the next step, otherwise you will have lost documents! So again backup backup backup before trying/testing/... !

And of course after this method the LOAD will be different that the original one, so if you keep a database/file of the loadids... you might be careful with that method.
Basically this method is used by the CMOD module called ERM (Enhanced Retention Management), which gives you also a new LoadID!!

One thing to be aware of with this procedure; backups and testing are the key and really know your environment.

If indexes have been updated after they were loaded, OD will not retrieve those when using ARSDOC GET with the loadid.
 
I found this out while trying to build my own version of ERM. 

There is workaround (just not as simple as -X) instead of by Loadid  , using  -i "WHERE doc_name LIKE '*****FAA%'" and -s ****

#ISERIES #ODWEK #XML

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: How to delete single statements from a CMOD Load File
« Reply #6 on: January 10, 2019, 11:21:19 PM »
Quote
There is workaround (just not as simple as -X) instead of by Loadid  , using  -i "WHERE doc_name LIKE '*****FAA%'" and -s ****

Wow!!!! Thank you for the info that's invaluable!!
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

ramakanth

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How to delete single statements from a CMOD Load File
« Reply #7 on: January 20, 2020, 02:34:35 AM »
Or even simpler than that (without playing with indexes, or whatever offser/length fields)

- Get the LoadID where the document you want to unload is (let say in old format: 123-123FAAA-1-0-12345-12345)
- Remove the index you don't want (arsdoc delete)
- retrieve all the documents from the LoadID from first step (arsdoc get -c -X loadID ...)
- archive the what you have retrieved in the previous point (arsload -X G -g ... -a ... ) You will have duplicates after this step is finished
- unload the whole original LoadID (that you took in the first step) (arsadmin unload -L LoadID -g ... )

Of course each of these steps must be successful in order to go to the next step, otherwise you will have lost documents! So again backup backup backup before trying/testing/... !

And of course after this method the LOAD will be different that the original one, so if you keep a database/file of the loadids... you might be careful with that method.
Basically this method is used by the CMOD module called ERM (Enhanced Retention Management), which gives you also a new LoadID!!




Hi Experts ,

Could you Please let us know where we can find the loadID.
the scenerio is like  we have inserted multiple no of documents,like 1 to 1000 we need to delete 850 documet how can we get the perticular load ID  odf 850 document.
 if it in table can you please tell me the table name .
Thanks in advance

Lars Bencze

  • Full Member
  • ***
  • Posts: 116
  • CMOD Expert at Skandia
    • View Profile
    • INACTIVE - Bezland Consulting
Re: How to delete single statements from a CMOD Load File
« Reply #8 on: January 20, 2020, 07:33:05 AM »
Hi ramakanth,

The answer depends a bit on what interface you plan on using.
The most straightforward method would be to find the document(s) you want to delete using arsdoc query with the -I p flags, or the -D flag which also includes some additional system metadata.

You could also use the OnDemand Client and just right-click on a document and select "Properties" to see the (partial) LoadID. (You can "pad" such partial LoadIDs with "-0-0-0" or search for the full LoadID in the OD System Log, which is better)

Or you could use the ODApi to call for such data.

I would strongly suggest against accessing the database directly. First for security reasons, and second if you plan to make changes directly to the database, that's a big no-no.
I suggest you try the arsdoc query method above and get back to us know if you need any more guidance.
OnDemand for MP expert. #Multiplatforms #Admin #Scripts #Performance #Support #Architecture #PDFIndexing #TSM/SP #DB2 #CustomSolutions #Integration #UserExits #Migrations #Workflow #ECM #Cloud #ODApi

ramakanth

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How to delete single statements from a CMOD Load File
« Reply #9 on: January 21, 2020, 12:06:44 AM »
Hi Lars,
Thankyou for the quick reponse let me see the guideline which you have shared .
Thankyou

Lars Bencze

  • Full Member
  • ***
  • Posts: 116
  • CMOD Expert at Skandia
    • View Profile
    • INACTIVE - Bezland Consulting
Re: How to delete single statements from a CMOD Load File
« Reply #10 on: January 27, 2020, 02:57:56 AM »
Hi Lars,
Thankyou for the quick reponse let me see the guideline which you have shared .
Thankyou
This type of query should get you all of the above. Replace anything starting with "my" with your own, real object names:

arsdoc query -f "MyFolder" -h ARCHIVE -i "WHERE MyID='MYID_12345'" -u MyUsername -p ~/myStashfile.stash -v -G MyApplicationGroup -H -D -I p
OnDemand for MP expert. #Multiplatforms #Admin #Scripts #Performance #Support #Architecture #PDFIndexing #TSM/SP #DB2 #CustomSolutions #Integration #UserExits #Migrations #Workflow #ECM #Cloud #ODApi