Sql tracing in 10g

Hi,
I need to trace the sql statements in 10g in linux so that as sys as sysdba i have entered the command
alter session set sql_trace=true;
session altered
Now i need to know the location where i can find the sql statements pls help me

Check USER_DUMP_DEST init. parameter. See http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sqltrace.htm#g22503.
Example with a SQL*Plus SYSDBA connection :
SQL> show parameter user_dump_dest
NAME                                 TYPE        VALUE
user_dump_dest                       string      C:\ORACLEXE\APP\ORACLE\ADMIN\X
                                                 E\UDUMPEdited by: P. Forstmann on 14 janv. 2010 09:35

Similar Messages

  • Enabling SQL Tracing for an instance

    Hi,
    I am aware that SQL_TRACE init parameter is deprecated :
    Oracle® Database Upgrade Guide
    10g Release 2 (10.2)
    Part Number B14238-01
    Initialization Parameters Deprecated in Release 10.2
    SQL_TRACE
    So I searched the recommended way of enabling sql tracing for an instance and I found :
    Oracle® Database Performance Tuning Guide
    10g Release 2 (10.2)
    Part Number B14211-01
    20.4.2 Step 2: Enabling the SQL Trace Facility
    You can enable the SQL Trace facility for an instance by setting the value of the SQL_TRACE initialization parameter to TRUE in the initialization file.
    Well, the Tuning guide should not mention deprecated parameter, should it?
    Anyway, I found later that the recommended way is to use
    exec DBMS_MONITOR.DATABASE_TRACE_ENABLEPlease update your tuning guide.
    Cam on rat nieu ;-)

    Laurent,
    Sorry to post a reply after nearly 2 years :-)
    But:
    Does dbms_monitor.database_trace_enable() only trace existing sessions or does it also enable tracing for all new sessions?
    I've been consulting the documentation and searching on the Internet but I can't determine this.
    Cheers & thanks,
    Colin

  • Enable SQL Tracing for Session

    Hi,
    I know how to enable SQL tracing for a session created either through SQL*Plus or like similar tool, but I want to explore is there any way to can we enable sql tracing for a single session which is connected to database through an application.
    ssome time for testing purpose we have a requirement to enable tracing for that user which run batch Job. Now that particular user gets connected to database through application and i want to enable tracing right at that moment. How can I accomplish it.
    Regards,
    Ababsi

    If you don't want to identify database session you can try to create a logon trigger to enable tracing for all database sessions created by a specific Oracle user account. In the following example you need to replace UWCLASS with the Oracle user account for which you want to trace sessions:
    CREATE OR REPLACE TRIGGER trace_trig
    AFTER LOGON
    ON DATABASE
    DECLARE
    sqlstr VARCHAR2(200) := 'ALTER SESSION SET EVENTS ''10046 TRACE NAME CONTEXT FOREVER, LEVEL 12''';
    BEGIN
      IF (USER = 'UWCLASS') THEN
        execute immediate sqlstr;
      END IF;
    END trace_trig;
    /Reference:
    http://psoug.org/reference/system_trigger.html
    If you want to identify database session you need to query V$SESSION to retrieve SID and SERIAL# of the session you want to trace and then you can use DBMS_MONITOR. See examples in http://www.oracle-base.com/articles/10g/SQLTrace10046TrcsessAndTkprof10g.php
    Edited by: P. Forstmann on 15 janv. 2011 11:07

  • Problem executing a sql query in 10g environment

    Hi,
    I am having problem executing the following sql query in 10g environment. It works fine in 8i environment.
    I tried to_number(to_char) and it did not work.
    **A.APPL_ACTION_DT >= TO_CHAR("&v_strBeginStatusDate&", 'DD-MON-YYYY') AND A.APPL_ACTION_DT <= TO_CHAR("&v_strEndStatusDate&", 'DD-MON-YYYY')))**
    Any suggestions..
    --Pavan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I would be surprised if that worked in 8i as posted, although I no longer have 8i to test. You do not tell us the error message you are getting, but there are several things wrong with what you posted.
    First, the substitution variable requires only the & at the beginning, you have one on each end of your string, the one at the end will remain in the string that is passed to the database.
    Second, you cannot TO_CHAR a string with a date format as you are trying to do. The TO_CHAR function is overloaded and has two basic forms TO_CHAR(date, format_model) and TO_CHAR(number, format_model). Note that neither takes a string. It would appear that at least current versions of Oracle choose the second signature unless specifically passed a date datatype.
    SQL> select to_char('&h', 'dd-mon-yyyy') from dual;
    Enter value for h: 12
    old   1: select to_char('&h', 'dd-mon-yyyy') from dual
    new   1: select to_char('12', 'dd-mon-yyyy') from dual
    select to_char('12', 'dd-mon-yyyy') from dual
    ERROR at line 1:
    ORA-01481: invalid number format modelalthough I suspect that the error you are getting with your posted code is more likely to be ORA-01722: invalid number.
    Depending on the data type of appl_action_date, you are probably lokoing for TO_DATE instead of TO_CHAR.
    John

  • Learning PL/SQL in Oracle 10G XE

    Successfully installed Oracle 10G XE on my desktop. I'm a newbie Oracle user who wants to learn PL/SQL through Oracle 10G XE.
    Is this possible? Hope you can give me tips and advice on how I would start with this?
    Thanks!

    Certainly possible. I would suggest you crack open the PL/SQL Users Guide. DO you have previous programming experience? If so, looks at the examples.

  • SQL tracing in ADR

    Hi,
    I've a question and needs calrification. As in 11g $ADR_HOME/trace holds the information of background process tracing and SQL tracing. Now I want to know how can we seperate the SQL tracing files and BG tracing files. Let say its not possible and both are written in single trace files, then my question is can we extract SQL tracing information from this single file through tkprof.
    I'm not sure weather BG tracing is enabled by default or not. Please clarify it as we have to explicityly enabled the SQL tracing.
    Looking for your information.
    Regards,
    Abbasi

    I think that it would be hard to tell which file belongs to the background process or which one to the foreground process just by looking at the files. We must know the process id and then use it to track the file. The trace folder contains both the Background and User_Dump_Dest combined in it so it contains both the files. Background tracing is not on( I think that there is no such concept called background tracing) and the trace file would be generated when the process would be abruptly terminated.
    Just my 2 cents.
    Aman....

  • Enabling SQL Tracing for already connected session

    Hi,
    I've a requirement. i.e. my users are connected to db through schema making sessions( As multiple users are connected from single Schema). Now there are certian users which have to run batch jobs and I want to trace there SQL for tunning. I want to know how can I enable SQL tracing for specific user,session,id since it is difficult to trace exact user as multiple users are running the batch jobs.
    I have a strategy to enable tracing at schema level. Can I do this while users are connected and running quries. As normally first we enable the tracing and then run the quries.
    Kindly help me in working out this.
    Regards,
    Abbasi

    You didn't post your Oracle version, but maybe you have DBMS_MONITOR available to you.
    Hope this helps!

  • SQL Tracing

    Hi,
    in 8.49 tools version,
    It's a part of psappsrv.cfg file :
    [Trace]
    ;=========================================================================
    ; Server Trace settings
    ;=========================================================================
    ; SQL Tracing Bitfield
    ; Bit Type of tracing
    ; 1 - SQL statements
    ; 2 - SQL statement variables
    ; 4 - SQL connect, disconnect, commit and rollback
    ; 8 - Row Fetch (indicates that it occurred, not data)
    ; 16 - All other API calls except ssb
    ; 32 - Set Select Buffers (identifies the attributes of columns
    ; to be selected).
    ; 64 - Database API specific calls
    ; 128 - COBOL statement timings
    ; 256 - Sybase Bind information
    ; 512 - Sybase Fetch information
    ; 1024 - SQL Informational Trace
    ; 4096 - Manager information
    ; 8192 - Mapcore information
    ; Dynamic change allowed for TraceSql and TraceSqlMask
    TraceSql=?
    TraceSqlMask=?
    which values should be given for TraceSql=? and TraceSqlMask=? to enable the followings :
    - SQL statements
    - SQL statement variables
    - SQL connect, disconnect, commit and rollback
    - Row Fetch (indicates that it occurred, not data)
    If you suggest a value please explain how/why you have chosen it.
    Many thanks.

    Thank you Nicolas.
    Why there is also something similar in PSPRCS.cfg :
    Trace settings
    ;=========================================================================
    ; PeopleTools trace file (NT only, ignored on UNIX)
    TraceFile=%PS_SERVDIR%\logs\PeopleTools.trc
    ; SQL Tracing Bitfield
    ; Bit Type of tracing
    ; 1 - SQL statements
    ; 2 - SQL statement variables
    ; 4 - SQL connect, disconnect, commit and rollback
    ; 8 - Row Fetch (indicates that it occurred, not data)
    ; 16 - All other API calls except ssb
    ; 32 - Set Select Buffers (identifies the attributes of columns
    ; to be selected).
    ; 64 - Database API specific calls
    ; 128 - COBOL statement timings
    ; 256 - Sybase Bind information
    ; 512 - Sybase Fetch information
    ; 1024 - SQL Informational Trace
    ; Dynamic change allowed for TraceSql and TraceSqlMask
    TraceSQL=0
    What is the difference ?
    Thanks again.

  • Enabling SQL tracing from Forms

    Hi...
    can I enable SQL tracing for Particular instance or session from my 6i/9i forms.I can do it directly from database but what if i want to do it from Forms programatically or forms provides something which can help me ....
    any idea ???
    Thanx in advance

    REPOST

  • Setting SQL TRACING

    Hi ,
    I want to set Sql tracing on in my machine.
    I am using the oracle 9i Database (9.2.0.4.0).
    My operating system is windows 2000 professional.
    Can anyone tell me how to enable SQL tracing in my database and wat is the use of it.
    Thanks...

    http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96533/sqltrace.htm#8760

  • AWR SQL TRACING

    Hi all,
    I want to produce sql tracing using AWR.
    But i can not find the hits in google for "AWR sql tracing".
    Kindly assist what is the right keywords.
    Thanks a lot.

    Hi,
    AWR doesn't provide any chronological information. It provides aggregate statistics per snapshots. For example you can use it to find out what was top SQL during that snapshot, and how many times it was executed, but you won't be able to see who was doing what at what moment in time. For that you would have to use ASH -- just run the query I gave you (add "order by sample_time", I forgot that part) and see what kind of information it gives you.
    Tracing the entire database would also give you information about SQL run by every user, but I wouldn't recommend that for several reasons:
    1) there will be a performance overhead
    2) trace files grow very fast, and they can eat up all your free space in the matter of minutes
    3) trace files are harder to read (if you want them formatted nicely, then you'll have to do some additional processing like running tkprof)
    And to reiterate: the tool of choice for monitoring user activity is not ASH, not trace, not AWR, but audit. So I would approach your problem as follows:
    1) use ASH to find out who was doing what at the period of interest
    2) enable audit to facilitate such investigations in the future
    Best regards,
    Nikolay

  • Connect to sql server from 10g webforms using exec sql

    Hi
    We are embarking on a project to upgrade our 6i client server forms to 10g web
    based. One of our forms uses the exec_sql package to open a connection to an MS
    SQL Server database and execute queries on that database.
    Oracle open client adapter and an odbc driver for SQL Server is installed on
    every client to achieve this. I have read that open client adapter is no longer
    available on 10g.
    I also read that there a feature of the Oracle database called Generic
    Connectivity which would allow us to install an odbc driver on the database
    server and allow us to connect to sql server. However I discovered that this
    feature is not supported on TRU64 - the operating system our database runs on.
    I have read about Oracle Transparent gateways but I have been informed that they are not supported from forms.
    Is there any alternative? How can our webform connect to sql server and execute
    queries against it? The sql we need to execute is already sql server compliant so no translation is required - just a simple pass through
    thanks
    paul schweiger

    I used in the past Forms 6i against DB2 on a mainframe through Transparent Gateway for DB2. So I'm wondering who did you tell such a configuration does not work. And the migration guide states:
    /* Open Client Adapters (OCA)
    In order to provide platform-independent access to a wider range of non-Oracle data sources, use the Oracle Transparent Gateway and Generic Connectivity solutions in place of OCA. */
    At least gateway is mentioned.
    Werner

  • Calling java from pl/sql in oracle 10g?its very urgent.

    Hi Friends,
    i hve simple java code:
    class Hell
    public static String Hello()
    return"hello world";
    & compile this code using javac & loaded Hell.class in to database using this command
    c:\>loadjava -user chandru/shekar@pulser c:\Hell.class
    & i wrote pl/sql like:
    CREATE OR REPLACE FUNCTION Hell RETURN String as language java name 'Hell.Hello() return java.lang.String';
    i will compile the code & run but at that time this error i am getting:
    ORA-29516: Aurora assertion failure: Assertion failure at eox.c:317
    Uncaught exception System error: java/lang/UnsupportedClassVersionError
    I am using oracle 10g.Plzzzzzzzzz help me.Its very important to for me.
    Is any path i hve to set for oracle 10g database.Plz any one help me.
    regards
    shekar

    Hello here is how I solved the problem
    Let us assume that i try to load the file Hello.Java into the user scott.
    public class Hello {
         public static String world() {
              return "hello world";
    1) Dropjava          
    You must drop the java class if you already have loaded the class onto the server.
    dropjava -u scott/tiger Hello.class
    2) load class on server and let the server compile the source code.
    It is necessary to compile the source code on the server when the server and the local machine have different Java versions. To check which Java version there is running on the client machine open a command prompt and write Java -version
    loadjava -user scott/tiger -resolve Hello.java
    3) Publish stored procedure      
    sqlplus scott/tiger@oracle
    CREATE OR REPLACE FUNCTION helloworld RETURN VARCHAR2 AS                LANGUAGE JAVA NAME 'Hello.world () return java.lang.String';
    4)Call stored procedure      
    VARIABLE myString VARCHAR2(20);
    CALL helloworld() INTO :myString;
    PRINT myString;
    RGDS
    Thomas Winterberg

  • Connecting SQL Plus to 10g XE

    Hi,
    I have Oracle 10g XE and Oracle Dev Suite installed on my computer. I want to connect to 10g XE via SQL Plus or from within Forms Builder but I don't know what to specify for Host String (in SQL Plus) or Database (in Forms Builder). "XE" doesn't work. Any ideas what should I put in for those params?
    Thanks in advance,
    Behi

    First you must make sure that your tnsnames.ora is configured correctly in 10g Devsuite (Forms)
    to do this you either configure it manually or use the Net Configuration Assistant found under
    All Programs<devsuit_home>/configuration and migration tools/Net Configuration Assistant.
    For manual configuration open the tnsnames.ora found under directory
    %oraclehome%/network/admin/tnsnames.ora
    and add a connection descriptor and save the file. remeber to take a backup copy.
    your file should look something like this.
    XE =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = XE)
      )Regards,
    Tony

  • SQL Query (Oracle 10g)

    Hi All,
    Please find the following requirement.
    Requirement -
    There are 2 standalone database named database A and
    database B used by 2 separate application. Database A
    has schema S1 and Database B has schema S2.
    Schema S1 has around 40 master tables which get updated
    very frequently. This 40 tables are also present in S2
    also.
    We want the both the 40 tables to be in sync every
    hourly or half any hour.
    eg. If records are added/updated deleted in S1.emp then
    same should be done in S2.emp and visa versa also.
    We dont want to use dblink,materialised views or
    scripts. Is there any feature in Oracle 10G like
    replication or Streams where in this can be done.
    Incase if are not able to replicate both ways then at
    least one way can we replicate ? like any records are
    added/updated deleted in S1.emp then same should be done
    in S2.emp and similarly in the other 39 tables.
    Thank you
    Message was edited by:
    User71408

    Can anyone provide a SQl query to create a
    schema/user named 'test' with username as 'system'
    and password as 'manager'system user is created during database creation, it's internal Oracle admin user that shouldn't be used as schema holder.
    In Oracle database, Oracle user is schema holder there's no seperate schema name to be defined other than username.

Maybe you are looking for

  • JRockit doesn't exist in Weblogic with OEPE

    Hi all, I'm just curious, why JRockit doesn't exist in WebLogic Server installation (10.3.6) with Coherence + OEPE package installer (1.5 GB) ? on the contrary, it exists in WebLogic Server (10.3.6) installation + Coherence without OEPE (820 MB) whic

  • Converting a color illustration to grayscale

    I have a color illustration comprising hundreds of colored objects (some with different fill and border colors). I have been asked to render a gray scale version of the same illustration. What would be the fastest way to replace each of the colors wi

  • Keyboard disabled with Front Row

    Since I upgraded to Leopard, the keyboard no longer works when Front Row is open. The only thing I can do with the keyboard is Opt-Cmd-Esc, forcing Front Row to quit. Remote works fine, but keyboard arrows, Cmd-Esc to close, etc. do nothing on the ke

  • How to remove the SYSTEM_NO_TASK_STORAGE error

    hi,very guys:    for changed the datasource,i have to restore the source system,but when i restore the source system , the SYSTEM_NO_TASK_STORAGE error occur, i have 8 GB physical RAM ,and the source system have 1892 datasources, i do not know how to

  • Webservice in ABAP using Attachments

    Hi, as far is I was able to find similar questions it seems that Abap is not supporting attachments for webservices (at least not for 6.20 or 6.40). I want to send a file (e.g. Pdf, Wrd) with a webservice but when I try to create a rfc enabled functi