Thursday, October 12, 2023
Query to check patches applied correctly with the expected sequence.
SQL query to get the version of a file
Tuesday, August 8, 2023
Query to find Plan Hash Values for a SQLID in Oracle
Thursday, February 16, 2023
Long-running sessions in Oracle
Long-running sessions in Oracle using below queries:
You can check long
running sessions using v$session_longops script which will show you, %
completed, remaining time, sofar completed and much more detailed information.
You can also use below queries to kill long running sessions in Oracle.
Query1:
SELECT SID,
SERIAL#,OPNAME, CONTEXT, SOFAR, TOTALWORK,ROUND(SOFAR/TOTALWORK*100,2)
"%_COMPLETE" FROM V$SESSION_LONGOPS WHERE OPNAME NOT LIKE
'%aggregate%' AND TOTALWORK != 0 AND SOFAR <> TOTALWORK;
Query2:
set lines 300
col TARGET for a40
col SQL_ID for a20
select SID,TARGET||OPNAME TARGET,
TOTALWORK, SOFAR,TIME_REMAINING/60 Mins_Remaining,ELAPSED_SECONDS,SQL_ID from
v$session_longops where TIME_REMAINING>0 order by TIME_REMAINING;
TO find out sql_id for the above sid:
SQL> select sql_id from v$session where sid='&SID';
To find sql text for the above sql_id:
SQL> select sql_fulltext from V$sql where sql_id='bgf07y9xn8grx';
To find wait event of the query for which it is waiting for:
SQL>select sql_id, state, last_call_et, event, program, osuser from v$session where sql_id='&sql_id';
Tuesday, December 6, 2022
How to Kill Long Running Concurrent Job in R12
How to Kill Long Running Concurrent Job in R12
Monday, October 17, 2022
Enable Diagnostics in Oracle Apps
Enable
Diagnostics in Oracle Apps
The below steps can be
followed for enabling diagnostics at user level.
1. Navigate
to System Administrator responsibility> Profile> System>
2. Enter profile
name: Utilities:Diagnostics .
Enter
Application User for whom you want to enable Diagnostics.
Enter value Yes at User
level and Save the Changes . You can set yes at site level for all application
users.
3. Navigate to System
Administrator responsibility> Profile> System>
Enter profile name: Hide
Diagnostics menu entry.
Enter Application User for whom
you do not want to hide Diagnostics menu entry .
Enter value No at User level
and Save the Changes .
4. Logout from Oracle
Application and login again.Diagnostic would be enabled.
Monday, June 20, 2022
Current Running SQLs
How to find SQL,SQL_ID history on Oracle
Session related Queries
Last/Latest Running SQL
-----------------------
set pages 50000 lines 32767
col "Last SQL" for 100
SELECT t.inst_id,s.username, s.sid, s.serial#,t.sql_id,t.sql_text "Last SQL"
FROM gv$session s, gv$sqlarea t
WHERE s.sql_address =t.address AND
s.sql_hash_value =t.hash_value
/
Current Running SQLs
--------------------
set pages 50000 lines 32767
col HOST_NAME for a20
col EVENT for a40
col MACHINE for a30
col SQL_TEXT for a50
col USERNAME for a15
select sid,serial#,a.sql_id,a.SQL_TEXT,S.USERNAME,i.host_name,machine,S.event,S.seconds_in_wait sec_wait,
to_char(logon_time,'DD-MON-RR HH24:MI') login
from gv$session S,gV$SQLAREA A,gv$instance i
where S.username is not null
-- and S.status='ACTIVE'
AND S.sql_address=A.address
and s.inst_id=a.inst_id and i.inst_id = a.inst_id
and sql_text not like 'select S.USERNAME,S.seconds_in_wait%'
/
Oracle Database Password Management: Resetting Password Policies and User Account Expiry Issues
Checking Password Lifetime Policy Oracle password expiration rules are controlled through profiles. The following query helps identify the...
-
TKPROF Overview. TKPROF is used for diagnosing performance issues. It formats a trace file into readable format for performance ana...
-
CLOUD EBS INSTALLTION login as: opc Authenticating with public key "rsa-key-20201105" from agent Last login: Thu Nov 19 08...
-
Query to find the Concurrent Request Trace File Path In Oracle Applications, we all submit concurrent requests. As a developer when we nee...