DBMS_MONITOR usage and trace file is empty

NLSRTL      11.2.0.3.0     Production
Oracle Database 11g Enterprise Edition      11.2.0.3.0     64bit Production
PL/SQL      11.2.0.3.0     Production
TNS for IBM/AIX RISC System/6000:      11.2.0.3.0     Production
I want to trace a block of PL/SQL code by using the package DBMS_MONITOR.
And I do it this way:
ALTER SESSION SET TRACEFILE_IDENTIFIER = 'ET2';
DECLARE
   <some delarations>
BEGIN
   DBMS_MONITOR.SESSION_TRACE_ENABLE(waits => TRUE, binds => TRUE);
   <some selects and updates are running here>
   DBMS_MONITOR.SESSION_TRACE_DISABLE;
END;
COMMIT;Then I locate the trace file by running this query:
select u_dump.value || '/' || instance.value || '_ora_' || v$process.spid || nvl2(v$process.traceid, '_' || v$process.traceid, null ) || '.trc'"Trace File"
from V$PARAMETER u_dump
cross join V$PARAMETER instance
cross join V$PROCESS
join V$SESSION on v$process.addr = V$SESSION.paddr
where u_dump.name = 'user_dump_dest'
and instance.name = 'instance_name'
and V$SESSION.audsid=sys_context('userenv','sessionid');This gives me the path: /ORACLE/DBDEV/dump/diag/rdbms/dbdev/DBDEV/trace/DBDEV_ora_30277668_ET2.trc
Then I go to the file and what I see in it is just two rows which look like this:
Trace file /ORACLE/DBDEV/dump/diag/rdbms/dbdev/DBDEV/trace/DBDEV_ora_30277668_ET2.trc
CLOSE #4574493152:c=1,e=1,dep=1,type=3,tim=57812311082909And it is the same no matter how many times I run the block.
Please, help me understand what do I miss to make the DBMS_MONITOR package generate tracing information.
Thank you

It works for me
SQL> ALTER SESSION SET TRACEFILE_IDENTIFIER = 'ET2';
Session altered.
SQL> exec DBMS_MONITOR.SESSION_TRACE_ENABLE(waits => TRUE, binds => TRUE);
PL/SQL procedure successfully completed.
SQL> select value from v$diag_info where name='Default Trace File';
VALUE
/u01/app/oracle/diag/rdbms/sales/sales/trace/sales_ora_11754_ET2.trc
SQL> select ename from scott.emp;
ENAME
SMITH
ALLEN
WARD
JONES
MARTIN
BLAKE
CLARK
SCOTT
KING
TURNER
ADAMS
ENAME
JAMES
FORD
MILLER
14 rows selected.
SQL> exec DBMS_MONITOR.SESSION_TRACE_DISABLE;
PL/SQL procedure successfully completed.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
[oracle@node1 ~]$ tail -30 /u01/app/oracle/diag/rdbms/sales/sales/trace/sales_ora_11754_ET2.trc
FETCH #1:c=3000,e=17735,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=1636480816,tim=1359129991410263
STAT #1 id=1 cnt=1 pid=0 pos=1 obj=0 op='FIXED TABLE FULL X$DIAG_INFO (cr=0 pr=0 pw=0 time=0 us cost=0 size=305 card=1)'
WAIT #1: nam='SQL*Net message to client' ela= 3 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1359129991410526
*** 2013-01-25 21:36:36.162
WAIT #1: nam='SQL*Net message from client' ela= 4752240 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1359129996162871
CLOSE #1:c=0,e=58,dep=0,type=0,tim=1359129996163090
=====================
PARSING IN CURSOR #1 len=27 dep=0 uid=0 oct=3 lid=0 tim=1359129996163357 hv=2660398526 ad='725a16e0' sqlid='5nwx8yqg94xdy'
select ename from scott.emp
END OF STMT
PARSE #1:c=0,e=177,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=3956160932,tim=1359129996163354
EXEC #1:c=0,e=49,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=3956160932,tim=1359129996163651
WAIT #1: nam='SQL*Net message to client' ela= 3 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1359129996163714
WAIT #1: nam='Disk file operations I/O' ela= 76 FileOperation=2 fileno=4 filetype=2 obj#=-1 tim=1359129996163938
FETCH #1:c=0,e=644,p=0,cr=7,cu=0,mis=0,r=1,dep=0,og=1,plh=3956160932,tim=1359129996164409
WAIT #1: nam='SQL*Net message from client' ela= 246 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1359129996164737
WAIT #1: nam='SQL*Net message to client' ela= 2 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1359129996164827
FETCH #1:c=0,e=72,p=0,cr=1,cu=0,mis=0,r=13,dep=0,og=1,plh=3956160932,tim=1359129996164880
STAT #1 id=1 cnt=14 pid=0 pos=1 obj=73201 op='TABLE ACCESS FULL EMP (cr=8 pr=0 pw=0 time=0 us cost=3 size=84 card=14)'
*** 2013-01-25 21:36:41.591
WAIT #1: nam='SQL*Net message from client' ela= 5426334 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1359130001591408
CLOSE #1:c=0,e=46,dep=0,type=0,tim=1359130001591630
=====================
PARSING IN CURSOR #1 len=48 dep=0 uid=0 oct=47 lid=0 tim=1359130001592054 hv=3127860446 ad='6ce47f80' sqlid='80u1a4kx6yr6y'
BEGIN DBMS_MONITOR.SESSION_TRACE_DISABLE; END;
END OF STMT
PARSE #1:c=0,e=347,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=0,tim=1359130001592052
EXEC #1:c=1999,e=1105,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,plh=0,tim=1359130001593421Edited by: Karan on Jan 25, 2013 9:38 PM

Similar Messages

  • Timestamp in Java log and trace files.

    Hi SAP'ies
    Running PI 7.11 on AIX 6.3 we face an issue with the content of log and trace files from Java.
    Eg.
    The file DefaultTrace_00.0.trc is timestamped 18-05-10 11:16:15. (The same time as the time of the OS/AIX)
    Looking inside the file the last statement is timestamped 2010 05 18 09:16:15.
    How can we ensure that the content of these Java files are timestamped with OS time?
    Looking into ABAP files like dev_w0 the timestamp of the file and the content are equal.
    Best regards,
    Teddy Løv Andersen

    Hello All
    Best way to convert the default trace time is , visit the site
    http://www.csgnetwork.com/epochtime.html
    here enter , for example if you have the following in default trace
    #1.#00265510DE7300120000000F000022030004C77AD7309DF5#1345230317066#com.sap.portal.fpn.rdl
    1345230317066   is time stamp , enter this in the above site to get the time
    Fri Aug 17 2012 21:05:17 GMT+0200
    Regards

  • SAP MMC and Trace Files

    Hi
    I want to get complete information on the "exit codes"  in SAP MMC for various server and other processes.
    And also want to know that what are the various log files and trace file .what kind of logs/information they provide and if the Portal has been restarted then is there any way to find at what time the portal was down.
    Thanks in Advance
    Ajay Sandal

    Hi Ajay,
    For Exit Codes
    SDM Exit code 16
    NW App Svr dies with SP06 upgrade
    NW2004sSP7 Preview installation
    Cannot start J2EE and the return code = 66
    Deploy Service doesn't start
    SDM Error
    By the way
    Logs file can be seen at
    http://help.sap.com/saphelp_nw04/helpdata/en/f6/6fff40e39ba854e10000000a1550b0/content.htm
    /usr/sap/SID/JCxx/j2ee/cluster/server0/log/defaulttrace.trc
    Thanx
    Pankaj

  • Delete audit and trace files

    Is anyone aware of why we should not delete audit and trace files under the oracle admin directory that are over 30 days old? I don't know that there is anything in place to do this and they are building up. Tuldcorpadb01:/oracle is at 96%. These files aren't that big, but there are a lot of them. See counts below.
    oracle:tuldcorpadb01:ecmd> cd admin
    oracle:tuldcorpadb01:ecmd>find . -name \*.aud -type f -ctime +30 -ls|wc -l
    25149
    oracle:tuldcorpadb01:ecmd>find . -name \*.trc -type f -ctime +30 -ls|wc -
    2426

    Move older audit files to a different filesystem until you find someone being able to define what files can be deleted.
    Regards
    Gustavo Restuccia

  • Useful logs and trace files

    Hello experts, for our Netweaver AS administration, I am in charge of periodically checking logs and trace files. I would like to know which are the most useful logs and trace files and the information each one will hold. I am familiar with "DefaultTrace.trc", and as of today it is the only one I have used, but I believe I should also be looking at other logs and trace files.
    Any suggestions?

    Hi Pedro,
    If you are talking about JAVA only system defaulttrace is the best log/trace to look, there are other log files like application log, but maybe the best way to check you logs is using NWA (NetWeaver Administrator) on the following URL on your JAVA system:
    http://<hostname>:<port>/nwa
    From there you need to go to Monitoring -> Logs and Traces and then Predefined View/SAP logs.
    My other recommendation is to change the severity level to ERROR for all you JAVA component within the Visual Administrator -> ServeNode -> Services -> Log Configurator -> Locations, otherwise it is possible that you see a lot of garbage on the defaulttraces. Anyway you can change the severity level per component, on demand, to investigate any possible problem.
    The work directory is very imporant and maybe you can also check the file "dev_serverX" that also will give you information about any out of memory conditions and garbage collection activity if you have these values set for the server node using the config tool:
    -verbose:gc
    -XX:+PrintGCDetails
    -XX:+PrintGCTimeStamps
    You can find more information on here:
    http://help.sap.com/saphelp_nw70/helpdata/en/ac/e9d8a51c732e42bd0e7de54b9ff4e2/content.htm
    Hopefully this help you, let me know if you need more information,
    Zareh

  • External portal capturing internal portal URL in Log and trace file

    Hi,
    We are facing one issue in portal like we have two portals for internal (Intranet) and external (Internet) users.
    Once users logged in the application and try to get the information about mylink from the external portal link (internet) they should not get any information about the internal portal.
    But in log and trace file we can see the external portal link capturing the internal portal URL.
    We need to find, from where system capturing the internal portal URL.
    Thanks.

    The tkproffed trace file is in seconds.
    "set timing" is in hh:mi:ss.uu format. So 00:00:01.01 is 1.01 seconds.
    You have to remember that most of these measurements are rounded. While your trace file says it contains one second of trace data, you know it's more.
    One excellent resource for trace files is "Optimizing Oracle Performance" by Cary Millsap & Jeff Holt. (http://www.amazon.com/Optimizing-Oracle-Performance-Cary-Millsap/dp/059600527X ) I thought I knew trace files before, but this book brings your knowledge to a whole new level.
    There is also an excellent WP by Cary Millsap ( http://method-r.com/downloads/doc_details/10-for-developers-making-friends-with-the-oracle-database-cary-millsap ) that gives you some insight.

  • How to configure logs and trace files

    Hello people,
       We have just implemented ESS-MSS, we have around 25000 people using this service and every 2 days my logs and trace file in server gets full and portal gets down.
    Please suggest how to solve this problem,how can i reduce trace and log files,,,,,any configuration or setting is there to configure this...please suggest and explain how can it be done.
    Biren

    Hi,
    You can control what messages gets logged depending on the severity.
    This can be configured using Log Configurator, check this how you can set severity to different locations.
    Netweaver Portal Log Configuration & Viewing (Part 1)
    Regards,
    Praveen Gudapati

  • Diff between Log files and Trace files

    hi
    What is the exact differences between Log Files and Trace Files.
    And the relevant informative URL/reference materils would be highly appriciated.
    Thanks
    Sekhar

    Hi,
    Go through these,
    http://help.sap.com/saphelp_nw04/helpdata/en/d1/7b1e40777cdd5fe10000000a155106/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0bf8c890-0201-0010-8b8c-fc93fa1f4795
    Hope it clarifies
    Regards
    Srinivasan T

  • How to clear the alertlog and trace file?

    since the database was created,the log and trace file have't been cleared.how to clear the alertlog and trace file?3tx!!

    Hi Friend.
    You can eliminate all the files ".TRC" (trace files) to purify the directory BDUMP. These are not necessary files in order that the Oracle Server works.
    The file Alert.log is a file that the Oracle Server can recreate if you eliminate it. When Oracle Server's process realizes certain action (for example ARCH), Oracle creates again the file (if it does not exist), or it adds text (if it exists) with the new income.
    It can happen, that appears some Bug if the file Alert.log does not exist. Though this is slightly possible.
    Anyhow I recommend to you in UNIX to use from the prompt: $> filename in order to take the size of the file to 0 bytes, without need to eliminate it. Is the same thing when you want to purify the listener.log, the sqlnet.log or the sbtio.log.
    I wait for my commentaries you be of great help.
    Bye Friend...

  • How to proceed further once the explain plan and trace files are generated?

    Hi Friends,
    I need to improve the performance of on of the views that i am working on.
    As suggested in the thread - http://forums.oracle.com/forums/thread.jspa?threadID=863295&tstart=0 , i gave generated the explain plan and the trace file.
    From the explain plan, we can see the expensive operations for the query.
    Can any one please tell, how to proceed further from here on i.e. how to make this expensive operations less expensive?
    For ex: FULL TABLE SCAN might be an expensive operation when the table has indexes.In such cases, how can we avoid such operations to make query faster?
    Regards,
    Sreekanth Munagala.

    Hi Veena,
    An earlier post by you regarding P45 is as below
    Starter report P45(3) / P46 efiling for UK
    from my understanding though i have not worked on GB Payroll you have said that you deleted IT 65 details of leaver,however there must be clusters generated in system from where the earlier data needs to be deleted and may be that is why you are facing the issue.
    In Indian payroll when we execute text file for efiling of tax after challan mapping all the data compiles and sits in PCL cluster and therefore we are unable to generate form 16 with proper output,here we delete the clusters and rerun again the mappings and then check form 16.
    Hope this might help you,Experts have suggested you earlier also,they may correct me for this.
    Salil

  • Automatic deletion of old archive files and trace files

    I've got a database that must run 24x7 without being monitored by a DBA.
    Two questions:
    1. Is it possible to get Oracle to automatically delete and uncatalog old archive files?
    2. Is it possible to get Oracle to automatically delete old trace files located in udump and bdump?
    Thanks in advance

    1. When you say 'uncatalog old archives’ do you mean that your database is backed up using RMAN and a catalog? If this is the case then RMAN can delete the backed up archives for you. Just add 'delete input' to the end of the 'backup archive log...' line in your backup script.
    2. Oracle can't delete the trace files. Best way is to write a script that delete all files older than X days and schedule it to run every night.

  • Removing alert logs and trace files

    Hi everyone!
    I noticed that in all the oracle databases, the trace files are piling and alert log is growing like anything ....
    Thought of making a copy of the trace files somewhere and remove them from the hard disk excluding the most recent ones.
    For alert log, thought of making a copy and renaming the current file so that Oracle can create a new one.
    Any advice if there are better approaches in handling this?
    Thanks in advance.

    user645399 wrote:
    Hi everyone!
    I noticed that in all the oracle databases, the trace files are piling and alert log is growing like anything ....
    Thought of making a copy of the trace files somewhere and remove them from the hard disk excluding the most recent ones.
    For alert log, thought of making a copy and renaming the current file so that Oracle can create a new one.
    Any advice if there are better approaches in handling this?
    Thanks in advance.I would include the alert log file in my backup strategy as it includes many important information; database parameter values,when and how the database was shut down, the important database errors and when they occur , etc ... I usually backup the alert log file once a month and keep 1 year of alert log file copies..

  • APEX Overhead and trace files

    Hey everyone,
    We've been asked to "stress" and "load" test our application as it is predicted our user base might grow in the near future (company acquisitions/etc)...
    Unfortunately, there is concern about the overhead added by APEX.  From everything I've read, I do not personally believe APEX adds much to each page view (as compared to our own self-managed data), however I need to PROVE this to our system admins/etc.  Simply referencing things on the internet like "APEX doesn't add much overhead" doesn't exactly make the case.
    To accomplish my mission, I've done the following:
    1) generated a trace file on a test page by appending the following to the end of the URL:
    "&p_trace=YES" (without quotes)
    2) found the location of trace files using:
    select value from v$parameter where name = 'user_dump_dest';
    3) found the exact trace file for my apex page view
    grep -l "3853406964369" *.trc (where the number in quotes was the session id taken from my apex url)
    4) formatted the trace file using tkprof from the linux command line:
    tkprof orcl_ora_24115.trc tkprof_output
    Now, I'm in the process of examining the file.  It is great that it shows everything involved in generating a page!  A couple of quick questions though.
    A) is it safe to assume that this trace file (found by using my method above in steps 1-4) only contains records associated with my single apex page view?  My fear is that just because a file contains my session id, that does not guarantee that other random stuff from other sessions is also in the same file (sorry i'm new to trace files and especially trace files generated by apex).
    B) if i view a second page with the trace=YES, will a second file get generated or does it get combined into 1 file?  how can i easily tell which file is for which page view?
    C) is there an easy way to differentiate what queries would normally be made by oracle (regardless of the UI) versus queries ran by APEX specifically (which would not occur if we were using PHP for a front end)?
    Specifically, I see queries (similar to the following) that do not appear to be APEX specific from what I can tell:
    -- example 1 --
    select i.obj#,i.ts#,i.file#,i.block#,i.intcols,i.type#,i.flags,i.property,
      i.pctfree$,i.initrans,i.maxtrans,i.blevel,i.leafcnt,i.distkey,i.lblkkey,
      i.dblkkey,i.clufac,i.cols,i.analyzetime,i.samplesize,i.dataobj#,
      nvl(i.degree,1),nvl(i.instances,1),i.rowcnt,mod(i.pctthres$,256),
      i.indmethod#,i.trunccnt,nvl(c.unicols,0),nvl(c.deferrable#+c.valid#,0),
      nvl(i.spare1,i.intcols),i.spare4,i.spare2,i.spare6,decode(i.pctthres$,null,
      null,mod(trunc(i.pctthres$/256),256)),ist.cachedblk,ist.cachehit,
      ist.logicalread
    from
    ind$ i, ind_stats$ ist, (select enabled, min(cols) unicols,
      min(to_number(bitand(defer,1))) deferrable#,min(to_number(bitand(defer,4)))
      valid# from cdef$ where obj#=:1 and enabled > 1 group by enabled) c where
      i.obj#=c.enabled(+) and i.obj# = ist.obj#(+) and i.bo#=:1 order by i.obj#
    -- example 2 --
    select intcol#, toid, version#, intcols, intcol#s, flags, synobj#
    from
    subcoltype$ where obj#=:1 order by intcol# asc
    and I see queries that are definitely APEX related (based on the existence of references to wwv objects):
    -- example 3 --
    SELECT ID, BRANCH_NAME, BRANCH_ACTION, BRANCH_POINT, BRANCH_TYPE,
      BRANCH_CONDITION, BRANCH_CONDITION_TEXT, BRANCH_CONDITION_TYPE,
      BRANCH_WHEN_BUTTON_ID, NVL(SAVE_STATE_BEFORE_BRANCH_YN,'N'),
      SECURITY_SCHEME
    FROM
    WWV_FLOW_STEP_BRANCHES WHERE FLOW_ID = :B4 AND FLOW_STEP_ID = :B3 AND
      BRANCH_POINT = 'BEFORE_HEADER' AND (REQUIRED_PATCH IS NULL OR
      (REQUIRED_PATCH > 0 AND (:B2 IS NULL OR INSTR(:B2 ,
      ':'||TO_CHAR(REQUIRED_PATCH)||':') = 0) ) OR (REQUIRED_PATCH < 0 AND (:B1
      IS NULL OR INSTR(:B1 ,':'||TO_CHAR(0-REQUIRED_PATCH)||':') = 0) ) ) ORDER
      BY BRANCH_SEQUENCE, ID
    and then of course it's easy for me to identify any queries that are based on our code because I recognize the object names we use.
    In the mean-time I'm starting to look into how to interpret trace files (outside of the context of apex).
    My biggest concern is that I do not want to "ding" or "tax" APEX for queries that it had nothing to do with and that would be ran by oracle regardless of the UI we use to "view a page".
    Thanks!

    Move older audit files to a different filesystem until you find someone being able to define what files can be deleted.
    Regards
    Gustavo Restuccia

  • Alert log and Trace file error

    Just found this in one of our alertlog file
    Thread 1 cannot allocate new log, sequence 199023
    checkpoint not complete
    and this in trace file:
    RECO.TRC file
    ERROR, tran=7.93.23662, session# =1, ose=60:
    ORA-12535: TNS: operation timed out

    Why would you increase the log files when the problem is a distributed transaction timed out?
    Distributed transactions time out when the data they need to access is locked. Unlike a local session that wants to update a row, which will wait forever, a distributed transaction times out. In earlier versions of Oracle you could set init.ora parameter distributed_lock_timeout to manage the timeout period. Oracle has since made this into an underbar parameter.
    The solution is to ignore the problem unless it appears regularly in which case you have an application design issue.
    HTH -- Mark D Powell --

  • Minact-scn errors in Alert and Trace Files

    we have enabled trace for one session (  where select query is running ) and we seen this error in trace file
    can any one suggest me to resolve this issue.
    --------------------------------------------------------------Trace File------------------------------------------------------------------
    *** 2015-04-23 19:19:29.559
    minact-scn master-status: grec-scn:0x0805.5b417ecb gmin-scn:0x0805.5b3d0eda gcalc-scn:0x0805.5b417ecb
    minact-scn master-status: grec-scn:0x0805.5b41818c gmin-scn:0x0805.5b3d0eda gcalc-scn:0x0805.5b41818c
    *** 2015-04-23 19:29:33.749
    minact-scn master-status: grec-scn:0x0805.5b424c67 gmin-scn:0x0805.5b3d0eda gcalc-scn:0x0805.5b424c67
    *** 2015-04-23 19:34:36.560
    minact-scn master-status: grec-scn:0x0805.5b425343 gmin-scn:0x0805.5b3d0eda gcalc-scn:0x0805.5b425343
    minact-scn master-status: grec-scn:0x0805.5b425749 gmin-scn:0x0805.5b3d0eda gcalc-scn:0x0805.5b425749

    Hi,
    Check support note if database is hitting a bug - Minact-Scn Master-Status: Grec-Scn Messages In Trace File (Doc ID 1361567.1)
    HTH,
    Pradeep

Maybe you are looking for

  • Outlook Connector w/Windows 7 64-bit

    Does anybody know if the (Oracle) Outlook Connector 7.3 is compatible with Outlook running on Windows 64-bit? I have a Windows 7 64-bit system and both the installer for Outlook Connector, as well as a resultant installer I've made using it, don't ap

  • Lion OS and Epson printers not printing photos through Aperture or CS4

    Hi everyone, I have done a search on the above topic but nothing obvious is coming up as a solution (ie...sorry if it has been done before) It's driving me mad. I have 2 epson printers, R300 and Stylus 1400.  They were both performing perfectly well

  • IPhone Screen Replacement Problems

    So I recently got my screen replaced by JetCity in Chicago for $140... two days later I dropped my phone and the screen shattered again.  This time I was determined to change the screen myself.  I ordered a new screen, took apart the phone without an

  • Skype for Business Server download

    Has Skype for Business Server been released today? If so, is there an evaluation version available to download?

  • Using adobe DNG convert help me please!!!!!

    I have Adobe CS5 and have just bought a panasonic FZ200. Rawimages cant be opened from this camera in CS5 so I have downloaded the DNG converter. All is well on my laptop but on the PC which is where I would really like to edit my images I keep getti