Oracle Internals Notes : Controlfile Dumps

博客介绍了一系列Oracle的Dump和Tracing脚本,如trace_file_name.sql、trace_event_on.sql等。详细说明了各脚本的使用注意事项,如设置事件可能改变服务器行为、某些转储会产生大文件影响性能等,还提供了不同版本的下载信息。
          The contents of the current controlfile can be dumped in text form to a process trace file in the user_dump_dest directory using the CONTROLF dump. The levels for this dump are as follows. 

Dump LevelDump Contains
1only the file header
2just the file header, the database info record, and checkpoint progress records
3all record types, but just the earliest and latest records for circular reuse record types
4as above, but includes the 4 most recent records for circular reuse record types
5+as above, but the number of circular reuse records included doubles with each level

For example, the following syntax could be used to get a text dump on the controlfile in the trace file of the current process showing all the controlfile record types but only the oldest and most recent of the circular reuse records.

oradebug setmypid
oradebug dump controlf 3
Of course, the session must be connected AS SYSDBA to use the ORADEBUG facility. However, any session with the ALTER SESSION privilege can use the following event syntax to take the same dump.
alter session set events 'immediate trace name controlf level 3';

http://www.ixora.com.au/scripts/dumps.htm 

Oracle Advanced Performance Tuning Scripts

Dump and Tracing Scripts

trace_file_name.sql

This script reports the pathname to the trace file for the current session. The trace file name is remembered by SQL*Plus for use by other APT scripts.

Note: The format of the trace file name is platform specific. This script contains three separate queries for different platforms. It is the user's responsibility to comment out those that do not apply.

Download script for: 7.3, 8.0 or 8.1

trace_event_on.sql

This is a simple script to set a trace event in the current session. Trace information is written to the process trace file in the user_dump_dest directory. The trace events are normally numbers in the range 10000 to 10999. For example, event 10053 can be used to trace cost-based optimizer execution path evaluation, and event 10104 can be used to trace hash join processing. Other event numbers are mentioned elsewhere on this site. For most events, the level is merely 1. However, multiple levels are defined for some events to control the level of detail returned.

Warning: Setting events changes the behavior of the Oracle server, and can destroy databases. Do not set events on production instances unless you have checked with Oracle Support.

Download script for: 7.3, 8.0 or 8.1

trace_event_off.sql

This is a simple script to stop a trace in the current session.

Download script for: 7.3, 8.0 or 8.1

which_events.sql

This script checks to see which events are set in the current session.

Download script for: 7.3, 8.0 or 8.1

post_event.sql

This script can be used to set an event in another session. To select a session before running this script, please see the first three scripts on the Session Scripts page. To turn an event off, use level 0.

Download script for: 7.3, 8.0 or 8.1

dump.sql

This is a simple script to dump an internal structure to the trace file for the current process. The systemstate and library_cache dumps are the most frequently used, at levels 10 and 4 respectively.

Warning: These dumps can produce VERY large trace files. They can also have a noticeable effect on system performance. There are other dumps that can damage databases. As always, don't use these things on production instances unless you have checked with Oracle Support.

Download script for: 7.3, 8.0 or 8.1

dump_logfile.sql

This script dumps the contents of a redo log file to the trace file for the current process in human (?) readable format. One nice thing about this script is that it can remind you about the syntax for the options.

Warning: Log file dumps can produce VERY large trace files. As always, don't do this on production instances unless you have checked with Oracle Support.

Download script for: 7.3, 8.0 or 8.1

redo_time.sql

Two of the options for dumping logfiles are to specify minimum and maximum time boundaries for the redo to be dumped. Those times need to be expressed in decimal using a special formula, which is what this script does.

Download script for: 7.3, 8.0 or 8.1

trace_zip.sql

This script can be used to dynamically zip the current process's trace file, prior to taking a large dump or trace, like a redo log file dump or systemstate dump. It creates a named pipe in place of the process's trace file, and spawns a gzip process to compress it. This slows down the taking dumps and traces significantly, but it is sometimes necessary if disk space is short.

This script is Unix specific, and uses the trace_file_name.sql script above.

Download script for: 7.3, 8.0 or 8.1

trace_nozip.sql

This script deletes the named pipe created by trace_zip.sql.

Download script for: 7.3, 8.0 or 8.1

blockdump.sql

This is one of the most important script for learning about Oracle internals. It dumps data blocks in a human readable form to the process' trace file. The Oracle8 facility allows for a range of blocks to be dumped, but in Oracle7 you can only dump one block at a time. Another important difference to be aware of is that Oracle8 does consistent gets on the blocks to be dumped, whereas Oracle7 dumps the current mode buffer.

Download script for: 7.3, 8.0 or 8.1

next_blockdump.sql

In Oracle7 you can only dump one block at a time, but this script can be used to dump consecutive blocks.

Download script for: 7.3

hex_blockdump.sql

This script does blockdumps in hex, rather than in human-readable format.

Download script for: 7.3, 8.0 or 8.1

next_hex_blockdump.sql

And this is the Oracle7 follow-on script.

Download script for: 7.3

header_dump.sql

This script dumps a segment header block by name, rather than by numbers.

Download script for: 7.3, 8.0 or 8.1

treedump.sql

This script dumps the structure of an index tree. The dump file contains one line for each block in the tree, indented to show its level, together with a count of the number of index entries in the block.

Download script for: 7.3, 8.0 or 8.1

buffers.pl

This script is intended for researching where new blocks are introduced to each buffer pool, and how the buffer aging algorithm works. It reads a trace file containing a dump of the buffer headers at level 4, and prints out the file and block number of each buffer in LRU order. The buffers dump can be taken as follows:
oradebug dump buffers 4
or
alter session set events 'immediate trace name buffers level 4';
The trace file must not contain more than one dump, so each dump must be taken from a new session.

Download script for: 8.1   -- It probably works back to 7.3 also, but has not been tested.

containing_chunk.sql

This script identifies the shared pool chunk containing a specific memory address. The address must already be defined to SQL*Plus in decimal as &Addr. This script is dependent on the rawtonum function below.

Download script for: 8.0 or 8.1

rawtonum.sql

This script creates a function that converts RAW values to NUMBERs. This is useful for calculating offsets from memory addresses.

Download script for: 7.3, 8.0 or 8.1

create_v$my_event.sql

This script creates a view over V$SESSION_EVENT that selects just the rows for the current session.

Download script for: 7.3, 8.0 or 8.1


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-84291/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/35489/viewspace-84291/

内容概要:本文系统阐述了Java Persistence API(JPA)的核心概念、技术架构、核心组件及实践应用,重点介绍了JPA作为Java官方定义的对象关系映射(ORM)规范,如何通过实体类、EntityManager、JPQL和persistence.xml配置文件实现Java对象与数据库表之间的映射与操作。文章详细说明了JPA解决的传统JDBC开发痛点,如代码冗余、对象映射繁琐、跨数据库兼容性差等问题,并解析了JPA与Hibernate、EclipseLink等实现框架的关系。同时提供了基于Hibernate和MySQL的完整实践案例,涵盖Maven依赖配置、实体类定义、CRUD操作实现等关键步骤,并列举了常用JPA注解及其用途。最后总结了JPA的标准化优势、开发效率提升能力及在Spring生态中的延伸应用。 适合人群:具备一定Java基础,熟悉基本数据库操作,工作1-3年的后端开发人员或正在学习ORM技术的中级开发者。 使用场景及目标:①理解JPA作为ORM规范的核心原理与组件协作机制;②掌握基于JPA+Hibernate进行数据库操作的开发流程;③为技术选型、团队培训或向Spring Data JPA过渡提供理论与实践基础。 阅读建议:此资源以理论结合实践的方式讲解JPA,建议读者在学习过程中同步搭建环境,动手实现文中示例代码,重点关注EntityManager的使用、JPQL语法特点以及注解配置规则,从而深入理解JPA的设计思想与工程价值。
先看效果: https://pan.quark.cn/s/d787a05b82eb 西门子SCALANCE X系列交换机是西门子公司所提供的工业以太网交换机产品系列,其在工业自动化领域具有广泛的应用。 如果在应用期间遭遇固件升级失误或采用了不相容的固件版本,可能会导致交换机无法正常启动。 在这种情况下,通常能够借助FTP(文件传输协议)来恢复交换机的固件,从而使其恢复正常运作。 本文件详细阐述了利用FTP修复SCALANCE X系列交换机固件的方法,并具体说明了实施步骤。 当SCALANCE X系列交换机的固件出现故障时,设备在启动后会自动激活引导加载程序,并通过故障LED的闪烁来表明设备处于特殊情形。 在这种情形下,交换机能够充当FTP服务器,与客户端建立联系,执行固件数据的传输。 需要特别强调的是,对于SCALANCE X200系列交换机,必须经由端口1来连接FTP客户端。 在实施步骤方面,首先需要为交换机指定一个IP地址。 这一步骤通常借助西门子公司提供的PST(Product Support Tools)软件来实施。 在成功配置IP地址之后,就可以通过FTP协议与交换机内部的FTP服务器建立连接,并借助FTP客户端将固件文件传输到交换机。 需要留意的是,在传输固件文件之前,应当先从西门子技术支持网站获取对应订货号的固件版本文件。 一旦固件文件备妥,就可以开始FTP操作。 这通常涉及打开操作系统的DOS窗口,运用FTP指令连接到交换机的FTP服务器,并输入正确的用户名和密码进行身份验证。 在本案例中,用户名和密码均为“siemens”,并且传输模式设定为二进制。 随后,使用FTP的“put”指令将本地固件文件上传至交换机。 值得留意的是,固件文件名必须严格遵循大小写规则。 上传成功后,...
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值