Skip to main content
13-Aquamarine
October 15, 2020
Solved

How to delete all WTParts and BOMs from PDMLink?

  • October 15, 2020
  • 3 replies
  • 4234 views

How to delete all the WTParts and BOMs? In our development machine we have loaded SAP parts  without taking a backup. we would like to wipe out the data and load again for testing. SAP parts weere
How to clean up WTParts and BOMs in bulk

Best answer by d_graham

Can’t you just write a utility that finds all links you loaded and delete them and then find all WTPartMasters you loaded and delete them.

 

You can search the links and masters by the date created if you know when the loading occurred.

 

I had to do a mass delete once. I had three windchill shells running the code for 3 days straight. When done the DB had shrunk by 24 GB.

3 replies

HelesicPetr
22-Sapphire II
22-Sapphire II
March 10, 2022

Hello @spitchan 

it is interesting question. 

I needed same thing in a past. 

I found only one way to delete all WTParts that I moved them all to a folder and then I deleted that folder. 

 

I had a trouble with an object counts so I needed to increase MethodServer memory to 10 GB because there where over 200k WTParts and links  

 

Hope this could help to anyone who deals with the question.

 

PetrH

avillanueva
23-Emerald I
23-Emerald I
March 10, 2022

How many do you have? If its <50000, I can see you doing it manually, churn and burn. Good idea to centrally locate them but use the collector to your advantage.  Grab 1000 to start in a collector and then include upstream links until no more are found (or where used). This should grab upper level assemblies that will stop you from deleting them cause you will have a trailing reference. You could also look at WTPartUsageLink table and see which parts have BOMs. Deleting those first will make the rest go quickly. Purging all iterations first will also help reduced references.

HelesicPetr
22-Sapphire II
22-Sapphire II
March 10, 2022

Hi @avillanueva 

Doesn't matter how many there are. 

Just move all WTParts to one folder and then just delete one folder.

I know the moving is annoying if you can display just 50k objects in a search results. 

 

The delete operation took several hours to complete.

 

PetrH

avillanueva
23-Emerald I
23-Emerald I
March 10, 2022

Six of one, half a dozen of the other. Search and move operation will be the time consuming part and this way he does not have to worry about running out of memory. It would suck to find out that after several hours that it failed. 

d_graham18-OpalAnswer
18-Opal
March 11, 2022

Can’t you just write a utility that finds all links you loaded and delete them and then find all WTPartMasters you loaded and delete them.

 

You can search the links and masters by the date created if you know when the loading occurred.

 

I had to do a mass delete once. I had three windchill shells running the code for 3 days straight. When done the DB had shrunk by 24 GB.

spitchan13-AquamarineAuthor
13-Aquamarine
June 21, 2022

we deleted schema and refreshed from test and loaded the data again