SQL Trace for schema level
Hi
Database 10.1.0.4
Sql trace file which I have used but didn't get the trace file. I have tried to get per session Id but not able to get the trace file, when ever user logged into application, virtually 6 user get lgged in and you never know about user. So I have desided to capture for schema
I have used this for tracing
SQL> ALTER SESSION SET sql_trace=TRUE;
SQL> ALTER SESSION SET sql_trace=FALSE;
Or
SQL> EXEC DBMS_SESSION.set_sql_trace(sql_trace => TRUE);
SQL> EXEC DBMS_SESSION.set_sql_trace(sql_trace => FALSE);
or
SQL> EXEC DBMS_SYSTEM.set_sql_trace_in_session(sid=>123, serial#=>1234, sql_trace=>TRUE);
SQL> EXEC DBMS_SYSTEM.set_sql_trace_in_session(sid=>123, serial#=>1234, sql_trace=>FALSE);
I want to get trace file for schema, can anyone suggest how do I get trace file at schema level.
Thanks for help
Hi,
Using instance-level tracing by setting the init.ora/spfile... parameter SQL_TRACE=TRUE, all processes against the instance will create their own trace files. This particular method of tracing should be used with care since it creates a great deal of overhead against the system. In addition, the default value for this parameter is FALSE.
Cheers
Legatti
Similar Messages
-
Hi,
I am in process of setting up Oracle Streams schema level replication on version 10.2.0.3. I am able to setup replication for one table properly. Now I want to add 10 more new tables for schema level replication. Few questions regarding this
1. If I create new tables in source, shall I have to create tables in target database manually or I have to do export STREAMS_INSTANTIATION=Y
2. Can you tell me metalink note id to read more on this topic ?
thanks & regards
paragThe same capture and apply process can be used to replicate other tables. Following steps should suffice your need:
Say table NEW is the new table to be added with owner SANTU
downstr_cap is the capture process which is already running
downstr_apply is the apply process which is already there
1. Now stop the apply process
2. Stop the capture process
3. Add the new table in the capture process using +ve rule
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_RULES
table_name => 'SANTU.NEW',
streams_type => 'capture',
streams_name => 'downstr_cap',
queue_name => 'strmadmin.DOWNSTREAM_Q',
include_dml => true,
include_ddl => true,
source_database => ' Name of the source database ',
inclusion_rule => true
END;
4. Take export of the new table with "OBJECT_CONSISTENT=Y" option
5. Import the table at destination with "STREAMS_INSTANTIATION=Y' option
6. Start the apply process
7. Start the capture process -
No insert Statements for EKKO EKPO in ST05 sql trace for transaction me21n
No insert Statements for EKKO EKPO in ST05 sql trace for transaction me21n.
IN ST05 I set a filter for ME21N and executed transaction to create a Purchase Order and then checked
ST05 but there is NO insert for EKKO or EKPO??
How Do I find in which columns of EKKO and EKPO data is inserted in ST05?
Edited by: DeepakNandikanti on Apr 28, 2010 8:27 AMHi,
I tried in my system and I can see INSERT statement on EKKO and EKPO tables. What exactly you are looking for? Some one else might have switched on the trace at the same time. Can you try again and see.
ST05=>Switch on trace
ME21N=>Create PO.
ST05=>Switch off and display trace.
In trace list search for EKKO and EKPO.
Column names are not shown in the trace list. It is the SQL trace and column list is generated dynamically like :A0, :A1....
@ Suhas,
That might be because the tables are updated via BAPIs ... Do you think SAP uses direct update statements on the DB tables ??
I didn't get above statement. Is there any other way of updation that happens when using BAPI? I believe that, even in case of BAPI there will be update task FMs called during database update. Please correct if i got it wrong.
Thanks,
Vinod. -
Hi
Can anyone suggest how to find the SQL trace for background jobs.
Thanks in advance.
Regards
D.VadivukkarasiHi
Check the transaction ST05.
Plz Reward Points if helpful -
How using sql trace event 10128 level 1&2
hi all,i want ask about sql trace event 10128. how using sql trace event 10128 level 1&2??
when I've enabled sql trace event 10128 level 2,and i execution query then appears error
ORA-00604: error occurred at recursive SQL level 1
ORA-00942: table or view does not exist
where the fault lies??
i'm using
ALTER SYSTEM SET timed_statistics=TRUE;
ALTER SESSION SET EVENT '10128 TRACE NAME CONTEXT FOREVER, LEVEL 2';But nothing issue with me on 10g on windows xp:
SQL> ALTER SYSTEM SET timed_statistics=TRUE;
System altered.
SQL> ALTER SESSION SET EVENT '10128 TRACE NAME CONTEXT FOREVER, LEVEL 2';
ALTER SESSION SET EVENT '10128 TRACE NAME CONTEXT FOREVER, LEVEL 2'
ERROR at line 1:
ORA-00927: missing equal sign
SQL> ALTER SESSION SET EVENTS
2 '10128 trace name context forever, level 2';
Session altered.
SQL>HTH
Girish Shamra
Edited by: Girish Sharma on Dec 9, 2009 11:46 AM
This is not "EVENT" .. it is "EVENTS" -
Ask result sql trace events 10046 level 8 and 12
hi all, i read result of sql trace events 10046 level 8 on
http://www.oracle-base.com/articles/10g/SQLTrace10046TrcsessAndTkprof10g.php#trace_example
and I do sql trace event 10046 level 8 or 12. But the results did not same, execution plan does not appear
how to have execution plan appears??We use level 12 and we have both RSO (row source operation) and execution plan. Remember, execution plan is just the preditive estimate execution path by the opimizer. RSO is actually how the optimizer executes.
ALTER SESSION SET EVENTS '10046 trace name context forever, level 12'
call count cpu elapsed disk query current rows
Parse 1 0.01 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.01 0.00 0 66 1 1
total 3 0.02 0.01 0 66 1 1
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 1767 (DELTEK) (recursive depth: 2)
Rows Row Source Operation
1 SORT AGGREGATE (cr=66 pr=0 pw=0 time=8793 us)
4732 TABLE ACCESS SAMPLE Z_PJPCOMPR_UPSUM47 (cr=66 pr=0 pw=0 time=74 us)
Rows Execution Plan
0 SELECT STATEMENT MODE: HINT: ALL_ROWS
1 SORT (AGGREGATE)
4732 TABLE ACCESS (SAMPLE) OF 'Z_PJPCOMPR_UPSUM47' (TABLE) -
Automize SQL TRACE for a selected session
Hi,
Should I automize the process of SQL Tracing for a particular session of our choice?
Lets say when there are several sessions, and we want to select the particular session for SQL TRACING, then the SQL tracing for that session enable via running a routine.
I used AFTER LOGON trigger for enabling SQL trace, but using this approach enable SQL TRACING all the sessions.
My Logon Trigger for enabling SQL Tracing:
create or replace trigger LOGON_SQL_TRACE
after logon on database
begin
execute immediate
'alter session set sql_trace=true';
end;
I want to use a perfect routine that first get the sid, serial# or username etc. from V$session, V$process or else, and then enable the SQL TRACING for the selected session.
Like SYS.DBMS.SYSTEM.SET_SQL_TRACE_IN_SESSION package is available for doing that or may be some others as well.
But how should we use these packages or other SQL tracing commands in a routine, which we can use for, enable SQL Tracing implicitly.
Any ideas will be great.
BillSYS.DBMS.SYSTEM.SET_SQL_TRACE_IN_SESSION is just fine.
You can get the SID and SERIAL# from v$session; you just have to know the username, osmachine, the OS process, ...
Fred -
Hi,
Should we use the Logon trigger for SQL TRACING,for the third party tool?
How should we manage SQL tracing and then read this trace file using
TKPROF for that specific session that is using the third party tool?
I wanted that whenever this third party tool connect to database with any user, the sql tracing will start for that specific seesion and then read the sqltrace for that session using TKPROF.
Any ideas/exmp will be great.
Regards
CLEEShould we use the Logon trigger for SQL TRACING,for the third party tool?
Yes you can use like
CREATE OR REPLACE TRIGGER af_sess_Logon
After logon on database
Begin
if ( user='SCOTT') then
execute immediate 'alter session set sql_trace=true';
End if;
End;
sql tracing will start for that specific seesion and then read the sqltrace for that session using TKPROF.
for tkprof you can user command line
or use host in sql
kuljeet pal singh -
SQL TRACE for WEB deployed report
When I put
Alter Session Set sql_trace=TRUE
into the BEFORE Parameter Form trigger...
I get a trace file showing data on the one SQL in that trigger.
There is no TRACE output of the main query or any of the PL/SQL in the Program Units.
The report is invoked from company-wide intra-net.
I think it is Oracle Apps running in Linux server.
What am I doing wrong?
PS
I cannot execute this report from Report Builder.Hello,
Just a remark : if you are using Reports 9.0.4 / 10.1.2, you don't have to modify the reports , you can activate the SQL trace with the parameter SQLTRACE=YES
http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/cmdline/common/cla_sqltrace.htm
Regards -
Hi,
How can I turn on SQL Tracing for ODS Transfer scripts?
Best regards,
JohanHi Johan,
If SAP Note 1289112 is not the case, please clarify what "ODS Transfer" means.
Regards,
Sergiy -
Hi,
i was tracing the sql statments present in vf03 transaction for the invoice no.'s with accounting document over all status as not clear.
i want to know the flow of the sql statements right from the user giving the invoice no. as input to the document flow window to know from where and how it is picking the accounting doucment over all processing status
waiting for ur replies
regards,
maqsoodHi
You should look at the code of std fm RV_ORDER_FLOW_INFORMATION, here you can see all selects the system does.
Anyway the tables are VBFA (document flow), VBUK and VBUP. But you can't find that information here, because it's only in accounting not in sales.
So perhaps the abap code you're looking for it's this:
if vbrk-vbeln <> vbfa_tab-vbeln.
perform vbrk_ermitteln using vbfa_tab-vbeln.
check sy-subrc = 0.
check xvbrk-rfbsk = 'C' or xvbrk-rfbsk = 'J'.
read table xdoc_num with key vbeln = vbfa_tab-vbeln
binary search.
tabix_xdoc = sy-tabix.
if sy-subrc = 0.
check xdoc_num-not_found is initial.
else.
refresh xbkpf.
call function 'FI_DOCUMENT_READ'
exporting
i_awtyp = 'VBRK'
i_awref = vbfa_tab-vbeln
i_awsys = vbrk-logsys
i_bukrs = vbrk-bukrs
i_gjahr = vbrk-gjahr
tables
t_bkpf = xbkpf
t_bseg = xbseg
exceptions
wrong_input = 1
not_found = 2.
describe table xbkpf lines sy-tabix.
if sy-tabix ne 0.
Delete documents from other fiscal year
if sy-tabix > 1.
CALL FUNCTION 'FI_PERIOD_DETERMINE'
EXPORTING
i_budat = vbrk-fkdat
i_bukrs = vbrk-bukrs
IMPORTING
e_gjahr = da_gjahr
e_poper = da_poper
EXCEPTIONS
fiscal_year = 1
period = 2
period_version = 3
posting_period = 4
special_period = 5
version = 6
posting_date = 7
OTHERS = 8.
IF sy-subrc = 0.
CONCATENATE da_gjahr da_poper INTO vbrk-gjahr.
loop at xbkpf where gjahr ne vbrk-gjahr.
delete xbkpf index sy-tabix.
endloop.
ENDIF.
endif.
loop at xbkpf.
clear l_xdoc_num-status.
move 'BKPF' to l_xdoc_num-awtyp.
move xbkpf-bukrs to l_xdoc_num-bukrs.
move xbkpf-belnr to l_xdoc_num-docnr.
move xbkpf-cpudt to l_xdoc_num-cpudt.
move xbkpf-gjahr to l_xdoc_num-gjahr.
l_xdoc_num-vbeln = vbfa_tab-vbeln.
l_xdoc_num-logsys = vbrk-logsys.
clear l_xdoc_num-not_found.
loop at xbseg where bukrs eq xbkpf-bukrs
and belnr eq xbkpf-belnr
and gjahr eq xbkpf-gjahr
and ( koart eq 'D' or koart eq 'K' ).
endloop.
if sy-subrc ne 0.
l_xdoc_num-status = 'C'.
else.
loop at xbseg where not augbl is initial
and ( koart eq 'D' or koart eq 'K' ).
endloop.
if not sy-subrc is initial.
SET STATUS TO 'No items are cleared'
l_xdoc_num-status = 'A'.
else.
loop at xbseg where augbl is initial
and umskz ne 'A'
and vorgn ne 'AZUM'
and ( koart eq 'D' or koart eq 'K' ).
endloop.
if not sy-subrc is initial.
Set status to 'All items are cleared'
l_xdoc_num-status = 'C'.
endif.
endif.
Otherwise: If there are customer/vendor positions where AUGBL is
filled and some other ones where AUGBL is blank then set status
to 'Partially cleared'
if l_xdoc_num-status is initial.
l_xdoc_num-status = 'B'.
endif.
endif.
append l_xdoc_num.
endloop.
insert lines of l_xdoc_num into xdoc_num index tabix_xdoc.
This is extracted from include LV05CF01
Max -
Q1.How can you trace the session of forms?
c:\ifrun60 module=<formname> userid=scott/tiger
statistics=yes
This will do a alter session set sql_trace=true in the background. -
How to set SQL trace in OCI session ?
Hello,
In a SQL*Plus session, I can use the SQL statement "alter session set sql_trace=true;" to set SQL trace in that session only. I assume I could execute the same SQL statement from C code in an OCI client and achieve the same goal.
However, if I cannot change the code of this OCI client, is there a way to set SQL trace for that single session alone, without changing the C code? Say, through an environment variable, configuration file, etc.?
Thanks.I am not aware of a way to selectively enable the server-side tracing without modifying the client code.
There is client tracing available by setting the environment variable EVENT_10842 as follows:
"server=<>;user=<>;stmt=<>;level=<>;interval=<>"
e.g.
setenv EVENT_10842 "server=inst1,inst2;user=scott,system;stmt=all;level=15"
Where:
"server" is a comma separated list or "all"
"user" is a comma separated list or "all"
"stmt" can be INSERT,UPDATE,DELETE,SELECT or "all"
The following levels are supported:
1 - Trace all server attach and server detach calls for servers listed in "server" attribute of the environment variable.
2 - Trace all session begin, logon, session end, logoff calls for the users listed in "user" attribute of the environment variable.
3 - Trace all prepare, execute, fetch calls for the specified statement types listed in "stmt" attribute of environment variable.
4 - Trace all Bind, Define, Describe calls.
5 - Trace all OCI LOB calls
7 - Get statistical info on all connection pooling /connection related calls
8 - Get statistical info on all session info
9 - Get statistical info on all handle info
10 - Get statistical info on time taken in execute and fetch calls
11 - Get statistical info on transaction related calls
15 - Trace all calls with statistical info. -
How to SQL trace File in udump Folder
Hi,
I kept the Sql Trace for one database. Now i am getting the bulk of files in udump folder. I tryed the command
ALTER SESSION SET SQL_TRACE=FALSE
to stop the trace, but it is not stoping.
Now my problem is how to stop this file load in to that folder.
Thank u,hi,
Thank u alok, Thank u very much. its working fine.
U told first that it is my mistake of enabling in database level. What are the real commands to start the trace and stop the trace by that session. What the Oracle Books says is this commands i followed ( Book name --- ORACLE HIGH PERFORMANCE TUNING FOR 9i AND 10g BY GAVIN POWELL ) Page -- 339
ALTER SESSION SET TIMED_STATISTICS = TRUE;
ALTER SESSION SET TIMED_OS_STATISTICS = 5;
ALTER SESSION SET MAX_DUMP_FILE_SIZE=1M;
ALTER SESSION SET SQL_TRACE = TRUE;
ALTER SESSION SET STATISTICS = ALL;
This command i followed. This is for session only, then why this is happened in database level.
Can u provide me the commands for start and stop the SQL TRACE.
Thank u for ur reply. -
SQL Tracing for session started from Java code
I am working with Oracle 10g on Solaris 9. I am facing a problem when trying to enable SQL Trace for Oracle sessions initiated from Weblogic server. I am querring V$SESSION to get the SID and SERIAL# of those sessions and then using DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(<sid>, <serial#>, TRUE); from the SQLPlus (using sys login). But the trace file is not being generated in UDUMP even after some queries are fired from the application. But when I am using the same procedure to turn SQL Trace on for SQLPlus sessions or SQLDeveloper sessions, they are just working fine.
Can anyone please help me out?Please help.....
There is already a thread
Problem with SQL_Trace for a Session
but there is no solution there.
Maybe you are looking for
-
Trying to factory reset an Iphone 6..
This phone was dropped in the water...and instead of waiting for it to "dry-out", I purchased another for my daughter. Well, now that it's working...I would like to use it for myself. The problem: well, she forgot the e-mail associated with the I-tu
-
how to attach a document or picture with po Edited by: baxter jas on Jan 11, 2008 10:05 AM
-
Hello, I have an Analysis workbook with a couple of crosstabs and a lot of graphs. For those I'm using filter components. When the workbook was saved the display setting (in the BEX query) of the filters (dimensions) were Key + Text. Now the users wa
-
Hello Experts, I have made a flat file extractor . Flat file is coming from Another third part database. Date format in flat file is in form DD/MM/YYYY . but in BI we do not have date dormat DD/MM/YYYY. My Question is how we can add this date form
-
Macbook pro 15" overheating when gaming
I recently purchased a refurbished high-end ($2600, but with refurb $2200) Macbook pro for college so I would have the option of gaming on the side whenever I had some free time while also experiencing the wonderful Apple OS. This is the first time