Oracle常用dump命令,记录一下备查。

来源:asp之家 时间:2009-03-04 10:27:00 

一.Memory Dumps
1).Global Area
ALTER SESSION SET EVENTS ‘immediate trace name global_area level n';
1 包含PGA
2 包含SGA
4 包含UGA
8 包含indrect memory
2).Library Cache
ALTER SESSION SET EVENTS ‘immediate trace name library_cache level n';
1 library cache统计信息
2 包含hash table histogram
3 包含object handle
4 包含object结构(Heap 0)
3).Row Cache
ALTER SESSION SET EVENTS ‘immediate trace name row_cache level n';
1 row cache统计信息
2 包含hash table histogram
8 包含object结构
4).Buffers
ALTER SESSION SET EVENTS ‘immediate trace name buffers level n';
1 buffer header
2 level 1 + block header
3 level 2 + block contents
4 level 1 + hash chain
5 level 2 + hash chain
6 level 3 + hash chain
8 level 4 + users/waiters
9 level 5 + users/waiters
10 level 6 + users/waiters
5).Buffer
ALTER SESSION SET EVENTS ‘immediate trace name buffer level n';
n为某个指定block的rdba,该命令可以转储某个block在buffer中的所有版本。
6).Heap
ALTER SESSION SET EVENTS ‘immediate trace name heapdump level level';
1 PGA摘要
2 SGA摘要
4 UGA摘要
8 Current call(CGA)摘要
16 User call(CGA)摘要
32 Large call(LGA)摘要
1025 PGA内容
2050 SGA内容
4100 UGA内容
8200 Current call内容
16400 User call内容
32800 Large call内容
7).Sub Heap
Oracle 9.0.1版本之前
ALTER SESSION SET EVENTS ‘immediate trace name heapdump_addr level n';
若n为subheap的地址,转储的是subheap的摘要信息
若n为subheap的地址+1,转储的则是subheap的内容
Oracle 9.2.0版本之后
ALTER SESSION SET EVENTS ‘immediate trace name heapdump_addr level n, addr m';
其中m为subheap的地址
n为1转储subheap的摘要,n为2转储subheap的内容
8).Process State
ALTER SESSION SET EVENTS ‘immediate trace name processstate level n';
9).System State
ALTER SESSION SET EVENTS ‘immediate trace name systemstate level n';
10).Error State
ALTER SESSION SET EVENTS ‘immediate trace name errorstack level n';
0 Error stack
1 level 0 + function call stack
2 level 1 + process state
3 level 2 + context area
11).Hang Analysis
ALTER SESSION SET EVENTS ‘immediate trace name hanganalyze level n';
12).Work Area
ALTER SESSION SET EVENTS ‘immediate trace name workareatab_dump level n';
1 SGA信息
2 Workarea Table摘要信息
3 Workarea Table详细信息
13).Latches
ALTER SESSION SET EVENTS ‘immediate trace name latches level n';
1 latch信息
2 统计信息
14).Events
ALTER SESSION SET EVENTS ‘immediate trace name events level n';
1 session
2 process
3 system
15).Locks
ALTER SESSION SET EVENTS ‘immediate trace name locks level n';
16).Shared Server Process
ALTER SESSION SET EVENTS ‘immediate trace name shared_server_state level n';
n取值为1~14
17).Background Messages
ALTER SESSION SET EVENTS ‘immediate trace name bg_messages level n';
n为pid+1
二.File Dumps
1).Block
Oracle 7之前
ALTER SESSION SET EVENTS ‘immediate trace name blockdump level n';
n为block的rdba
Oracle8以后
ALTER SYSTEM DUMP DATAFILE file# BLOCK block#;
ALTER SYSTEM DUMP DATAFILE file#
BLOCK MIN minimum_block#
BLOCK MAX maximum_block#;
2).Tree Dump
ALTER SESSION SET EVENTS ‘immediate trace name treedump level n';
n为object_id
3).Undo Segment Header
ALTER SYSTEM DUMP UNDO_HEADER 'segment_name';
4).Undo for a Transaction
ALTER SYSTEM DUMP UNDO BLOCK 'segment_name' XID xidusn xidslot xidsqn;
5).File Header
ALTER SESSION SET EVENTS ‘immediate trace name file_hdrs level n';
1 控制文件中的文件头信息
2 level 1 + 文件头信息
3 level 2 + 数据文件头信息
10 level 3
6).Control file
ALTER SESSION SET EVENTS ‘immediate trace name controlf level n';
1 文件头信息
2 level 1 + 数据库信息 + 检查点信息
3 level 2 + 可重用节信息
10 level 3
7).Redo log Header
ALTER SESSION SET EVENTS ‘immediate trace name redohdr level n';
1 控制文件中的redo log信息
2 level 1 + 文件头信息
3 level 2 + 日志文件头信息
10 level 3
8).Redo log
ALTER SYSTEM DUMP LOGFILE ‘FileName';
ALTER SYSTEM DUMP LOGFILE ‘FileName'
SCN MIN MinimumSCN
SCN MAX MaximumSCN
TIME MIN MinimumTime
TIME MAX MaximumTime
LAYER Layer
OPCODE Opcode
DBA MIN FileNumber . BlockNumber
DBA MAX FileNumber . BlockNumber
RBA MIN LogFileSequenceNumber . BlockNumber
RBA MAX LogFileSequenceNumber . BlockNumber;
其中time = (((((yyyy - 1988)) * 12 + mm - 1) * 31 + dd - 1) * 24 + hh) * 60 + mi) * 60 + ss;
9).Loghist
ALTER SESSION SET EVENTS ‘immediate trace name loghist level n';
1 dump控制文件中最早和最迟的日志历史项
1 dump 2^n个日志历史项

标签:Oracle,dump,命令,记录
0
投稿

猜你喜欢

  • 马化腾关于产品设计与用户体验的培训

    2009-02-12 11:45:00
  • CentOS7下MySQL5.7安装配置方法图文教程(YUM)

    2024-01-25 19:43:05
  • javascript获取ckeditor编辑器的值(实现代码)

    2024-04-16 09:12:54
  • Yii1.0 不同页面多个验证码的使用实现

    2024-05-11 09:53:57
  • 在 git 中取消 __pycache__ 文件的方法

    2022-09-14 20:00:17
  • 教你如何利用Python批量翻译英文Word文档并保留格式

    2022-10-18 21:27:17
  • Windows 配置Apache以便在浏览器中运行Python script的CGI模式

    2021-08-01 11:22:07
  • JavaScript实现自动变换表格边框颜色

    2024-06-07 15:25:53
  • Python基于分水岭算法解决走迷宫游戏示例

    2021-08-04 17:41:37
  • 解决pyCharm中 module 调用失败的问题

    2022-11-27 23:21:19
  • python构建基础的爬虫教学

    2023-09-28 04:24:38
  • Golang远程调用框架RPC的具体使用

    2024-02-16 01:50:02
  • 十分钟搞定pandas(入门教程)

    2023-08-09 01:00:15
  • Python configparser模块常用方法解析

    2021-07-08 17:31:11
  • firefox 2正则表达式

    2008-08-25 19:15:00
  • 发一个较复杂的字符串截取函数

    2009-12-08 16:23:00
  • 深入解析Python中的WSGI接口

    2021-02-03 01:22:14
  • anaconda升级sklearn版本的实现方法

    2021-08-07 02:28:18
  • 详解Python手写数字识别模型的构建与使用

    2023-10-21 18:34:12
  • python在不同条件下的输入与输出

    2021-10-20 05:51:37
  • asp之家 网络编程 m.aspxhome.com