Skip to content
March 17, 2017 / doganay

BIND DATATYPE MISMATCHED SQLS

  • !!! These sqls do not return all bind datatype mismatches. Just return right and wrong datatype binded at the same time ones.

RECENT:

SELECT COUNT (*),
       sql_id,
       child_number,
       name
  FROM (SELECT DISTINCT sql_id,
                        child_number,
                        name,
                        SUBSTR (datatype_string, 1, 4) dtype
          FROM gv$sql_bind_capture
        GROUP BY sql_id,
                 child_number,
                 name,
                 SUBSTR (datatype_string, 1, 4))
GROUP BY sql_id, child_number, name
HAVING COUNT (*) > 1;


HISTORICAL:

SELECT COUNT (*), sql_id, name
  FROM (SELECT DISTINCT sql_id, name, SUBSTR (datatype_string, 1, 4) dtype
          FROM dba_hist_sqlbind
        GROUP BY sql_id, name, SUBSTR (datatype_string, 1, 4))
GROUP BY sql_id, name
HAVING COUNT (*) > 1;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: