Thanks for the updated, it is not real time scenario but some one asked me thhis question which i felt i should ask in this forum so i am asking

is there any way to find that backup piece are belongs to which database ?

Thanks

PGR

I'm always curious about "someone asked". It always sounds like trying to deflect any criticism to a mysterious "someone". Like saying "I have this friend who has this problem", when in reality the "friend" yourself and you just don't want to admit to having the problem. Else the "someone asked" was a job interviewer.

Nevertheless, the question sounds like you have this file (supposedly a backup piece) that exists in something of a vacuum and you want to know what database it belongs to. I revert back to my original reply. It should be in a directory structure that includes the name of the database. Did that not prove to be the case?

You could start an rman session on each of your 40 databases (did I mention that 40 databases on a single server is madness? ) and do a LIST BACKUP, then examine the results to see if the backup piece in question is listed.

Did I mention that 40 databases on a single server is madness?

Of course, this method does not take into account the possibility that the backup piece in question was moved from its original location and a CROSSCHECK BACKUP; DELETE EXPIRED BACKUP; was issued, leaving the backup piece 'orphaned'. In that case you'd have to revert to MohaAGOU's method.