How to find the sql query

four months back someone updated my table of billing through sql developer.

How can I find the details of the request or the original data.

now the problem is that we rebooted the server, if it's not rest with time stamp.

log mode is Archieve record only.
Please help me

I don't know why you're getting this error, I tried and it works:

SQL> exec dbms_logmnr.add_logfile( logfilename=> 'C:\oracle\product\11.2.0\dbhome_1\RDBMS\ARC0000000736_0765299251.0001', options=> dbms_logmnr.new);

PL/SQL procedure successfully completed.

SQL> EXECUTE DBMS_LOGMNR.START_LOGMNR(OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG);

PL/SQL procedure successfully completed.

SQL> exec dbms_logmnr.start_logmnr

PL/SQL procedure successfully completed.

SQL> select seg_owner,seg_name,sql_redo,sql_undo from v$logmnr_contents;

.....

35 rows selected.

SQL> exec dbms_logmnr.end_logmnr

PL/SQL procedure successfully completed.

@Boris - you don't have to have an additional connection to the database. The thing is that if you don't have additional logging, Oracle will give you only the ROWID of the records and if it is not the same database or something has changed (as "alter table... move"), ROWID is not relevant. If you enable additional logging, you will get more information on the line (like the other columns or PK) which will help you a lot to identify RELEVANT changes. As I said, it is not mandatory, but as you say, if you want extra logging, it must be turned on BEFORE the changes in the database.

Hope that's clear,
Liron

Tags: Database

Similar Questions

  • How to find the sql query generated by BI Publisher

    I'm looking for the physical sql query generated by BEEP when I send parameters as part of the data model.

    Of course, this can be noted in newspapers...

    Can anyone tell me the location of newspapers?

    Thanks in advance

    Have a look here http://gerardnico.com/wiki/dat/bip/log
    I explain a bit how you can get the newspaper.

    See you soon
    Nico

  • How to find the sql query by using the hash value

    Hello

    DBVERSION: 9.2.0.8

    I generated the statspack report and I want to see total request and I hash_value here.

    in v$ sql can't see all querys... .pls suggest me other ways...

    Thank you
    Srini...

    Have you seen Peter's response? There is no installation other than that would be to store the history of the IMO. Another reason that you must pass to 10g or 11g better, now.

    Aman...

  • Find the sql query in statspack report

    Salvation;
    I have 11.5.10.2 and db version 9iR2... I took a statspack report, and I should find a sql query... But admin, is kill session and I can't see complite sorted SQL query by gets for DB...

    so the question is find this query which is kiiled by admin?

    Thank you

    Hello

    Its bad news to can not find this sql... So normally it istn killed by admin, I could find it from stats$ sql_summary or v$ sql_text?

    It is possible.

    Note: 153507.1 - Applications Oracle StatsPack
    https://metalink2.Oracle.com/MetaLink/PLSQL/ml2_documents.showDocument?p_database_id=not&P_ID=153507.1

    And another question... If I have a sql printing is eating my cpu or my server resource, how do I find this sql? Under what title I can find in the statspack report

    Refer to:

    Note: 232443.1 - how to identify the resource intensive SQL for Tuning
    https://metalink2.Oracle.com/MetaLink/PLSQL/ml2_documents.showDocument?p_database_id=not&P_ID=232443.1

    Kind regards
    Hussein

  • How to find the sql queries executed in one day with the sql and runtime text

    Hi Experts,

    Please tell me the sql query to find out the queries executed on a particular day and the runtime and the sql text of the query.

    Please reply urgent.

    Thanks in advance

    Database instance 'A' may have run 100 SQL queries today.  As for the instance of database 'B' could have exploited queries SQL 1 million today.  Instance of database 'B' to 'keep' the 1 million SQL statements - in memory or on disk do you expect?  Of course not.  There the age or flush or invalidate memory SQL statements.  He can't keep them on the disk (imagine running a completely different set of 1.2million SQL statements tomorrow and 1.3 the next day).

    AWR and StatsPack can make counts the number of "n" top of the page ("n" default to 30) SQL statements which are still present in the cache of the library (not years, rinsed, invalidated) when a snapshot was taken.  They can't declare "all" SQL statements.

    To return to your needs.  WHY do you need all the SQL statements?  Or are there only certain operations specific SQL would you be interested?  Could they have been treated by allowing audit (for example, UPDATE and DELETE with EXTENDED verification instructions)?

    Hemant K Collette

  • How to get the sql query result?

    Hello

    Currently I use LV2012 to connect to an Oracle database server. After the Oracle Express and Oracle ODBC driver facilities/settings made.

    I managed to use the SQL command to query the data through my command prompt window.

    Now the problem is, how to do the same task in Labview using database connectivity tools?

    I have build a VI to query as being attached, but I have no idea of what range to use to get the result of the query.

    Please help me ~ ~

    Here is a piece of code that I use to test the SQL commands, you can use the part that retrieves the results of sql.

    It is also possible to get the rear column headers, but it's for the next lesson!

    ;-)

  • How to get the SQL query running of af: search?

    I use JDeveloper 11.1.2.3.0. I have a page where I've set up an af:query and an array of result. The problem is that I can't get the exact query that is used during the execution of this component in a managed bean method. Is it possible to get the query string that is run within the af: query?

    Thank you

    Hello

    Method of the ViewObject getQuery() returns what you need;

    You can replace the executeQueryForCollection(), and prior to calling super, you can print the result of getQuery() method:

    public void executeQueryForCollection (rowset Object,

    Object [] params,

    {int noUserParams)

    System.out.println ("SQL =" + getQuery());

    call the super method here...

    }

  • How to get the sql query

    Hello

    I already set date value as below.
    SET THE VALUE OF START_TIME = 2011-08-12 09:00
    DEFINE END_TIME = 2011-08-12 10:00
    and executes the table based on the defined date as below,
    Select * from my_table
    where
    (to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS))
    GOLD to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS)
    GOLD to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS)
    GOLD to_date (Accounting_Start_Time,'yyyy-mm-dd HH24:MI:SS) < = to_date ('& start_time ',' yyyy-mm-dd HH24:MI:SS) and to_date (Accounting_Stop_Time,'yyyy-mm-dd HH24:MI:SS) > = to_date ('& end_time ',' yyyy-mm-dd HH24:MI:SS));
    ) but now I want to query the table based on the time,

    Any help please,.

    Hello

    It is not very hard in SQL * more.

    First of all, put your query in a script file, like this one, called hour_query.sql:

    --     hour_query.sql          Show data from my_table for a given time period
    
    PROMPT     The data below shows the period from &1 to &2
    PROMPT
    
    SELECT     *
    FROM     my_table
    WHERE     accounting_start_time     <= '&2'
    AND     '&1'               <= accounting_stop_time
    ;
    

    Parameters & 1 and & 2 are beginning and end of time, for example "2011-08-12 09:00".
    Note that this does not use TO_DATE. If you have incorrect strings in columns that must be DATEs, no errors occur.

    Assuming that hour_query.sql is located on p:\some_dir\, you want another script that runs hour_query.sql 24 times, like this one, which I will call all_hours.sql:

    @p:\some_dir\hour_query  "2011-08-12 09:00:00"  "2011-08-12 10:00:00"
    @p:\some_dir\hour_query  "2011-08-12 10:00:00"  "2011-08-12 11:00:00"
    @p:\some_dir\hour_query  "2011-08-12 11:00:00"  "2011-08-12 12:00:00"
    ...
    

    (I just did 3 hours to test. You can easily make that 24 hours).

    The following code creates and then runs all_hours.sql:

    -- Turn off SQL*Plus features that interfere with raw output
    SET     FEEDBACK     OFF
    SET     PAGESIZE     0
    SET     VERIFY          OFF
    
    -- Write all_hours.sql
    SPOOL     p:\&some_dir\all_hours.sql
    
    WITH     got_start_time     AS
    (
         SELECT TO_DATE ( '2011-08-12 09:00:00'
                            , 'YYYY-MM-DD HH24:MI:SS'
                     ) AS start_time
         FROM    dual
    )
    SELECT     '@p:\some_dir\hour_query  "'
        ||  TO_CHAR ( start_time + ((LEVEL - 1) / 24)
              , 'YYYY-MM-DD HH24:MI:SS'
              )
        ||  '"  "'
        ||  TO_CHAR ( start_time + ( LEVEL      / 24)
              , 'YYYY-MM-DD HH24:MI:SS'
              )
        ||  '"'
    FROM    got_start_time
    CONNECT BY     LEVEL <= 3     -- You can make this 24, or any other number
    ;
    
    SPOOL     OFF
    
    -- Turn on SQL*Plus features turned off earlier
    SET     FEEDBACK     ON
    SET     PAGESIZE     50
    -- Except VERIFY.  leave that OFF while all_hours runs
    --SET     VERIFY          OFF
    
    -- Run all_hours.sql
    @p:\some_dir\all_hours.sql
    
    SET     VERIFY     ON
    
  • How can I find out whether a patch applied to the sql query

    How can I find out whether a patch applied to the sql query

    Select * from ad_bugs where numero_de_bogue = '';

    HTH
    Srini

  • How to find the definition of an indextype sql

    Hi all

    I would like to know how to find the "indextype" sql definition...?

    could not understand this. I even tried sql developer and TOAD to extract the sql definition but couldn't!

    Thanks in advance.

    Hello

    You can use the dbms_metadata.getddl

    the query would be like this:

    Select dbms_metadata.get_ddl ('INDEXTYPE', 'indextype_name') of double;

    How to recover or retrieve oracle database operator. Master of geodata

    Kind regards

  • How to find the primary key columns in the tables in MS Access using SQL queries

    How to find the primary key columns in the tables in MS Access using SQL queries

    Hello

    This is the forum for Windows Vista programs related issues.

    For better assistance, please try instead the Forums in SQL Server .

    Thank you! Vincenzo Di Russo - Microsoft MVP Windows Internet Explorer, Windows Desktop Experience & security - since 2003. ~ ~ ~ My MVP profile: https://mvp.support.microsoft.com/profile/Vincenzo

  • How to select only the part by using the sql query

    Hello

    I have the task to retrieve only the integral of the input text by using the sql query.

    The entry is as follows

    Entry for the price setting

    $12.5 (FYI without space)

    $ 12.5 (FYI single space)

    $ 12.5 (double space FYI)

    $12.5 (FYI multiple space)

    $12.5 (FYI multiple space)

    Output expected of 12.5

    The price is the type varchar2 column in the store_price table.

    Please let me know how to achieve this.

    Thanks in advance.

    If this is always the case that you get a $ followed by a number of places, you can use something like:

    Select to_number (ltrim ('$ 12.5',' $')) DOUBLE

    or

    SELECT ltrim ('$ 12.5',' $') OF double

    but take care of your nls_numeric_character settings if they are defined so that, for example, a comma is the decimal separator, you will have a problem.

    HTH

  • How to find the second largest in a pl/sql table

    Hello friends,

    I want to find the first and second maximum items in a pl/sql table.

    Here's the code...

    DECLARE
    Max_earnings_type TYPE TABLE IS NUMBER;
    max_earnings_tab max_earnings_type: = max_earnings_type();
    number of v_count: = 0;
    number of v_max_earnings;


    Can someone give me how to find the maximum first max and second in the type of the given table.

    appreciate your help.

    Thank you/kumar

    Published by: kumar73 on October 21, 2010 09:42

    kumar73 wrote:

    When I tried to implement your logic in my application, I get the following error...

    PL/SQL: digital or value error: NULL index key value table

    What happens if the PL/SQL table has NULL values. Question is how you want to handle NULL values. You want to ignore nulls as GROUP BY do? If you want to consider NULL values, you can say if you want to order the NULLS FIRST or NULLS LAST. I guess that logical GROUP BY:

    DECLARE
        TYPE max_earnings_type IS TABLE OF NUMBER;
        TYPE max_earnings_sorted_type IS TABLE OF NUMBER
          INDEX BY BINARY_INTEGER;
        max_earnings_tab        max_earnings_type;
        max_earnings_tab_sorted max_earnings_sorted_type;
    BEGIN
        SELECT  sal + comm
          BULK COLLECT
          INTO  max_earnings_tab
          FROM  emp;
        FOR v_i in 1..max_earnings_tab.count LOOP
          IF max_earnings_tab(v_i) IS NOT NULL
            THEN
              max_earnings_tab_sorted(max_earnings_tab(v_i)) := 1;
          END IF;
        END LOOP;
        DBMS_OUTPUT.PUT_LINE('MAX value in PL/SQL table is ' || nvl(to_char(max_earnings_tab_sorted.last),'NULL'));
        DBMS_OUTPUT.PUT_LINE('Second MAX value in PL/SQL table is ' || nvl(to_char(max_earnings_tab_sorted.prior(max_earnings_tab_sorted.last)),'NULL'));
    END;
    /
    MAX value in PL/SQL table is 2650
    Second MAX value in PL/SQL table is 1900
    
    PL/SQL procedure successfully completed.
    
    SQL> SELECT  sal + comm
      2    FROM  emp;
    
      SAL+COMM
    ----------
    
          1900
          1750
    
          2650
    
          1500
    
      SAL+COMM
    ----------
    
    14 rows selected.
    
    SQL>
    

    SY.

  • How to convert the hierarchical query of SQL Server (CTE) to Oracle?

    How to convert the hierarchical query of SQL Server (CTE) to Oracle?

    WITH cte (col1, col2) AS
    (
    SELECT col1, col2
    FROM dbo. [tb1]
    WHERE col1 = 12
    UNION ALL
    SELECT c.col1, c.col2
    FROM dbo. [tb1] AS c INNER JOIN cte AS p ON c.col2 = p.col1
    )
    DELETE one
    FROM dbo. [tb1] AS an INNER JOIN b cte
    ON a.col1 = b.col1

    Hello
    Something like this maybe:

    DELETE FROM dbo.tb1 a
     WHERE EXISTS (
      SELECT 1
        FROM dbo.tb1 b
      WHERE a.co11 = b.col1
          AND a.col2 = b.col2
       START WITH b.col1 = 12
      CONNECT BY b.col2 = PRIOR b.col1)
    

    Although you need to do here is to check that CONNECT it BY SELECT, returns records you wait first, then the DELETION should work too.

  • How to measure the performance of the sql query?

    Hi Experts,

    How to measure the cost of performance, efficiency and CPU of an sql query?

    What are all the measures available to a sql query?

    How to identify the optimal query writing?

    I use Oracle 9i...

    It'll be useful for me to write the effective query...

    Thanks and greetings

    PSRAM wrote:
    Could you tell me how to activate the PLUSTRACE role?

    First put on when you do a search on PLUSTRACE: http://forums.oracle.com/forums/search.jspa?threadID=&q=plustrace&objID=f75&dateRange=all&numResults=15&rankBy=10001

    Kind regards
    Rob.

Maybe you are looking for