eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« 《Oracle数据库性能优化》一书即将出版 | Blog首页 | Oracle10g的UNDO_RETENTION自动化管理增强 »

使用SET TRANSACTION给事务命名
modb.pro

以前没有注意的命令,可以使用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




历史上的今天...
    >> 2018-03-14文章:
    >> 2012-03-14文章:
    >> 2011-03-14文章:
    >> 2010-03-14文章:
    >> 2009-03-14文章:
    >> 2008-03-14文章:
           我的搬家历程

By eygle on 2005-03-14 23:34 | Comments (0) | FAQ | 203 |


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com