eygle.com   eygle.com
eygle.com  
 

« March 12, 2005 | Blog首页 | March 15, 2005 »



March 14, 2005

使用SET TRANSACTION给事务命名

作者:eygle

出处:http://blog.eygle.com

以前没有注意的命令,可以使用SET TRANSACTION给事务命名。
v$transaction中的name字段代表的正是:Name of a named transaction

[oracle@jumper bdump]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.4.0 - Production on Mon Mar 14 23:17:21 2005

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production

SQL> set transaction name 'Update Dept Table';

Transaction set.

SQL> select * from scott.dept;

    DEPTNO DNAME          LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON
        33 ORACLE         Beijing
        35 Oracle         Beijing
        36 Oracle         Beijing
        37 Oracle         Beijing

8 rows selected.

SQL> update scott.dept set LOC='Home' where deptno=35;

1 row updated.


SQL> select xidusn,xidslot,xidsqn,used_ublk,used_urec,name from v$transaction;

    XIDUSN    XIDSLOT     XIDSQN  USED_UBLK  USED_UREC NAME
---------- ---------- ---------- ---------- ---------- --------------------
         3         17       9120          1          1 Update Dept Table



Posted by eygle at 11:34 PM | Comments (0)



CopyRight © 2004-2008 eygle.com, All rights reserved.