I've come across a scenario where I was trying to compare plan for two SQL.
There I've fetched both sql_id against sql statement, and seen its plans through v$sql_plan table.
But after 20 minutes when I tried to execute sql to fetch plan for particular sql_id, none of the record showing from V$SQL_PLAN table and even from V$SQL table that SQL disappear.
I think It might be moved to history table but which history table shall I query.
Or what else I can do to retain in v$SQL or V$SQL_PLAN table.