When doing some comparative kernel research on Oracle, the dump command is used to dump the information in the database into the trace file. This article simply describes using the dump command to dump the information in a data block into a trace file.
Lab Environment: rhel7.2+11.2.0.4
Grammar:
Alter system dump DataFile {File No} block {block No};
Alter system dump DATAFILE 4 block 129;
Alter system dump DataFile {File No} block min {block min} block max {block Max};
Alter system dump DATAFILE 4 block min 129 block Max 133;
alter system dump DataFile ' {name} ' block {block No};
alter system dump DataFile ' {name} ' block min {block min} block max {block Max};
1. Create a test table
[Email protected]>drop table t; Table dropped. [Email protected]>create table T as select * from dual; Table created. [Email Protected]>select * from t;d-xxx3 rows selected.
2. The data block number where the data table is queried
[Email Protected]>select dbms_rowid. ROWID_RELATIVE_FNO (ROWID), Dbms_rowid. Rowid_block_number (ROWID) from T;dbms_rowid. ROWID_RELATIVE_FNO (ROWID) Dbms_rowid. Rowid_block_number (ROWID)------------------------------------------------------------------------4 37771 4 377 4 377713 rows selected.
You can see from the above query that three data are stored on 37771 blocks of file 4th.
3. Use the dump command to dump the block information into the trace file and locate the corresponding trace file
[Email protected]>alter system dump datafile 4 block 37771; System altered. [Email protected]>select value from V$diag_info where Name= ' Default Trace File '; VALUE-------------------------------------------------------------------------/u01/app/oracle/diag/rdbms/ Ora11g/ora11g/trace/ora11g_ora_5332.trc
4. View the contents of the trace file
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/08/5A/wKiom1ngNYfCh_0zAABwv61ESF0939.png "style=" float : none; "title=" 1.png "alt=" Wkiom1ngnyfch_0zaabwv61esf0939.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/A7/11/wKioL1ngMtGy8gXYAACJpOS68sw753.png "style=" float : none; "title=" 2.png "alt=" Wkiol1ngmtgy8gxyaacjpos68sw753.png "/>
It intercepts some information: the object_id <OBJN 90835> that contains the table, the transaction slot information on the table, the details of the three rows of data in the table, and so on.
The dump trace file contains a lot of information, and if you can read and analyze such trace files, it is a step closer to the master.
Different versions of the database dump out of the trace file, the source is different, may be from the disk may also be from the buffer cache, interested students can self-test.
Reference: "Oraclecore Essential Internals for DBAs and developers"
This article is from the "DBA fighting!" blog, so be sure to keep this source http://hbxztc.blog.51cto.com/1587495/1972013
Oracle uses dump dump data blocks