Home > Database > Mysql Tutorial > Oracle中DUMP的转储方法

Oracle中DUMP的转储方法

WBOY
Release: 2016-06-07 16:55:52
Original
1424 people have browsed it

什么是DUMP: 美[dand;mp] 转贮;转存;转贮数据 (内存信息)转贮,转存 DUMP是一个动词,它代表一种操作,说的

  什么是DUMP:    美[d∧mp]   转贮;转存;转贮数据   (内存信息)转贮,转存

  DUMP是一个动词,它代表一种操作,说的简单一点,,拿内存举例,就是原封不动的把某一片内存给展现出来。拿跟踪举例,就是它原始的展示了Oracle处理某个问题的过程。

  大家在学习研究Oracle的过程中,为了更深入的了解内部的机制,免不了要经常DUMP来研究学习。

  Oracle 11g的Trace文件存放路径:oracle\diag\rdbms\**\**\trace
  1、DUMP出控制文件
  alter system (session) set events 'immediate trace name controlf level 10'
  —————————————————————————————
  2、DUMP出日志文件分析
  alter system dump logfile logfilename;
  —————————————————————————————
  3、DUMP出日志文件头分析
  alter session set events 'immediate trace name REDOHDR level 10'
  ———————————————————————————
  4、DUMP出LIBRARY CACHE
  alter system (session) set events 'immediate trace name library_cache level 10'
  —————————————————————————————
  5、 DUMP出share_pool
  alter system (session) set events 'immediate trace name heapdump level 10'
  ———————————————————————————
  6、DUMP出所有数据文件头
  alter system (session) set events 'immediate trace name file_hdrs level 10';
  ———————————————————————————
  7、DUMP出数据文件(只能是alter system)
  alter system dump datafile n block m
  如
  select file_id,block_id,blocks from dba_extents where segment_name='EMPLOYEES'
  FILE_ID BLOCK_ID BLOCKS
  ---------- ---------- ------------------
  5           81           8
  SQL>alter system dump datafile 5 block 81;
  System altered.
  另外是做很具体的针对某行所在的BLOCK 并DUMP出来研究,可以用如下方法
  1、取BLOCK号
  select dbms_rowid.rowid_block_number(rowid) from wdjk1999;
  DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
  78
  2、取文件号
  select file_id from dba_data_files where tablespace_name='WDJK1999'
  FILE_ID
  ----------
  16
  SQL>alter system dump datafile 16 block 78;
  System altered.
  —————————————————————————
  8、DUMP出索引
  SQL> select object_id from dba_objects where object_name=upper('index_name');
  OBJECT_ID
  ----------
  70591
  SQL> alter session set events 'immediate trace name TREEDUMP level 70591';
  —————————————————————————————

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template