Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

what's the relation between v$view and dba_hist*?

484696Aug 19 2010 — edited Aug 20 2010
Today, I have a problem:
I ran a sql, and can be check in the v$sql, but I can't search it in the dba_hist_sqltext. why?

sample:
1. run a sql:
anmh@MYORACLE> select count(*) from a2;

2.check in v$sql:
sys@MYORACLE> select sql_id,sql_text
from v$sql
where sql_text like '%a2%'
order by LAST_LOAD_TIME
sql_id sql_text
880yywbu8kg7z select count(*) from a2

3.create snapshot:
esys@MYORACLE> select to_char(sysdate,'yyyymmdd hh24miss') from dual;

TO_CHAR(SYSDATE
---------------
20100819 143726

sys@MYORACLE> exec dbms_workload_repository.create_snapshot;

PL/SQL procedure successfully completed.

sys@MYORACLE> l
1* select to_char(sysdate,'yyyymmdd hh24miss') from dual
sys@MYORACLE> select snap_id, BEGIN_INTERVAL_TIME from dba_hist_snapshot order by 1 desc ;

SNAP_ID BEGIN_INTERVAL_TIME
12868 19-AUG-10 02.35.06.528 PM

4. check in dba_hist_sqltext:
sys@MYORACLE> select sql_id,sql_text from dba_hist_sqltext where sql_id='880yywbu8kg7z';

no rows selected

what 's the problem? thanks
This post has been answered by Uwehesse-Oracle on Aug 19 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 17 2010
Added on Aug 19 2010
7 comments
1,525 views