Can someone please enlighten me why the below query is being fired and when it will be fired. I belive this query is having huge impact on the performance. I am not able to trace from where this is being fired.
Query :
SELECT SUM (used), SUM (total)
FROM (SELECT /*+ ORDERED */
SUM (d.BYTES) / (1024 * 1024) - MAX (s.BYTES) used,
SUM (d.BYTES) / (1024 * 1024) total
FROM ( SELECT tablespace_name, SUM (BYTES) / (1024 * 1024) BYTES
FROM ( SELECT/*+ ORDERED USE_NL(obj tab) */DISTINCT ts.NAME
FROM SYS.obj$ obj, SYS.tab$ tab, SYS.ts$ ts
WHERE obj.owner# = USERENV ('SCHEMAID')
AND obj.obj# = tab.obj#
AND tab.ts# = ts.ts#
AND BITAND (tab.property, 1) = 0
AND BITAND (tab.property, 4194400) = 0) tn,
dba_free_space sp
WHERE sp.tablespace_name = tn.NAME
GROUP BY sp.tablespace_name) s, dba_data_files d
WHERE d.tablespace_name = s.tablespace_name
GROUP BY d.tablespace_name)
It is having a Full table scan on SYS.TS$ and SYS.FILE$. I belive it is utilizing the maximum resoures of Database.
Please help me.
Thanks in Advance.
SYS_CONTEXT returns the value of parameter associated with the context namespace . You can use this function in both SQL and PL/SQL statements. For namespace and parameter , you can specify either a string or an expression that resolves to a string designating a namespace or an attribute.
I too got ORA-12543 :TNS :destination host unreachable. But for me the problem was in the password. Resolution : Need to remove "@" from the existing password as @ defines connection identifier being used to connect in sqlPlus. Save this answer.
Have you done a query in v$sqlarea so see if it is in there, and then see what session/user it is?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With