Flashback query to view table transactions

I am on 11g DB and have a requirement to view a set of tables transactional events that occurred every 5-10 minutes. The events for each table must be viewed in the order they occurred. From there a may need to write that information to another table. I was looking to use the flashback quey feature (as I see it is enabled on my DB) to do this. What is the best way to do this with flashback query and are there any performance considerations to consider querying the flashback tables on a regular interval?
Thanks
Edited by: bobmagan on Feb 6, 2013 4:43 AM

Hi,
refer ,
http://www.oracle-developer.net/display.php?id=320
Simply , you can use below query to get records as of desired TS from any table of the database, However oldest timestamp that you can query depends on your UNDO retention
SELECT count(1) FROM <table_name> AS OF TIMESTAMP to_timestamp('13-MAY-11 19:00:00','DD-MON-YY HH24:MI:SS');Thanks,
Ajay More
http://www.moreajays.com

Similar Messages

  • Flashback query on the v$transaction

    hi All,
    if i know the SCN just before the transaction commit, after the transaction is commit, I can use flashback query on the v$transaction to get the info about the transaction, such as undo segment number, used undo block.
    Here comes the testcase, i use dbms_lock.sleep(6) because the smon_scn_time is updated every 6 seconds(Note ID: 281510.1)
    the problem is that the flashback query on the v$transaction doest not work, no rows return at the last line.
    any advice?
    sys@SID10G> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE     10.2.0.4.0     Production
    TNS for MacOS X Server: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    sys@SID10G> drop table t purge;
    Table dropped.
    sys@SID10G>
    sys@SID10G> create table t as select * from all_objects where rownum <= 1000;
    Table created.
    sys@SID10G>
    sys@SID10G> exec dbms_lock.sleep(6);
    PL/SQL procedure successfully completed.
    sys@SID10G>
    sys@SID10G> update t set object_name = lower(object_name);
    1000 rows updated.
    sys@SID10G>
    sys@SID10G> --save the current scn for later flashback query
    sys@SID10G> col scn new_value _scn
    sys@SID10G>
    sys@SID10G> select dbms_flashback.get_system_change_number scn from dual;
           SCN
       6397848
    sys@SID10G>
    sys@SID10G> select xidusn, xidslot, xidsqn, used_ublk from v$transaction;
        XIDUSN    XIDSLOT     XIDSQN  USED_UBLK
             8         12       4725          8
    sys@SID10G>
    sys@SID10G> select dbms_flashback.get_system_change_number scn from dual;
           SCN
       6397848
    sys@SID10G>
    sys@SID10G> commit;
    Commit complete.
    sys@SID10G>
    sys@SID10G> exec dbms_lock.sleep(6);
    PL/SQL procedure successfully completed.
    sys@SID10G> select xidusn, xidslot, xidsqn, used_ublk from v$transaction as of scn &_scn;
    old   1: select xidusn, xidslot, xidsqn, used_ublk from v$transaction as of scn &_scn
    new   1: select xidusn, xidslot, xidsqn, used_ublk from v$transaction as of scn    6397848
    no rows selectedEdited by: Sidney Chen on Aug 7, 2011 3:33 PM

    Please see,
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e17125/adfns_flashback.htm#g1703502
    You cannot retrieve past data from a dynamic performance (V$) view. A query on such a view always returns current data.Aman....

  • How to query AWR views/tables?

    Hi,
    AWR reports statistics related to SQLs used in DB/application.
    I have a requirement to find out the location of those SQLs. Can anyone please help me how can I do that? Is there any internal table/view I can query to find the location?
    Regards,
    Ashok

    Hi;
    If you have metalink account, I suggest also see:
    How to Generate an AWR Report and Create Baselines [ID 748642.1]
    Which Views Can Be Used to Monitor PGA Usage in Oracle 10g and Higher? [ID 469521.1]
    Regard
    Helios

  • Privilege for flashback query

    I am using Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi.
    Documentation says"
    ◦For Flashback Query and Flashback Version Query, grant _FLASHBACK_ and SELECT privileges on specific objects to be accessed during queries or grant the FLASHBACK ANY TABLE privilege to allow queries on all tables. "
    However, I do not see flashback privilege, but I am still able to use flashback query if the table is in same schema.
    All the following select yeields - no rows found.
    select * from user_tab_privs where privilege like '%FLASHBACK%'
    select * from USER_SYS_PRIVS where privilege like '%FLASHBACK%'
    select * from role_tab_privs where privilege like '%FLASHBACK%'
    select * from role_sys_privs where privilege like '%FLASHBACK%'
    What privilege do we need to use flashback query? +Why I am able to use flashback query ( select * from <tablename> as of SCN ...) without the privilege?
    +Note: Flashback_on in V$database table is NO
    Edited by: spur230 on Mar 11, 2011 1:39 PM

    Ganesh Srivatsav wrote:
    Do your research using this
    select * from dict where table_name like '%PRIV%'G.Went through all of them but did not find how schema owner has flashback privilege.

  • Initial load of small target tables via flashback query?

    A simple question.
    Scenario: I’m currently building a near real time warehouse, streaming some basic facts and dimension tables between two databases. I’m considering building a simple package to "reset" or reinitialize the dimensions an all-round fix for variety of problem scenarios (since they are really small, like 15 000 rows each). The first time I loaded the target tables I utilized data pump with good success, however since streams transforms data on the way a complete reload is somewhat more complex.
    Considered solution: Ill just write a nice flashback query via db-link fetching data from a specific (recent) SCN and then I reinitialize the table on that SCN in streams...
    Is this a good idea? Or is there something obvious like a green and yellow elephant in the gift shop that I overlooked? Why I’m at all worried is because in the manuals this solution is not mention among the supported ways to do the initial load of a target table and I’m thinking there is a reason for this?

    I have a series of streams with some tranformations feeding rather small dimensional tables, I want to make this solution easy to manage even when operations encounter difficult replication issues, so Im developing a PL/SQL package that will:
    1) Stop all streams
    2) Clear all errors
    3) Truncate target tables
    4) Reload them including transformation (using a SELECT AS OF "ANY RECENT SCN" from target to source over dblink)
    5) Using this random recent SCN I will re-instantiate the tables
    6) Start all streams
    As you see datapump even if it works is rather difficult to utilize when you tranform data from A to B, using AS OF I not only get a constant snapshot from the source, I also get the exact SCN for it.
    What do you think? Can I safely use SELECT AS OF SCN instead of datapump with SCN and still get a consisten sollution?
    For the bigger FACT tables im thinking about using the same SELECT AS OF SCN but there with particular recent paritions as targets only and thus not having to reload the whole table.
    Anyways this package would ensure operations that they can recover from any kind of disaster or incomplete recovery on both source and target databases, and just re-instantiate the warehouse within minutes.

  • View Criteria in ADF Query Panel with Table-Class Cast Exception

    Hi,
    I am getting Class Cast Exception when using view criteria for ADF Query Panel with Table. The version I am using is 11g Release 1(11.1.1.2.0)
    Here is what I did:
    1. created a view criteria on a view object
    2. all are optional
    3. all are Strings
    3. Dragged the view criteria as a query component (ADF Query panel with Query table) on to the design layout
    and the error when I clicked the Search button is:
    javax.el.ELException: java.lang.ClassCastException: oracle.jbo.common.ViewCriteriaImpl cannot be cast to oracle.jbo.ViewCriteriaRow
    at com.sun.el.parser.AstValue.invoke(AstValue.java:161)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1289)
    at oracle.adf.view.rich.component.UIXQuery.broadcast(UIXQuery.java:115)
    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at sni.foundation.facesextensions.filters.FoundationFilter.doFilter(FoundationFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.lang.ClassCastException: oracle.jbo.common.ViewCriteriaImpl cannot be cast to oracle.jbo.ViewCriteriaRow
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._clearFilterCriteriaRows(FacesCtrlSearchBinding.java:4549)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._addFilterCriteria(FacesCtrlSearchBinding.java:4603)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding.processQuery(FacesCtrlSearchBinding.java:423)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
    Thanks
    Venkatesh

    Hi Frank.
    I'm using JDev 11.1.1.3.0 as you suggest the error is no longer present in the latest version.
    I can pick my query from the "Saved Search" pick list on the QueryPanel list of queries just fine, and it sets up the filter properly, but when I press the "Search" button, I get the same reported error...
    <RegistrationConfigurator><handleError> Server Exception during PPR, #1
    javax.el.ELException: java.lang.ClassCastException: oracle.jbo.common.ViewCriteriaImpl cannot be cast to oracle.jbo.ViewCriteriaRow
         at com.sun.el.parser.AstValue.invoke(AstValue.java:161)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1303)
         at oracle.adf.view.rich.component.UIXQuery.broadcast(UIXQuery.java:115)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.lang.ClassCastException: oracle.jbo.common.ViewCriteriaImpl cannot be cast to oracle.jbo.ViewCriteriaRow
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._clearFilterCriteriaRows(FacesCtrlSearchBinding.java:4588)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._addFilterCriteria(FacesCtrlSearchBinding.java:4642)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding.processQuery(FacesCtrlSearchBinding.java:424)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         ... 42 more

  • Query to obtain tables in SH schema using data-dictionary views/tables.

    Hi,
    I have just installed Oracle 10g Database. Logged on to SQL Plus by scott (changed the password as prompted).
    I want to see the tables in SH schema (which comes by default with Oracle 10g database).
    The problem, I am facing is:
    I can see the schema name: SH in the result of the below query:
    SELECT * FROM ALL_USERS
    but, nothing is returned in the result of the below query:
    SQL> SELECT OWNER FROM ALL_TABLES WHERE OWNER='SH';
    Result: no rows selected.
    Why is this happening?
    What will be the correct query to obtain tables present in SH schema ?
    Thanks in Advance & Regards,
    Deeba

    conn /as sysdba
    SQL> select table_name from dba_tables where owner='SH';
    I think the user SCOTT have no privilege to see SH schema tables through all_tables view.
    Thanks

  • Flashback query to get back a old table with data.

    Hi,
    By mistake i drop one table 20 days before so is it possible to get that table back using flashback query.
    if yes , can you give me some idea for that query.
    thanks for your support...

    Hi,
    Flashback is a 10g new Feature. The only solution in your case will be recover the table from a backup. If you have an exp backup just import the table back to the DB, if you have a RMAN backup you can perform an incomplete recovery (point-in-time recovery) to the time just
    before the drop in an auxiliary DB and exp/imp back the table to your DB.
    Cheers,
    Francisco Munoz Alvarez
    http://www.oraclenz.com

  • Why Am I able to view flashback query longer than undo_retention?

    Hi
    this is what I did
    SQL> select sysdate from dual;
    SYSDATE
    2008-11-23 16:55:39
    --to find out the lower transaction end
    SQL> exec :v_lower_timestamp:='2008-11-23 15:55:39';
    --adjust the timestamp to a lower value than will overshot the undo_retention
    SQL> update emp set sal=sal*2 where empno=:v_empno;
    1 row updated.
    SQL> commit;
    Commit complete.
    SQL> select sysdate from dual;
    SYSDATE
    2008-11-23 16:59:14
    SQL> exec :v_upper_timestamp:='2008-11-23 16:59:14';
    SQL> SELECT * FROM emp AS OF TIMESTAMP TO_TIMESTAMP(:v_lower_timestamp, :v_date_ format) WHERE empno=:v_empno;
    EMPNO ENAME JOB MGR HIREDATE SAL
    COMM DEPTNO
    7934 MILLER CLERK 7782 1982-01-23 00:00:00 650
    10
    SQL> SELECT * FROM emp AS OF TIMESTAMP TO_TIMESTAMP(:v_upper_timestamp, :v_date_ format) WHERE empno=:v_empno;
    EMPNO ENAME JOB MGR HIREDATE SAL
    COMM DEPTNO
    7934 MILLER CLERK 7782 1982-01-23 00:00:00 1300
    10
    but when I try to do that for flashback transaction query
    SQL> SELECT versions_startscn, versions_endscn, versions_xid, versions_operation ,
    ename, sal
    FROM emp
    VERSIONS BETWEEN TIMESTAMP
    TO_TIMESTAMP(:v_lower_timestamp, :v_date_format)
    AND TO_TIMESTAMP(:v_upper_timestamp, :v_date_format)
    WHERE empno=:v_empno;
    2 3 4 5 6 7 FROM emp
    ERROR at line 3:
    ORA-30052: invalid lower limit snapshot expression
    --but the moment I raise the lower timestamp limit
    SQL> exec :v_lower_timestamp:='2008-11-23 16:55:39';
    VERSIONS_STARTSCN VERSIONS_ENDSCN VERSIONS_XID V ENAME SAL
    619162 0300250051010000 U MILLER 1300
    619162 MILLER 650
    flashback transaction works, this is understandable.
    but my question is why flashback query does allow the snapshot to be capture even longer than the undo_retention specified by but not flashback version query?
    thanks a lot!

    Select 10 files and open the files, then select and open the next 10 files.

  • Flashback Query, Versions and Transactions

    My flashback question pertains to recovering from a deleted row that was committed. To recover the row using flashback would I use flashback query embedded in an UPDATE statement? Or would I query FLASHBACK_TRANSACTION_QUERY to get the undo_sql then take the statement(s) and apply them to restore the row?
    Matt

    If the row was deleted you'd have to insert it.
    ME_XE?delete temp;
    100 rows deleted.
    Elapsed: 00:00:00.04
    ME_XE?insert into temp select * from temp as of timestamp sysdate-1 where col1 = 1;
    1 row created.
    Elapsed: 00:00:00.46
    ME_XE?commit;
    Commit complete.
    Elapsed: 00:00:00.01
    ME_XE?select * from temp;
                  COL1 SOME_DATE
                     1 22-JUL-2008 03 25:17
    1 row selected.
    Elapsed: 00:00:00.00
    ME_XE?Edited by: Tubby on Nov 7, 2008 1:38 PM

  • Materialized view long transaction time

    I am using Oracle DB 11g R2 and created a materialized view log WITH SEQUENCE. I need to find out the exact date/time the transaction was made. I see that my MV log has the 'XID$$' column (NUMBER 22), but not sure how to determine the date/time from that. Is there another view/table I can join to get me that info? I see some have 'XID' column but they are RAW(8).
    Thanks
    Edited by: bobmagan on Feb 27, 2013 11:57 AM

    - CDC is at least as performant as materialized view logs. If you do asynchronous CDC, it performs better since you're not burdening the source transactions with the overhead of synchronously maintaining the materialized view logs.
    - CDC is at least as effective as materialized view logs. Since CDC is designed to publish changes to custom consumers where materialized view logs are designed to be used by Oracle to refresh a materialized view, it strikes me as a much safer solution. If someone comes along and creates a materialized view that starts using your materialized view log, for example, a solution that involves custom code to manipulate the materialized view is almost certainly going to fail.
    - CDC isn't an extra cost option so there shouldn't be a cost difference
    That leaves the question of simplicity. I'll certainly grant you that a materialized view log solution may appear simpler. But a lot of that simplicity advantage disappears over time. The fact that we're talking about doing things like querying relatively obscure data dictionary tables like all_summap, for example, is added complexity that a CDC-based solution doesn't need. But over time, I'd much rather maintain a CDC-based solution rather than hooking in to materialized view logs. If someone wants to build a materialized view and Oracle happens to be able to use the materialized view log you've created for your own CDC, the custom solution will stop working. Over time, Oracle introduces more and more functionality that allows the ROWID of a row to change (shrinking a table, flashback, etc.). If you're using CDC, Oracle will take care of making sure that all those things are presented to you correctly. If you're rolling your own solution, you have to test and ensure that your code handles all those cases correctly. When Oracle makes a change in some future release that you hadn't considered, you've got to notice the potential problem, code the fix, and test it. Most places are probably going to miss something and only discover that there is a problem when they do something like shrink a table and then find that their custom solution doesn't handle that gracefully.
    Justin

  • Using View Tables in SQ01 and SQ02, getting 'Not Authorized to Read Table'

    We are trying to use a SAP Standard View Table (CAUFV) in an SQ01 and SQ02 transaction. Even though there is no Authorization Group assigned to the View we still get "You have no authorization to read table caufv' when running the linked transaction. We tried assigning the CA and KA authorization groups to the role and got the same results. (The tables used to create the View are AFKO and AUKF and thier Authorization groups are CA and KA.) We tried other views and received the same results. Does anyone have any experience with this?

    Hello Chuck,
    There are 2 ways to restrict this
    1: The user should be a part of at least one user group to run the corresponding ABAP query. This automatically restricts the access of the user to specific functional areas, and thus the corresponding underlying logical databases.
    2: The authorization object S_QUERY should be used to give proper authorizations to the user for a query. This authorization object has a field named ACTVT, which can take values 02 for Change, 23 for Maintain and 67 for Translate.
    This value determines whether the user can create and modify the query. The possible authorizations in the object are as follows:
    S_QUERY_ALL          Change, maintain and translate query
    S_QUERY_UPD         Change and Translate

  • Which views/tables to use for retrieving item information

    Hi All,
    I need to write a PL/SQL procedure for retrieving detailed information for a specified item (given inventory item ID and organization ID). I'm not quite sure which views/tables to us for this.
    I found out that view MTL_SYSTEM_ITEMS_FVL is the underlying view for the Master Item Form (via help / record history menu option). But when looking up in eTRM following warning is described:
    Warning: Oracle does not recommend you query or alter data using this view. It may change dramatically in subsequent minor or major releases.
    The second view I found is MTL_SYSTEM_ITEMS_VL. But when quering for data in this view, it turned out that the view is empty.
    Can anybody tell me for what purposes this view is used?
    Is it the correct way to use one of these views (or any other?) for retrieving detailed item information or should I better define a new query within the procedure using tables such as MTL_SYSTEM_ITEMS_B, MTL_SYSTEM_ITEMS_TL and MTL_PARAMETERS (any others) ?
    Any ideas for that?
    Best Regards,
    Carolin

    Hi Carolin,
    It's usually more efficient to use base tables instead of views. The tables you will actually need will depend on your requirements. Regarding your question about MTL_SYSTEM_ITEMS_VL, it's usually ok to use the _VL views. These typically contain the same information as the base tables plus some logic to get the appropriate translations for fields that can be shown in different languages (for instance, DESCRIPTION). Typical table names you will need could be:
    Item Master: MTL_SYSTEM_ITEMS_B
    Organizations: MTL_PARAMETERS
    Subinventories: MTL_SECONDARY_INVENTORIES
    Units of Measure: MTL_UNITS_OF_MEASURE
    Onhand Quantity: MTL_ONHAND_QUANTITIES_DETAIL
    Material Transactions: MTL_MATERIAL_TRANSACTIONS
    Categories: MTL_CATEGORIES_B, MTL_CATEGORY_SETS_B, MTL_ITEM_CATEGORIES
    If your query didn't return any data, it's probably because the language was not properly setup in your session (check USERENV ('LANG') so see what's the language in your session).
    Hope it helps.

  • Flashback query works, but not flashback versions query

    This is a test database (Oracle10g 10.1.0.5), not in archivelog mode. I deleted one row 2 hours ago. I can still use flashback query:
    select * from tm_instances as of timestamp to_timestamp('STARTTIME_HERE') to view this row. But I can't use the following flashback versions query:
    SELECT versions_startscn, versions_starttime,
    versions_endscn, versions_endtime,
    versions_xid, versions_operation from tm_instances VERSIONS BETWEEN TIMESTAMP to_timestamp('STARTTIME_HERE') and MAXVALUE
    It gave the following error:
    ORA-30052: invalid lower limit snapshot expression
    So I guess flashback query works better than flashback versions query?
    undo_retention is set to 900 by default here.
    Thanks,
    Hai

    currently function returns all mydate rows, i just want mydesired date rowsCheck if there is a column in the table with the same name as the function parameter. It's the most probable reason of such DML operations behaviour in PL/SQL procedures and function.
    Rgds.

  • Using Oracle Flashback Query

    So, this is a very powerfull tool, but useless if you have a 3-tire application and using a persistent connection feature.
    So in most cases you'll have only one Oracle user used to connect. It would be great if the flashback_transaction_query view can be extended with a CLIENT_INFO or CLIENT_IDENTIFIER fields from the session. Hope, this is not too hard to code... This information is VERY usefull in case you have invistigation of who, why and what for had changed some information.

    But want to check if the same concepts works incase of 'TRUNCATE' commandWhy not to check then ?
    SQL> select * from t;
           TID I
             1 A
             1 B
             1 D
             2 A
             2 C
             2 C
             2 B
             3 A
             3 C
             4 A
             4 B
             4 C
             5 A
             6 A
             7 A
    15 rows selected.
    SQL> select DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER from dual;
    GET_SYSTEM_CHANGE_NUMBER
                     5228349
    SQL> truncate table t;
    Table truncated.
    SQL> select * from t as of scn 5228349;
    select * from t as of scn 5228349
    ERROR at line 1:
    ORA-01466: unable to read data - table definition has changedMoreover, the answer is described in the documentation:
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14220/consist.htm#sthref2174
    Flashback Query does not work through DDL operations that modify columns, or drop or truncate tables
    Rgds.

Maybe you are looking for

  • Airport Extreme - problem with usb printer and usb disk

    I have Airport extreme with firmware 7.1. I try connect usb disk and usb printer with usb-hub to airport. I can't get disk or printer working. Also try connect only disk or printer without usb-hub to airport getting same problem. How I get disk and p

  • Best way to insert non-flash photo album in Dreamweaver CS5.5

    Using Dreamweaver CS4, I created my wife's art website.  It is:  www.tanglewoodbrushstrokes.com To insert photo albums, I used Bridge and Fireworks.  Once past the initial learning curve, I was able to create these albums fairly easily.  However, the

  • Can connect to wireless network but not to internet

    Ok, so I bought a new AEBS and have finally managed to get it set up with my cable modem, and with security on so that the light is green, and not amber... the only problem now is that although I can connect to the wireless network that i have create

  • Installing JDBC, Oracle, PI 7

    I am configuring a JDBC adapter (sender) in SAP PI 7, against a Oracle 10g database. My configuration is like this: JDBC Driver: oracle.jdbc.driver.OracleDriver Connection: jdbc:oracle:thin:@144.84.236.22:1531:ha1u When starting the interface I get t

  • N73 settings problem

    hi hope someone can help me ive got a n73 and i cant get into the settings menu when i go to setting a message flashes up saying"unable to open settings.backup or restore in progress all the other menus work fine just wondered if any one knows ho to