[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
[20180627]测试bbed是否支持管道命令.txt的更多相关文章
- linux管道命令grep命令参数及用法详解---附使用案例|grep
功能说明:查找文件里符合条件的字符串. 语 法:grep [-abcEFGhHilLnqrsvVwxy][-A<显示列数>][-B<显示列数>][-C<显示列数>] ...
- Oracle bbed使用说明2---常用命令
一.BBED常用命令说明 先看帮助的说明 BBED> help all SET DBA [ dba | file#, block# ] SET FILENAME 'filename' SET F ...
- 数据流重定向和管道命令, grep, tr,sort, wc, cut,split,tee,sleep(shell 02)
主要内容 1.标准输入输出和错误 2.管道命令和 grep, tr,sort, wc, cut,split,tee,sleep 标准输入输出和错误 标准输入(stdin) 是指令数据的输入,代码为0, ...
- git 入门教程之 git bash 竟然不支持 tree 命令
开门见山 git bash 是 Windows 用户安装 git 时默认安装的命令行工具,不仅界面漂亮功能也不错,大多数情况下可以替代 Windows 原生的 cmd 命令行. 然而,git bash ...
- CMD命令行管道命令
一.什么是管道命令 管道命令能够将一个命令的执行结果经过筛选,只保留我们需要的信息. 如 dir 命令会显示目录下所有文件夹和文件,可以使用管道命令| findstr "" 将di ...
- linux shell 管道命令(pipe)使用及与shell重定向区别
管道命令操作符是:”|”,它仅能处理经由前面一个指令传出的正确输出信息,也就是 standard output 的信息,对于 stdandarderror 信息没有直接处理能力.然后,传递给下一个命令 ...
- grep 和 wc命令 --- !管道命令!
Linux系统中grep命令是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹 配的行打印出来.grep全称是Global Regular Expr ession Print,表示全局正则表 ...
- nginx 支持的命令行参数
Command-line parameters 命令行参数 nginx supports the following command-line parameters: nginx支持以下命令行参数 - ...
- [20171124]bbed的使用问题2.txt
[20171124]bbed的使用问题2.txt --//bbed 是探究oracle数据块的好工具,有时候不用转储,直接可以它看oracle内部块的内部结构.--//在使用中要注意一些问题,昨天又犯 ...
随机推荐
- 【LeetCode】1. 两数之和
题目 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标.你可以假设每种输入只会对应一个答案.但是,你不能重复利用这个数组中同样 ...
- Sublime Text3自定义全部字体大小、字体类型和背景颜色
一.定义侧栏的背景颜色.字体大小和间距 Sublime Text3的Afterglow主题链接为:https://github.com/YabataDesign/afterglow-theme 1.按 ...
- pycharm 安装第三方库报错:AttributeError: 'module' object has no attribute 'main'
pip升级到 10.0.1 之后 老版的pycharm 使用pip安装第三方库的时候会报错,报错如上图所示: 其主要原因是 新版的 pip 更改了 部分api 将其中 pip.main() 改为 pi ...
- listview监听组件内容变化
package com.meizu.ui.gifts; import android.app.Activity; import android.content.Context; import andr ...
- EntityFramework使用总结(与MVC4.0实现CURD操作)
本篇文介绍一下Entity Framework Code First的简单用法,通过一个学生信息的增删查改来学习Entity Framework的使用及与存储过程的交互.我也是学习Entity Fra ...
- 阿里云服务器 Mysql数据库的安装和使用
为了做服务迁移,mysql的安装总是不那么顺利, 教程很多, 但都不能够一蹴而就, 所以,单独总结一篇, 当然也借鉴了一些前辈的经验. ================================ ...
- Dubbo 源码分析系列之一环境搭建
环境搭建的步骤有哪些 依赖外部的环境 使用的开发工具 源码的拉取 结构大致介绍 1 依赖的外部环境 安装JDK 安装Git 安装maven 这边我们就不介绍怎么安装这些外部环境了,大家自行从安装这些外 ...
- 大话DI依赖注入+IOC控制反转(一) 之 定义
转发时请注明原创作者及地址,否则追究责任.原创:alunchen 依赖注入与控制反转 依赖注入与控制反转是老生常谈的问题.一般面试也会面试到这种问题.网上很多很多这方面的资料,搜索出来一大堆 ...
- asp.net 获取网站根地址
public static string GetSiteRoot() { string port = System.Web.HttpContext.Current.Request.ServerVari ...
- 强烈推荐:240多个jQuery插件
概述 jQuery 是继 prototype 之后又一个优秀的 Javascript 框架.其宗旨是—写更少的代码,做更多的事情.它是轻量级的 js 库(压缩后只有21k) ,这是其它的 js 库所不 ...