Using Proc METACLEANSE
Proc METACLEANSE is an experimental procedure in SAS 9.2 that allows you to clean up Foundation and Custom repositories from metadata "orphans".
In conjunction with the %OMABAKUP macro it is the best approach when it comes to maintain metadata in your environment.
But before using it always make sure that you take a backup of the metadata! The following demonstrates its use, assuming your Foundation repository is to be cleaned up and your metadata server is listening on port 8561:
proc metacleanse server='localhost' port=8561 userid='sasadm' password='-pwencoded-password-' repository='Foundation' protocol=bridge type='PropertyType' verbose cleanup; run;
Also if you want to know which objects are going to be deleted, you can run the same code without the CLEANUP option at the end. Finally, this procedure should not be used on Project repositories.