使用DUMP数据块与BBED查看BLOCK对比数据库修改时的SCN
实验思路: 先在数据库中对bys.a表的一行进行更新,查出此行对应的FILE# BLOCK# 然后DUMP此FILE# BLOCK#,查看SCN信息 使用BBED DUMP此FILE# BLOCK#,查看SCN信息 1.在数据库中对 bys.a表的一行进行更新,记录此行的ROWID。 19:55:13 BYS@ bys3select * from
实验思路:先在数据库中对bys.a表的一行进行更新,查出此行对应的FILE# BLOCK#
然后DUMP此FILE# BLOCK#,查看SCN信息
使用BBED DUMP此FILE# BLOCK#,查看SCN信息
1.在数据库中对 bys.a表的一行进行更新,记录此行的ROWID。
19:55:13 BYS@ bys3>select * from a;B
----------
55
7
3
19:55:15 BYS@ bys3>update a set b=0 where b=7;
1 row updated.
19:55:38 BYS@ bys3>commit;
Commit complete.
19:55:40 BYS@ bys3>select rowid,b from a; ---COMMIT的时间是19:55:40
ROWID B
------------------ ----------
AAAFOzAAEAAAACSAAA 55
AAAFOzAAEAAAACZAAA 0
AAAFOzAAEAAAACbAAA 3
19:57:15 BYS@ bys3>col object_name for a10
20:01:04 BYS@ bys3>select a.rowid,a.object_id,a.file_id,a.block_id,a.row_id,b.object_name,b from (select rowid,dbms_rowid.rowid_object(rowid) object_id,dbms_rowid.rowid_relative_fno(rowid) file_id,dbms_rowid.rowid_block_number(rowid) block_id,dbms_rowid.rowid_row_number(rowid) row_id,b from bys.a) a,dba_objects b where a.object_id=b.object_id; ---如使用此语句,只需要修改标红出的表名,字段名即可。
ROWID OBJECT_ID FILE_ID BLOCK_ID ROW_ID OBJECT_NAM B
------------------ ---------- ---------- ---------- ---------- ---------- ----------
AAAFOzAAEAAAACbAAA 21427 4 155 0 A 3
AAAFOzAAEAAAACZAAA 21427 4 153 0 A 0
AAAFOzAAEAAAACSAAA 21427 4 146 0 A 55
通过上面的语句可以查询出update a set b=0 where b=7;修改数据块是:file#4,block#153
###################################################################
2.使用DUMP file#4,block#153数据块来查看此块相关信息---主要是修改时的SCN
20:01:36 BYS@ bys3>alter system dump datafile 4 block 153;System altered.
查看TRACE文件位置方法有三个:
select value from v$diag_info where name like 'Default%';
SYS用户执行:oradebug setmypid; oradebug tracefile_name
或者直接在user_dump_dest目录中使用 ls -alt 找最近生成的文件
20:05:32 BYS@ bys3>col name for a10
20:05:40 BYS@ bys3>col value for a50
20:05:49 BYS@ bys3>select * from v$diag_info where name like 'Default%';
INST_ID NAME VALUE
---------- ---------- --------------------------------------------------
1 Default Tr /u01/app/oracle/product/11.2.0/dbhome_1/log/diag/r
ace File dbms/bys3/bys3/trace/bys3_ora_17341.trc
从DUMP信息中查出修改时SCN为:scn: 0x0000.00197b75 ---详见下面的TRACE文件具体信息
转换为SCN为:
20:19:17 BYS@ bys3>select to_number('197b75','xxxxxxxxx') from dual;
TO_NUMBER('197B75','XXXXXXXXX')
-------------------------------
1670005
20:19:38 BYS@ bys3>select scn_to_timestamp(1670005) from dual; --把SCN转换为时间,验证此SCN与UPDATE语句提交时的相符。
SCN_TO_TIMESTAMP(1670005)
---------------------------------------------------------------------------
29-NOV-13 07.55.39.000000000 PM
查看bys3_ora_17341.trc中的详细信息如下:===截取块头部分信息:
Start dump data blocks tsn: 4 file#:4 minblk 153 maxblk 153
Block dump from cache:
Dump of buffer cache at level 4 for tsn=4 rdba=16777369
BH (0x22bfad14) file#: 4 rdba: 0x01000099 (4/153) class: 1 ba: 0x22b9e000
set: 3 pool: 3 bsz: 8192 bsi: 0 sflg: 1 pwc: 0,0
dbwrid: 0 obj: 21427 objn: 21427 tsn: 4 afn: 4 hint: f
hash: [0x22bfba7c,0x2879bdd8] lru: [0x22bfaea4,0x22bfac10]
ckptq: [NULL] fileq: [NULL] objq: [0x22bfaebc,0x25040784] objaq: [0x22bfbba8,0x22bfb9f0]
st: XCURRENT md: NULL fpin: 'kdswh01: kdstgr' tch: 6
flags: block_written_once redo_since_read
LRBA: [0x0.0.0] LSCN: [0x0.0] HSCN: [0xffff.ffffffff] HSUB: [1]
BH (0x22bfb9f8) file#: 4 rdba: 0x01000099 (4/153) class: 1 ba: 0x22bbc000
set: 3 pool: 3 bsz: 8192 bsi: 0 sflg: 1 pwc: 0,0
dbwrid: 0 obj: 21427 objn: 21427 tsn: 4 afn: 4 hint: f
hash: [0x2879bdd8,0x22bfad98] lru: [0x22bfacec,0x217e4bb8]
lru-flags: hot_buffer
ckptq: [NULL] fileq: [NULL] objq: [NULL] objaq: [NULL]
st: CR md: NULL fpin: 'kdswh01: kdstgr' tch: 0
cr: [scn: 0x0.197b72],[xid: 0x0.0.0],[uba: 0x0.0.0],[cls: 0x0.197b72],[sfl: 0x0],[lc: 0x0.14da6c]
flags: only_sequential_access
Block dump from disk:
buffer tsn: 4 rdba: 0x01000099 (4/153)
scn: 0x0000.00197b75 seq: 0x02 flg: 0x06 tail: 0x7b750602
frmt: 0x02 chkval: 0xe52c type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
Dump of memory from 0xB6C41600 to 0xB6C43600
##########################################################3
3.使用BBED 查看file#4,block#153数据块中的SCN信息
[oracle@bys3 ~]$ cat par.bbdblocksize=8192
listfile=bbedfile.txt
mode=edit
[oracle@bys3 ~]$ cat bbedfile.txt
1 /u01/oradata/bys3/system01.dbf 524288000
2 /u01/oradata/bys3/sysaux01.dbf 340787200
3 /u01/oradata/bys3/undotbs01.dbf 209715200
4 /u01/oradata/bys3/user01.dbf 52428800
[oracle@bys3 ~]$ bbed parfile=par.bbd
Password:
BBED: Release 2.0.0.0.0 - Limited Production on Fri Nov 29 20:22:10 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> set file 4 block 153
FILE# 4
BLOCK# 153
BBED> map
File: /u01/oradata/bys3/user01.dbf (4)
Block: 153 Dba:0x01000099
------------------------------------------------------------
KTB Data Block (Table/Cluster)
struct kcbh, 20 bytes @0
struct ktbbh, 72 bytes @20
struct kdbh, 14 bytes @100
struct kdbt[1], 4 bytes @114
sb2 kdbr[660] @118
ub1 freespace[719] @1438
ub1 rowdata[6031] @2157
ub4 tailchk @8188
BBED> print kcbh
struct kcbh, 20 bytes @0
ub1 type_kcbh @0 0x06
ub1 frmt_kcbh @1 0xa2
ub1 spare1_kcbh @2 0x00
ub1 spare2_kcbh @3 0x00
ub4 rdba_kcbh @4 0x01000099
ub4 bas_kcbh @8 0x00197b75 ---从名字就比较好看出是scn wrap和scn base
ub2 wrp_kcbh @12 0x0000
ub1 seq_kcbh @14 0x02
ub1 flg_kcbh @15 0x06 (KCBHFDLC, KCBHFCKV)
ub2 chkval_kcbh @16 0xe52c
ub2 spare3_kcbh @18 0x0000
下面两行对应的就是SCN的scn wrap 高16位-2byte和scn base 低32位-4byte 详见:http://blog.csdn.net/q947817003/article/details/11590983
ub4 bas_kcbh @8 0x00197b75
ub2 wrp_kcbh @12 0x0000
scn计算方法:SCN=(SCN_WRP * 4294967296) + SCN_BAS
所以此数据块上的SCN就是:0x0000.00197b75 --对应十进制SCN:1670005 对应时间:29-NOV-13 07.55.39.000000000 PM
这个SCN的值与在数据库中使用DUMP file#4,block#153数据块信息得出的SCN是一致的。此处的SCN:0x0000.00197b75转换为十进制SCN及转换为时间详见上一步DUMP时的转换,不详细写出了。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

0.What does this article do? We propose DepthFM: a versatile and fast state-of-the-art generative monocular depth estimation model. In addition to traditional depth estimation tasks, DepthFM also demonstrates state-of-the-art capabilities in downstream tasks such as depth inpainting. DepthFM is efficient and can synthesize depth maps within a few inference steps. Let’s read about this work together ~ 1. Paper information title: DepthFM: FastMonocularDepthEstimationwithFlowMatching Author: MingGui, JohannesS.Fischer, UlrichPrestel, PingchuanMa, Dmytr

The performance of JAX, promoted by Google, has surpassed that of Pytorch and TensorFlow in recent benchmark tests, ranking first in 7 indicators. And the test was not done on the TPU with the best JAX performance. Although among developers, Pytorch is still more popular than Tensorflow. But in the future, perhaps more large models will be trained and run based on the JAX platform. Models Recently, the Keras team benchmarked three backends (TensorFlow, JAX, PyTorch) with the native PyTorch implementation and Keras2 with TensorFlow. First, they select a set of mainstream

Currently, the potential coins that are favored by the currency circle include SOL coin and BCH coin. SOL is the native token of the Solana blockchain platform. BCH is the token of the BitcoinCash project, which is a fork currency of Bitcoin. Because they have different technical characteristics, application scenarios and development directions, it is difficult for investors to make a choice between the two. I want to analyze which one has more potential, SOL currency or BCH? Invest again. However, the comparison of currencies requires a comprehensive analysis based on the market, development prospects, project strength, etc. Next, the editor will tell you in detail. Which one has more potential, SOL coin or BCH? In comparison, SOL coin has more potential. Determining which one has more potential, SOL coin or BCH, is a complicated issue because it depends on many factors.

In today's smartphone market, consumers are faced with more and more choices. With the continuous development of technology, mobile phone manufacturers have launched more and more models and styles, among which Vivox100 and Vivox100Pro are undoubtedly two products that have attracted much attention. Both mobile phones come from the well-known brand Vivox, but they have certain differences in functions, performance and price. So when facing these two mobile phones, which one is more worth buying? There are obvious differences in appearance design between Vivox100 and Vivox100Pro

Facing lag, slow mobile data connection on iPhone? Typically, the strength of cellular internet on your phone depends on several factors such as region, cellular network type, roaming type, etc. There are some things you can do to get a faster, more reliable cellular Internet connection. Fix 1 – Force Restart iPhone Sometimes, force restarting your device just resets a lot of things, including the cellular connection. Step 1 – Just press the volume up key once and release. Next, press the Volume Down key and release it again. Step 2 – The next part of the process is to hold the button on the right side. Let the iPhone finish restarting. Enable cellular data and check network speed. Check again Fix 2 – Change data mode While 5G offers better network speeds, it works better when the signal is weaker

Cloud storage has become an indispensable part of our daily life and work nowadays. As one of the leading cloud storage services in China, Baidu Netdisk has won the favor of a large number of users with its powerful storage functions, efficient transmission speed and convenient operation experience. And whether you want to back up important files, share information, watch videos online, or listen to music, Baidu Cloud Disk can meet your needs. However, many users may not understand the specific use method of Baidu Netdisk app, so this tutorial will introduce in detail how to use Baidu Netdisk app. Users who are still confused can follow this article to learn more. ! How to use Baidu Cloud Network Disk: 1. Installation First, when downloading and installing Baidu Cloud software, please select the custom installation option.

1. First, click to open the Douyin app and click [Me]. 2. Click the three-dot icon in the upper right corner. 3. Click to enter [Settings]. 4. Click to open [Account and Security]. 5. Select and click [Log in to device management]. 6. Finally, click to select the device and click [Remove].

MetaMask (also called Little Fox Wallet in Chinese) is a free and well-received encryption wallet software. Currently, BTCC supports binding to the MetaMask wallet. After binding, you can use the MetaMask wallet to quickly log in, store value, buy coins, etc., and you can also get 20 USDT trial bonus for the first time binding. In the BTCCMetaMask wallet tutorial, we will introduce in detail how to register and use MetaMask, and how to bind and use the Little Fox wallet in BTCC. What is MetaMask wallet? With over 30 million users, MetaMask Little Fox Wallet is one of the most popular cryptocurrency wallets today. It is free to use and can be installed on the network as an extension
