This script will use a sql_id to retrieve the execution plan for the query.
with aa as (
SELECT DISTINCT ss.sql_id, ss.plan_hash_value
FROM DBA_HIST_SQLSTAT SS
WHERE SS.SQL_ID = ‘&sql_id’
)
SELECT b.*
from aa, table(dbms_xplan.display_awr(aa.sql_id,aa.plan_hash_value)) b
/