以管理员的权限登录到数据库,通过sql命令:select addr,xidusn,ses_addr,start_time from v$transaction;可以得到与事务相关的信息,其中ses_addr为事务所在的session的地址。再利用select * from v$session where saddr=上面的ses_addr;得到事务的会话的相关信息。

解决方案 »

  1.   

    SQL> desc v$transaction
    名称                          是否为空?类型
    ------------------------------- -------- ----
     ADDR                                     RAW(4)
     XIDUSN                                   NUMBER
     XIDSLOT                                  NUMBER
     XIDSQN                                   NUMBER
     UBAFIL                                   NUMBER
     UBABLK                                   NUMBER
     UBASQN                                   NUMBER
     UBAREC                                   NUMBER
    ses_addr?start_time ?
    且其中的记录一定是没有提交的。
      

  2.   

    oracle是根据redo log文件来进行判断。“Oracle generates redo information, but stores it in a separate location in memory. When the transaction issues a commit request, Oracle writes the redo information to the redo log file (along with other group commits), and applies the changes to the database block directly to the block”
      

  3.   

    oracle recover:"The online redo log is a set of two or more online redo log files that record all changes made to the database, including both uncommitted and committed changes. "太多了,你可以查查联机文挡的oracle recover部分
      

  4.   

    oracle是根据redo log文件来进行判断,但是ORACLE在写datafile前就写redo log了,当进行一个大事务时,data buffer可能出于空间的考虑,将尚未递交的数据写入datafile中以腾出free buffer供其他数据块操做,在写datafile之前,数据库将先写rodo log,如果在用户发出commit之前数据库崩溃,那么数据库重启时将会发生相应的重做以及回滚,此时数据库用何种方法判断哪个事务尚未递交,应该回滚呢?