ITPub博客

首页 > 数据库 > Oracle > [20241026]建立完善opeek.sql脚本.txt

[20241026]建立完善opeek.sql脚本.txt

原创 Oracle 作者:lfree 时间:2024-10-31 20:33:45 0 删除 编辑

[20241026]建立完善opeek.sql脚本.txt

--//原来写的如下:
$ cat opeek.sql
@ ti
oradebug setmypid
oradebug peek 0x&1 &2 &3
prompt

--//存在一个问题有时候参数1习惯加入0x,导致执行报错。
SYS@book>  @ opeek 0x7324db30 48 0
New tracefile_identifier = /u01/app/oracle/diag/rdbms/book/book/trace/book_ora_5948_0002.trc
Statement processed.
ORA-01858: a non-numeric character was found where a numeric was expected

--//修改支持输入或者不输入0x或者x都可以,应该不会选择作为10进制地址输入。
--//而且有时候我并不想执行调用ti脚本,这个脚本也是来自tpt,给跟踪文件生成系列号,感觉这部分修改有点难度,这部分先注解。

$ cat opeek.sql
-- Copyright 2023 lfree. All rights reserved.
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms and conditions.
--------------------------------------------------------------------------------
--
-- Name:        opeek.sql
-- Purpose:     oradebug peek
-- Author:      lfree
-- Usage:
--     @ opeek <addr> <length> <1|0>
-- argv3 : 1 -- write tracename and display 0 -- display
--------------------------------------------------------------------------------

set term off

col 1 new_value 1
select replace(lower('&&1'),'x','') "1" from dual;
oradebug setmypid
set term on

--@ ti
oradebug peek 0x&1 &2 &3
prompt

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-3044818/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    4017
  • 访问量
    7994029