Finding orphaned files through queries

These queries identify the records in FsEmbeddedObjects that are orphaned. After the orphaned records have been determined, appropriate actions should be taken to remove this data.

SQL Server


SELECT E.BLOB_ID, E.DESCRIPTION, E.FILE_NAME 

FROM FSEMBEDDEDOBJECTS E LEFT OUTER JOIN FSDOC D ON E.BLOB_ID = D.BLOB_ID 

WHERE D.DOC_ID IS NULL

Oracle


SELECT E.BLOB_ID, E.DESCRIPTION, E.FILE_NAME 

FROM FSEMBEDDEDOBJECTS E, FSDOC D 

WHERE E.BLOB_ID = D.BLOB_ID(+) AND D.DOC_ID IS NULL