Skip to Main Content

SQL & PL/SQL

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!

Trying to generate AWR report for a sql_id

vpolasaJul 17 2014

Hi,

  I'm trying to generate AWR report for sql_id with below details:

I'm using the below query to get the sql_id: 8afh601gmtnm2, snap_id:213

SELECT d.sql_id,  d.snap_id,  s.sql_text

FROM dba_hist_sqlstat d

INNER JOIN v$sql s

ON s.sql_id           = d.sql_id

WHERE d.snap_id       > 181

AND d.snap_id        <= 221

AND d.instance_number = 1

AND d.dbid            = 1379679421

AND s.sql_text LIKE '%emp_test%';

Running below script:

@C:\app\orcl\product\12.1.0\dbhome_1\RDBMS\ADMIN\awrsqrpi.sql;

Values I entered for generating the report:

Report type: text

DBID: 1379679421

INST_NUM:1

NUM_DAYS: 1

BEGIN_SNAP:212

END_SNAP:214

SQL_ID: 8afh601gmtnm2

REPORT_NAME: <default>

I'm getting the below error:

no rows selected

Error starting at line : 206 File @ C:\app\orcl\product\12.1.0\dbhome_1\RDBMS\ADMIN\awrsqrpi.sql

In command -

select output from table(dbms_workload_repository.&fn_name( :dbid,

                                                            :inst_num,

                                                            :bid, :eid,

                                                            :sqlid,

                                                            :rpt_options ))

Error report -

SQL Error: ORA-00904: : invalid identifier

00904. 00000 -  "%s: invalid identifier"

*Cause:   

*Action:

Commit

Can someone please help me understand what I'm missing here?

I'm using: Windows 8.1

Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production

PL/SQL Release 12.1.0.1.0 - Production

"CORE 12.1.0.1.0 Production"

TNS for 64-bit Windows: Version 12.1.0.1.0 - Production

NLSRTL Version 12.1.0.1.0 - Production

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 14 2014
Added on Jul 17 2014
0 comments
11,206 views