Showing results for 
Search instead for 
Do you mean 
Reply

TC Query to list orphan datasets and datasets which has no named reference in it

[ Edited ]

Hello,

 

I am tring to build the TC query to find all orphaned datasets that means datasets which are not attached to any item revision and thereafter list all datasets which has no named reference in it that mean no file attach with it

 

I have created query for 2d point as follows which will fid the datasts without named reference but not able to create the first case.

 

Please hlp me with query to find the orphaned datasets that means datasets which are not attached to any item revision.

 

Any help is highly appreciated. 

 

Thanks in advance.

Rathore

 

<plmxml_bus:QueryClause id="id4" stringValue="SELECT qid FROM Dataset WHERE &quot;owning_user.user_id&quot; = &quot;${OwningUser = $USERID}&quot; AND &quot;owning_group.name&quot; = &quot;${OwningGroup = $GROUP}&quot; AND &quot;creation_date&quot; &gt;= &quot;${CreatedAfter = }&quot; AND &quot;creation_date&quot; &lt;= &quot;${CreatedBefore = }&quot; AND &quot;last_mod_date&quot; &gt;= &quot;${ModifiedAfter = }&quot; AND &quot;last_mod_date&quot; &lt;= &quot;${ModifiedBefore = }&quot; AND &quot;ref_list&quot; IS_NULL &quot;IS_NULL&quot;"></plmxml_bus:QueryClause></

 

9 REPLIES

Re: TC Query to list orphan datasets and datasets which has no named reference in it

Hi,

You can alternatively use "dataset_cleanup" utility which does similar job. You can generate a report using -rf argument and later take necessary action.

 

Reference:

Repairs corrupted datasets and removes orphaned revision anchors.

A dataset is identified as corrupted if any of the following problems are found:

•Dataset has no reference to an ImanFile object.

•Dataset has reference to an ImanFile object, but the corresponding operating system file does not exist and the dataset is not archived.

•Dataset is an orphan (that is, the dataset refers to the anchor but the anchor does not go to dataset).

•Anchor refers to datasets that do not exist.

•Anchor size = 0.

 

Regards

Naveen Gowda

TC9.1

Re: TC Query to list orphan datasets and datasets which has no named reference in it

Hi Naveengm,

 

Thanks for your reply. Yeah that would be the possible solution but situation here is different.

 

For running these utilities one required the Tc Data and Tc root access and suppose someone don not have the access for that case I am trying to build the query. (Suppose Tc support L1 guys)

 

Any help for finding orphan datasets through some query would be appreciated.

 

Regards,

Rathore

 

 

Re: TC Query to list orphan datasets and datasets which has no named reference in it

Try this one...

 

query.png

 

Regards

Naveen Gowda

Re: TC Query to list orphan datasets and datasets which has no named reference in it

Thanks Naveen for taking time to post the reply.

 

Tried the query suggested by you but results are not as expected. it is showing the dataset’s versions but not the datasets.

 

I created a blank datasets not attached to any item but it was not listed in the result.

 

Output was like test.doc;1

 

2016-07-14 13_10_49-My Teamcenter - Teamcenter 10.png

 

But I think we are near to the solution Smiley Happy 

 

Regards,

Rathore

Re: TC Query to list orphan datasets and datasets which has no named reference in it

Hi   @naveengm : could you please explain how you got  "ItemRevision <-IMAN_specification" in the last row ?

 

Thanks!

Re: TC Query to list orphan datasets and datasets which has no named reference in it

@xplm2005

 

Click on "Referenced By" attribute in AttributeSelection pane.

 You get class/attribute selection pop-up.

Re: TC Query to list orphan datasets and datasets which has no named reference in it

@Rathore

 

Make sure you set Search Preference (in search results tab):

Latest Dataset Versions=checked

 

For test case, create a dataset within ItemRev. And then CUT

 

Regards

Naveen Gowda

Re: TC Query to list orphan datasets and datasets which has no named reference in it

@naveengm  Thanks for your reply. I was getting upto IMAN_specification before, but could not add it to the criteria. Now I understood that a property on IMAN_specification has to be selected to add a row and then the property has to be removed.

Re: TC Query to list orphan datasets and datasets which has no named reference in it

Hello all,
I am currently dealing with a similar issue. However I cannot find "IMAN_specification" in "ItemRevision" when looking in Referenced by.
Do you have an Idea what I am doing wrong?
Thanks