[20180627]测试bbed是否支持管道命令.txt

[20180627]测试bbed是否支持管道命令.txt

--//测试bbed是否支持管道命令.txt

1.环境:
SCOTT@test01p> @ ver1
PORT_STRING                    VERSION        BANNER                                                                               CON_ID
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
IBMPC/WIN_NT64-9.1.0           12.1.0.1.0     Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production              0

SCOTT@test01p> select rowid,dept.* from dept;
ROWID                  DEPTNO DNAME                LOC
------------------ ---------- -------------------- -------------
AAAWh9AAJAAAACFAAA         10 ACCOUNTING           NEW YORK
AAAWh9AAJAAAACFAAB         20 RESEARCH             DALLAS
AAAWh9AAJAAAACFAAC         30 SALES                CHICAGO
AAAWh9AAJAAAACFAAD         40 OPERATIONS           DALLAS

SCOTT@test01p> @ rowid AAAWh9AAJAAAACFAAA
    OBJECT       FILE      BLOCK        ROW ROWID_DBA            DBA                  TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
     92285          9        133          0  0x2400085           9,133                alter system dump datafile 9 block 133 ;
2.测试:
$ cat a.cmd
set dba 9,134
x /rncc *kdbr[0]
quit

--//说明一下,我使用windows下bbed,由于无法识别文件头.存在1个数据块的偏移. 访问的数据块要在原来基础上+1.

d:\tools\bbed>cat a.cmd | bbed parfile=bbed.par cmdfile=cmd.par
BBED: Release 2.0.0.0.0 - Limited Production on Wed Jun 27 20:52:13 2018
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> set count 8192
        COUNT           8192

BBED> set width 160
        WIDTH           160

BBED>   DBA             0x02400086 (37748870 9,134)
BBED> rowdata[518]                                @8140
------------
flag@8140: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8141: 0x00
cols@8142:    3

col    0[2] @8143: 20
col    1[8] @8146: RESEARCH
col    2[6] @8155: DALLAS

--//可以发现支持管道.上班再测试终止符EOF.

3.补充测试linux环境:
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

SCOTT@book> select rowid,dept.* from dept where rownum=1;
ROWID                  DEPTNO DNAME          LOC
------------------ ---------- -------------- -------------
AAAVRCAAEAAAACHAAA         10 ACCOUNTING     NEW YORK

SCOTT@book> @ rowid AAAVRCAAEAAAACHAAA
    OBJECT       FILE      BLOCK        ROW ROWID_DBA            DBA                  TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
     87106          4        135          0  0x1000087           4,135                alter system dump datafile 4 block 135 ;

--//测试管道:
$ echo x /rncc dba 4,135  *kdbr[0] |  rlbbed
BBED: Release 2.0.0.0.0 - Limited Production on Thu Jun 28 08:37:22 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> set count 64
        COUNT           64
BBED> set width 160
        WIDTH           160

BBED> rowdata[66]                                 @8162
-----------
flag@8162: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8163: 0x01
cols@8164:    3

col    0[2] @8165: 10
col   1[10] @8168: ACCOUNTING
col    2[8] @8179: NEW YORK

--//说明:rlbbed 我定义函数,如下:
export RLWRAP=$(which rlwrap)
[ ! -z $RLWRAP ] || { echo  'not exist execution file rlwrap' ; return 7 ; }
rlbbed()
{
    cd /home/oracle/bbed
    $RLWRAP -s 9999 -c -r -i -f  /usr/local/share/rlwrap/bbed $ORACLE_HOME/bin/bbed parfile=bbed.par cmdfile=cmd.par
}

--//测试EOF
$ rlbbed <<EOF
> set dba 4,135
> x /rncc *kdbr[0]
> quit
> EOF

BBED: Release 2.0.0.0.0 - Limited Production on Thu Jun 28 08:39:07 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

************* !!! For Oracle Internal Use only !!! ***************

BBED> set count 64
        COUNT           64

BBED> set width 160
        WIDTH           160

BBED>   DBA             0x01000087 (16777351 4,135)

BBED> rowdata[66]                                 @8162
-----------
flag@8162: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8163: 0x01
cols@8164:    3

col    0[2] @8165: 10
col   1[10] @8168: ACCOUNTING
col    2[8] @8179: NEW YORK

BBED>

--//这样可以更好操作bbed,加快恢复工作.例子:

$ rlbbed <<EOF
> set dba 4,135
> $(seq 0 3 | xargs -I{} echo x /rncc *kdbr[{}] )
> quit
> EOF
--//注意$(seq 0 3 | xargs -I{} echo x /rncc *kdbr[{}] ),$与()之间不能有空格.

BBED: Release 2.0.0.0.0 - Limited Production on Thu Jun 28 08:40:04 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> set count 64
        COUNT           64
BBED> set width 160
        WIDTH           160
BBED>   DBA             0x01000087 (16777351 4,135)
BBED> rowdata[66]                                 @8162
-----------
flag@8162: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8163: 0x01
cols@8164:    3

col    0[2] @8165: 10
col   1[10] @8168: ACCOUNTING
col    2[8] @8179: NEW YORK


BBED> rowdata[44]                                 @8140
-----------
flag@8140: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8141: 0x01
cols@8142:    3

col    0[2] @8143: 20
col    1[8] @8146: RESEARCH
col    2[6] @8155: DALLAS


BBED> rowdata[24]                                 @8120
-----------
flag@8120: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8121: 0x01
cols@8122:    3

col    0[2] @8123: 30
col    1[5] @8126: SALES
col    2[7] @8132: CHICAGO


BBED> rowdata[0]                                  @8096
----------
flag@8096: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8097: 0x01
cols@8098:    3

col    0[2] @8099: 40
col   1[10] @8102: OPERATIONS
col    2[6] @8113: BOSTON


--//比如前面做删除sys.bootstrap$的测试,为了获得flag标识状态,可以写成如下:
--//参考链接:http://blog.itpub.net/267265/viewspace-2156149/=>[20180614]删除bootstrap$记录无法启动2

rlbbed <<EOF | grep flag
set dba 1,521
$(seq 0 23 | xargs -I{} echo x /rnnc *kdbr[{}] )
quit
EOF

--//执行如下:
flag@8167: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@8030: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@7641: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@7441: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@7058: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@6846: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@6641: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@6029: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@5823: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@5623: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@5402: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@5198: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@4915: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@4681: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@4434: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@3964: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@3756: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@3541: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@3261: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@2477: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@2272: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@1698: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@1489: 0x2c (KDRHFL, KDRHFF, KDRHFH)
flag@1290: 0x2c (KDRHFL, KDRHFF, KDRHFH)

--//如果写成如下,直接获得修改命令:
rlbbed <<EOF | grep flag  | cut -c6-9 | xargs -I{} echo assign  dba 1,521 offset {} = 0x2c
set dba 1,521
$(seq 0 23 | xargs -I{} echo x /rnnc *kdbr[{}] )
quit
EOF

$ rlbbed <<EOF | grep flag  | cut -c6-9 | xargs -I{} echo assign  dba 1,521 offset {} = 0x2c
> set dba 1,521
> $(seq 0 23 | xargs -I{} echo x /rnnc *kdbr[{}] )
> quit
> EOF
assign dba 1,521 offset 8167 = 0x2c
assign dba 1,521 offset 8030 = 0x2c
assign dba 1,521 offset 7641 = 0x2c
assign dba 1,521 offset 7441 = 0x2c
assign dba 1,521 offset 7058 = 0x2c
assign dba 1,521 offset 6846 = 0x2c
assign dba 1,521 offset 6641 = 0x2c
assign dba 1,521 offset 6029 = 0x2c
assign dba 1,521 offset 5823 = 0x2c
assign dba 1,521 offset 5623 = 0x2c
assign dba 1,521 offset 5402 = 0x2c
assign dba 1,521 offset 5198 = 0x2c
assign dba 1,521 offset 4915 = 0x2c
assign dba 1,521 offset 4681 = 0x2c
assign dba 1,521 offset 4434 = 0x2c
assign dba 1,521 offset 3964 = 0x2c
assign dba 1,521 offset 3756 = 0x2c
assign dba 1,521 offset 3541 = 0x2c
assign dba 1,521 offset 3261 = 0x2c
assign dba 1,521 offset 2477 = 0x2c
assign dba 1,521 offset 2272 = 0x2c
assign dba 1,521 offset 1698 = 0x2c
assign dba 1,521 offset 1489 = 0x2c
assign dba 1,521 offset 1290 = 0x2c

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

转载于:http://blog.itpub.net/267265/viewspace-2156932/

weixin151云匹面粉直供微信小程序+springboot后端毕业源码案例设计 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值