首页 > 其他分享 >验证表的伪列rowid在主备库的一致性

验证表的伪列rowid在主备库的一致性

时间:2023-01-17 21:31:49浏览次数:42  
标签:LAST NAME 伪列 EMPLOYEE 主备 rowid ---------- ID

文档课题:验证表的伪列rowid在主备库的一致性.
数据库:oracle 11.2.0.4
环境:主库 orcl150,备库 orcl151
应用场景:主库检测出存在坏块,若表存在索引.此时可以在主库确认出坏块对应的行rowid,进而通过rowid在备库确认到坏块对应的数据.
1、主库数据
--查主库中employees表的rowid.
HR@orcl150> set line 200
HR@orcl150> select rowid,employee_id,first_name,last_name,salary from employees

ROWID EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY
------------------ ----------- -------------------- ------------------------- ----------
AAAVZIAAEAAAADzAAA 100 Steven King 24000
AAAVZIAAEAAAADzAAB 101 Neena Kochhar 17000
AAAVZIAAEAAAADzAAC 102 Lex De Haan 17000
AAAVZIAAEAAAADzAAD 103 Alexander Hunold 9000
AAAVZIAAEAAAADzAAE 104 Bruce Ernst 6000
AAAVZIAAEAAAADzAAF 107 Diana Lorentz 4200
AAAVZIAAEAAAADzAAG 124 Kevin Mourgos 5800
AAAVZIAAEAAAADzAAH 141 Trenna Rajs 3500
AAAVZIAAEAAAADzAAI 142 Curtis Davies 3100
AAAVZIAAEAAAADzAAJ 143 Randall Matos 2600
AAAVZIAAEAAAADzAAK 144 Peter Vargas 2500

ROWID EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY
------------------ ----------- -------------------- ------------------------- ----------
AAAVZIAAEAAAADzAAL 149 Eleni Zlotkey 10500
AAAVZIAAEAAAADzAAM 174 Ellen Abel 11000
AAAVZIAAEAAAADzAAN 176 Jonathon Taylor 8600
AAAVZIAAEAAAADzAAO 178 Kimberely Grant 7000
AAAVZIAAEAAAADzAAP 200 Jennifer Whalen 4400
AAAVZIAAEAAAADzAAQ 201 Michael Hartstein 13000
AAAVZIAAEAAAADzAAR 202 Pat Fay 6000
AAAVZIAAEAAAADzAAS 205 Shelley Higgins 12008
AAAVZIAAEAAAADzAAT 206 William Gietz 8300

20 rows selected.
2、备库数据
--查备库中employees表的rowid.
HR@orcl151> set line 200
HR@orcl151> select rowid,employee_id,first_name,last_name,salary from employees

ROWID EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY
------------------ ----------- -------------------- ------------------------- ----------
AAAVZIAAEAAAADzAAA 100 Steven King 24000
AAAVZIAAEAAAADzAAB 101 Neena Kochhar 17000
AAAVZIAAEAAAADzAAC 102 Lex De Haan 17000
AAAVZIAAEAAAADzAAD 103 Alexander Hunold 9000
AAAVZIAAEAAAADzAAE 104 Bruce Ernst 6000
AAAVZIAAEAAAADzAAF 107 Diana Lorentz 4200
AAAVZIAAEAAAADzAAG 124 Kevin Mourgos 5800
AAAVZIAAEAAAADzAAH 141 Trenna Rajs 3500
AAAVZIAAEAAAADzAAI 142 Curtis Davies 3100
AAAVZIAAEAAAADzAAJ 143 Randall Matos 2600
AAAVZIAAEAAAADzAAK 144 Peter Vargas 2500

ROWID EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY
------------------ ----------- -------------------- ------------------------- ----------
AAAVZIAAEAAAADzAAL 149 Eleni Zlotkey 10500
AAAVZIAAEAAAADzAAM 174 Ellen Abel 11000
AAAVZIAAEAAAADzAAN 176 Jonathon Taylor 8600
AAAVZIAAEAAAADzAAO 178 Kimberely Grant 7000
AAAVZIAAEAAAADzAAP 200 Jennifer Whalen 4400
AAAVZIAAEAAAADzAAQ 201 Michael Hartstein 13000
AAAVZIAAEAAAADzAAR 202 Pat Fay 6000
AAAVZIAAEAAAADzAAS 205 Shelley Higgins 12008
AAAVZIAAEAAAADzAAT 206 William Gietz 8300

20 rows selected.
HR@orcl151> select EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,DEPARTMENT_ID from employees where rowid='AAAVZIAAEAAAADzAAA'

EMPLOYEE_ID FIRST_NAME LAST_NAME EMAIL PHONE_NUMBER HIRE_DATE JOB_ID SALARY DEPARTMENT_ID
----------- ---------- ---------- ---------- -------------------- --------- ---------- ---------- -------------
100 Steven King SKING 515.123.4569 17-JUN-11 AD_PRES 24000 90
3、结论
如上所示,表在主备库的rowid相同.

标签:LAST,NAME,伪列,EMPLOYEE,主备,rowid,----------,ID
From: https://blog.51cto.com/u_12991611/6017833

相关文章

  • postgresql14主备流复制状态查看
    查看同步状态主库使用pg_stat_replication监控流复制postgres=#\xExpandeddisplayison.postgres=#select*frompg_stat_replication;-[RECORD1]----+-----......
  • postgresql14主备流复制状态切换
    pg12开始新增了一个pg_promote()函数,可以通过SQL命令激活备库。pg_promote()语法pg_promote(waitbooleanDEFAULTtrue,wait_secondsintegerDEFAULT60)两个参数:w......
  • 模拟表存在坏块,索引对坏块对应rowid查询的影响
    文档课题:模拟表存在坏块,索引对坏块对应rowid查询的影响.数据库:oracle19.12多租户测试结果:表存在坏块,若该表有索引,坏块对应的rowid可以查询;若没有索引便不能查询.1、测试数......
  • oracle rowid字段解析
    文档课题:oraclerowid字段解析.1、相关概念rowid是一行数据的唯一标识,是数据的详细地址,通过rowid可快速定位某行数据的具体位置.其可分为物理rowid和逻辑rowid.普通堆表的r......
  • 使用keepalived绑定虚拟vip实现主备切换
    !ConfigurationFileforkeepalivedglobal_defs{notification_email{root@localhost}notification_email_fromroot@localhostsmtp_se......
  • Centos7.6部署k8s v1.16.4高可用集群(主备模式)
    原文:https://zhuanlan.zhihu.com/p/465647563一、部署环境主机列表:共有7台服务器,3台controlplane,3台work,1台client。k8s版本:二、高可用架构本文采用kub......
  • 使用keepalived绑定虚拟vip实现主备切换
    keepalived配置如下!ConfigurationFileforkeepalivedglobal_defs{notification_email{root@localhost}notification_email_fromroot@lo......
  • freeswitch的gateway实现出中继的主备方案
      概述freeswitch是一款简单好用的VOIP开源软交换平台。某些呼叫场景中,我们有2条出中继线路可选,2条出中继需要按照主备模式来配置,优先使用主中继呼叫,当主中继出现问......
  • 主备集群增加异步备机
    背景因用户需要增加远程异地灾备功能,用户要求远距离的备机不能影响原有的主备集群,允许有远程备机有一定延迟,现测试在主备集群增加一台异步备机 IP规划:主机名服......
  • keepalived 主备使用
    keepalived主备使用本篇主要介绍一下keepalived的基本的主备使用1.概述什么是keepalived呢,它是一个集群管理中保证集群高可用的软件,防止单点故障,keepalived......