Saturday, September 11, 2010

How To Enable Trace to a concurrent program


Solution
1. Go to System Administrator >> Concurrent >> Program >> Define
2. Query back the concurrent program that you want to trace.
3. Click 'Enable Trace' and save it.
4. Run the concurrent program as a concurrent request
5. A SQL trace file will be saved in the ../udump directory on the database server.




(OR)
How do you enable/disable a trace to a Concurrent Program?
1. Connect to Oracle Applications
2. Navigate to System Administrator->Concurrent->Program->Define
3. Query the concurrent program on which you want to enable trace.
4. Check the enable trace check box bottom of the screen, Save it.
5. Ask the developer to submit the request, Once the request got submitted and completed normal.
6. Get the spid as select oracle_process_id from apps.fnd_concurrent_requests where request_id=456624.
7. You will get a spid like 12340.
8. Goto Udump and ls -ltr *12344*.
9 . You will get trace file.



ENABLE A TRACE
1.    Enable trace at instance level

Put the following line in init.ora. It will enable trace for all sessions and the background processes
sql_trace = TRUE

to disable trace:
sql_trace = FALSE

- or -

to enable tracing without restarting database run the following command in sqlplus
SQLPLUS> ALTER SYSTEM SET trace_enabled = TRUE;

to stop trace run:
SQLPLUS> ALTER SYSTEM SET trace_enabled = FALSE;

2. Enable trace at session level

to start trace:
ALTER SESSION SET sql_trace = TRUE;

to stop trace:
ALTER SESSION SET sql_trace = FALSE;

- or -

EXECUTE dbms_session.set_sql_trace (TRUE);
EXECUTE dbms_session.set_sql_trace (FALSE);

- or -

EXECUTE dbms_support.start_trace;
EXECUTE dbms_support.stop_trace;

3. Enable trace in another session

Find out SID and SERIAL# from v$session. For example:

SELECT * FROM v$session WHERE osuser = OSUSER;

to start trace:
EXECUTE dbms_support.start_trace_in_session (SID, SERIAL#);

to stop trace:
EXECUTE dbms_support.stop_trace_in_session (SID, SERIAL#);

- or -

EXECUTE dbms_system.set_sql_trace_in_session (SID, SERIAL#, TRUE);
EXECUTE dbms_system.set_sql_trace_in_session (SID, SERIAL#, FALSE);

SQL> select sid, serial# from v$session where username = 'USER';

SQL> alter system kill session 'SID,SERIAL#'

No comments:

Post a Comment

Post a Comment