Below are the scripts for finding the sessions holding libary cache lock:

For standalone db:

For RAC DB:

or