[20180222]Oracle中如何追踪savepoint.txt

简介: [20180222]Oracle中如何追踪savepoint.txt --//测试如何跟踪事务的savepoint点.测试参考http://www.askmaclean.

[20180222]Oracle中如何追踪savepoint.txt

--//测试如何跟踪事务的savepoint点.测试参考http://www.askmaclean.com/archives/how-to-find-out-the-savepoint-for-current-process.html

1.环境:

SCOTT@book> @ ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

2.测试:

SCOTT@book> @ &r/spid
       SID    SERIAL# PROCESS                  SERVER    SPID       PID  P_SERIAL# C50
---------- ---------- ------------------------ --------- ------ ------- ---------- --------------------------------------------------
        80         59 34661                    DEDICATED 34662       30         24 alter system kill session '80,59' immediate;

SCOTT@test01p> create table t ( a number);
Table created.      

insert into t values(1);
savepoint a;
insert into t values(2);
savepoint b;
insert into t values(3);
savepoint c;

--//打开新的session,以sys用户执行:
SYS@book> oradebug setospid 34662
Oracle pid: 30, Unix process pid: 34662, image: oracle@gxqyydg4 (TNS V1-V3)

SYS@book> oradebug event immediate trace name savepoints level 1;
Statement processed.

SYS@book> oradebug tracefile_name
/u01/app/oracle/diag/rdbms/book/book/trace/book_ora_34662.trc

--//检查转储文件内容:
Received ORADEBUG command (#1) 'event immediate trace name savepoints level 1' from process 'Unix process pid: 34785, image: <none>'
====================================================
SAVEPOINT FOR CURRENT PROCESS
------------------------------
   flag: 0x3
    xctsp name:C
          svpt(xcb:0x81bc9708 sptn:0xfc46 uba: 0x00c00120.03e9.28)
          status:VALID next:0x7d5e61e0
    xctsp name:B
          svpt(xcb:0x81bc9708 sptn:0xfc36 uba: 0x00c00120.03e9.27)
          status:VALID next:0x7cdebbf0
    xctsp name:A
          svpt(xcb:0x81bc9708 sptn:0xfc26 uba: 0x00c00120.03e9.26)
          status:VALID next:(nil)

*** 2018-02-22 10:13:55.459
Finished processing ORADEBUG command (#1) 'event immediate trace name savepoints level 1'

--//再次执行:
SCOTT@test01p> savepoint c;
Savepoint created.

*** 2018-02-22 10:15:33.953
Received ORADEBUG command (#3) 'event immediate trace name savepoints level 1' from process 'Unix process pid: 34785, image: <none>'
====================================================
SAVEPOINT FOR CURRENT PROCESS
------------------------------
   flag: 0x3
    xctsp name:C
          svpt(xcb:0x81bc9708 sptn:0xfc4b uba: 0x00c00120.03e9.28)
          status:VALID next:0x7d5e61e0
    xctsp name:B
          svpt(xcb:0x81bc9708 sptn:0xfc36 uba: 0x00c00120.03e9.27)
          status:VALID next:0x7cdebbf0
    xctsp name:A
          svpt(xcb:0x81bc9708 sptn:0xfc26 uba: 0x00c00120.03e9.26)
          status:VALID next:(nil)

*** 2018-02-22 10:15:33.954
Finished processing ORADEBUG command (#3) 'event immediate trace name savepoints level 1'
--//依旧3个.做一个回滚操作看看.

SCOTT@book> rollback to b;
Rollback complete.

Received ORADEBUG command (#4) 'event immediate trace name savepoints level 1' from process 'Unix process pid: 34785, image: <none>'
====================================================
SAVEPOINT FOR CURRENT PROCESS
------------------------------
   flag: 0x3
    xctsp name:B
          svpt(xcb:0x81bc9708 sptn:0xfc36 uba: 0x00c00120.03e9.27)
          status:VALID next:0x7cdebbf0
    xctsp name:A
          svpt(xcb:0x81bc9708 sptn:0xfc26 uba: 0x00c00120.03e9.26)
          status:VALID next:(nil)

*** 2018-02-22 10:16:18.705
Finished processing ORADEBUG command (#4) 'event immediate trace name savepoints level 1'

--//仅仅剩下2个.

SYS@book> oradebug event immediate trace name savepoints level 12;
Statement processed.

*** 2018-02-22 10:16:58.480
Received ORADEBUG command (#5) 'event immediate trace name savepoints level 12' from process 'Unix process pid: 34785, image: <none>'
====================================================
SAVEPOINT FOR CURRENT PROCESS
------------------------------
   flag: 0x3
    xctsp name:B
          svpt(xcb:0x81bc9708 sptn:0xfc36 uba: 0x00c00120.03e9.27)
          status:VALID next:0x7cdebbf0
    xctsp name:A
          svpt(xcb:0x81bc9708 sptn:0xfc26 uba: 0x00c00120.03e9.26)
          status:VALID next:(nil)

*** 2018-02-22 10:16:58.481
Finished processing ORADEBUG command (#5) 'event immediate trace name savepoints level 12'

目录
相关文章
|
6月前
|
消息中间件 关系型数据库 Kafka
实时计算 Flink版产品使用合集之oracle cdc 抽取新增一张表 可以从savepoint恢复吗
实时计算Flink版作为一种强大的流处理和批处理统一的计算框架,广泛应用于各种需要实时数据处理和分析的场景。实时计算Flink版通常结合SQL接口、DataStream API、以及与上下游数据源和存储系统的丰富连接器,提供了一套全面的解决方案,以应对各种实时计算需求。其低延迟、高吞吐、容错性强的特点,使其成为众多企业和组织实时数据处理首选的技术平台。以下是实时计算Flink版的一些典型使用合集。
|
30天前
|
存储 Oracle 关系型数据库
Oracle数据库的应用场景有哪些?
【10月更文挑战第15天】Oracle数据库的应用场景有哪些?
153 64
|
20天前
|
SQL Oracle 关系型数据库
Oracle数据库优化方法
【10月更文挑战第25天】Oracle数据库优化方法
26 7
|
20天前
|
Oracle 关系型数据库 数据库
oracle数据库技巧
【10月更文挑战第25天】oracle数据库技巧
23 6
|
20天前
|
存储 Oracle 关系型数据库
Oracle数据库优化策略
【10月更文挑战第25天】Oracle数据库优化策略
18 5